Skip to content

Streamline Benchmark rollouts and add aime24/math_with_judge metrics - #891

Merged
bxyu-nvidia merged 18 commits into
mainfrom
georgea/aime24-metrics
Mar 13, 2026
Merged

bxyu-nvidia merged 18 commits into
mainfrom
georgea/aime24-metrics

Conversation

@gwarmstrong

@gwarmstrong gwarmstrong commented Mar 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds compute_metrics and get_key_metrics overrides to math_with_judge resources server, producing math-specific aggregate metrics: pass@k, pass@1[avg-of-k], majority@k, std_dev_across_runs/std_err_across_runs, and per-task breakdowns — all for every k from 1 to num_repeats.
  • Per-task metrics (pass@k, pass@1[avg-of-k], majority@k, no_answer) are merged into group_level_metrics so each task row in the output has its own breakdown.
  • Adds benchmark config chaining via config_paths so benchmarks compose naturally with the rest of the Gym config system.
  • Finishes configuring the AIME24 benchmark.

Example usage

# Prepare benchmark data (downloads from HuggingFace)
ng_prepare_benchmark "+config_paths=[benchmarks/aime24/config.yaml]"

# Start servers (needs a vLLM endpoint in env.yaml)
ng_run "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]"

# Collect rollouts
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl

# Override defaults
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl \
    +num_repeats=8 "+responses_create_params={temperature: 0.7}"

Example key metrics output

{
  "mean/input_tokens": 231.40,
  "mean/output_tokens": 972.04,
  "pass@1[avg-of-8]/no_answer": 21.67,
  "pass@1[avg-of-8]/symbolic_accuracy": 44.17,
  "pass@8/symbolic_accuracy": 73.33,
  "majority@8/symbolic_accuracy": 53.33
}

Example full output with 30 tasks and 8 repeats included.
aime24_mock_aggregate_metrics.json

Add pluggable metrics module (nemo_gym/metrics/) with BaseMetrics ABC
supporting 3-tier customization: get_score_dict, get_answer for
majority@k, _add_derived_metrics for precision/recall, or full
compute() override for arena-style metrics.

Wire into /aggregate_metrics via compute_metrics() on
AggregateMetricsMixin: when metrics_type is configured on the
resources server, BaseMetrics runs alongside RewardProfiler.

AIME24: add prompts/default.yaml, prompt_config, responses_create_params.
MathMetrics: symbolic_accuracy, judge_accuracy, accuracy, majority@k.
Signed-off-by: George Armstrong <[email protected]>
…judge

Add compute_metrics() and get_key_metrics() overrides directly on
LibraryJudgeMathResourcesServer. Pass@k, majority@k, per-sample
statistics functions live as module-level helpers in app.py.

No new modules or ABCs — computation introduced where needed.

AIME24: add prompts/default.yaml and prompt_config.
Signed-off-by: George Armstrong <[email protected]>
Load benchmark config when +benchmark=<name> is passed. Benchmark's
config_paths prepended to chain, other keys become overridable defaults.

Signed-off-by: George Armstrong <[email protected]>
Add per_sample_aggregate dict to agent_metrics — element i is the
pass@1 score computed using only rollout i across all tasks. Shows
variance across seeds/rollouts.

Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
@gwarmstrong
gwarmstrong requested a review from bxyu-nvidia March 13, 2026 18:56
@copy-pr-bot

copy-pr-bot Bot commented Mar 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Comment thread nemo_gym/reward_profile.py Resolved
Comment thread nemo_gym/rollout_collection.py Resolved
Comment thread tests/unit_tests/test_math_metrics.py Resolved
Signed-off-by: George Armstrong <[email protected]>
…the config for ng_collect_rollouts

Signed-off-by: George Armstrong <[email protected]>
@gwarmstrong
gwarmstrong requested a review from bxyu-nvidia March 13, 2026 20:57
@bxyu-nvidia
bxyu-nvidia merged commit 1ad64a4 into main Mar 13, 2026
5 checks passed
@bxyu-nvidia
bxyu-nvidia deleted the georgea/aime24-metrics branch March 13, 2026 22:00
mahanfathi pushed a commit that referenced this pull request Mar 24, 2026
…891)

## Summary

- Adds `compute_metrics` and `get_key_metrics` overrides to
`math_with_judge` resources server, producing math-specific aggregate
metrics: `pass@k`, `pass@1[avg-of-k]`, `majority@k`,
`std_dev_across_runs`/`std_err_across_runs`, and per-task breakdowns —
all for every k from 1 to num_repeats.
- Per-task metrics (`pass@k`, `pass@1[avg-of-k]`, `majority@k`,
`no_answer`) are merged into `group_level_metrics` so each task row in
the output has its own breakdown.
- Adds benchmark config chaining via `config_paths` so benchmarks
compose naturally with the rest of the Gym config system.
- Finishes configuring the AIME24 benchmark.

## Example usage

```bash
# Prepare benchmark data (downloads from HuggingFace)
ng_prepare_benchmark "+config_paths=[benchmarks/aime24/config.yaml]"

# Start servers (needs a vLLM endpoint in env.yaml)
ng_run "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]"

# Collect rollouts
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl

# Override defaults
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl \
    +num_repeats=8 "+responses_create_params={temperature: 0.7}"
```

## Example key metrics output

```json
{
  "mean/input_tokens": 231.40,
  "mean/output_tokens": 972.04,
  "pass@1[avg-of-8]/no_answer": 21.67,
  "pass@1[avg-of-8]/symbolic_accuracy": 44.17,
  "pass@8/symbolic_accuracy": 73.33,
  "majority@8/symbolic_accuracy": 53.33
}
```

Example full output with 30 tasks and 8 repeats included.

[aime24_mock_aggregate_metrics.json](https://github.com/user-attachments/files/25979232/aime24_mock_aggregate_metrics.json)

---------

Signed-off-by: George Armstrong <[email protected]>
jsw-zorro pushed a commit to niletron/Gym that referenced this pull request Apr 7, 2026
…VIDIA-NeMo#891)

## Summary

- Adds `compute_metrics` and `get_key_metrics` overrides to
`math_with_judge` resources server, producing math-specific aggregate
metrics: `pass@k`, `pass@1[avg-of-k]`, `majority@k`,
`std_dev_across_runs`/`std_err_across_runs`, and per-task breakdowns —
all for every k from 1 to num_repeats.
- Per-task metrics (`pass@k`, `pass@1[avg-of-k]`, `majority@k`,
`no_answer`) are merged into `group_level_metrics` so each task row in
the output has its own breakdown.
- Adds benchmark config chaining via `config_paths` so benchmarks
compose naturally with the rest of the Gym config system.
- Finishes configuring the AIME24 benchmark.

## Example usage

```bash
# Prepare benchmark data (downloads from HuggingFace)
ng_prepare_benchmark "+config_paths=[benchmarks/aime24/config.yaml]"

# Start servers (needs a vLLM endpoint in env.yaml)
ng_run "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]"

# Collect rollouts
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl

# Override defaults
ng_collect_rollouts \
    "+config_paths=[benchmarks/aime24/config.yaml,responses_api_models/vllm_model/configs/vllm_model.yaml]" \
    +output_jsonl_fpath=results/aime24.jsonl \
    +num_repeats=8 "+responses_create_params={temperature: 0.7}"
```

## Example key metrics output

```json
{
  "mean/input_tokens": 231.40,
  "mean/output_tokens": 972.04,
  "pass@1[avg-of-8]/no_answer": 21.67,
  "pass@1[avg-of-8]/symbolic_accuracy": 44.17,
  "pass@8/symbolic_accuracy": 73.33,
  "majority@8/symbolic_accuracy": 53.33
}
```

Example full output with 30 tasks and 8 repeats included.

[aime24_mock_aggregate_metrics.json](https://github.com/user-attachments/files/25979232/aime24_mock_aggregate_metrics.json)

---------

Signed-off-by: George Armstrong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants