Skip to content

feat(grpo): port grouped validation (pass_k) to validate_sync - #3686

Open
lonexreb wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
lonexreb:feat/3336-sync-grouped-validation-pass-k
Open

feat(grpo): port grouped validation (pass_k) to validate_sync#3686
lonexreb wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
lonexreb:feat/3336-sync-grouped-validation-pass-k

Conversation

@lonexreb

Copy link
Copy Markdown
Contributor

What does this PR do ?

Ports grouped validation (#3401) to the sync dataplane's validate_sync, as tracked in #3336:

  • With grpo.val_num_generations_per_prompt = k > 1, each validation prompt is now rolled out k times (repeat_interleave, contiguous per prompt — same as grpo.validate()), and the val TQ partition is sized for the expanded batch.
  • A pass_k metric (pass@k over each prompt's k rollouts) is reported alongside accuracy, so grpo.stop_at_validation_metric: pass_k now works on the sync path too (the sync driver already threads stop_at_validation_metric through).
  • pass_k grouping relies on rollout_to_tq returning per-row driver_carry in input order — the same alignment the existing message-log reconstruction (turn_roles[i]/turn_contents[i]) already depends on.
  • No new config: reuses grpo.val_num_generations_per_prompt, and the k >= 1 / pass_k-stop-metric asserts already apply since the sync driver runs the shared grpo.setup().

Previously validate_sync silently ignored the knob.

Issues

Part of #3336 (item: "Port grouped validation (#3401) to validate_sync").

Usage

grpo:
  val_num_generations_per_prompt: 4
  # optionally:
  stop_at_validation_metric: pass_k
  stop_at_validation_threshold: 0.9

Before your PR is "Ready for review"

NVIDIA-NeMo#3401 gave grpo.validate() grouped validation: with
grpo.val_num_generations_per_prompt = k > 1 each val prompt is rolled
out k times (repeat_interleave, contiguous per prompt) and a pass_k
metric (pass@k over each prompt's k rollouts) is reported alongside
accuracy, usable as a stop_at_validation_metric. The sync dataplane's
validate_sync never received the port and silently ignored the knob.

Mirror the legacy implementation: expand the batch before
rollout_to_tq (sizing the val partition for the expanded batch) and
compute pass_k from the per-row rewards, which rollout_to_tq returns
in input order. Config validation (k >= 1, pass_k stop-metric
requires k > 1) already applies -- the sync driver uses the shared
grpo.setup().

Tracked in NVIDIA-NeMo#3336 (port of NVIDIA-NeMo#3401 to grpo_sync).

Add a validate_sync unit test mirroring
test_grouped_validation_reports_pass_k.

Signed-off-by: Shubhankar Tripathy <reach2shubhankar@gmail.com>
@lonexreb
lonexreb requested review from a team as code owners August 17, 2026 19:19
@copy-pr-bot

copy-pr-bot Bot commented Aug 17, 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.

@lonexreb

Copy link
Copy Markdown
Contributor Author

/ok to test c73b5f4

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants