Skip to content

Analysis scripts

A pandas pipeline, snap-benchmark-analysis, that turns runs' events.jsonl files into KPI tables, a workbook and charts. It keeps the runs it has read, so each new run is added to what came before and every output is rebuilt from the full set.

Page What it covers
Run the analysis Running it, filling in prices, and reading the results
Outputs Every CSV file, the workbook and the charts: what each holds and what to use it for
Metrics and rules How each metric is worked out, the reliability flags, and the known gaps

It runs on your workstation, not on the hosts. It needs pandas, openpyxl and matplotlib, which are the project's analysis extra, so the client hosts don't install them. Its source is src/snap_benchmark_analysis/, and README_ASR_v2_4.txt there defines every column.

Modules

Module Role
run_asr_benchmark_analysis.py Command-line entry point
asr_log_parser.py Finds events.jsonl files, removes duplicate runs, reads events into raw tables, and reads and writes the stored runs. No KPI maths.
asr_analysis.py Every calculation: request metrics, run, load and hardware summaries, network adjustment, server-metric deltas and latency, accelerator use and energy, reliability flags, and the CSV export
asr_report_generator.py The Excel workbook
charts.py The PNG charts
reference_pricing.py snap-benchmark-pricing, which fills in reference_pricing.csv
asr_common.py Shared helpers, the request columns, and the ParseResult container

Pipeline

  1. Discover. Only .jsonl inputs are read: files, run directories, or a runs folder (each <run-id>/events.jsonl in it).
  2. De-duplicate. Each file's run_id (from run_start) is checked against the runs already stored and the rest of the batch. Duplicates are skipped, and a file without a run_id is rejected.
  3. Parse new runs into raw observation tables and add them to the store (<analysis folder>/pkl). The tables are requests, runs, resources, streams, server_metrics (cumulative samples only), network_baseline, diagnostics and raw_event_counts. They hold no derived metrics. Each log is read as a stream, keeping only what the analysis uses.
  4. Reload every stored run.
  5. Analyse everything from the reloaded data.
  6. Write the CSV files (up to 16), the workbook and the charts, regenerated from scratch each time (Outputs).

What the parser handles:

  • Telemetry: nvidia-smi CSV and neuron-monitor JSON are parsed into resource samples, which are matched to streams by mono_ns window.
  • Journal: only lines at error priority or worse (and journalctl errors) are kept, as diagnostics.
  • Completeness: each run records whether seq has gaps or duplicates and whether run_end was seen.
  • Plan runs: the runs table has one row per run and target, because target_start, the warm-up events and target_end are written per target. Each request takes the clip metadata of its own input_id, so a manifest run's requests describe their own clip. Sweep settings are read from options.jobs.
  • What the server ran: the log sidecar's /health at each target's start gives vLLM's command line, API server and engine counts, which go in the runs table.
  • Warm-up: warm-up rows stay in the stored data, tagged run_phase, and are left out of every calculated table.

Tests

Its tests are in tests/analysis/, with the event fixtures and the check against the JSONL events spec in tests/analysis/analysis_events.py. Run them from the repository root:

uv run --extra analysis pytest -q tests/analysis