Repository navigation
feat(single-controller): support two-source GRPO checkpoint resume - #5300
WenzheWang wants to merge 7 commits into
Conversation
Build step-bounded GRPO streams from two task dataloaders and preserve their native per-task checkpoint files. Restore task cursors together with replay ownership and resolve pending prompts by task and sample ID. Retain legacy eager iteration and validate unsupported configurations. Signed-off-by: Wenzhe Wang <[email protected]>
Merge main 84374ef while retaining per-task loader and native replay state. Snapshot deferred checkpoint cursors and cover two-source setup and restore. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
Preserve named task identity across rollout trace runs and restored records. Clarify single-dataloader limits for replay-free and MSC checkpoints. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
WenzheWang
left a comment
There was a problem hiding this comment.
The six-file follow-up addresses the earlier local findings on task identity in rollout traces, checkpoint recovery without replay and MSC support. No actionable findings remain within this review scope.
This follow-up rechecked the affected callers, trace readers and support descriptions, using the earlier complete local review for unchanged code. Five specialist lanes, an independent devil’s advocate in separate discovery and challenge passes, and a separate comment editor completed the follow-up.
The existing 205-case CPU results match the exact committed patch. Earlier 936-case CPU and two-A800 stop/restart evidence was reused only for unchanged code. No new tests or GPU runs were started for this review.
nemo-rl-review: kind=self harness=codex/0.171.0-alpha.13 model=gpt-6.1-sol effort=high review-pr-team=v2 reviewed=d3147a6
|
The author self-review for Could a maintainer vet this PR for NVIDIA runner access and route it to a reviewer for SingleController data loading and checkpoint recovery? The current-head pull-request workflows are awaiting approval. The legacy |
Merge main d93ba7d while retaining per-task checkpoint and trace identity. Validate affected CPU paths and preserve the existing trainer evidence. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
Merge main e77523f while preserving claimed replay order and capture ownership. Clarify how to align repeated samples when comparing rollout traces. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
Merge main 0be64f4 and retain task-qualified prompt rehydration. Update the privileged checkpoint fixture for per-suffix dataloader state. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
Merge main f3b2d53 and retain the per-task cursor and replay identity. Validate the affected CPU paths and keep the earlier trainer evidence scoped. AI assistance was used for this change. Signed-off-by: Wenzhe Wang <[email protected]>
What and why
Enable step-bounded SingleController GRPO training with two data sources and resumable per-task dataloader cursors.
Setup builds two task loaders through the existing
MultipleDataloaderWrapperand defers iterator creation until consumption. Checkpoints writetrain_dataloader_<task>.pt, following the legacy sync layout requested in #5044. Resume loads both task cursors, checks the saved data configuration, and restores native replay and rollout ownership. Pending prompts are resolved using task name and sample index, so equal indices in different datasets identify their own records. Rollout trace events also retain named task identity across runs and restored records.The initial mode uses the
in_ordersampler with zero lookahead, a deterministic stateless custom callback, a positive step limit, and dynamic sampling disabled. Checkpointed runs retain native replay state. Single-source checkpoint layout and legacy wrapper iteration remain supported.flowchart LR A[Two task dataloaders] --> B[Step-bounded GRPO stream] B --> C[Native rollout and replay ownership] C --> D[Checkpoint] A --> E[Per-task dataloader state files] E --> D D --> F[Restore both task cursors and native optimizer] F --> BIssues
Related to #5044, specifically the multiple-dataloaders and resume item.
Usage
Configure SingleController GRPO with two distinct tasks in
data.trainand the following overrides. The shipped callback takes one batch from each source and cycles an exhausted source.Keep the same data configuration when resuming. Both task cursor files and the matching native checkpoint metadata are required.
Convergence / perf / functionality proof
CPU regression on the merge with main
f3b2d532. Job916268passed 224 tests, including two-source cursor resume, task-qualified replay, legacy single-source restore, and recovery metadata compatibility. Ruff lint, import order, and formatting passed.Type check and source identity. Job
916271ran full-project Pyrefly 1.4.0 with zero errors and verified 2,254 source paths and file modes before and after execution.Optional Forest coverage. Seven NeMo-Gym-marked tests stopped at import in job
916270. The candidate and main reference the same older Gym module path. These cases are outside the 224 passing tests.Earlier evidence. Jobs
916119and916124covered 202 CPU tests on the0be64f47merge. The 619 tests one77523feand the two-A800 stop/restart on84374efbremain scoped to those sources.Real trainer: Qwen3-0.6B on 2×A800, using two distinct task sources. The uninterrupted baseline completed steps 1–2. A separate run saved at step 1 and exited, then a new trainer restored that checkpoint and completed step 2. Four optimizer updates were executed in total.
Resume state: native optimizer restore was enabled (
load_optim=true,finetune=false). Both task-specific dataloader files were restored; each final step-2 cursor file matched its corresponding baseline SHA256. All three phases exited successfully, all loss/gradient values were finite, and every skipped-step metric was zero.This establishes functional two-source stop/restart for the tested recipe. The asynchronous checkpoint cut does not establish an identical uninterrupted training trajectory; the values above are the observed results. No convergence or performance gain is claimed.
Earlier seven-module CPU sweep on
e77523fe(setCPU_PYTHONto the existing Linux test environment):Needs upstream changes
None.
AI assistance was used for this contribution.
PR commands and CI
/ok to test <full-commit-sha>starts repository CI after maintainer validation./reviewrequests the repository review service.