-
Notifications
You must be signed in to change notification settings - Fork 102
[hypearactor] skeleton for mesh controller behavior #1729
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
Open
mariusae
wants to merge
2
commits into
gh/mariusae/128/base
Choose a base branch
from
gh/mariusae/128/head
base: gh/mariusae/128/base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+55
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Basic idea: meshes are just resources like any other The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers. We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.) We can now query states, etc., by just calling GetState on the *mesh* resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources. # Supervision events The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them. # Rationale Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for *all* resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with `hyper`); 2) it integrates cleanly with observability / "Monarchy". Differential Revision: [D85982104](https://our.internmc.facebook.com/intern/diff/D85982104/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85982104/)! [ghstack-poisoned]
mariusae
added a commit
that referenced
this pull request
Oct 31, 2025
# Basic idea: meshes are just resources like any other The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers. We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.) We can now query states, etc., by just calling GetState on the *mesh* resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources. # Supervision events The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them. # Rationale Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for *all* resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with `hyper`); 2) it integrates cleanly with observability / "Monarchy". Differential Revision: [D85982104](https://our.internmc.facebook.com/intern/diff/D85982104/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85982104/)! ghstack-source-id: 320165967 Pull Request resolved: #1729
# Basic idea: meshes are just resources like any other The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers. We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.) We can now query states, etc., by just calling GetState on the *mesh* resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources. # Supervision events The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them. # Rationale Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for *all* resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with `hyper`); 2) it integrates cleanly with observability / "Monarchy". Differential Revision: [D85982104](https://our.internmc.facebook.com/intern/diff/D85982104/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85982104/)! [ghstack-poisoned]
mariusae
added a commit
that referenced
this pull request
Nov 6, 2025
Pull Request resolved: #1729 # Basic idea: meshes are just resources like any other The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers. We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.) We can now query states, etc., by just calling GetState on the *mesh* resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources. # Supervision events The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them. # Rationale Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for *all* resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with `hyper`); 2) it integrates cleanly with observability / "Monarchy". ghstack-source-id: 321276801 @exported-using-ghexport Differential Revision: [D85982104](https://our.internmc.facebook.com/intern/diff/D85982104/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D85982104/)!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Basic idea: meshes are just resources like any other
The idea is that we treat meshes like any other resource. We define a common behavior for mesh controllers.
We stand up a controller actor, and ActorMesh::allocate, ProcMesh::spawn, ActorMesh::spawn, etc. -- all they do is issue a CreateOrUpdate. (This makes them nonblocking -- which is our eventual goal -- but we have a few more things to do before we're fully ready for this.)
We can now query states, etc., by just calling GetState on the mesh resource. This is managed by the controller, and returns immediately (nonblocking). The controller is responsible for polling/pushing/keepaliving the underlying resources.
Supervision events
The mesh controller can "raise" supervision events in the following way: when we create a resource, we include a "supervisor". The controller synthesizes and then pushes supervision events to this port. In effect, any time a rank in a mesh enters non-running status, we generate a supervision event. The controller keeps track of which events have been raised so as to not duplicate them.
Rationale
Having a common resource model is very powerful. For one, it establishes a clean separation of concerns (controller responsible for managing a mesh vs. the owner of the mesh), and it allows us to build common tooling for managing all mesh types centered around a common interface (the mesh resource behavior). It also means that 1) we can have common tooling for all resources (a mesh is now named just by its controller actor+Name, and we can query it like any other resource, e.g., with
hyper); 2) it integrates cleanly with observability / "Monarchy".Differential Revision: D85982104
NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!