Repository navigation
Conversation
17837dd to
879f3bf
Compare
bg51717
left a comment
There was a problem hiding this comment.
Self-review of the 4 commits on top of #5301 (837fbb37..879f3bfe), by a team of agents (code, bugs, tests, design, existing threads) plus an adversarial pass.
The change is well shaped: capture and non-capture rows write their reward component columns through the same payload helper, the zero-fill sits in the finalizer (the one place that sees the whole group), and the ledger bump to schema 9 keeps a schema-8 load path.
Needs a rebase. #5158 landed on main and conflicts with the import block of nemo_rl/experience/rollout_manager.py. The conflicting hunk comes from #5301, so fix it there and rebase this PR on top. Nothing else that landed on main touches the code this PR changes.
What was checked:
- Unit tests at this head, on CPU: 749 passed across the five changed files in the default lane, 131 passed in
tests/unit/data_plane/test_rollout_reassembler.pyin the NeMo Gym lane. - The functional tests were read but not run (no GPU on the review machine). No unit or functional CI job has run on this PR yet.
pre-commit run --all-filesis clean.- Two inline comments:
- (C1) A header comment in the sibling-recovery script describes a check the test does not make.
- (C2) One missing unit test for a restored sibling's components in the reassembly request.
One behaviour to know about, no action: the reward == sum(reward_components) check now also runs on token-capture rows, for every estimator. A verifier that breaks that rule (for example Gym's vibench, or mcqa in boxed_and_normalized mode) is now rejected under GRPO with token capture too, as it already is on the legacy path.
nemo-rl-review: kind=self harness=claude-code/2.1.332 model=claude-fable-5-2 effort=medium review-pr-team=v3 reviewed=879f3bf
AsyncRolloutImpl accumulates a dict of rewards per component, keeps their sum as the completion reward, and the rollout payload writes one reward/<name> column per component. Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Reward shaping adjusts only total_reward, which GDPO does not read, so the run would silently skip the shaping. Reject the combination at setup, and name gdpo in the full-batch error. Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
The recipe now inherits the SingleController exemplar (Megatron trainer, non-colocated vLLM, sync in_order sampler) and its script runs examples/run_grpo_single_controller.py. Signed-off-by: bg51717 <[email protected]>
grpo.length_penalty adjusts only the scalar reward after the Gym results become completions, and GDPO reads only the reward components, so the penalty would be silently skipped. Signed-off-by: bg51717 <[email protected]>
Adds the SingleController variant of gdpo_math_1B.yaml and a functional test that runs it, and registers both SingleController GDPO functional tests in the L1 list. Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Both change only the scalar reward, which GDPO does not read, so the run would silently skip them. Signed-off-by: bg51717 <[email protected]>
A prompt group writes only the reward/<name> columns its own completions carry, but a train step fetches the columns of all its groups from every row. A GDPO step that mixed a group with components and a group without them failed in the advantage stage with a missing-column KeyError. claim_for_training now writes float32 zeros for the columns a claimed group lacks and adds them to its metadata, inside the claim's mutation section. Existing values are kept and a claim without any component column writes nothing. Signed-off-by: bg51717 <[email protected]>
Token capture kept only the scalar reward: a receipt completion dropped its reward components, and the recovery ledger, the reassembly request and the finalizer carried one number per rollout. Setup therefore rejected GDPO with token_capture.enabled. A receipt completion now keeps its reward/<name> components. The recovery ledger stores them per attempt (schema version 9; versions up to 8 load without them), the reassembly request forwards them, and the finalizer publishes them as columns on every row, placeholders included. Forest rows carry no components, so the finalizer rejects that pairing, which setup already excludes. The setup reject for GDPO with token capture is removed. Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Signed-off-by: bg51717 <[email protected]>
Run the sibling recovery functional test through the GDPO smoke on a multi-reward environment. The checkpoint must hold the sealed sibling's reward components, and the resumed group, which mixes the restored sibling with a regenerated one, must publish. Signed-off-by: bg51717 <[email protected]>
879f3bf to
28b666f
Compare
|
/ok to test 28b666f |
What and why
GDPO (
grpo.adv_estimator.name: gdpo) could not run on the SingleController path with token capture on (token_capture.enabled: true). #5301 added GDPO with token capture off and rejected this combination at setup. This PR makes the combination work.Depends on #5287 and #5301.
With token capture on, the finalizer actor writes the training rows, and it receives only the capture receipts and the scalar reward. This PR carries the reward components along the same route as the scalar reward:
Completion.reward_componentsfor results that carry a capture receipt too. A verifier whoserewarddiffers from the sum of its components is now rejected with token capture on, as it already is with token capture off.reward/<name>columns with the same payload code as the path without token capture. A rollout whose capture failed becomes a placeholder row that keeps its component values and hassample_mask0.GDPO with
token_capture.forest_trainingis still rejected at setup, as before. The finalizer also raises if a forest row arrives with components.Usage:
uv run examples/run_grpo_single_controller.py \ --config <a NeMo Gym config with a multi-reward environment> \ grpo.adv_estimator.name=gdpo \ ++token_capture.enabled=trueIssues
Part of the "GDPO / component-wise reward advantages" item in #5044.
Convergence / perf / functionality proof
train/reward:L1_Functional_Tests_SingleController_3.sh:gdpo_gym_single_controller.sh ++token_capture.enabled=true, which also checks that the finalizer ran.grpo_async_gym_single_controller_sibling_recovery.shwithSC_SIBLING_RECOVERY_ADV_ESTIMATOR=gdpo. It checkpoints a group with one sealed and one unfinished rollout, restarts, and checks that the checkpoint holds the sealed rollout's components.gdpo_gym_single_controller.shwith token capture off, and the GRPO variant of the sibling recovery test.Needs upstream changes
None.