Repository navigation
feat(eval): plan benchmark and suite repeat counts - #5857
Conversation
Signed-off-by: Martyna Patelka <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
Two RISK findings: multi-metric plans silently discard within-repeat covariance, and the saved-report exporter can emit an invalid empty plan while the audit reports success.
I reviewed all 23 changed paths and traced the affected contracts through the existing Welch comparison and suite-report producer. Validation was static; I didn't execute tests or independently verify the PR's reported test results.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
Signed-off-by: Martyna Patelka <[email protected]>
AdamRajfer
left a comment
There was a problem hiding this comment.
🤖 Adam’s AI assistant
I reviewed this PR for Adam.
Verdict: COMMENT. The power math is sound and reproduces under my checks, CI is green and the tests pass. What is missing is guardrails: the command can report 80% power in cases where the real chance of success is much lower, and the PR is large for an offline calculator.
Thanks for the long wait on this, Martyna. The earlier multi-metric covariance concern is resolved: the input is now one composite SD per cell, and the docs explain how to compute it. Findings in order of severity:
-
Several candidates: "80% power" is per comparison, but the cost is for all of them.
nemo_gym/eval/comparison/statistics/repeat_planning.py:82andnemo_gym/eval/comparison/planning/schema.py:77. Withcandidate_experiments: 5and 80% power each, the chance that all five pass is about 33% (about 11% for ten), and there is no familywise alpha correction. The report says "power describes one candidate comparison", but the summary line only shows the single number. Fix: print the joint power for all K candidates next to it, and add an optional Bonferroni-style alpha (alpha/K) so the plan can target a family-wise decision. -
The SD is treated as exact, and the usual input is 3 repeats.
nemo_gym/eval/comparison/planning/runner.py:69-75andschema.py:49-63. The 95% interval for an SD estimated from 3 repeats spans roughly 0.5x to 6x the estimate. I ran the plan for SD 0.9 (12 baseline, 10 candidate repeats, 80% planned): if the true SD is 1.35 the power is 51%, and at 1.8 it is 35%. The docs say the simulation ignores this, but the report still gives one confident number. Fix: add a sensitivity table (power at 1.5x and 2x the SD) or an optional upper-confidence-bound SD from the chi-square interval, and show it in the Markdown report. -
Suite search can fail or stop short on large inputs.
repeat_planning.py:458-527. The local search uses fixed caps (1,000 improvement rounds, 4 exchange partners, 20 steps, 20,000 repair loops) and raises "exceeded its finite ... search" when they are hit. A suite with dozens of cells and a largemax_repeatscan therefore fail with no plan, even though a feasible allocation was already found. Fix: return the best feasible allocation found so far with the method label saying the search was truncated, and add a test with a 48+ cell suite near the caps. -
Nothing ties the plan to real runs or recovered runs.
schema.py:63.existing_baseline_repeatsis typed in by hand. A resumed or recovered run can leave a partial repeat, and the docs do not say that only complete repeats count. Over-counting makes the planner under-buy candidate repeats. Fix: add one docs sentence (count and SD use only complete repeats of the finished run), and optionally a cross-check helper that reads the counts from the run's saved aggregate file. -
Size. 2,600 added lines for an offline planner: a 670-line statistics module, a new agent skill, a 210-line tutorial and a 129-line reference page that overlap, plus the index edits. The simulation and the suite heuristic are the parts that carry the most review and maintenance cost. Suggestion: land the scalar planner, CLI and one doc page first, and move the suite heuristic and skill to a follow-up, or cut the tutorial down to a link.
Not verified: the NCSS and NIST formula references, and the full broad regression the PR describes. I ran the PR's two new test files (102 passed), plus my own numerical probes.
Signed-off-by: Martyna Patelka <[email protected]>
|
Thanks for the review and for independently checking the calculations. Responding to the five points in your review:
Validation for this report-only change: 51 CLI tests passed, and pre-commit passed. A fresh run of the checked-in benchmark example produced identical numerical JSON; only the Markdown explanation changed. |
AdamRajfer
left a comment
There was a problem hiding this comment.
🤖 Adam’s AI assistant
I reviewed this again for Adam. The SD-forecast note in the report helps, and with the docs now saying plainly there's no simultaneous guarantee, marginal power per comparison is fine. Joint power and a sensitivity table can come in a follow-up. Failing visibly on the search caps is OK for now; worth revisiting if a real suite hits them. Approving.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44122496555 |
Use
gym eval plan-repeats --plan planning.yamlto plan benchmark, model, or suite repeat budgets before running evaluation benchmarks with Gym. Keep existing baseline counts fixed or optimize baseline investment across distinct candidate checkpoints, defaulting to one candidate. Inputs support legal repeat increments and common-unit per-pass costs.Each model × benchmark entry supplies one normalized complete-pass score SD; an omitted candidate SD defaults to its baseline SD forecast, and entries have equal aggregate weight. The walkthrough shows normalization and averaging within each repeat before estimating SD, including a three-repeat SD-0.9 example, baseline reuse, and the matching final comparison decision.
The prospective noncentral-t calculation shares Gym's Welch uncertainty implementation. The power function documents the exact equations and links to NCSS, NIST, and SciPy references; the scalar search uses descriptive names and goal comments for each algorithm section. Scalar allocation finds an exact bounded integer minimum by evaluating noncentral-t power directly. Scalar count bounds and repeat steps stay as numbers; the same power calculation also evaluates batches for suite allocation. Suite allocation reports a feasible local solution without a global minimum claim. Optional simulation evaluates Gym's actual Welch decision and reports power and boundary false-success rates without changing counts. It redraws both arms in hypothetical normal experiments, including existing-baseline mode; it is not conditioned on the collected baseline observations.
No separate issue: this is a focused feature addition with its input contract and examples documented here. Existing comparison commands and report formats are unchanged.
Validation
.venv/bin/python -m pytest tests/unit_tests/eval/ tests/unit_tests/test_public_api_facades.py tests/unit_tests/cli/test_cli_main.py tests/unit_tests/cli/test_cli_eval.py tests/unit_tests/test_fern_docs_links.py -q --no-cov --tb=short.1.11e-15; 107 shared-baseline plans / 214 matching optimized arm counts; four exhaustive scalar checks passed. Audit tools and evidence are retained locally, outside the PR.cd fern && npm run check: zero errors; the authenticated missing-redirect check is unavailable locally.pre-commit run --all-files, including Ruff and package layering: passed.opus[1m](resolvedclaude-opus-5-5) and literal--effort max: completed. Addressed count-array dtype, scalar clamp compatibility, and the final naming findings. The review confirmed the formula citations and all six scalar-search section comments. Added regressions for exactly representable large baseline counts/caps and overflow in both scalar and suite paths.Formula parity replays the reference's frozen counts and weights; it does not require joint optimization to reproduce its equal-arm allocations. Product suites weight entries equally; some reference aggregates weight models equally. The audit also preserves a small-count case with approximately 84% analytic power and 62% actual Welch power, so formula agreement is not presented as an achieved-power guarantee.
Rollout evidence: N/A for new model execution. This adds an offline statistical command and changes no agent, environment, scorer, or existing benchmark results. Saved real rollout artifacts were used for end-to-end validation; no inference or GPU jobs were launched. The implementation is independent, with no external executable code imported or vendored.