Repository navigation
fix: preserve advantage statistics across filtering and batch splitting - #5216
Conversation
|
/ok to test 041c5a2 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
No correctness defects found in the guards, estimator/controller paths, regression assertions or recipe inheritance.
Suggestions
- (C1) Add convergence evidence for the streaming recipe's switch to unnormalized advantages. This is a non-blocking validation gap, not a demonstrated training regression.
I inspected all 12 changed files and their directly affected paths. One delegated report wasn't delivered, so I independently covered its setup-validation scope. This review was static: I didn't execute tests or linters, inspect live CI, or independently verify the author-reported results.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test 581a71d |
|
/ok to test a062161 |
|
/ok to test 7fd61d9 |
terrykong
left a comment
There was a problem hiding this comment.
Self-review of my own PR, run with the review team, at 7fd61d9. The redesign in a062161 is the right shape: each estimator now declares requires_global_batch from its own settings, and the streaming guard and advantage-actor sharding both read it through one create_advantage_estimator(). That replaces three separate name/setting checks. It also fixes a bug already on main: OPD with subtract_global_baseline: true was split across advantage actors, so with 2+ actors each part was centered on its own mean instead of the step's. Worth a line in the PR description. No bugs found in the guards; the new tests pass on CPU, and the unit-test results match the previous head.
Two CI breaks to fix before merge:
- (C1) The L1 PPO streaming smoke test now fails at setup; one-line override fix.
- (C4) The abstract
compute_advantagefails the pinned pyrefly lint.
Also:
3. (C5) The new streaming error prints the whole config; name the setting instead.
4. (C3) Reply on the convergence-run thread: wrong baseline, and the run plan.
Not run: GPU/functional tests.
Generated by Claude Code
|
/ok to test 1105fab |
yuki-97
left a comment
There was a problem hiding this comment.
Merge blockers — please rebase on main and resolve conflicts.
LGTM, and thanks for addressing the feedback and for the self-review.
Scope: full static review at 7fd61d9, plus the single-commit update to 1105fab and verification of the existing requests.
Checked:
- Streaming validation and actor sharding use the same estimator requirement. Shared requirement.
- Global OPD baselines stay on one actor, while unnormalized GAE can split. Estimator requirements, OPD requirement.
- In-loss sequence filtering rejects incompatible advantage-statistics settings. Validation.
Waiting for nightly run results before merge.
nit
- Document the shared factory's arguments and return value.
Not blocking merge.
Generated by Codex (#4999 version)
1105fab to
df4edf2
Compare
|
/ok to test df4edf2 |
❌ Submodule Fast-Forward Check FailedCheck based on commit: df4edf2 (PR #5216 from ❌ Submodules that need attention:Gym: ❌ PR branch is BEHIND main branch Please ensure all submodule commits are fast-forwards of the main branch before merging. |
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
Signed-off-by: Terry Kong <[email protected]>
df4edf2 to
303d240
Compare
|
/ok to test 303d240 |
|
@yuki-97 — the two streaming nightlies and both matched full-batch controls passed. The short-run reward curves look similar. Disabling normalization did not reduce the final-10-step mean reward in the full-batch comparison, but these runs do not establish equal final convergence.
Every update consumed one chunk of 256 prompt groups, including the minimum-32 recipes. The minimum permits smaller chunks but does not require them. These runs therefore do not validate convergence with multiple chunks per update, or a meaningful split-versus-whole-batch critic difference. The CPU regressions separately check advantage equivalence across chunks and actor shards. Plotted values, including warmup (CSV). Reward is shown as faint individual values and a bold trailing five-update mean. All 40 steps and every plotted metric were checked against the original driver logs. Settings, tested revisions, and run linksAll four runs used Qwen2.5-1.5B-Instruct on GSM8K, 16 H100 GPUs, configured seed 42, 256 prompt groups, 40 training steps with 10 critic-only warmup steps, one policy epoch and four critic epochs. Policy learning rate was 1e-6; critic learning rate was 1e-5. This is one run per setting and only 30 policy updates. Asynchronous execution is not bitwise deterministic. The full-batch controls change only the chunk minimum (256) and normalization setting relative to The experiment uses PR revision Initial Slurm submission timeouts were retried. The first control attempts stopped before training because their temporary wrappers lacked executable permissions; those were fixed before the measured control runs. No metric checks were weakened. W&B: full batch, normalized · full batch, unnormalized · streaming32 · streaming32-split. |
…kind-advantages Brings in 69 commits, including per-environment GRPO settings (grpo.agent_overrides, #5321) and the advantage statistics fix across filtering and batch splitting (#5216). Two conflict blocks, both resolved by keeping both sides: - grpo.py: DEFAULT_POLICY_FAILURE_KINDS next to main's AgentOverrideConfig. - test_rollout_reassembler.py: this PR's infra-failure weight test next to main's agent-name stamping tests. One more change keeps this PR's test working: the sync-trainer case of test_trainers_infra_masked_reward_never_moves_valid_siblings sets data_plane.backend, which grpo_train_sync now reads (#5151 made the same change to main's tests). exclude_infra needs no change for agent_overrides: its voters do not depend on overlong_filtering, so main's dynamic-sampling check stays limited to masked_reward_policy "exclude". Main's ledger schema is still 8, so failure_kind stays in schema 9. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>

What does this PR do?
Prevent advantage statistics from changing when sequence-error filtering moves into the loss, a step streams in chunks, or advantage actors split its batch.
masked_reward_policy=exclude+seq_logprob_error_in_loss=trueinclude, or filter before computing advantages.requires_global_batch=true+ streamingrequires_global_batch=true+ multiple advantage actorsTurning off
seq_logprob_error_in_losskeeps the threshold enabled and restores the separate policy-logprob pass. Full-batch chunks useasync_rl.min_groups_for_streaming_train == <algorithm>.num_prompts_per_step.One requirement for streaming and sharding
Each estimator implements the required
requires_global_batchproperty. Validation and actor dispatch read that property from the same estimator factory used for computation, replacing the name-based sharding list and separate streaming checks.normalize_advantages.subtract_global_baseline.This fixes an additional OPD bug even with streaming disabled. For six prompt groups with four identical one-token rollouts each, teacher–student logprob gaps [1, 3, 5, 9, 11, 13] should be centered on 7, giving [-6, -4, -2, 2, 4, 6]. Two actors instead centered their shards on 3 and 11, giving [-2, 0, 2, -2, 0, 2]. The property now keeps that batch together. OPD without a global baseline can still shard. Unnormalized PPO can also shard; its advantages and value targets are checked numerically.
The shared
streaming32PPO recipe disables advantage normalization; its split-critic variant inherits this setting. The full-batch recipe keeps normalization enabled. The PPO mask branch remains necessary because GAE normalizes using its token mask. The GRPO late-filter guard rejects exactlyexclude, allowing #4968's proposedexclude_infrapolicy to compose when it lands.Regression coverage and validation
DID NOT RAISE.--noconftestto omit unrelated global Ray/GPU-monitor startup; it mocks actor transport and storage while running the real estimators and dispatcher.bash -npasses. The GPU smoke itself was not run locally.bad-overridediagnostics, adds none, and leaves 28 pre-existing configuration diagnostics in this local environment. The earlier zero-error report used a newer pyrefly version.compute_advantageis declared as aClassVar[Callable[...]];requires_global_batchremains the only abstract member. The streaming error names the relevant settings and prints both chunk and step sizes.GPU validation
Results, plots, run links, and tested revisions. All four targeted runs passed their nightly checks after 40 steps, including 10 critic-only warmup steps.
Mean reward over the final 10 steps was 0.7363 with normalization and 0.7473 without it in the full-batch controls;
streaming32andstreaming32-splitscored 0.7174 and 0.7254. The reward curves look similar over these 30 policy updates. This single-seed comparison does not establish equal final convergence.Every update consumed one chunk of 256 prompt groups, including the minimum-32 recipes. These GPU runs therefore do not validate convergence with multiple chunks per update. The CPU regressions separately check advantage equivalence across chunks and actor shards.
Follows #4160, #5080 and #5130; related to #4968, #4326 and #4357.
Pre checks