Skip to content

fix(rollout): require complete groups for group estimators - #48

Open
k21993 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
k21993:fix/incomplete-groups-without-dynamic-filtering
Open

fix(rollout): require complete groups for group estimators#48
k21993 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
k21993:fix/incomplete-groups-without-dynamic-filtering

Conversation

@k21993

@k21993 k21993 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Group completeness (a group must keep all n_samples_per_prompt rollouts) was previously
checked only when --algo.dynamic_filtering_enable was set. With it unset (the default), a
group-advantage estimator (grpo/dr_grpo/reinforce_baseline/rloo) could compute
advantages from fewer than n_samples_per_prompt usable rollouts when a rollout was lost to
an unrelated per-response drop (vlm_truncation, logprob_misalign, no_action_tokens, ...),
computing advantages from a partial group and changing the intended group statistics/baselines.

Require complete groups when training with a group estimator, while preserving the existing
completeness requirement whenever dynamic filtering is on (its uniform-vs-mixed decision is
itself group-based). Per-sample estimators without dynamic filtering, and eval (_generate_batch,
which never backfills), retain usable partial groups. Pre-filter score-stat collection stays
before the completeness decision so incomplete-but-scored groups still count toward the logged rate.

Test plan

  • tests/unit/test_samples_generator.py: incomplete group dropped when a group estimator
    requires it; dropped whenever dynamic filtering is on (even for a per-sample estimator, with
    mixed scores that would otherwise pass the DAPO filter); kept for a per-sample estimator with
    DF off; kept for eval; complete group kept; incomplete-but-scored group still recorded in score_stats.
  • Verified the two drop tests each fail against the respective pre-fix code and pass after.
  • python -m pytest -q: 196 passed, 2 failed; both failures (test_cp_thd_packing) reproduce
    unchanged on origin/main and are unrelated to this change.

Group completeness was previously checked only when dynamic filtering
was enabled. As a result, group-advantage estimators could compute
advantages from fewer than n_samples_per_prompt usable rollouts when
dynamic filtering was disabled.

Require complete groups when training with a group estimator, while
preserving the existing completeness requirement for dynamic filtering.
Per-sample estimators without dynamic filtering and evaluation continue
to retain usable partial groups. Preserve pre-filter score-stat
collection before the completeness decision.

Signed-off-by: Karthik Suresh <7954591+k21993@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 30, 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.

@k21993

k21993 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @hijkzzz, just wanted to follow up on this PR. Would appreciate your review and any feedback when you get a chance. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant