Skip to content

feat(sc): add GRPO training-time validation - #5423

Open
yuekaizhang wants to merge 11 commits into
NVIDIA-NeMo:mainfrom
yuekaizhang:yuekaiz/sc-training-time-validation
Open

yuekaizhang wants to merge 11 commits into
NVIDIA-NeMo:mainfrom
yuekaizhang:yuekaiz/sc-training-time-validation

Conversation

@yuekaizhang

@yuekaizhang yuekaizhang commented Nov 24, 2026 •

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

What and why

SingleController GRPO can now evaluate during training with native environments and direct, non-colocated vLLM generation. Start, periodic, and final validation use their own dataset and sampling profile. Validation emits accuracy, response length, pass@k, and completion JSONL. Optional early stopping saves the stopping step, and validation-based checkpoint ranking uses the score measured on that checkpoint's weights.

flowchart LR
    A[Validation is due] --> B[Close training dispatch and drain rollouts]
    B --> C[Refit the generation fleet]
    C --> D[Run validation rollouts]
    D --> E[Log metrics and provide current-step checkpoint score]
    E --> F[Resume training or save and stop]
Loading

Issues

Addresses the training-time validation item in #5044. Ports the validation lifecycle and rollout-manager design from #3203 to the current controller.

Convergence / perf / functionality proof

  • 1,662 unit tests and 1,750 configuration subtests passed in the targeted suites, including same-step checkpoint scoring and early stopping.

  • The new H100 functional test with Qwen2.5-1.5B, Megatron Bridge, and async vLLM passed. It verifies the validation schedule, pass@k from logged completions, and checkpoint metadata.

  • A second H100 smoke stopped on greedy validation at step 1 and resumed from its checkpoint through step 3.

  • A three-step Qwen3.5-35B-A3B-Base smoke with Megatron Bridge EP16 and vLLM TP8 on 24 H100s completed. AIME2024 validation emitted 16 completions per pass at steps 0, 2, and 3. Step 2 and 3 checkpoint metadata matched the validation scores recomputed from their completion logs.

  • Matched three-step Qwen2.5-1.5B runs on 2 H100s measured validation at steps 0, 2, and 3 with 3 prompts and 2 completions each. Validation took 4.10 s at startup and 2.22 s at steps 2 and 3, with drain under 0.1 ms for this LA0 smoke. Step 2 and 3 wall times were 3.88/4.07 s with validation off and 6.11/6.52 s with it enabled. End-to-end valid training tokens/s/GPU for those steps were 28.36/27.36 off and 20.94/15.81 on. These are short-run timing measurements and include rollout variability.

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.
  • /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

@copy-pr-bot

copy-pr-bot Bot commented Nov 24, 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 Documentation Improvements or additions to documentation CI:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) labels Nov 24, 2026

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

Reviewed the 16-file change with five specialist roles, an independent two-pass adversarial review, and a separate comment-editing pass. Four collaborator agents plus the lead performed these roles.

The explicit validation profile and current-step checkpoint result are useful boundaries. Eight findings remain:

  1. (C1) Admitted replacement rollouts can deadlock validation draining.
  2. (C2) Existing fixtures and argument checks cause 113 recurring unit-test failures.
  3. (C3) The watchdog can abort while validation prompts are completing.
  4. (C4) Periodic validation enters the next training step’s engine token count.
  5. (C5) Shared sampling comments omit native validation support.
  6. (C6) Supported native recipes retain outdated support comments.
  7. (C7) Validation overhead needs measured evidence.
  8. (C8) Shared metric-key constants would avoid paired spelling changes.

The same 361-case selection gives 361 passes at the base, 248 passes and 113 failures at the head, then 361 passes with disposable fixture/assertion repairs only. Bounded production-code probes reproduce the drain, watchdog and counter defects. The final per-prompt watchdog repair passes the timing cases, ordering/failure/cancellation checks and 36 equivalence cases.

The real-model functional smoke was not rerun, and the broader backend run was interrupted. The import-order hook reports two PR files; the other Ruff checks pass. Pinned type checking remains unverified because the container’s Pyrefly version differs from the required version.

No merge conflict was reported. This remains a local preview; no GitHub review or comments were created.

nemo-rl-review: kind=self harness=codex/0.166.0 model=gpt-6.1-sol effort=high review-pr-team=v3 reviewed=03d9a5d

Comment thread nemo_rl/algorithms/single_controller.py Resolved
Comment thread nemo_rl/algorithms/single_controller.py Resolved
Comment thread nemo_rl/algorithms/single_controller.py Resolved
Comment thread nemo_rl/models/generation/interfaces.py Resolved
Comment thread docs/guides/single-controller.md Resolved
Comment thread nemo_rl/algorithms/single_controller.py Resolved
@yuekaizhang
yuekaizhang marked this pull request as ready for review November 27, 2026 03:11
@yuekaizhang

Copy link
Copy Markdown
Contributor Author

Please review the curves below: red = Mcore backend single controller path with train-time validation enabled; blue = legacy Mcore backend validation curve. Experiments are on qwen3.5-30b-a3b.
image

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 6ab87d7

@copy-pr-bot

copy-pr-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

/ok to test 6ab87d7

@yuekaizhang, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 6ab87d7

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 5805103

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 3ef946c

@terrykong terrykong removed the Documentation Improvements or additions to documentation label Nov 28, 2026
yuekaizhang added a commit to yuekaizhang/RL that referenced this pull request Nov 30, 2026
@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) labels Dec 1, 2026
@yuekaizhang

Copy link
Copy Markdown
Contributor Author
image

Attached training time validation curve using sc mcore backend.

@yuekaizhang

Copy link
Copy Markdown
Contributor Author

/ok to test 4e05c29

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:Lfast Runs a fast test suite and re-use nightly `main` container (but sync dependencies to PRs version) 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants