Skip to content

feat(eval): export failure classes, retry counts and resumes to exporters - #4852

Merged
AdamRajfer merged 3 commits into
NVIDIA-NeMo:mainfrom
AdamRajfer:eval/failure-retry-export
Oct 22, 2026
Merged

AdamRajfer merged 3 commits into
NVIDIA-NeMo:mainfrom
AdamRajfer:eval/failure-retry-export

Conversation

@AdamRajfer

@AdamRajfer AdamRajfer commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A run's exported metrics say how many rollouts were expected, scored and missing, but not why rollouts failed, how many were retried, or how often the run was resumed. Reading a run from its tracker alone needs those.

gym eval run and gym eval aggregate now add these keys next to the coverage metrics they export:

  • coverage/failed/<class>: failed rollouts per failure class.
  • retries/attempts, retries/rollouts_retried, retries/at_cap and retries/max_attempts.

The counts come from the _failures.jsonl sidecars, so a resumed run reports totals for the whole run, not only for its last job. A rollout that failed and then landed on a later resume is not counted as failed. MLflowExporter.setup counts each reopen of a run in a gym_resume_count tag. A failure class that a resume cleared is exported as 0, so a reopened MLflow or W&B run does not keep the old count.

A reopened run also stops re-logging its config. MLflow refuses to change a logged param, and the policy server's host and port move between segments, so every later segment logged INVALID_PARAMETER_VALUE and its params were not all logged, while its config overwrote the first segment's global_config.json. On a reopened run the exporter now logs only params that are not logged yet, and writes the segment's full config to config/segment_<UTC start>_<content digest>.json. A first segment behaves as before.

Training is not affected: run_examples and gym env start have no diff.

Validation:

  • test_a_resumed_run_exports_its_failures_and_retries and test_run_from_config_exports_failures_and_retries_of_every_shard in tests/unit_tests/test_rollout_collection.py, and test_each_reopen_counts_one_more_resume, test_a_resumed_segment_with_a_moved_server_logs_no_error_or_warning, test_a_resumed_segment_logs_only_params_that_are_not_logged_yet, test_a_resumed_segment_records_its_changed_config_in_an_artifact_of_its_own and test_each_resumed_segment_gets_its_own_config_artifact in tests/unit_tests/test_exporters.py. Each fails without its change. TestFailureExportMetrics in tests/unit_tests/test_rollout_collection.py checks that a class cleared by a resume or replaced by a later attempt is exported as 0, and that no sidecar rows export no class.
  • pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_exporters.py: pass.
  • ruff check, ruff format.

Compatibility: adds metric keys, one tag and one config artifact per resumed segment. Existing keys do not change.

🤖 Generated with Claude Code

…ters

gym eval run and gym eval aggregate now add coverage/failed/<class> and
retries/{attempts,rollouts_retried,at_cap,max_attempts} to the coverage
metrics they export. The counts come from the failures sidecars, so a
resumed run reports totals for the whole run. MLflowExporter.setup counts
each reopen of a run in a gym_resume_count tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@AdamRajfer AdamRajfer self-assigned this Oct 21, 2026
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test 637dca0

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work labels Oct 21, 2026
@AdamRajfer
AdamRajfer marked this pull request as ready for review October 21, 2026 15:01
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 21, 2026

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

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.

HOLD — two RISK defects make resumed and offline tracker summaries inaccurate.

Inspected all four changed files and traced the affected cache, aggregation, and exporter paths. Findings are based on source inspection; tests were not executed in this read-only review.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

Comment thread nemo_gym/rollout_collection.py Resolved
Comment thread nemo_gym/rollout_collection.py Resolved
Review finding 4338960567 on NVIDIA-NeMo#4852. A resumed run reopens its tracking run, which keeps the last value of every metric it was sent. When a rollout that had failed later landed, or its last attempt failed with another class, coverage/failed/<class> was left out of the export and the old count stayed. Every class the sidecars name is now exported, at 0 when no unresolved rollout has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 21, 2026 19:03
AdamRajfer added a commit to AdamRajfer/Gym that referenced this pull request Oct 21, 2026
Review finding 4338960587 (follow-up to NVIDIA-NeMo#4852). Offline aggregation compared each rollout's failed attempts with the attempt cap of the process doing the aggregating, so a run collected with cap 1 and aggregated in a fresh shell reported max_attempts 3 and nothing at the cap. Collection now records its cap on each failures-sidecar row (_ng_failure_max_attempts, kept out of the metrics like the other _ng_failure_ fields), and retries/at_cap holds each rollout to the cap on its last attempt. retries/max_attempts is that cap, and is left out when the rollouts were collected with different caps. A row written before the cap was recorded uses the current cap, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
A resumed or resubmitted run reopens the MLflow run it recorded, and
_log_config logged every config value as a param again. MLflow refuses
to change a logged param, so each later segment failed with
INVALID_PARAMETER_VALUE (the policy server's host and port move between
segments), its config was never recorded, and the guard logged a
warning.

On a reopened run the exporter now reads the run's logged params and
logs only keys that are new, so it never tries to change one. The
first segment's global_config.json stays as is, and the segment's full
config goes to config/segment_<UTC start>_<content digest>.json. The
name needs no read of the run's artifacts and cannot collide: the start
time orders segments and the digest separates two that start in the
same second. A first segment behaves as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@AdamRajfer
AdamRajfer added this pull request to the merge queue Oct 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39760212720

Merged via the queue into NVIDIA-NeMo:main with commit aa4a69f Oct 22, 2026
49 of 55 checks passed
@AdamRajfer
AdamRajfer deleted the eval/failure-retry-export branch October 22, 2026 10:26
AdamRajfer added a commit to AdamRajfer/Gym that referenced this pull request Oct 22, 2026
NVIDIA-NeMo#4852 landed on main as one squashed commit, which also holds its later MLflow fix. This merge takes main's version of the files NVIDIA-NeMo#4852 changed and keeps this branch's own change on top, so the PR targets main and shows only that change: report retries at the cap a run was collected with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
yaoyu-33 pushed a commit to yaoyu-33/Gym that referenced this pull request Oct 22, 2026
…-NeMo#4873)

* feat(eval): export failure classes, retry counts and resumes to exporters

gym eval run and gym eval aggregate now add coverage/failed/<class> and
retries/{attempts,rollouts_retried,at_cap,max_attempts} to the coverage
metrics they export. The counts come from the failures sidecars, so a
resumed run reports totals for the whole run. MLflowExporter.setup counts
each reopen of a run in a gym_resume_count tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>

* fix(eval): export 0 for a failure class a resume cleared

Review finding 4338960567 on NVIDIA-NeMo#4852. A resumed run reopens its tracking run, which keeps the last value of every metric it was sent. When a rollout that had failed later landed, or its last attempt failed with another class, coverage/failed/<class> was left out of the export and the old count stayed. Every class the sidecars name is now exported, at 0 when no unresolved rollout has it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>

* fix(eval): report retries at the cap a run was collected with

Review finding 4338960587 (follow-up to NVIDIA-NeMo#4852). Offline aggregation compared each rollout's failed attempts with the attempt cap of the process doing the aggregating, so a run collected with cap 1 and aggregated in a fresh shell reported max_attempts 3 and nothing at the cap. Collection now records its cap on each failures-sidecar row (_ng_failure_max_attempts, kept out of the metrics like the other _ng_failure_ fields), and retries/at_cap holds each rollout to the cap on its last attempt. retries/max_attempts is that cap, and is left out when the rollouts were collected with different caps. A row written before the cap was recorded uses the current cap, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>

---------

Signed-off-by: Adam Rajfer <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
AdamRajfer added a commit to AdamRajfer/Gym that referenced this pull request Oct 22, 2026
Brings in the run health counts (NVIDIA-NeMo#4788) and the exporter changes (NVIDIA-NeMo#4852, NVIDIA-NeMo#4873), which the time-limit diagnostics now build on. No conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>

This branch was previously deployed

1 inactive deployment
public — a07f173e Deployed Oct 21, 2026 by copy-pr-bot[bot] via release / finalize / notify #6517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants