mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#5191
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/4806
Author: @XiaoBinGan
Created: 10/31/2026
Status: 🔄 Open
Base:
main← Head:feat/bench-compare-standard📝 Commits (1)
673dd39Feature (#4325): compare two standard-v1 benchmark reports📊 Changes
3 files changed (+179 additions, -0 deletions)
View changed files
📝
strata_cli/bench_standard.py(+90 -0)📝
strata_cli/cli.py(+21 -0)📝
tests/terminal/test_bench_standard.py(+68 -0)📄 Description
Problem and result
docs/COMMUNITY_BENCHMARKS.mdtells a contributor to compare two saved runs, and a standard-v1 run — the defaultstrata bench run— could not be compared:strata bench compareansweredunsupported benchmark report, andtools/strata_bench.py --comparedied withKeyError: 'results'(reported in #4325, with the two readable-error halvesin #4326 and #4329).
After this change
strata bench compare BASELINE CANDIDATEreads two standard reports and prints one table with thebaseline and candidate medians per case and figure, the change in percent, and whatever a reader should not carry over.
--output markdownrenders the same comparison as a real Markdown table,--out FILEwrites that table to a new filethe way
strata bench report --output markdown --outalready does, and--output jsonreturns the same numbers(
{"schema_version": 1, "ok": true, "comparison": {...}}).This is the actual output on the two real
standard-v1runs from #4313 (RTX 5090, Q2_0, same machine: 2026-10-21 withthe card shared, 2026-10-24 exclusive), read from the saved
results.jsonfiles:and the same comparison with
--output markdown:The changes agree with what #4313 reported by hand: decode +55.1% at 4K, +62.0% at 16K, TTFT -51.3% / -40.1%. No warning
line is printed for the pair: same protocol, same model, same card, same engine.
Related discussion
#4325 — the bug report, and the scope proposal for this feature posted there on 2026-10-31 (per CONTRIBUTING, a feature
agrees scope first). The two readable-error halves are open as #4326 and #4329. The PR was opened as a draft while that
question was unanswered; it is now marked ready for review. If the shape is wrong I will change or drop it.
Approach
One function plus two renderers in
strata_cli/bench_standard.py:strata bench reportalready prints:prompt_tps,decode_tps,ttft_s,total_spercase, read from
summaries.working; it is named in a warning line instead, so a benchmark claim cannot be made by accident. Only a mixed pair
(one standard report, one serving-suite report) is an error. A missing or unreadable path still gets the reader's
error from
bench.load, not the mixed-pair error.nullfor an empty summary — isNone->n/a, never 0._bench()instrata_cli/cli.pyasksbench_standard.load_if_standard()for both paths before the serving-suitereader, the same way the
reportcommand beside it already does; two serving-suite reports go throughbench.compareuntouched.strata bench runchanges, and no default changes; the feature is only the newreader and the
comparebranch.Validation
Passed: the comparison unit cases:
python -m pytest tests/terminal/test_bench_standard.py -q -k StandardComparison-> 4 passed, 69 deselected — abefore/after pair computes the medians and the +50.0% change; a different suite/model/card/engine is named in the
warnings; a figure missing on one side is
None/n/a, not 0; the Markdown output has the table header, separator line,row and warning bullet.
Passed: the CLI branch in human, Markdown, Markdown-file and JSON forms:
python -m pytest tests/terminal/test_bench_standard.py -q -k compare_reads_two_standard_results-> 1 passed, 72deselected — two mock standard runs are compared through
strata_cli.cli.main, with--outwriting the Markdownfile.
Passed: the whole file on this Windows checkout, second run:
python -m pytest tests/terminal/test_bench_standard.py -q-> 73 passed in 46.70s.Failed: none of the five new tests. The first whole-file run on the same checkout had one failure,
RunTests::test_a_request_that_never_finishes_times_out(1 failed, 72 passed): a timing-sensitive mock-server case.The same test also failed on this machine with the three files reset to upstream
main(1 failed, 67 passed), andanother
mainrun had two failures, that one andRunTests::test_a_round_total_is_null_when_a_counted_request_has_no_token_count(2 failed, 66 passed), so those are pre-existing environment/timing failures, not this change.
Passed: end-to-end on the two real
standard-v1folders from #4313 (RTX 5090, Q2_0, same machine), reading only thesaved reports; the output is quoted under Problem and result.
--output markdownand--output jsonreturned the same12 rows, and
--outwrote a 21-line Markdown file. Since this checkout's Python environment has norequests/numpy/PIL,python strata.py bench comparerefuses to start (its dependency check), so the CLI entry point was calleddirectly:
python -c "from strata_cli.cli import main; raise SystemExit(main(['bench','compare', BASELINE, CANDIDATE]))".Not run:
strata.py bench compareitself (the launcher's dependency check above); no GPU run was made, the figurescome from the saved reports. CUDA, HIP, SYCL and Metal builds do not apply to a Python-only change.
Limits
there is a different question — whether two runs are comparable at all — and #4325's guards cover the parts that
matter for a claim).
run.statusis not read: a partial or nonconforming run compares like any other, so a claim still needs two completeruns. Both example runs are
nonconformingbecause the model file could not be hashed; the same-machine before/afterthis table shows is still the one #4313 measured.
optional_concurrency) are not in the table; a report with them compares only its performancefigures.
strata bench report.shortcase's prompt rate is in the table even thoughstrata bench reportexplains that it is dominated by thefixed cost of one request; read prompt speed from the 4K and 16K rows.
tools/strata_bench.py --compare, is not changed here; #4326 turns itstraceback into a sentence.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.