Skip to content

ci: Bump Gym to 98458af - #5553

Open
terrykong wants to merge 7 commits into
mainfrom
terryk/bump-gym-98458af
Open

terrykong wants to merge 7 commits into
mainfrom
terryk/bump-gym-98458af

Conversation

@terrykong

@terrykong terrykong commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator
  • I, the PR author, have personally reviewed every line of this PR.

What and why

Moves the Gym submodule from 91666f9 to 98458af, the latest Gym main (192 commits).

Lock fix. New Gym needs hydra-core>=1.4.0rc3, but Megatron-Bridge pins hydra-core<1.4, so mcore and nemo-gym could not be locked together. A package-scoped override widens Bridge's range to <1.5, the same fix as #5484. The lock then moves Hydra to 1.4.0rc3 and OmegaConf to 2.4.1rc4 for every extra, so every RL install now gets these release candidates. No other package versions change. The override's comment says to remove it once Bridge allows Hydra 1.4.

Head-server port fix. If the Gym head server can't bind the port RL picked, Gym moves it to a new port, but RL kept using the old one. This bump brings in NVIDIA-NeMo/Gym#6849, which also moves the port when another Gym run already answers on it, so RL could send rollouts to the other run. RL now reads the port back from Gym's config after startup. A unit test covers it and fails without the fix.

RL code. Gym reorganized its package, but every name RL imports still resolves. 50 imports now go through Gym's moved-path redirects, which emit a DeprecationWarning until Gym 0.10.0. Moving them to the new paths can be a follow-up.

From #5484. Only the Hydra override is needed here. Checkpoint schema v3 and the docs about masked config are already on main (from #5432). #5484's own Gym pin needs Gym #6846 (looping metrics), which this bump doesn't need.

Issues

None

Convergence / perf / functionality proof

Pending: L1 CI, and the Gym bump nightly tests for Nano on H100 and GB200, which will post their results here. The Super 120B Gym test is skipped for this bump.

Needs upstream changes

None

PR commands and CI
  • CI label, exactly one:
    • CI:Lfast: the default for most PRs. Runs a fast test subset.
    • CI:L1: dependency or container changes (pyproject.toml, uv.lock, Dockerfile) or broad core changes. Builds a new image and runs unit and functional tests.
    • CI:docs: docs-only changes. Runs doc tests only.
  • /ok to test <full-commit-sha>: start CI for that commit. Post again after each push.
  • /nightly-ci test-case=<test>: run NVIDIA's nightly CI for the PR head; eligible teams only.
  • /review: automated review comments. Add mode=strict for a stricter review, reset=true for a fresh full review.
  • /resolve-conflict: Autobot merges main into this PR and resolves the conflicts. PRs from forks must allow edits by maintainers.
  • Locally: /review-pr-team <pr-number> for a team review before you ask for human review.
  • Contributor guidelines

🤖 Generated with Claude Code

Move the Gym submodule from 91666f9 to 98458af (latest Gym main, 192 commits). uv.lock is re-locked in a follow-up commit.

Signed-off-by: Terry Kong <[email protected]>
@terrykong terrykong added the CI:L1 Run doctests, unit tests, and functional tests label Dec 4, 2026
@copy-pr-bot

copy-pr-bot Bot commented Dec 4, 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 commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 071fc16 (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

@svcnvidia-nemo-ci svcnvidia-nemo-ci added complexity:high Large or cross-cutting change. Set by Autobot PR classify (skills/pr-classify) convergence-risk:high Likely to change training results. Set by Autobot PR classify (skills/pr-classify) proof:convergence Needs convergence proof (W&B runs). Set by Autobot PR classify (skills/pr-classify) proof:functionality Needs proof that it works. Set by Autobot PR classify (skills/pr-classify) proof:perf Needs performance proof. Set by Autobot PR classify (skills/pr-classify) labels Dec 4, 2026
Gym 98458af needs hydra-core>=1.4.0rc3, but Megatron-Bridge pins
hydra-core<1.4, so nemo-rl[mcore] and nemo-rl[nemo-gym] could not be
locked together. Widen Bridge's Hydra range to <1.5 with a package-scoped
override, the same fix as #5484.

The sglang and trtllm extras keep hydra-core 1.3.7 and omegaconf 2.3.1:
tensorrt-llm caps omegaconf below the 2.4 line that Hydra 1.4 needs.
Every other extra moves to hydra-core 1.4.0rc3 and omegaconf 2.4.1rc4.
No other package versions change.

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 6d4f174

@terrykong
terrykong marked this pull request as ready for review December 4, 2026 08:27
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 6d4f174 (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

The first re-lock kept hydra-core 1.3.7 and omegaconf 2.3.1 for the sglang
and trtllm extras because uv prefers versions already in the lock. Nothing
requires them: a second `uv lock` moves every extra to hydra-core 1.4.0rc3
and omegaconf 2.4.1rc4, and `uv lock --check` (the Lockfile freshness
check) only passes on that result.

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 3858791

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 3858791 (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

@terrykong terrykong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Self-review of the Gym bump at 3858791. Nothing blocks merge except C1.

Verdict. The bump is right. The Gym pin is on Gym main and moves 192 commits forward, and the lock now has one Hydra (1.4.0rc3) and one OmegaConf (2.4.1rc4) for every extra. The Megatron-Bridge override is the smallest fix, because Bridge main still caps Hydra below 1.4.

What we checked

  • Config loading: ran RL's real load_config, resolvers and Hydra override parsing over every shipped YAML, on both OmegaConf 2.3.1 / Hydra 1.3.7 and 2.4.1rc4 / 1.4.0rc3, in three separate checks. Resolved values were identical. Config unit tests gave the same result on both versions (677 passed; the same 4 failures on both, caused by the local machine setup).
  • Megatron-Bridge and Megatron-LM Hydra/OmegaConf code (omegaconf_utils, instantiate): same output on both version pairs.
  • Gym: all 140 RL imports resolve at the new pin; the Gym values RL copies (failure kinds, sampling keys) still match; the checkpoint format did not change.
  • No locked package sets an OmegaConf or Hydra limit that the new versions break (TRT-LLM lists plain omegaconf). Old pickled and saved configs load on 2.4.
  • Lint on the changed files passed; uv lock check passed on this head.

Minor, not blocking

  • OmegaConf 2.4 deprecates register_new_resolver, so each launch prints 4 warnings from register_omegaconf_resolvers. Switching to register_resolver is only safe once RL requires OmegaConf ≥2.4 (on 2.3 that name passes strings, so ${mul:2,3} breaks). Do it when 2.4.1 ships as a stable release.
  • The override comment at pyproject.toml#L507 doesn't say when to remove it, and nothing upstream asks Bridge to allow Hydra 1.4 (Bridge main pyproject.toml#L91). A Bridge PR that allows <1.5, linked from that comment and from "Needs upstream changes", would let us drop the override later.
  • OmegaConf 2.4.1rc4 is a one-day-old pre-release. Gym's minimum version forces it, so there is no way around it.

Before merge

  1. (C1) Make RL use the head-server port Gym actually bound.
  2. Fill in the proof section: link the green L1 run and the Nano Gym nightlies on H100 and GB200.
  3. Description: write NVIDIA-NeMo/Gym#6846 (a bare #6846 links to an RL issue that doesn't exist). The line "50 imports now go through Gym's moved-path redirects" is wrong: RL used those redirects before this bump too, and we count about 90 import statements in 18 nemo_rl/ files.

nemo-rl-review: kind=self harness=claude-code/2.1.336 model=claude-opus-5-5 effort=medium review-pr-team=v3 reviewed=3858791

Comment thread 3rdparty/Gym-workspace/Gym Resolved
Gym requires hydra-core>=1.4.0rc3, its security floor that only exists
on the 1.4 pre-release line, but Megatron-Bridge caps hydra-core <1.4.
The package-scoped override replaces Bridge's whole Hydra requirement,
so this comment is the only place that says why. Carried over from the
review of #5484 (C2). Comment only: uv.lock is unchanged.

Signed-off-by: Terry Kong <[email protected]>
RL picks the Gym head-server port and writes it into Gym's config. If the
head server cannot bind it, Gym's RunHelper.start() moves it to a fresh
port in its global config and restarts every server, but RL kept
building its rollout client from the port it picked. With this Gym bump
(NVIDIA-NeMo/Gym#6849) that also happens when another Gym run already
answers on the port, so RL could send rollouts to the other run.

Read the port back from Gym's global config right after start(), before
the rollout client is built.

Test: a fake RunHelper.start() moves the head port; the head server
config and the rollout client must use the new port. It fails without
the fix (11000 != 11500).

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 73b1dc8

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 73b1dc8 (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

The pre-commit taplo hook expands the inline dependency list; the Lint check failed on the one-line form.

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 27af457

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 27af457 (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

_spinup now imports nemo_gym.global_config to read back the head-server
port, so the helper that stands in for the Gym modules must provide it.

Signed-off-by: Terry Kong <[email protected]>
@terrykong

Copy link
Copy Markdown
Collaborator Author

/ok to test 909157b

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 909157b (PR #5553 from terryk/bump-gym-98458af)

✅ Submodules that are properly updated:

Gym: ✅ PR branch is ahead of main branch (fast-forward)

All submodule changes look good! ✨

This branch has not been deployed

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

Labels

CI:L1 Run doctests, unit tests, and functional tests complexity:high Large or cross-cutting change. Set by Autobot PR classify (skills/pr-classify) convergence-risk:high Likely to change training results. Set by Autobot PR classify (skills/pr-classify) proof:convergence Needs convergence proof (W&B runs). Set by Autobot PR classify (skills/pr-classify) proof:functionality Needs proof that it works. Set by Autobot PR classify (skills/pr-classify) proof:perf Needs performance proof. Set by Autobot PR classify (skills/pr-classify)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants