Skip to content

fix(eval): report retries at the cap a run was collected with - #4873

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

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

Conversation

@AdamRajfer

@AdamRajfer AdamRajfer commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #4852, which is merged; this PR now targets main. From review finding 4338960587.

What and why. Offline gym eval aggregate reported retries/at_cap and retries/max_attempts from the aggregating machine's NEMO_GYM_MAX_ROLLOUT_ATTEMPTS, not from the cap the run was collected with. So a cap-1 run aggregated in a fresh shell showed at_cap=0. Each sidecar row now records the attempt cap it ran under (_ng_failure_max_attempts), and aggregation reads it. When rollouts were collected with different caps (across shards, or a resume under a new cap), no single retries/max_attempts is reported. A sidecar row written before this change has no recorded cap and uses the current one. The field is dropped before scoring, so it never becomes a metric.

Eval scores. No change: diagnostics only.

Unit tests. tests/unit_tests/test_rollout_collection.py::TestRecordedAttemptCap: five new cap tests. The recorded-cap and mixed-cap tests fail without the fix; the other two pin the fallback to the current cap and that the field never becomes a metric.

🤖 Generated with Claude Code

AdamRajfer and others added 3 commits October 21, 2026 15:20
…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]>
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]>
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]>
@AdamRajfer AdamRajfer self-assigned this Oct 21, 2026
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 21, 2026 20:26
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working labels Oct 21, 2026
laszkiewiczp
laszkiewiczp previously approved these changes Oct 22, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the ready-to-merge PR is approved, current, and waiting for final CI or merge label 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]>
@AdamRajfer
AdamRajfer requested a review from a team as a code owner October 22, 2026 10:35
@AdamRajfer
AdamRajfer changed the base branch from arajfer/stack/failure-retry-export to main October 22, 2026 10:35
@AdamRajfer
AdamRajfer dismissed laszkiewiczp’s stale review October 22, 2026 10:35

The base branch was changed.

@AdamRajfer
AdamRajfer enabled auto-merge October 22, 2026 10:39
@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/39767119786

Merged via the queue into NVIDIA-NeMo:main with commit 29fb4cc Oct 22, 2026
53 of 59 checks passed
@AdamRajfer
AdamRajfer deleted the eval/failure-retry-export-cap branch October 22, 2026 11:19
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 — d5c96c1c Deployed Oct 22, 2026 by copy-pr-bot[bot] via release / finalize / notify #6606
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 bug Something isn't working ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants