Repository navigation
Streamline Benchmark rollouts and add aime24/math_with_judge metrics - #891
Merged
Merged
Conversation
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]>
…tat keys 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]>
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]>
Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
bxyu-nvidia
requested changes
Mar 13, 2026
Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
…the config for ng_collect_rollouts Signed-off-by: George Armstrong <[email protected]>
Signed-off-by: George Armstrong <[email protected]>
bxyu-nvidia
approved these changes
Mar 13, 2026
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]>
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
compute_metricsandget_key_metricsoverrides tomath_with_judgeresources 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.pass@k,pass@1[avg-of-k],majority@k,no_answer) are merged intogroup_level_metricsso each task row in the output has its own breakdown.config_pathsso benchmarks compose naturally with the rest of the Gym config system.Example usage
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