-
Notifications
You must be signed in to change notification settings - Fork 49
: actor: port receiver monitoring is made non-optional #578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
: actor: port receiver monitoring is made non-optional #578
Conversation
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Rollback Plan: Differential Revision: D78528860
ccf6e47
to
f837492
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 Differential Revision: D78528860
f837492
to
b2f6675
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 Differential Revision: D78528860
b2f6675
to
1fa2092
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
1fa2092
to
c929fd8
Compare
Summary: Pull Request resolved: pytorch-labs#578 Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
c929fd8
to
cf9083f
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
cf9083f
to
98f7c5b
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
98f7c5b
to
ca4e12c
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
ca4e12c
to
487d23d
Compare
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
487d23d
to
b6f2363
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
b6f2363
to
db42224
Compare
c9d2505
to
cd54193
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
3a93f96
to
3fd2829
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
3fd2829
to
774ab14
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
774ab14
to
cba1703
Compare
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
de8a1b3
to
d1e3a5c
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
d1e3a5c
to
5eb8ac4
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
278f95f
to
3e97aaa
Compare
Summary: this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D78528860 |
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
3e97aaa
to
693ad30
Compare
Summary: Pull Request resolved: pytorch-labs#578 this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python. the essential change is that: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> "PortTuple[R]": monitor = ( None if self._actor_mesh._actor_mesh is None else self._actor_mesh._actor_mesh.monitor() ) return PortTuple.create(self._mailbox, monitor, once) ``` becomes: ``` class ActorEndpoint(...): def _port(self, once: bool = False) -> PortTuple[R]: p, r = PortTuple.create(self._mailbox, once) return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver))) ``` `_supervise(...)` dispatches to new Rust helpers: ```python mesh.supervise_port(...) and mesh.supervise_once_port(...) ``` which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`. most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired. - the creation and wiring of the monitor stream is now fully in rust. - the responsibility of wrapping receivers with supervision is now fully in rust. - python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust. Differential Revision: D78528860
This pull request was exported from Phabricator. Differential Revision: D78528860 |
693ad30
to
cf7434a
Compare
Differential Revision: D78528860