Skip to content

feat(grpo): add sequence-level logprob error metrics - #2559

Merged
yfw merged 3 commits into
mainfrom
amahishi/seq-logprob-error-metrics
May 28, 2026
Merged

feat(grpo): add sequence-level logprob error metrics#2559
yfw merged 3 commits into
mainfrom
amahishi/seq-logprob-error-metrics

Conversation

@macandro96

Copy link
Copy Markdown
Contributor

What does this PR do ?

Summary

  • Add sequence-level logprob error metrics for GRPO training.
  • Support optional sequence masking via grpo.seq_logprob_error_threshold.
  • Preserve force_on_policy_ratio=True skip behavior unless sequence-level masking requires real prev logprobs.
  • Exclude fully masked sequences from sequence-level min/mean/max error statistics.

Issues

Related: #1910 (adds more monitoring metrics)
Closes: #1950

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

@macandro96
macandro96 requested review from a team as code owners May 22, 2026 18:46
@macandro96 macandro96 added CI:L0 Run doctests and unit tests super-v3 labels May 22, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 22, 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.

@macandro96
macandro96 force-pushed the amahishi/seq-logprob-error-metrics branch from 8e33bc7 to cd28deb Compare May 22, 2026 18:49
@macandro96

Copy link
Copy Markdown
Contributor Author

/ok to test cd28deb

@yfw

yfw commented May 26, 2026

Copy link
Copy Markdown
Contributor

Overall change looks good. Can you take a look at the test failure? https://github.com/NVIDIA-NeMo/RL/actions/runs/26306657989/job/77450890117?pr=2559. Also, can we include some tests for the new metrics?

@macandro96
macandro96 force-pushed the amahishi/seq-logprob-error-metrics branch from c076b75 to 8c7f147 Compare May 26, 2026 22:09
@macandro96 macandro96 closed this May 26, 2026
@macandro96
macandro96 force-pushed the amahishi/seq-logprob-error-metrics branch from 8c7f147 to fad476e Compare May 26, 2026 23:10
@copy-pr-bot

copy-pr-bot Bot commented May 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

yfw and others added 3 commits May 26, 2026 16:17
ffcb0d176f6ecc5a6761ffb287fdc3692cb78fd4

#1910
Related: #1838

Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Co-Authored-By: Jiaqi Zeng <jiaqiz@nvidia.com>
(cherry picked from commit 145c744)
Signed-off-by: Anish Mahishi <amahishi@cw-dfw-cs-001-vscode-02.cm.cluster>
Signed-off-by: Anish Mahishi <amahishi@cw-dfw-cs-001-vscode-02.cm.cluster>
@macandro96 macandro96 reopened this May 26, 2026
@macandro96

Copy link
Copy Markdown
Contributor Author

/ok to test fb02284

@macandro96

Copy link
Copy Markdown
Contributor Author

@yfw I made some changes - could you please review again?

@yfw
yfw merged commit 64be007 into main May 28, 2026
45 checks passed
@yfw
yfw deleted the amahishi/seq-logprob-error-metrics branch May 28, 2026 06:35
vigneshwaran pushed a commit to vigneshwaran/RL that referenced this pull request May 28, 2026
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Signed-off-by: Anish Mahishi <amahishi@cw-dfw-cs-001-vscode-02.cm.cluster>
Co-authored-by: Yi-Fu Wu <yifu.wu@gmail.com>
Co-authored-by: Jiaqi Zeng <jiaqiz@nvidia.com>
Co-authored-by: Anish Mahishi <amahishi@cw-dfw-cs-001-vscode-02.cm.cluster>
qiaochuz-nv added a commit that referenced this pull request May 28, 2026
Adds CPU-runnable unit coverage for the 3 dict-access lines at
grpo_sync.py:773-781 introduced by the #2559 follow-up fix.

Signed-off-by: Qiaochu Zhu <qiaochuz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:L0 Run doctests and unit tests super-v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[super-pr] don't count fully masked sequences

2 participants