fix(sc): retain rollout metrics through training - #3880
Conversation
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
yfw
left a comment
There was a problem hiding this comment.
Rollout metrics reaching the SingleController train logs is a real gap: on main the SC path computed record.rollout_metrics and discarded it, with no other route to those numbers. The implementation matches its nearest analogs (grpo.py:4845-4849, ppo.py:2432) almost line for line and reuses the shared aggregate_rollout_metrics rather than reimplementing its min/max/sum/histogram semantics, which is the right call. The re-attach in _finalize_selection is genuinely necessary — concat keeps only the first meta's extra_info — and the pop targets a fresh concat-produced meta, so it cannot corrupt buffered state. Multi-chunk accumulation is correctly scoped, and resume from a pre-PR checkpoint degrades gracefully.
One inline comment is a real bug on an adjacent line this PR activates; the other two are low-priority test pins.
Minor, no action required: the TODO at single_controller.py:1401-1403 still lists rollout_metrics as outstanding — this PR implements it. The histogram log item in that same TODO is a different thing (the explicit log_histogram calls that grpo.py:2562-2582 makes for baseline/advantage) and is still outstanding.
Generated by Claude Code
Honor the existing W&B opt-in before retaining NeMo Gym full-result tables in SingleController rollout metrics. Add coverage for default-off behavior, setup propagation, checkpoint compatibility, and removal before DP sharding. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 14a80c8 |
Keep the constructor-bypassing NeMo Gym redispatch fixture aligned with the production default so rollout metric computation can exercise the retry path. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 3be567b |
Keep the partial checkpoint setup config aligned with the production logger shape so full-result table gating can be evaluated during resume tests. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 103fef5 |
Resolve the SingleController setup import overlap while preserving rollout metric logging and warm-start checkpoint validation. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 38ee49e |
Keep the partial PPO setup config aligned with the production logger shape so rollout table gating can be evaluated across critic setup tests. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Resolve SingleController rollout metric retention against native TQ checkpoint recovery while preserving both behaviors. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Preserve rollout metric retention and optional full-result table logging while incorporating reward penalties, reference-logprob gating, and the latest SingleController changes. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 8491d65 |
Treat generation worker IDs as string metric labels so retained per-worker token counts remain valid native TQ replay metadata. Cover both metric production and checkpoint round trips. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
mehraakash
left a comment
There was a problem hiding this comment.
The full-result-table opt-in is useful, but the branch is no longer safe to merge as-is.
The rollout-metric retention and aggregation portion has already landed on main through #3883, together with speculative-decoding metrics and replay-manifest handling. This PR now conflicts with current main, and taking the PR versions during conflict resolution could regress those newer changes.
Please rebase and reduce this PR to the remaining unique change:
- propagate
log_nemo_gym_full_result_tablesinto the SingleController rollout manager; - construct full-result tables only when enabled;
- retain focused default-off, opt-in, setup-propagation, and checkpoint-serialization tests.
The current SingleController functional failure is a real checkpointing regression caused by hashing rollout_metrics, so I don’t think this is ready until that path is fixed and green.
Keep the full-result-table opt-in on top of main rollout metrics and replay-manifest handling. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
|
/ok to test 782dff6 |
Summary
Ports the rollout-metric aggregation behavior from #2175 to the SingleController async/TransferQueue path.
TQReplayBufferaggregate_rollout_metricssemantic rules and log them with the corresponding train stepNo new configuration or migration changes are required.
Validation
ruff checkandruff format --check: passedpyrefly checkon changed production files: passed