Run the analysis¶
The analysis scripts turn runs' events.jsonl files into a workbook, CSV
tables and PNG charts. Run them on your workstation once the runs' files
have come back (Run a benchmark).
1. Run the analysis¶
uv run --extra analysis snap-benchmark-analysis <run directories> --out-dir <analysis folder>
--extra analysisadds pandas, openpyxl and matplotlib, which the client hosts don't install.- The inputs are run directories (
<work-dir>/runs/<run-id>-<target>, each holding anevents.jsonl),events.jsonlfiles, or a runs folder, which means every run in it. - Give each analysis its own folder, holding only the runs you're comparing,
for example
scratch/analysis/<run-id>/with the run ID of a plan run (without the-<target>suffix). Without--out-dir, the output goes to<runs folder>/analysis, which collects every run it's ever given. -
To analyse every target of a plan run, let the shell expand a pattern. It works the same in bash and zsh; leave the
*unquoted:uv run --extra analysis snap-benchmark-analysis scratch/runs/${RUN_ID}-* --out-dir scratch/analysis/${RUN_ID}If nothing matches, zsh stops before the analysis starts, and in bash the analysis stops with
input not found. - To add runs, run it again with the same--out-dirand the new run directories. It skips a run it already holds (byrun_id), adds the rest, and rebuilds every output from all the runs it holds. - To rebuild the outputs without adding runs, for example after changing a price, give only the folder:uv run --extra analysis snap-benchmark-analysis --out-dir <analysis folder>
| Option | Default | Use |
|---|---|---|
--out-dir |
<runs folder>/analysis |
The analysis folder |
-o, --output |
<out-dir>/snap_benchmark_report.xlsx |
The workbook's path |
--pkl-dir, --csv-dir |
<out-dir>/pkl, <out-dir>/csv |
Where the stored runs and the CSV tables go |
--charts-dir |
charts/ next to the workbook |
Where the charts go |
--pricing |
src/snap_benchmark_analysis/reference_pricing.csv |
The reference prices for the cost columns |
--skip-csv, --skip-kpi-csv, --skip-pkl-csv |
Off | Skip all CSV tables, only the calculated ones, or only the *_pkl.csv copies of the source data |
--skip-excel, --skip-charts |
Off | Skip the workbook or the charts |
What it writes, file by file, is in Outputs.
2. Fill in prices¶
The cost columns divide a reference hourly price by the measured throughput.
The prices are in src/snap_benchmark_analysis/reference_pricing.csv, one
row per instance type, with its region, the target name the runs use, the
price basis, its source and the date it was looked up.
If the analysis prints No reference price for target(s) …, add a row with
the instance type, region and target, then fill it in:
uv run --extra analysis snap-benchmark-pricing
It fills only blank prices, so a price you entered by hand stays: the
On-Demand Linux price from the AWS Price List API, or, for a type sold only
as Capacity Blocks (trn2.3xlarge), the current 24-hour Capacity Block
offering in its region. It needs AWS credentials that allow
pricing:GetProducts and ec2:DescribeCapacityBlockOfferings. Then rebuild
the outputs as in step 1.
3. Read the results¶
- Start with
csv/benchmark_metrics.csv, one row per hardware configuration and test setup. Checkreliableandreliability_notesfirst: a group marked unreliable says why. - Above concurrency 1, read the steady-state columns (
steady_*), not the whole-level ones, whose ramp-up and tail one slow response can stretch. Which columns to read first, and what each means, is in Metrics and rules. - For a concurrency sweep,
charts/concurrency.pngplots each level's steady-state throughput and p95 latency, andcsv/load_summary.csvhas a row per level. A target saturates at the lowest level whose steady throughput is within a few percent of its peak; past it, latency grows and throughput doesn't. Read it from throughput, not from accelerator use (NeuronCore use levels off before throughput does), and leave out any client-bound level, which measured the client. - For accuracy, score the runs with
snap-asr-bench-score(Validate accuracy): the analysis doesn't compute word error rate.
Then check the runs themselves as in
Validate the results. To turn an
analysis into a short written report, use /snap-bench report
(Run benchmarks with Claude Code).