Skip to content

Log compaction-aware rollout metrics - #2710

Merged
Shi-Dong merged 2 commits into
mainfrom
shi/260821-rollout-step-metrics
Aug 25, 2026
Merged

Log compaction-aware rollout metrics#2710
Shi-Dong merged 2 commits into
mainfrom
shi/260821-rollout-step-metrics

Conversation

@Shi-Dong

@Shi-Dong Shi-Dong commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • log rollout/num_training_samples for the finalized samples in each rollout step
  • log rollout/episode_raw_reward by averaging samples within each original rollout, then averaging rollouts equally

Why

Session compaction can turn one rollout into many training samples. The existing raw-reward metric gives those rollouts proportionally more weight, and W&B does not currently expose how many samples a step trains on. These metrics make both effects visible without changing the meaning of existing metric histories.

Testing

  • python -m pytest --confcutdir=tests/fast/ray/rollout tests/fast/ray/rollout/test_metrics.py -q (23 passed)
  • uvx black --check miles/ray/rollout/metrics.py tests/fast/ray/rollout/test_metrics.py
  • python -m ruff check miles/ray/rollout/metrics.py tests/fast/ray/rollout/test_metrics.py
  • git diff --check

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Shi-Dong
Shi-Dong force-pushed the shi/260821-rollout-step-metrics branch from 519fdd9 to 3912a50 Compare August 22, 2026 05:58
@Shi-Dong
Shi-Dong merged commit f2b7c79 into main Aug 25, 2026
25 checks passed
@Shi-Dong
Shi-Dong deleted the shi/260821-rollout-step-metrics branch August 25, 2026 02:38
arpitg1991 added a commit to arpitg1991/miles that referenced this pull request Sep 8, 2026
…sample metrics

build_dp_schedule needs a micro-batch count that is a multiple of
dp_size * mb_group. It splits multi-sample bins but not singletons, so an
odd number of rows over max_tokens_per_gpu asserts under
--arena-train-segments all. The upstream Terminus 2 recipe shares this
gap. Pad the batch with zero-loss sibling segments of the shortest kept
row: same rollout_id and reward, all-zero loss mask, status COMPLETED, so
the episode advantage and loss weight are unchanged.

Drop rollout/compaction_segments_mean. miles log_rollout_data already logs
rollout/num_training_samples and rollout/episode_raw_reward (radixark#2710).
ADR-0011 records the precedent and the pad.
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.

3 participants