mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3494] [CLOSED] [Benchmark] Paired stats for bench comparisons: the test says, and a size note next to it #4654
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4654
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3494
Author: @victorgabr
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:feature/paired-ab-stats📝 Commits (2)
b070ebf[Benchmark] Paired statistics for bench comparisons: strata_bench --compare and ab_engine --stats test matched run pairs (Wilcoxon signed-rank on the speed ratios, Holm-corrected) through scipy and statsmodels, opt-in via requirements-bench.txt - the tables print as before without the packages. The test is the ground result: every compare table opens with that line and shows 'the test says (Wilcoxon, Holm)' next to 'size vs the floor' (defaults --floor-prefill 2% / --floor-decode 5%), so being over the floor can never read as a statistical claim and being under it never cancels a real one. A run warns before starting when --runs cannot reach significance (the prompt pairs' p floor is 2**(1-n)), the README and docs write the same, and a footer answers was-this-many-runs-enough. Also fixes the redactor ordering when the user name sits inside the Strata folder path, and the no-scipy fallback crashing on the None verdict tuple. The port NameError on the start-server path is NOT here - it is PR #3320. New: tools/paired_stats.py, tools/test_paired_stats.py, requirements-bench.txt; 24 tests pass (4 skip without the packages)1cedc75Merge remote-tracking branch 'upstream/main' into feature/paired-ab-stats📊 Changes
7 files changed (+400 additions, -14 deletions)
View changed files
📝
docs/COMMUNITY_BENCHMARKS.md(+18 -0)➕
requirements-bench.txt(+24 -0)📝
tools/ab_engine.py(+47 -2)➕
tools/paired_stats.py(+125 -0)📝
tools/strata_bench.py(+115 -12)➕
tools/test_paired_stats.py(+42 -0)📝
tools/test_strata_bench.py(+29 -0)📄 Description
Problem and result
--compareandab_engineprinted a median delta only. Three runs carry 1-2% noise easily, so a 1% delta read as an improvement. That is how phantom improvements and regressions reach reports.Now both tools match runs slot by slot (same question, same prompt size) and test the speed ratios: Wilcoxon signed-rank, Holm-corrected across the metrics. The compare table gets two columns, kept apart on purpose:
the test says (Wilcoxon, Holm)- the ground result. It says yes or no whatever the size, and nothing else in the table can overturn it.size vs the floor- magnitude only:faster/slower, over/under the floor(default 2% prefill / 5% decode, set with--floor-prefill/--floor-decode). Over the floor is never a statistical claim; under it never cancels a real one.A run also says up front when its
--runscannot reach significance (with three runs the prompt pairs' p cannot drop below 0.25), the report README writes the same, and a footer answers "was this many runs enough".Also fixed here: the redactor order broke when the user name sits inside the Strata folder path; the no-scipy fallback crashed on the None verdict tuple. The
portNameError is NOT here - that is #3320.Why this approach
tools/paired_stats.pywraps scipy and statsmodels; nothing is re-implemented in-tree. Optional viarequirements-bench.txt(the core install stays light). Without the packages every table prints as before, with a line naming the install. The measurement run stays standard library only.Validation
Passed (Linux, Python 3.10.9 venv, scipy 1.15.3, statsmodels 0.15.0):
python tools/test_strata_bench.py: 20/20.python tools/test_paired_stats.py: 4/4; and 4 clean skips on system Python without the packages (degraded path proven).--vram-reserve-mib 700vs1600(A100 SXM4 80 GB, Qwen3.8-Flash-Next IQ3_S,--runs 3, medians). Raw deltas up to -3.6% - none survives the test, so the reserve change is not shown to have moved speed, and a false regression claim from the -3.6% is exactly what the test stops:With 3 runs the prompt pairs' p cannot drop below 0.25; the run itself says
--runs 8 or morecan decide. All four size cells readsize unknown (test not passed).Failed: none.
Not run: Windows. No CUDA/HIP/SYCL file touched.
Limits
Commit:
16d3ae05(one commit).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.