Skip to content

feat(sc): NeMo-Gym path#3267

Open
yuki-97 wants to merge 11 commits into
yukih/sc-split-3from
yukih/sc-split-4
Open

feat(sc): NeMo-Gym path#3267
yuki-97 wants to merge 11 commits into
yukih/sc-split-3from
yukih/sc-split-4

Conversation

@yuki-97

@yuki-97 yuki-97 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Part 4/4 of the #2819 split. Stack on #3266.

#3219 (1/4) -> #3220 (2/4) -> #3266 (3/4) -> #3267 (4/4)

Summary

Wires NeMo-Gym rollouts into the SC (Single Controller) entrypoint by introducing an SC-facing gym-actor spinup helper and wiring it into the SC setup path. The existing grpo.py path retains its local _spinup_nemo_gym implementation for now because it also supplies GRPO-specific timing, routed-experts dtype, and fastokens configuration.

  • spinup_nemo_gym_actor (nemo_rl/environments/nemo_gym.py): factors the NeMo-Gym actor construction needed by SC (config assembly, uv/venv cache reuse, image-baked venv reuse, and soft NodeAffinitySchedulingStrategy when num_gpu_nodes > 0) into a reusable helper. Consolidating the remaining GRPO-specific startup path is left for follow-up work.
  • SC setup wiring (nemo_rl/algorithms/single_controller_utils/setup.py): setup_single_controller branches on _should_use_nemo_gym — skips env spinup in setup_response_data, brings up generation first, then calls spinup_nemo_gym_actor with the vLLM OpenAI URLs. Raises NotImplementedError on non-vllm backends.
  • examples/run_grpo_single_controller.py: restores the setup_nemo_gym_config call (removed in feat(sc): setup + entrypoint #3266 while the SC path had no gym support).
  • Tests: tests/unit/single_controller/test_single_controller_setup.py gains env-handle wiring + non-vllm backend guard coverage (replaces the previous "not supported yet" trip-wire). New tests/functional/grpo_async_gym_single_controller.sh covers SC + NeMo-Gym end-to-end.

@yuki-97
yuki-97 requested review from a team as code owners July 17, 2026 13:06
@copy-pr-bot

copy-pr-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the CI Relating to CI label Jul 17, 2026
@yuki-97
yuki-97 marked this pull request as draft July 17, 2026 13:07
@yuki-97
yuki-97 force-pushed the yukih/sc-split-4 branch from 6afeaae to 62947e5 Compare July 18, 2026 10:02
@yuki-97
yuki-97 changed the base branch from main to yukih/sc-split-3 July 18, 2026 10:04
@yuki-97
yuki-97 force-pushed the yukih/sc-split-3 branch 2 times, most recently from 8025950 to 5aba114 Compare July 18, 2026 13:31
@yuki-97
yuki-97 force-pushed the yukih/sc-split-4 branch from 62947e5 to 7f1d6ce Compare July 18, 2026 15:25
@github-actions github-actions Bot removed the CI Relating to CI label Jul 18, 2026
@yuki-97
yuki-97 force-pushed the yukih/sc-split-4 branch from 7f1d6ce to 4278c73 Compare July 18, 2026 15:29
@yuki-97
yuki-97 force-pushed the yukih/sc-split-4 branch from cba2389 to 4d159fb Compare July 19, 2026 04:39
@RayenTian
RayenTian force-pushed the yukih/sc-split-3 branch 2 times, most recently from 850b583 to faf877c Compare July 23, 2026 11:47
@RayenTian
RayenTian marked this pull request as ready for review July 24, 2026 05:55

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at the rebased head (dd3cb538, now MERGEABLE/CLEAN). The spinup_nemo_gym_actor extraction and SC wiring check out: the 2-tuple/4-tuple setup_response_data unpacking is correct (now with an explicit assert len(...) == 2), dp_openai_server_base_urls is guaranteed real by the _should_use_nemo_gym asserts, and configure_vllm_for_router_replay is a safe no-op when router replay is off. Note: the rebase dropped the original PR's grpo.py refactor — grpo.py keeps its own inline _spinup_nemo_gym (still importing NemoGym, never referencing spinup_nemo_gym_actor), so the new helper is currently a near-duplicate used only by the SC path. grpo's sync path is untouched (no behavior change), but the description's "shared function so both grpo.py and the SC setup can call it" no longer holds — worth either re-landing the grpo call-site swap or noting the duplication. No correctness bugs.

Six inline comments: one medium (the new e2e functional test is registered in no CI lane, so it never runs — regressed during the rebase), and five low/non-blocking (guard hoist, a test-assertion tightening, a docstring, a smoke-threshold note, and a router-replay tracking note). Enabling router replay (R3) on the SC async+TransferQueue path is only half-wired and fails silently — filed as #3327 (assigned) and added to the SC loose-ends tracker #2625.

Cross-checked against merged #3219/#3220 and base #3266 threads to avoid duplication.

Reviewed by an agent team (rl-expert, bug-finder, test-agent, comment-reviewer, devil's-advocate), re-audited after rebase and cross-referenced against the PR stack. Generated by Claude Code

Comment thread tests/functional/grpo_async_gym_single_controller.sh
Comment thread nemo_rl/algorithms/single_controller_utils/setup.py Outdated
Comment thread tests/unit/single_controller/test_single_controller_setup.py Outdated
Comment thread nemo_rl/environments/nemo_gym.py
Comment thread tests/functional/grpo_async_gym_single_controller.sh
Comment thread nemo_rl/algorithms/single_controller_utils/setup.py
Comment thread nemo_rl/algorithms/single_controller_utils/setup.py
@RayenTian

Copy link
Copy Markdown
Contributor

Re-review at the rebased head (dd3cb538, now MERGEABLE/CLEAN). The spinup_nemo_gym_actor extraction and SC wiring check out: the 2-tuple/4-tuple setup_response_data unpacking is correct (now with an explicit assert len(...) == 2), dp_openai_server_base_urls is guaranteed real by the _should_use_nemo_gym asserts, and configure_vllm_for_router_replay is a safe no-op when router replay is off. Note: the rebase dropped the original PR's grpo.py refactor — grpo.py keeps its own inline _spinup_nemo_gym (still importing NemoGym, never referencing spinup_nemo_gym_actor), so the new helper is currently a near-duplicate used only by the SC path. grpo's sync path is untouched (no behavior change), but the description's "shared function so both grpo.py and the SC setup can call it" no longer holds — worth either re-landing the grpo call-site swap or noting the duplication. No correctness bugs.

Six inline comments: one medium (the new e2e functional test is registered in no CI lane, so it never runs — regressed during the rebase), and five low/non-blocking (guard hoist, a test-assertion tightening, a docstring, a smoke-threshold note, and a router-replay tracking note). Enabling router replay (R3) on the SC async+TransferQueue path is only half-wired and fails silently — filed as #3327 (assigned) and added to the SC loose-ends tracker #2625.

Cross-checked against merged #3219/#3220 and base #3266 threads to avoid duplication.

Reviewed by an agent team (rl-expert, bug-finder, test-agent, comment-reviewer, devil's-advocate), re-audited after rebase and cross-referenced against the PR stack. Generated by Claude Code

Update the PR doc describe.

@RayenTian

Copy link
Copy Markdown
Contributor

/ok to test 1d6a09c

@RayenTian RayenTian added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Jul 24, 2026
@RayenTian

Copy link
Copy Markdown
Contributor

/ok to test 1d6a09c

yuki-97 and others added 11 commits July 24, 2026 10:12
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
This reverts commit 0eeab08.

Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: Yuki Huang <yukih@nvidia.com>
Signed-off-by: ruit <ruit@nvidia.com>
Signed-off-by: ruit <ruit@nvidia.com>
Signed-off-by: ruit <ruit@nvidia.com>
@RayenTian

Copy link
Copy Markdown
Contributor

/ok to test b2bd34d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants