Skip to content

build(gym): update baseline and guard checkpoint compatibility - #5484

Closed
u-brixton wants to merge 6 commits into
mainfrom
rzayashnikov/gym-baseline-upgrade
Closed

u-brixton wants to merge 6 commits into
mainfrom
rzayashnikov/gym-baseline-upgrade

Conversation

@u-brixton

@u-brixton u-brixton commented Nov 30, 2026 •

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

What and why

Upgrade Gym for #5460, with the dependency alignment and restore compatibility required by the newer API. The temporary pin is 001df4f9dff48fd97d0f140ca643e2131705fdf5 from Gym #6846. This prerequisite contains dependency and restore changes; #5460 contains the training integration.

  • Extend the existing package-scoped Bridge Hydra override and update the matching lock. Only Hydra and OmegaConf versions change; all other package versions and Git sources stay fixed. The lock diff remains +88/-156 lines.
  • Advance the existing Gym checkpoint schema to version 3. Older in-flight Gym snapshots lack a reliable model identity in captured lineage and can otherwise lose generated-token masks when resumed. Reject them before installing participant state, with instructions to resume using the original versions or regenerate unfinished episodes from a trainer checkpoint without its rollout snapshot.
  • Correct the private-config and public HTTP credential-redaction explanations for the updated Gym API.
flowchart LR
    G[Saved Gym rollout snapshot] --> V{Checkpoint version 3?}
    V -->|yes| R[Restore participant state]
    V -->|no| E[Stop with recovery instructions]
Loading

Current-version restore and trainer checkpoints without Gym state keep their existing paths. This separates the baseline upgrade and compatibility work from the looping feature.

Issues

No separate issue: this prerequisite and #5460 track the integration.

Convergence / perf / functionality proof

The 72 checkpoint tests passed, including current-version commit/load/restore and rejection of the old manifest before actor restore. The old manifest fixture was verified against the actual immutable pre-upgrade writer. Existing private-auth assertions also passed with local port and Ray-context stubs; no Ray runtime was launched and their assertions were unchanged. Pinned Ruff 0.9.9 lint/imports/format checks and diff whitespace checks passed.

Independent resolver/export checks using repository-pinned uv 0.13.6 found equivalent native/committed requirements across all 37 supported extra combinations and the supported Linux architectures. Only Hydra/OmegaConf identities change from the base. Full locked pre-commit cannot run on this macOS host because the lock targets Linux. No GPU/cluster training or convergence run is claimed.

Needs upstream changes

Gym #6846 must merge first. Before merging this PR, replace the temporary pin with Gym’s landed commit, rerun the dependency and integration checks, and update #5460 on this branch.

@u-brixton u-brixton added the CI:L1 Run doctests, unit tests, and functional tests label Nov 30, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 30, 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

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 0c0d56f (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ 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:functionality Needs proof that it works. 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:perf Needs performance proof. Set by Autobot PR classify (skills/pr-classify) labels Nov 30, 2026
@u-brixton u-brixton changed the title build(gym): update merged baseline and align Hydra build(gym): update baseline and guard checkpoint compatibility Nov 30, 2026
@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 6b9f684 (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@u-brixton

Copy link
Copy Markdown
Contributor Author

TODO before merging: after Gym #6846 lands, replace this PR's temporary Gym submodule pin with the landed commit SHA and rerun the dependency and integration checks. Then restack #5460 on this prerequisite.

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 8c331ef (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@github-actions

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: dd4165c (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@u-brixton u-brixton left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM for this scoped follow-up at dd4165c. The previous private description request is fixed: both sections identify the actual temporary Gym pin and the companion merge dependency, and the human review checkbox is preserved. No new major regression or follow-up comment remains.

Six specialist roles ran across three agents, followed by independent discovery and challenge passes and a separate editor. Complete source comparison shows that the Gym advance changes one test file; runtime and dependency inputs are unchanged. Earlier checkpoint/API/dependency evidence is retained with hash provenance. One private-auth test passed with current NRL/Gym imports.

Validation is adapted macOS CPU evidence, with local port and Ray-context stubs and a guard preventing Ray initialization. The historical 72 checkpoint passes and 37-selector dependency-export checks were not rerun. Native locked Linux/GPU validation was not run; the known pre-commit host/lock blocker was not retried. At review time, CI reported pr-description and Self-review failures; local results did not establish green CI. Gym must still land, followed by the acknowledged pin replacement, rechecks and restacking. This review does not establish merge readiness.

nemo-rl-review: kind=self harness=codex/0.169.0-alpha.11.1 model=gpt-6.1-sol effort=high review-pr-team=v3 reviewed=dd4165c

@u-brixton
u-brixton marked this pull request as ready for review November 30, 2026 21:16
terrykong added a commit that referenced this pull request Dec 3, 2026
…lineage

Gym 91666f9 scopes the parent search of captured calls by agent instance and
model server. Rows saved by the older Gym have no model server, so resuming
such a snapshot would treat already generated tokens as prompt. Bump
GYM_CHECKPOINT_SCHEMA_VERSION to 3 so these snapshots are refused, and say how
to continue (restore_mode=trainer_checkpoint, or a new checkpoint_dir).

Also update the comments and docs that said Gym's head server serves the
global config unredacted; Gym 91666f9 masks credential strings there.

Moved from #5484 (review C1).

Signed-off-by: Terry Kong <[email protected]>
Advance Gym to merged main d3525861 and allow its Hydra 1.4 requirements through the existing scoped Bridge override. Preserve all other package versions and Git sources.

Generate with uv 0.13.6, retain unchanged metadata and equivalent selector spellings, and verify identical frozen exports for all 37 supported extra combinations. The lock diff is limited to +88/-156 lines.

Signed-off-by: Renat Zayashnikov <[email protected]>
Advance the existing Gym checkpoint schema gate to require model-scoped capture lineage before restoring participant state. Reject earlier rollout snapshots with trainer-boundary recovery guidance, and verify the old manifest against its original writer.

Correct the private configuration and public credential-redaction explanations for the upgraded Gym baseline.

Signed-off-by: Renat Zayashnikov <[email protected]>
@u-brixton
u-brixton force-pushed the rzayashnikov/gym-baseline-upgrade branch from dd4165c to c2afa39 Compare December 3, 2026 14:34
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: c2afa39 (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@u-brixton

Copy link
Copy Markdown
Contributor Author

/ok to test c2afa39

@u-brixton

Copy link
Copy Markdown
Contributor Author

/ok to test 8ac9004

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Submodule Fast-Forward Check Results

Check based on commit: 8ac9004 (PR #5484 from rzayashnikov/gym-baseline-upgrade)

✅ Submodules that are properly updated:

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

All submodule changes look good! ✨

@terrykong terrykong mentioned this pull request Dec 4, 2026
5 tasks done
@terrykong

Copy link
Copy Markdown
Collaborator

btw @u-brixton i'm creating a new PR #5553 for the gym bump with a slightly newer commit. i can help land the bump over there, so i'll close this one in favor of that one which i'll trigger internal CI for

@terrykong terrykong closed this Dec 4, 2026
terrykong added a commit that referenced this pull request 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 added a commit that referenced this pull request Dec 4, 2026
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]>
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.

3 participants