Repository navigation
Conversation
Each per-task row in the reward profiling output now includes a raw_rewards_and_lengths field: one entry per rollout (sorted by rollout index) with _ng_rollout_index, reward, and input/output/total token counts. This preserves the per-rollout evidence behind aggregate stats like pass rate, enabling downstream length-aware filtering and re-derivation of pass rates from profiled rollouts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: adithyare <adithya.r@gmail.com>
arendu
requested review from
bxyu-nvidia and
jkyi-nvidia
and
a lite review from Copilot
August 25, 2026 21:53
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances NeMo Gym’s reward profiling outputs by preserving per-rollout evidence (reward and token lengths) alongside aggregate metrics, enabling downstream analyses (e.g., length-aware filtering and pass-rate re-derivation) without re-running rollouts.
Changes:
- Add a
raw_rewards_and_lengthsfield to each per-task (group-level) metrics row produced byRewardProfiler.profile_from_data, derived from the already-sortedrollout_infos. - Update unit tests to (1) assert the exact contents of the new field in the “sorted rollout infos” test and (2) ignore the new key in
_clean_metricswhere appropriate.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
nemo_gym/reward_profile.py |
Adds raw_rewards_and_lengths as a lightweight projection of sorted rollout_infos into group-level metrics rows. |
tests/unit_tests/test_reward_profile.py |
Updates metrics-cleaning to ignore the new key and adds a precise assertion for raw_rewards_and_lengths contents/order. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Doesnt the output already contain the fields in raw_rewards_and_lengths, for example from https://github.com/NVIDIA-NeMo/Gym/blob/main/resources_servers/longmt_eval/data/example_rollouts_reward_profiling.jsonl#L1C1-L2C1 |
This was referenced Sep 8, 2026
This was referenced Oct 22, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a
raw_rewards_and_lengthsfield to each per-task (group-level) row in thereward profiling output produced by
RewardProfiler.profile_from_data.The field contains one entry per rollout, sorted by rollout index, with
_ng_rollout_index,reward, andinput_tokens/output_tokens/total_tokens(token keys included only when present in the rollout's usage). It is a cheap
projection of the existing
rollout_infos, so it flows through unchanged to boththe
*_reward_profiling.jsonlartifact and the group-level metrics returned bycompute_aggregate_metrics.Motivation: aggregate stats like pass rate discard the per-rollout evidence
behind them. Preserving each rollout's reward and length in the profiled output
enables downstream length-aware filtering, checking whether passing rollouts are
systematically shorter/longer than failing ones, and re-deriving pass rates
(
passed = count(reward > 0),total = len(list)) without re-running rollouts.Changes (+25 lines, no deletions):
nemo_gym/reward_profile.py: buildraw_rewards_and_lengthsfrom the sortedrollout_infosinprofile_from_data(+8)tests/unit_tests/test_reward_profile.py: assert the new field's exactper-rollout contents in
test_rollout_infos_are_sorted_and_pass_rate_is_recoverable,and add the key to the
_clean_metricsignore set (+17)Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).