Conversation
…dulers The SchedulerActor name format is inlined in _create_scheduler_actor, so an external process that wants a handle to the schedulers (for example a trainer that supplied the placement group and pushes weights into them) can only find them by scanning ray.util.list_named_actors for substring matches. Move the format into a get_scheduler_actor_name() helper and re-export it from sglang.srt.ray. The name is fully determined by the placement group, bundle index and ranks, all of which such a caller already knows, so it can rebuild the name and ray.get_actor() directly. Pure refactor: the produced names are unchanged.
…group
Replace the _pg{hex} segment with the engine's http port. The placement-group
id is only knowable inside RayEngine, so a caller that wants to rebuild the
name cannot produce it; the port is assigned per host, which makes
(node ip, port) a unique key for an engine and keeps engines co-located on one
node distinct.
Also matches get_scheduler_actor_name's signature to what such a caller has on
hand: node ip, ranks, port and bundle index.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
RayEnginenames eachSchedulerActor, but the name format is inlined in_create_scheduler_actor. A process outside the engine that wants handles to those schedulers — e.g. an RL trainer that supplied the placement group and wants to push weights straight into the scheduler actors — has no supported way to address them, and ends up scanningray.util.list_named_actors()for substring matches.Modifications
get_scheduler_actor_name(*, rank0_node_ip, dp_rank, pp_rank, tp_rank, port, bundle_idx)and call it from_create_scheduler_actor.sglang.srt.ray._pg{hex}. The placement-group id is only knowable insideRayEngine, so an external caller cannot reproduce it; the port is assigned per host, so(node ip, port)uniquely identifies an engine and keeps engines co-located on one node distinct.With this, a caller that knows the node ip, ranks, port and bundle indices it handed to
RayEnginecan rebuild the name andray.get_actor()directly.Note this does change the actor names
RayEngineproduces (_pg{hex}→_port{port}). Nothing in-tree reads the names —_create_scheduler_actorwas the only place the format appeared.Checklist
CI States
Latest PR Test (Base): ❌ Run #31641744701
Latest PR Test (Extra): ❌ Run #31641744995