refactor(aime): drop structured runner, ship configs/aime/{run.sh,rescore.py} - #91
Merged
Merged
Conversation
ishandhanani
requested review from
alec-flowers,
csahithi and
nlevin-ui
as code owners
April 27, 2026 06:16
4 tasks
ishandhanani
force-pushed
the
ishan/drop-structured-aime
branch
from
April 27, 2026 06:23
bb947b6 to
64b448e
Compare
…score.py}`
The structured `type: aime` runner couldn't deliver answer-extraction
overrides reliably: NeMo Skills' `ns eval` fans out parallel
`python -m nemo_skills.inference.generate` subprocesses through nemo-run,
which constructs unquoted bash command strings for those children. Backslash
flags (e.g. `++eval_config.extract_regex=(?:\boxed\{|...)`) get stripped
to invalid regex by the time the inner shell parses them — verified
on-cluster with two failed jobs (4836 / 4838 / 4840 sequence).
Replace the runner with two files under `configs/aime/`:
- `run.sh` — orchestrates `ns prepare_data` + `ns eval` (default
`\boxed{}` extraction; tuning knobs via env vars with reasoning-eval
reference defaults: max_tokens=400000, repeat=16, temperature=1.0,
num_threads=512) inside the official NeMo Skills container.
- `rescore.py` — re-extracts answers from the cached per-seed
`output-rs<seed>.jsonl` files using a broader regex (`\boxed{}`,
`**Answer**`, `final answer …`, `answer is/=/:`). Regex stays in Python
source — no shell, no Hydra CLI, backslashes survive.
Recipes use `type: custom` with `command: bash /configs/aime/run.sh` and
the `nemo-skills` container alias (already documented in
srtslurm.yaml.example via PR #87). Same pattern can be reused for any
NeMo-Skills-driven benchmark — see the new follow-up issue tracking
GPQA/MMLU/longbenchv2 ports.
Removed:
- `src/srtctl/benchmarks/aime.py` (91 LOC)
- `src/srtctl/benchmarks/scripts/aime/bench.sh` (166 LOC)
- `BenchmarkType.AIME` enum
- `BenchmarkConfig.aime_dataset` schema field
- `TestAIMERunner` (4 tests)
- AIME entries in `docs/config-reference.md` benchmark table + section
- AIME mention in `examples/example.yaml`
Updated:
- `docs/accuracy.md` AIME section → script-based runbook with the
reasoning-mode env var requirements, container alias setup, recipe
shape, and a brief explanation of why it's a script and not a runner.
- `src/srtctl/benchmarks/__init__.py` — drop aime import + __all__ entry.
Backward compat: none. Recipes with `type: aime` will fail schema
validation. Migration is a 1:1 swap to `type: custom` + `bash /configs/aime/run.sh`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ishandhanani
force-pushed
the
ishan/drop-structured-aime
branch
from
April 27, 2026 06:24
64b448e to
44a0e36
Compare
2 tasks
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.
Summary
Drops the first-class
type: aimerunner and replaces it with two scripts underconfigs/aime/that recipes invoke viatype: custom. Cleaner, more reliable, easier to extend to other NeMo Skills benchmarks (GPQA / MMLU / etc. — see follow-up issue).Why drop the runner
NeMo Skills'
ns evalfans out parallelpython -m nemo_skills.inference.generatesubprocesses through nemo-run, which constructs unquoted bash command strings for those children. Backslash-bearing CLI overrides — including any custom++eval_config.extract_regex=...— get stripped down to invalid regex by the time the inner shell parses them.Three failed cluster runs walked through the consequences:
**Answer**collapsed to**(invalid quantifier) → all 16 generate seeds crashed instantly → "Benchmark completed successfully" false positive.bash /configs/aime/run.sh) → real generations, no crash, real metrics.Keeping the regex in Python source as a raw string sidesteps every shell/Hydra escape layer.
What ships
Removed
src/srtctl/benchmarks/aime.py(91 LOC, structured runner)src/srtctl/benchmarks/scripts/aime/bench.sh(166 LOC, pip-install-into-container path)BenchmarkType.AIMEenumBenchmarkConfig.aime_datasetschema fieldTestAIMERunnertest class (4 tests)docs/config-reference.mdbenchmark-type table and sectionexamples/example.yamlAdded
configs/aime/run.sh— orchestratesns prepare_data+ns evalagainstlocalhost:8000/v1(the in-job dynamo frontend). Tuning knobs (MAX_TOKENS,REPEAT,NUM_THREADS,TEMPERATURE,TOP_P,SEED,DATASET,MODEL) are env-var overridable; defaults match the upstream reasoning-eval reference (max_tokens=400000,repeat=16,temperature=1.0).configs/aime/rescore.py— re-extracts answers from the cached per-seedoutput-rs<seed>.jsonlfiles using a broader regex (matches\boxed{},**Answer**,final answer …,answer is/=/:). Regex is a Python raw string — no shell layers. Writesmetrics-regex.jsonalongside NeMo Skills' defaultmetrics.jsonfor an easy A/B.Updated
docs/accuracy.mdAIME section → script-based runbook with reasoning-mode env vars, container alias setup (nemo-skills), recipe shape, and a paragraph on why it's a script not a runner.src/srtctl/benchmarks/__init__.py— drop aime import +__all__entry.Recipe shape (from the new docs section)
/configsis already mounted into the bench container byRuntimeContext, so the script and its companion are just there.Backward compatibility
None. Recipes with
type: aimewill fail schema validation. Migration is 1:1: swap to thetype: customblock above. The structured runner couldn't actually deliver the regex anyway, so anyone relying on it for reasoning models was getting silently-wrong (no_answer-inflated) metrics.Test plan
make check— 611 passed, 2 skipped. Drops 8 tests (the AIME runner suite).'</think>'markers in output).metrics-regex.jsonextraction recoversno_answercases vs defaultmetrics.json.Follow-up
Issue to track porting GPQA / MMLU / longbenchv2 to the same
configs/<bench>/script pattern coming next.🤖 Generated with Claude Code