Repository navigation
fix(cli): stop --num-repeats from multiplying a benchmark's num_repeats - #5042
Merged
marcromeyn merged 3 commits intoOct 27, 2026
Merged
Conversation
`gym eval run --help` describes --num-repeats as "Number of rollouts per task", but with --benchmark it multiplied the benchmark's own num_repeats: data preparation wrote each task num_repeats times, then rollout collection ran every row --num-repeats times. terminal_bench_2_1/terminus_2 (num_repeats: 8) with --num-repeats 3 ran 24 per task. When num_repeats is set for the run, data preparation now writes each task once, so it alone sets the count. Validation and the metrics sidecars still use the dataset's num_repeats, so they don't change. Without it, a benchmark runs its own num_repeats as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Kelly <[email protected]>
AdamRajfer
approved these changes
Oct 26, 2026
Contributor
|
/ok to test 59fbcf8 |
Contributor
|
Thanks, the fix looks right: |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/40529681001 |
7 tasks done
7 tasks done
fsiino-nvidia
added a commit
that referenced
this pull request
Nov 2, 2026
…5042 Since #5042, data preparation writes each task once whenever a run-level num_repeats is set, so the run-level value replaces each dataset's own. The Core recipe listed only APEX (16) and LMArena (3) with a default of 1, so every other member dropped from 8, 10 or 16 attempts per task to 1 (23,801 rollouts before, 9,427 now). The SWE recipe's run-level 1 did the same to its 3 attempts (2,400 rollouts before, 800 now). List every Core member's intended count in the run-level num_repeats, set num_repeats: 3 in swe.yaml, and update the matching expectations in test_super35_batch_launcher.py. num_repeats_add_seed is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]>
7 tasks done
fsiino-nvidia
added a commit
that referenced
this pull request
Nov 13, 2026
…ataset A run-level num_repeats replaces every dataset's own count (#5042), so the recipes had to repeat every member's count. Drop it from both recipes: each member's dataset sets its count, and the Core recipe sets APEX's and LMArena's datasets to 16 and 3, since they repeat only in this batch. The launcher test checks that neither recipe sets a run-level num_repeats. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]>
pplattner
pushed a commit
to pplattner/Gym
that referenced
this pull request
Nov 19, 2026
…VIDIA-NeMo#5042 (NVIDIA-NeMo#6095) * fix(benchmarks): restore the Core and SWE batch repeat counts after NVIDIA-NeMo#5042 Since NVIDIA-NeMo#5042, data preparation writes each task once whenever a run-level num_repeats is set, so the run-level value replaces each dataset's own. The Core recipe listed only APEX (16) and LMArena (3) with a default of 1, so every other member dropped from 8, 10 or 16 attempts per task to 1 (23,801 rollouts before, 9,427 now). The SWE recipe's run-level 1 did the same to its 3 attempts (2,400 rollouts before, 800 now). List every Core member's intended count in the run-level num_repeats, set num_repeats: 3 in swe.yaml, update the launcher test, and update the README repeat paragraphs. num_repeats_add_seed is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(benchmarks): require every Core batch member to mirror its benchmark's repeat count Drop _default: 1 from the Core recipe's run-level num_repeats, so a member without an entry stops the run instead of silently getting one attempt. Check in the launcher test that each member's batch count equals its own benchmark's count (APEX and LMArena take theirs from the batch alone), and that SWE's run-level count matches its datasets, so the two sources cannot drift. Update the README example and its explanation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(benchmarks): take each batch member's repeat count from its own dataset A run-level num_repeats replaces every dataset's own count (NVIDIA-NeMo#5042), so the recipes had to repeat every member's count. Drop it from both recipes: each member's dataset sets its count, and the Core recipe sets APEX's and LMArena's datasets to 16 and 3, since they repeat only in this batch. The launcher test checks that neither recipe sets a run-level num_repeats. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * test(benchmarks): check batch repeat counts come from each member's dataset Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> --------- Signed-off-by: Frankie Siino <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
evasnow1992
pushed a commit
to evasnow1992/Gym
that referenced
this pull request
Nov 20, 2026
… are settled (NVIDIA-NeMo#5386) * feat(eval): write a completion file per agent as soon as its rollouts are scored Signed-off-by: Frankie Siino <[email protected]> * docs(eval): document the per-agent completion file Signed-off-by: Frankie Siino <[email protected]> * fix(eval): keep a failed completion-file write from failing the run Signed-off-by: Frankie Siino <[email protected]> * fix(eval): aggregate a completion file's rollouts in rollout order Signed-off-by: Frankie Siino <[email protected]> * fix(benchmarks): restore the Core and SWE batch repeat counts after NVIDIA-NeMo#5042 Since NVIDIA-NeMo#5042, data preparation writes each task once whenever a run-level num_repeats is set, so the run-level value replaces each dataset's own. The Core recipe listed only APEX (16) and LMArena (3) with a default of 1, so every other member dropped from 8, 10 or 16 attempts per task to 1 (23,801 rollouts before, 9,427 now). The SWE recipe's run-level 1 did the same to its 3 attempts (2,400 rollouts before, 800 now). List every Core member's intended count in the run-level num_repeats, set num_repeats: 3 in swe.yaml, and update the matching expectations in test_super35_batch_launcher.py. num_repeats_add_seed is unchanged. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * docs(benchmarks): update the batch README for run-level repeat counts Signed-off-by: Frankie Siino <[email protected]> * fix(eval): group completion files by scoring environment and skip unscored agents Signed-off-by: Frankie Siino <[email protected]> * fix(eval): keep completion filenames distinct for distinct agent names Replacing every character outside letters, digits and . _ - with an underscore made names such as 'alpha beta' and 'alpha_beta' share one completion file, so the later write silently replaced the earlier agent's file. Percent-encode the name instead, which keeps ordinary names unchanged, keeps distinct names distinct, and cannot leave the completion directory. Document the encoding for consumers that build the filename, and note how the completion label differs from the run-wide label for an agent behind several environment servers. Signed-off-by: Frankie Siino <[email protected]> * revert(benchmarks): move the Core and SWE repeat-count restore to its own PR Reverts the repeats parts of 6abbf26 and 174c5e6 Signed-off-by: Frankie Siino <[email protected]> * fix(eval): keep an agent pending while a masked rollout awaits its rerun A success masked by infrastructure stays retryable: coverage reports it as masked_retryable and a resume runs it again. The completion code counted it as done, so the agent's file was written from the masked row and went stale once the resume reran it. A masked retryable success now stays pending, during the run and when a resume rebuilds the pending set, so the file is written after the rerun and equals the run-wide entry. The rule moves into RolloutRecords.masked_retryable, which coverage now uses too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(eval): complete an agent once every rollout is settled, including final failures Only successes left the pending set, so one failure no resume would retry blocked its agent's completion file for the rest of the job. A rollout now leaves it once its outcome is settled (RolloutRecords.settled, the complement of pending): a success no resume reruns, or a failure or omission none retries. The early aggregate adds the failures the run counts as zero, with the same helpers as the end of the run, so it still equals the run-wide entry, and the file gains failed_rollouts. A failure a resume will retry still keeps the agent pending, so the file never goes stale. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * refactor(eval): share record reads and server labels with the completion files Read an agent's records through one handle per file (read_record_rows, also used by RolloutRecords.selected) instead of one open per record. Derive the agent that labels each environment server's entry in one helper (_server_agents) for both the run-wide aggregate and the completion files, and test two environment servers fronting one agent. Make the rollout-order test hand records back out of order, so only the completion file's sort keeps it green. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * docs(eval): say the run-wide aggregate wins over a stale completion file gym eval aggregate repairs the run-wide aggregate in place but leaves the completion files, so one that recorded an aggregation error can be stale after a repair. Document that the run-wide entry is authoritative once it exists. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * docs(eval): give per-agent completion files their own section with every field List every field of a completion file and the complete/error values, state when an agent is complete, that a fresh run deletes the directory and a resume rewrites completed_at, and give gym eval aggregate +merge_shards=false as the fallback for a job killed before its run-wide aggregate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * docs(eval): note the run-level health summary on the first run-wide entry After a run, Gym attaches _ng_run_health_metrics, a run-level health summary, to the first entry of the run-wide aggregate. A completion file's aggregate equals its run-wide entry apart from that key, so say so where the docs promise equality. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(eval): bound and clean up early agent aggregation A resume deletes the completion file of an agent it still runs. The early /aggregate_metrics call gives up after 30 minutes and records an aggregation error, so a hung server cannot hold the run-wide aggregate. A run that stops early cancels and waits for its completion tasks and their in-flight requests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(eval): refresh completion files after the saved-answer re-judge pass The re-judge pass at the end of gym eval run grades judge failures again and recomputes the run-wide aggregate, which left completion files written during collection with the old scores. Each file now takes its agent's recomputed entry and rollout counts; if the metrics or the files cannot be refreshed, the files are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(eval): keep completion files in step with every in-place re-judge The judge-only recovery job recomputes the run-wide metrics in place and now refreshes the completion files, or removes them when it cannot. A strict run that the re-judge pass leaves incomplete gets no recomputed metrics, so its completion files are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * fix(rollouts): treat a masked rollout at its attempt cap as unsettled Match main's masked_exhausted coverage (NVIDIA-NeMo#6070), so no completion file is written while such a rollout is unmeasured. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Frankie Siino <[email protected]> * Lint Signed-off-by: Frankie Siino <[email protected]> --------- Signed-off-by: Frankie Siino <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Closes #5041.
Problem
gym eval run --helpdescribes--num-repeatsas "Number of rollouts per task", but with--benchmarkit multiplies the benchmark's ownnum_repeatsinstead of replacing it.gym eval run --benchmark terminal_bench_2_1/terminus_2 --num-repeats 3runs 24 rollouts per task, not 3, because TB2.1 setsnum_repeats: 8. 48 of the 149 benchmarks on main set their ownnum_repeatsabove 1; the issue has the full table.Changes
nemo_gym/train_data_utils.pynum_repeats(--num-repeats), data preparation writes each task once instead of the dataset'snum_repeatstimes, so rollout collection's repeats alone set the count. Validation and the metrics sidecars still use the dataset'snum_repeats, so committed*_metrics.jsonfiles don't conflict.tests/unit_tests/test_train_data_utils.pytest_collate_writes_each_task_once_when_the_run_sets_num_repeats: anum_repeats: 3dataset is written 3× per task without a run value, and once with one.Compatibility
num_repeats: unchanged; each benchmark runs its ownnum_repeats.--num-repeats, ornum_repeatsin a run config): each task now runs exactly that many times. READMEs that assumed this become correct, e.g.proofnetandaime25-x(--num-repeats 32ran 1,024 per task).num_repeats_add_seedand--interleave-repeatsworking for every attempt.Testing
pytest tests/unit_tests/test_train_data_utils.py test_task_materialization.py test_cli_eval.py test_indic_aime_2026.py: 135 passed. The new test fails on main.TrainDataProcessor.runon a benchmark-type dataset withnum_repeats: 8(2 tasks):num_repeats: 3The second run passed the metrics-sidecar check.
ruff check/ruff format: clean.Model rollout: N/A. The change is in data preparation, before any agent or model runs.
Docs: no change needed. The help text and
cli-commands.mdxalready say "rollouts per task".Proposed labels:
bug,area:evaluation.🤖 Generated with Claude Code