Repository navigation
perf: pool IsolatedWorkerInitializer per node instead of per worker - #2739
Merged
Merged
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ananthsub
force-pushed
the
ananthsub/pool-initializers
branch
from
June 8, 2026 16:52
0b31bc4 to
868f9f0
Compare
Contributor
Author
|
/ok to test 868f9f0 |
Contributor
Author
|
/ok to test 868f9f0 |
Create one IsolatedWorkerInitializer actor per unique placement-group index (node) instead of one per worker. All workers on a node share a py_executable, so the initializer only needs that in its runtime_env; per-worker env_vars are passed through create_worker(). This reduces GCS actor registrations from N_workers to N_nodes (|num_gpus/node| reduction for Megatron/Gym, |TP size| for vLLM), cutting RPC traffic to Ray's single-threaded GCS so large-scale runs don't overload it. Cleanup is simplified: pooled initializers are killed after workers in shutdown, and the per-worker _RAY_INITIALIZER_ACTOR_REF_TO_AVOID_GC attribute is no longer needed. Because pooled init means multiple workers on a node apply the vLLM file patches concurrently, serialize those patches with an fcntl.flock-based _locked_file_patch() context manager so one worker's truncating open() can't race another worker's read. Ported from nemo-rl-internal!197 and !208; validated with 1K-GPU runs. Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub
force-pushed
the
ananthsub/pool-initializers
branch
from
June 8, 2026 17:48
868f9f0 to
1bf5a74
Compare
Contributor
Author
|
/ok to test 1bf5a74 |
yfw
added a commit
that referenced
this pull request
Jun 8, 2026
- setup() returns an 11-tuple (the NeMo-Gym actor is at index 2). Update the three non-gym callers (run_grpo, run_grpo_sliding_puzzle, run_vlm_grpo) to unpack the extra element so they don't fail with a ValueError, and fix the setup() docstring, which listed a stale tuple. - Drop the dead ray_namespace / ray_num_gpus_per_node gym config fields: the pinned Gym (9b52dc8) has zero references to them, so they were set into the gym global config but silently ignored. Keep ray_head_node_address, which the Gym does consume. The _apply_vllm_patches() non-owner write race is handled separately by #2739, which lands before this PR. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
4 tasks
yfw
added a commit
that referenced
this pull request
Jun 9, 2026
- setup() returns an 11-tuple (the NeMo-Gym actor is at index 2). Update the three non-gym callers (run_grpo, run_grpo_sliding_puzzle, run_vlm_grpo) to unpack the extra element so they don't fail with a ValueError, and fix the setup() docstring, which listed a stale tuple. - Drop the dead ray_namespace / ray_num_gpus_per_node gym config fields: the pinned Gym (9b52dc8) has zero references to them, so they were set into the gym global config but silently ignored. Keep ray_head_node_address, which the Gym does consume. The _apply_vllm_patches() non-owner write race is handled separately by #2739, which lands before this PR. Signed-off-by: Yi-Fu Wu <[email protected]>
yfw
approved these changes
Jun 9, 2026
pengdurice
pushed a commit
to pengdurice/RL
that referenced
this pull request
Jun 12, 2026
…VIDIA-NeMo#2739) Signed-off-by: Ananth Subramaniam <[email protected]>
This branch was previously deployed
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.
What does this PR do ?
Create one
IsolatedWorkerInitializeractor per unique placement-group index (node) instead of one per worker. All workers on a node share apy_executable, so the initializer only needs that in its runtime_env; per-worker env_vars are passed through create_worker().This reduces GCS actor registrations from N_workers to N_nodes (
|num_gpus/node|reduction for Megatron,|TP size|for vLLM), cutting RPC traffic to Ray's single-threaded GCS so large-scale runs don't overload it.Cleanup is simplified: pooled initializers are killed after workers in shutdown, and the per-worker
_RAY_INITIALIZER_ACTOR_REF_TO_AVOID_GCattribute is no longer needed.Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information