Skip to content

fix(distillation): use _spinup instead of removed health_check for NeMo-Gym - #2786

Merged
terrykong merged 7 commits into
mainfrom
yifu/fix-distill-gym-spinup
Jun 11, 2026
Merged

fix(distillation): use _spinup instead of removed health_check for NeMo-Gym#2786
terrykong merged 7 commits into
mainfrom
yifu/fix-distill-gym-spinup

Conversation

@yfw

@yfw yfw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do ?

Fix distillation startup. Use _spinup instead of health_check

Issues

Closes #2784

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

mxinO and others added 6 commits June 10, 2026 02:43
Distillation can now reuse the NeMo Gym rollout path that GRPO already uses, while keeping the new runner and smoke coverage scoped to the distillation integration.

Constraint: NeMo Gym requires the vLLM async HTTP generation path.
Rejected: Mirror GRPO's full NeMo Gym test matrix | distillation only adds orchestration around the shared rollout and environment layers
Confidence: medium
Scope-risk: moderate
Tested: tests/unit/algorithms/test_distillation.py::test_distillation_train_uses_nemo_gym_rollout_when_enabled in container
Tested: ruff check and ruff format --check on touched Python files
Tested: tests/functional/distillation_nemo_gym.sh in container via Slurm job 210602
Signed-off-by: Meng Xin <mxin@nvidia.com>
The NeMo Gym distillation example now uses a distinct default teacher and the current DTensor v2 path used by base distillation. The functional smoke keeps CI cheap by overriding to the small Qwen3 base/instruct pair while still exercising NeMo Gym rollout, teacher logits, and student training with nonzero KL.

Constraint: Split PR must stay scoped to NeMo Gym distillation without quant changes
Rejected: Same teacher/student smoke | it can produce zero KL and miss the distillation path
Rejected: DTensor v1 | smoke jobs stalled during teacher state-dict loading
Confidence: high
Scope-risk: narrow
Tested: uv run --no-sync ruff check examples/nemo_gym/run_distillation_nemo_gym.py nemo_rl/algorithms/distillation.py tests/unit/algorithms/test_distillation.py
Tested: uv run --no-sync ruff format --check examples/nemo_gym/run_distillation_nemo_gym.py nemo_rl/algorithms/distillation.py tests/unit/algorithms/test_distillation.py
Tested: bash -n tests/functional/distillation_nemo_gym.sh && bash -n tests/functional/L1_Functional_Tests_Gym.sh
Tested: Slurm unit job 210733, 12 passed
Tested: Slurm functional smoke job 210729, train/loss=0.8154925107955933, generation=2.2170605659484863s, mean_gen_tokens=128.0
Not-tested: Full unmodified 1.7B-teacher example run; functional smoke intentionally overrides to the cheap small-model pair
Signed-off-by: Meng Xin <mxin@nvidia.com>
NeMo Gym is now available for on-policy distillation, so the public docs should not read as GRPO-only. The usage examples call out required dataset path overrides because the checked-in config intentionally keeps placeholder paths.

Constraint: Split PR stays scoped to NeMo Gym distillation docs and examples
Rejected: Present the example config as runnable without overrides | the config contains placeholder dataset paths
Confidence: high
Scope-risk: narrow
Tested: git diff --check -- README.md docs/about/algorithms/on-policy-distillation.md docs/design-docs/nemo-gym-integration.md
Tested: uv run --group docs python -m sphinx.cmd.build -b dummy docs docs/_build/dummy
Signed-off-by: Meng Xin <mxin@nvidia.com>
The top-level README should stay focused on the existing high-level workflow list. Keep the NeMo Gym distillation usage details in the algorithm and integration docs instead.

Constraint: User requested no top-level README update
Confidence: high
Scope-risk: narrow
Tested: git diff --check -- README.md docs/about/algorithms/on-policy-distillation.md docs/design-docs/nemo-gym-integration.md
Signed-off-by: Meng Xin <mxin@nvidia.com>
…Mo-Gym

run_distillation_nemo_gym.py mirrored the pre-#2741 GRPO gym-init flow and
called nemo_gym.health_check.remote() to block until the gym is ready. #2741
("overlap NeMo Gym init with vLLM init") removed the NemoGym actor's
health_check() method in favor of _spinup(), so the call raised
AttributeError: 'ActorHandle' object has no attribute 'health_check' and broke
gb200_L1_Functional_Tests_Gym.

create_env() still creates the actor correctly; only the blocking spin-up call
needed renaming to match the new API (grpo.setup() uses the same
ray.get(actor._spinup.remote())).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
…spinup

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw
yfw requested a review from a team as a code owner June 11, 2026 17:31
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 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.

@yfw yfw added the CI:L1 Run doctests, unit tests, and functional tests label Jun 11, 2026
@yfw

yfw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test af236c8

@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.

lgtm, but can you change the distillation nemo gym test to "fast"

Image

so we can catch this. i think this was missed in the original pr

Mark the distillation NeMo-Gym functional test as `fast` in
L1_Functional_Tests_Gym.sh so it also runs under CI:Lfast (FAST=1), not only
the full L1 tier. Catches regressions like the health_check->_spinup breakage
earlier, on more PRs.

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw
yfw requested a review from a team as a code owner June 11, 2026 17:46
@yfw yfw added CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) and removed CI:L1 Run doctests, unit tests, and functional tests labels Jun 11, 2026
@yfw

yfw commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7616c64

@terrykong
terrykong enabled auto-merge (squash) June 11, 2026 17:51
@terrykong
terrykong merged commit f45e87a into main Jun 11, 2026
131 of 134 checks passed
@terrykong
terrykong deleted the yifu/fix-distill-gym-spinup branch June 11, 2026 21:22
ashors1 pushed a commit that referenced this pull request Jun 27, 2026
…Mo-Gym (#2786)

Signed-off-by: Meng Xin <mxin@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Co-authored-by: Meng Xin <mxin@nvidia.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Anna Shors <ashors@nvidia.com>
jQizhang added a commit that referenced this pull request Jul 6, 2026
Advance 3rdparty/Automodel-workspace/Automodel from fa0f60144 to
9c232dc7d (90 upstream commits), including CP support for MiniMax M3
(#2551), vision biencoder finetuning + Nemotron VL 1B support (#2354),
and DDP selective checkpointing (#2786).

Signed-off-by: larkzhang-nv <larkz@nvidia.com>
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.

nemo_gym 'ActorHandle' object has no attribute 'health_check'

3 participants