Skip to content

test: validate SingleController init from pretrained Bridge/MLM checkpoints - #5528

Merged
yuki-97 merged 1 commit into
mainfrom
amahishi/sc-pretrained-ckpt-init
Dec 3, 2026
Merged

yuki-97 merged 1 commit into
mainfrom
amahishi/sc-pretrained-ckpt-init

Conversation

@macandro96

@macandro96 macandro96 commented Dec 2, 2026 •

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

What and why

Users can start RL training from their own Megatron checkpoint instead of the Hugging Face model, by setting checkpointing.pretrained_checkpoint. This already had a test on the legacy GRPO path, but not on SingleController (SC).

This PR adds that SC test. It restores a checkpoint in both supported formats (megatron_bridge and megatron_lm) and checks that training and generation both use the restored weights.

One improvement over the legacy test: the legacy test restores a copy of the same model it started with, so it would pass even if the checkpoint were ignored. Here the checkpoint comes from a different model with the same architecture (Qwen3-0.6B loaded into a Qwen3-0.6B-Base run), so the test fails if the checkpoint isn't actually used.

No library changes were needed; the feature already works on SC.

Issues

Part of #5044

Convergence / perf / functionality proof

Test-only change. Passes locally on 2×H100. I also checked that it catches the bug it's meant to catch: when SC is changed to skip syncing the restored weights to vLLM, the test fails.

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

@copy-pr-bot

copy-pr-bot Bot commented Dec 2, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the complexity:low Small, contained change. Set by Autobot PR classify (skills/pr-classify) label Dec 2, 2026
@macandro96
macandro96 marked this pull request as ready for review December 2, 2026 23:38
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the convergence-risk:none Cannot change training results. Set by Autobot PR classify (skills/pr-classify) label Dec 2, 2026
…points

Add an SC sibling of grpo_megatron_mbridge_restore.sh. Phase 1 converts
Qwen3-0.6B to megatron-bridge format; phases 2 and 3 run SC GRPO on
Qwen3-0.6B-Base with checkpointing.pretrained_checkpoint pointing at it
(format=megatron_bridge, then megatron_lm via _bridge_to_mlm_helper.py).

The checkpoint holds different weights than policy.model_name, which vLLM
starts from, so each restore phase checks that the trainer loaded the
pretrained path (never the policy model's own conversion) and that
generation matches training (token_mult_prob_error), which holds only if
the initial refit delivered the loaded weights to vLLM.

Registered in L1_Functional_Tests_SingleController_5.sh as a fast entry,
so the CI:Lfast functional lane runs it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Anish Mahishi <[email protected]>
@macandro96
macandro96 force-pushed the amahishi/sc-pretrained-ckpt-init branch from 966742d to 7cfb6b7 Compare December 2, 2026 23:39
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the proof:functionality Needs proof that it works. Set by Autobot PR classify (skills/pr-classify) label Dec 2, 2026
@macandro96 macandro96 added the CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) label Dec 2, 2026
@macandro96

Copy link
Copy Markdown
Contributor Author

/ok to test 7cfb6b7

@macandro96
macandro96 requested a review from yuki-97 December 3, 2026 01:04

@yuki-97 yuki-97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding SingleController coverage for both Megatron restore formats.

Scope: Checkpoint provenance, initial refit, metric assertions and fast-suite registration.

Checked: Both restore phases completed two steps in CI. The largest measured token_mult_prob_error was 1.01551 against the 1.05 limit.

nemo-rl-review: kind=expert harness=codex/0.173.0 model=gpt-6.2-astra effort=medium review-pr-team=v3 reviewed=7cfb6b7

@yuki-97
yuki-97 merged commit 61d4ef5 into main Dec 3, 2026
97 of 98 checks passed
@yuki-97
yuki-97 deleted the amahishi/sc-pretrained-ckpt-init branch December 3, 2026 10:38
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) complexity:low Small, contained change. Set by Autobot PR classify (skills/pr-classify) convergence-risk:none Cannot 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants