Skip to content

fix: aggregate rollout metrics by semantic type (min/max/sum/mean)#2175

Open
yfw wants to merge 1 commit intomainfrom
yifu/fix-rollout-metrics-min-max-aggregation
Open

fix: aggregate rollout metrics by semantic type (min/max/sum/mean)#2175
yfw wants to merge 1 commit intomainfrom
yifu/fix-rollout-metrics-min-max-aggregation

Conversation

@yfw
Copy link
Copy Markdown
Contributor

@yfw yfw commented Mar 30, 2026

Previously all numeric rollout metrics were averaged when aggregating across trajectory groups, giving misleading values for min/max/total metrics. Now min-prefixed/suffixed metrics use min(), max uses max(), total_turns is summed, and the rest are averaged.

Extracts aggregate_rollout_metrics() helper for testability and adds unit tests covering each aggregation path.

Closes #1955

What does this PR do ?

Add a one line overview of what this PR aims to accomplish.

Issues

List issues that this PR closes (syntax):

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

  • ...

@yfw yfw requested review from a team as code owners March 30, 2026 22:59
@yfw yfw added the super-v3 label Mar 30, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Mar 30, 2026

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.

Previously all numeric rollout metrics were averaged when aggregating
across trajectory groups, giving misleading values for min/max/total
metrics. Now min-prefixed/suffixed metrics use min(), max uses max(),
total_turns is summed, and the rest are averaged.

Extracts `aggregate_rollout_metrics()` helper for testability and adds
unit tests covering each aggregation path.

Closes #1955

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
@yfw yfw force-pushed the yifu/fix-rollout-metrics-min-max-aggregation branch from 8bb0339 to 3b197f3 Compare March 30, 2026 23:01
for k, v in rollout_metrics.items()
}
per_group_metrics.setdefault(k, []).append(v)
rollout_metrics = aggregate_rollout_metrics(per_group_metrics)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, don't we need to add this in the sync grpo path as well?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[super-pr] fix min&max metric

2 participants