Name run folders and exported results after the run
ci / check (push) Successful in 10s

<YYMMDD>_<submitter>_<model>_<engine>_<N>x-<gpu>[_quick][_2], with N the
GPUs the model runs on (tp x pp). The results .json/.html carry the same
name as the folder, so a file sent on its own still says what it is.
Another run of the same setup on the same day gets _2, _3, ...

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-10-29 15:15:51 +01:00
1 parent 5bb750cece
commit d6cf8777be
5 files changed
+77 -40

No files matched your search

+15 -5
View File
@@ -142,7 +142,7 @@ file next to `bench.sh`.
bandwidth reached, average power and clock, and energy: J per token for decode and bandwidth reached, average power and clock, and energy: J per token for decode and
each concurrency level, J per 1000 tokens for prefill. each concurrency level, J per 1000 tokens for prefill.
Everything is recorded as notes in `results.json`, so it shows in the report and in Everything is recorded as notes in the results `.json`, so it shows in the report and in
`compare`. Example notes: `compare`. Example notes:
``` ```
@@ -160,12 +160,22 @@ run full · concurrency on · bench-standard 0.5.0 · betterbench 0.6.1
## Your result ## Your result
Each run makes a folder `results/<date>-<you>-<model>-<engine>-<gpu>/`: Each run makes a folder `results/<run>/`, and the report and results inside it carry the
same name, so they still say what they are when sent on their own:
```text
<YYMMDD>_<you>_<model>_<engine>_<N>x-<gpu>[_quick][_2]
261029_pascal_qwen3.5-9b_llama.cpp_1x-intel-arc-pro-b65
```
`N` is the number of GPUs the model runs on (`--tp` × `--pp`). Fields are separated by
`_`, words within a field by `-`. Quick runs end in `_quick`. Another run of the same
setup on the same day gets `_2`, `_3`, ...
| file | what | | file | what |
|---|---| |---|---|
| `results.html` | the report; open it in a browser | | `<run>.html` | the report; open it in a browser |
| `results.json` | the results, with all notes | | `<run>.json` | the results, with all notes |
| `meta.json` | every raw value, plus energy and % of bandwidth | | `meta.json` | every raw value, plus energy and % of bandwidth |
| `server-cmd.txt` | your server's launch command, secrets redacted | | `server-cmd.txt` | your server's launch command, secrets redacted |
| `config.json`, `power.csv`, `timeline.tsv`, `betterbench.log` | the config used, power samples, when each phase ran, the full output | | `config.json`, `power.csv`, `timeline.tsv`, `betterbench.log` | the config used, power samples, when each phase ran, the full output |
@@ -176,7 +186,7 @@ first. Tokens, keys and passwords are redacted automatically.
Compare two runs: Compare two runs:
```sh ```sh
betterbench compare A/results.json B/results.json betterbench compare A/A.json B/B.json
``` ```
Every recorded difference shows up as a mismatch chip, so you can see exactly what Every recorded difference shows up as a mismatch chip, so you can see exactly what
+28 -16
View File
@@ -277,21 +277,32 @@ fi
python3 "$here/notes.py" "$tmp/mandatory" "$tmp/collected" "$tmp/measured" "$tmp/cmd.red" \ python3 "$here/notes.py" "$tmp/mandatory" "$tmp/collected" "$tmp/measured" "$tmp/cmd.red" \
"$tmp/launch.json" "$here/models.tsv" > "$tmp/notes" "$tmp/launch.json" "$here/models.tsv" > "$tmp/notes"
engine=$(get engine) gpu=$(get gpu_model) count=$(get gpu_count) ctx=$(get ctx) engine=$(get engine) gpu=$(get gpu_model) ctx=$(get ctx)
[ "$engine" != unknown ] || echo "bench.sh: warning: engine not detected; result is hard to compare" >&2 [ "$engine" != unknown ] || echo "bench.sh: warning: engine not detected; result is hard to compare" >&2
if [ "$power_src" = declared ] && [ "$power_limit" != stock ] && matches "$pl" '[0-9.]+' && if [ "$power_src" = declared ] && [ "$power_limit" != stock ] && matches "$pl" '[0-9.]+' &&
[ "$(awk -v a="$pl" -v b="$power_limit" 'BEGIN{print (a-b>1||b-a>1)}')" = 1 ]; then [ "$(awk -v a="$pl" -v b="$power_limit" 'BEGIN{print (a-b>1||b-a>1)}')" = 1 ]; then
echo "bench.sh: warning: --power-limit $power_limit W but the GPU reports $pl W" >&2 echo "bench.sh: warning: --power-limit $power_limit W but the GPU reports $pl W" >&2
fi fi
matches "$count" '[2-9]|[1-9][0-9]+' && gpu="${count}x-$gpu" # File names: <YYMMDD>_<submitter>_<model>_<engine>_<N>x-<gpu>[_quick][_2],
# with N the GPUs the model runs on (tp x pp); _2, _3, ... for another run of
# the same setup on the same day. Fields are joined with _ since
# model names have dashes. The run folder and the exported results.json/.html
# are named alike, so a file sent on its own still says what it is.
slug() { tr 'A-Z' 'a-z' | sed -e 's/[^a-z0-9.]\{1,\}/-/g' -e 's/^-//' -e 's/-$//'; } slug() { tr 'A-Z' 'a-z' | sed -e 's/[^a-z0-9.]\{1,\}/-/g' -e 's/^-//' -e 's/-$//'; }
name=$(printf '%s-%s-%s' "$model" "$engine" "$gpu" | slug) gpu=$(printf '%s' "$gpu" | slug)
name="$(printf '%s' "$model" | slug)_$(printf '%s' "$engine" | slug)_$((tp * pp))x-${gpu:-unknown}"
run_dir="$results_dir/$(date +%Y%m%d-%H%M%S)-$(printf '%s' "$submitter" | slug)-$name" run_id="$(date +%y%m%d)_$(printf '%s' "$submitter" | slug)_$name"
[ $quick = 1 ] && run_id="${run_id}_quick"
base=$run_id i=1
while [ -e "$results_dir/$run_id" ] || [ -e "$results_dir/$run_id.failed" ]; do
i=$((i + 1)); run_id="${base}_$i"
done
run_dir="$results_dir/$run_id"
results="$run_dir/$run_id.json"
# ---------------------------------------------------------------- run # ---------------------------------------------------------------- run
set -- run --no-update-check --endpoint "$endpoint" --model "$model" \ set -- run --no-update-check --endpoint "$endpoint" --model "$model" \
--config "$run_dir/config.json" --name "$name" --out "$run_dir/results.json" --config "$run_dir/config.json" --name "$name" --out "$results"
[ $quick = 1 ] && set -- "$@" --quick [ $quick = 1 ] && set -- "$@" --quick
[ $no_conc = 1 ] && set -- "$@" --no-concurrency [ $no_conc = 1 ] && set -- "$@" --no-concurrency
# Through a proxy /v1/models often lacks the context size; hand over what the # Through a proxy /v1/models often lacks the context size; hand over what the
@@ -374,14 +385,14 @@ fi
# Energy (whole run and per phase) and decode as % of memory bandwidth, from # Energy (whole run and per phase) and decode as % of memory bandwidth, from
# what the run measured. They come after the run, so they go to meta.json # what the run measured. They come after the run, so they go to meta.json
# ("post_run"), not into the notes of results.json. # ("post_run"), not into the notes of the results file.
T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" || T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" "$results" ||
echo "bench.sh: warning: post-run figures failed" >&2 echo "bench.sh: warning: post-run figures failed" >&2
# BetterBench with GGZ14/BetterBench#4 fingerprints PCIe and BAR itself # BetterBench with GGZ14/BetterBench#4 fingerprints PCIe and BAR itself
# (env.gpu.pci), on the machine BetterBench runs on. Say so when that is not # (env.gpu.pci), on the machine BetterBench runs on. Say so when that is not
# the benchmarked GPU, or when it disagrees with collect-env.sh. # the benchmarked GPU, or when it disagrees with collect-env.sh.
ENV_FILE=$env_file python3 - "$run_dir/results.json" "$tmp/collected" <<'PY' || true ENV_FILE=$env_file python3 - "$results" "$tmp/collected" <<'PY' || true
import json, os, sys import json, os, sys
pci = ((json.load(open(sys.argv[1], encoding="utf-8")).get("env") or {}).get("gpu") or {}).get("pci") pci = ((json.load(open(sys.argv[1], encoding="utf-8")).get("env") or {}).get("gpu") or {}).get("pci")
if not pci: if not pci:
@@ -1154,10 +1165,11 @@ __BENCH_STANDARD_EOF__
cat > "$d/postrun.py" <<'__BENCH_STANDARD_EOF__' cat > "$d/postrun.py" <<'__BENCH_STANDARD_EOF__'
"""postrun.py - figures that need the finished run, and the summary. """postrun.py - figures that need the finished run, and the summary.
usage: T0=epoch T1=epoch postrun.py RUN_DIR usage: T0=epoch T1=epoch postrun.py RUN_DIR [RESULTS_JSON]
Reads results.json, meta.json, power.csv (epoch_s,watts,joules,mhz) and Reads RESULTS_JSON (default RUN_DIR/results.json), and meta.json, power.csv
timeline.tsv (epoch<TAB>BetterBench progress line) from RUN_DIR. Writes (epoch_s,watts,joules,mhz) and timeline.tsv (epoch<TAB>BetterBench progress
line) from RUN_DIR. Writes
energy (whole run and per phase) and the bandwidth figure to meta.json under energy (whole run and per phase) and the bandwidth figure to meta.json under
"post_run", and prints the summary to stderr. "post_run", and prints the summary to stderr.
""" """
@@ -1232,7 +1244,7 @@ def segments(timeline, t_end):
def phase_energy(res, rows, timeline, t_end): def phase_energy(res, rows, timeline, t_end):
"""Joules and joules per token for decode, prefill and each concurrency """Joules and joules per token for decode, prefill and each concurrency
level. Warm-up passes draw power but aren't in results.json, so their level. Warm-up passes draw power but aren't in the results, so their
tokens are estimated from the measured passes of the same piece.""" tokens are estimated from the measured passes of the same piece."""
ts, cum, _ = energy_curve(rows) ts, cum, _ = energy_curve(rows)
single = res.get("single_stream") or {} single = res.get("single_stream") or {}
@@ -1300,8 +1312,8 @@ def roofline(single, c, m):
"pct_of_mem_bw": round(100 * eff / (bw * tp), 1)} "pct_of_mem_bw": round(100 * eff / (bw * tp), 1)}
def main(d): def main(d, results=None):
res = json.load(open(f"{d}/results.json", encoding="utf-8")) res = json.load(open(results or f"{d}/results.json", encoding="utf-8"))
meta = json.load(open(f"{d}/meta.json", encoding="utf-8")) meta = json.load(open(f"{d}/meta.json", encoding="utf-8"))
c, m = meta["collected"], meta["mandatory"] c, m = meta["collected"], meta["mandatory"]
t0, t1 = float(os.environ["T0"]), float(os.environ["T1"]) t0, t1 = float(os.environ["T0"]), float(os.environ["T1"])
@@ -1396,7 +1408,7 @@ def main(d):
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1]) main(*sys.argv[1:3])
__BENCH_STANDARD_EOF__ __BENCH_STANDARD_EOF__
cat > "$d/models.tsv" <<'__BENCH_STANDARD_EOF__' cat > "$d/models.tsv" <<'__BENCH_STANDARD_EOF__'
# name engine quant sha256 (a GGUF file, or a safetensors directory: README, Models) # name engine quant sha256 (a GGUF file, or a safetensors directory: README, Models)
+6 -3
View File
@@ -14,10 +14,13 @@ What `bench.sh` records, how, and how it's built. For running it, see
## Files in a run folder ## Files in a run folder
`<run>` is the folder's name, `<YYMMDD>_<submitter>_<model>_<engine>_<N>x-<gpu>[_quick][_2]`
with `N` = tp × pp; see the README.
| file | what | | file | what |
|---|---| |---|---|
| `results.json` | BetterBench results; the notes below are under `env.notes` | | `<run>.json` | BetterBench results; the notes below are under `env.notes` |
| `results.html` | the standalone report | | `<run>.html` | the standalone report |
| `config.json` | the BetterBench config the run used | | `config.json` | the BetterBench config the run used |
| `meta.json` | every raw value: `mandatory` (declared), `collected` (detected), `measured`, `launch`, `post_run` | | `meta.json` | every raw value: `mandatory` (declared), `collected` (detected), `measured`, `launch`, `post_run` |
| `server-cmd.txt` | the server launch command, secrets redacted | | `server-cmd.txt` | the server launch command, secrets redacted |
@@ -117,7 +120,7 @@ fixed before BetterBench starts.
`timeline.tsv`, and a piece of work lasts until the next line. That gives joules and `timeline.tsv`, and a piece of work lasts until the next line. That gives joules and
average W for decode (J per output token), prefill (J per 1000 prompt tokens) and each average W for decode (J per output token), prefill (J per 1000 prompt tokens) and each
concurrency level (J per token). The warm-up passes draw power but aren't in concurrency level (J per token). The warm-up passes draw power but aren't in
`results.json`, so their tokens are estimated from the measured passes of the same the results, so their tokens are estimated from the measured passes of the same
piece (`tokens_incl_warmup_est`). These compare across quick and full runs; the piece (`tokens_incl_warmup_est`). These compare across quick and full runs; the
whole-run figure doesn't. whole-run figure doesn't.
- **roofline:** median batch-1 decode t/s × weight bytes ÷ memory bandwidth = % of - **roofline:** median batch-1 decode t/s × weight bytes ÷ memory bandwidth = % of
+20 -9
View File
@@ -267,21 +267,32 @@ fi
python3 "$here/notes.py" "$tmp/mandatory" "$tmp/collected" "$tmp/measured" "$tmp/cmd.red" \ python3 "$here/notes.py" "$tmp/mandatory" "$tmp/collected" "$tmp/measured" "$tmp/cmd.red" \
"$tmp/launch.json" "$here/models.tsv" > "$tmp/notes" "$tmp/launch.json" "$here/models.tsv" > "$tmp/notes"
engine=$(get engine) gpu=$(get gpu_model) count=$(get gpu_count) ctx=$(get ctx) engine=$(get engine) gpu=$(get gpu_model) ctx=$(get ctx)
[ "$engine" != unknown ] || echo "bench.sh: warning: engine not detected; result is hard to compare" >&2 [ "$engine" != unknown ] || echo "bench.sh: warning: engine not detected; result is hard to compare" >&2
if [ "$power_src" = declared ] && [ "$power_limit" != stock ] && matches "$pl" '[0-9.]+' && if [ "$power_src" = declared ] && [ "$power_limit" != stock ] && matches "$pl" '[0-9.]+' &&
[ "$(awk -v a="$pl" -v b="$power_limit" 'BEGIN{print (a-b>1||b-a>1)}')" = 1 ]; then [ "$(awk -v a="$pl" -v b="$power_limit" 'BEGIN{print (a-b>1||b-a>1)}')" = 1 ]; then
echo "bench.sh: warning: --power-limit $power_limit W but the GPU reports $pl W" >&2 echo "bench.sh: warning: --power-limit $power_limit W but the GPU reports $pl W" >&2
fi fi
matches "$count" '[2-9]|[1-9][0-9]+' && gpu="${count}x-$gpu" # File names: <YYMMDD>_<submitter>_<model>_<engine>_<N>x-<gpu>[_quick][_2],
# with N the GPUs the model runs on (tp x pp); _2, _3, ... for another run of
# the same setup on the same day. Fields are joined with _ since
# model names have dashes. The run folder and the exported results.json/.html
# are named alike, so a file sent on its own still says what it is.
slug() { tr 'A-Z' 'a-z' | sed -e 's/[^a-z0-9.]\{1,\}/-/g' -e 's/^-//' -e 's/-$//'; } slug() { tr 'A-Z' 'a-z' | sed -e 's/[^a-z0-9.]\{1,\}/-/g' -e 's/^-//' -e 's/-$//'; }
name=$(printf '%s-%s-%s' "$model" "$engine" "$gpu" | slug) gpu=$(printf '%s' "$gpu" | slug)
name="$(printf '%s' "$model" | slug)_$(printf '%s' "$engine" | slug)_$((tp * pp))x-${gpu:-unknown}"
run_dir="$results_dir/$(date +%Y%m%d-%H%M%S)-$(printf '%s' "$submitter" | slug)-$name" run_id="$(date +%y%m%d)_$(printf '%s' "$submitter" | slug)_$name"
[ $quick = 1 ] && run_id="${run_id}_quick"
base=$run_id i=1
while [ -e "$results_dir/$run_id" ] || [ -e "$results_dir/$run_id.failed" ]; do
i=$((i + 1)); run_id="${base}_$i"
done
run_dir="$results_dir/$run_id"
results="$run_dir/$run_id.json"
# ---------------------------------------------------------------- run # ---------------------------------------------------------------- run
set -- run --no-update-check --endpoint "$endpoint" --model "$model" \ set -- run --no-update-check --endpoint "$endpoint" --model "$model" \
--config "$run_dir/config.json" --name "$name" --out "$run_dir/results.json" --config "$run_dir/config.json" --name "$name" --out "$results"
[ $quick = 1 ] && set -- "$@" --quick [ $quick = 1 ] && set -- "$@" --quick
[ $no_conc = 1 ] && set -- "$@" --no-concurrency [ $no_conc = 1 ] && set -- "$@" --no-concurrency
# Through a proxy /v1/models often lacks the context size; hand over what the # Through a proxy /v1/models often lacks the context size; hand over what the
@@ -364,14 +375,14 @@ fi
# Energy (whole run and per phase) and decode as % of memory bandwidth, from # Energy (whole run and per phase) and decode as % of memory bandwidth, from
# what the run measured. They come after the run, so they go to meta.json # what the run measured. They come after the run, so they go to meta.json
# ("post_run"), not into the notes of results.json. # ("post_run"), not into the notes of the results file.
T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" || T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" "$results" ||
echo "bench.sh: warning: post-run figures failed" >&2 echo "bench.sh: warning: post-run figures failed" >&2
# BetterBench with GGZ14/BetterBench#4 fingerprints PCIe and BAR itself # BetterBench with GGZ14/BetterBench#4 fingerprints PCIe and BAR itself
# (env.gpu.pci), on the machine BetterBench runs on. Say so when that is not # (env.gpu.pci), on the machine BetterBench runs on. Say so when that is not
# the benchmarked GPU, or when it disagrees with collect-env.sh. # the benchmarked GPU, or when it disagrees with collect-env.sh.
ENV_FILE=$env_file python3 - "$run_dir/results.json" "$tmp/collected" <<'PY' || true ENV_FILE=$env_file python3 - "$results" "$tmp/collected" <<'PY' || true
import json, os, sys import json, os, sys
pci = ((json.load(open(sys.argv[1], encoding="utf-8")).get("env") or {}).get("gpu") or {}).get("pci") pci = ((json.load(open(sys.argv[1], encoding="utf-8")).get("env") or {}).get("gpu") or {}).get("pci")
if not pci: if not pci:
+8 -7
View File
@@ -1,9 +1,10 @@
"""postrun.py - figures that need the finished run, and the summary. """postrun.py - figures that need the finished run, and the summary.
usage: T0=epoch T1=epoch postrun.py RUN_DIR usage: T0=epoch T1=epoch postrun.py RUN_DIR [RESULTS_JSON]
Reads results.json, meta.json, power.csv (epoch_s,watts,joules,mhz) and Reads RESULTS_JSON (default RUN_DIR/results.json), and meta.json, power.csv
timeline.tsv (epoch<TAB>BetterBench progress line) from RUN_DIR. Writes (epoch_s,watts,joules,mhz) and timeline.tsv (epoch<TAB>BetterBench progress
line) from RUN_DIR. Writes
energy (whole run and per phase) and the bandwidth figure to meta.json under energy (whole run and per phase) and the bandwidth figure to meta.json under
"post_run", and prints the summary to stderr. "post_run", and prints the summary to stderr.
""" """
@@ -78,7 +79,7 @@ def segments(timeline, t_end):
def phase_energy(res, rows, timeline, t_end): def phase_energy(res, rows, timeline, t_end):
"""Joules and joules per token for decode, prefill and each concurrency """Joules and joules per token for decode, prefill and each concurrency
level. Warm-up passes draw power but aren't in results.json, so their level. Warm-up passes draw power but aren't in the results, so their
tokens are estimated from the measured passes of the same piece.""" tokens are estimated from the measured passes of the same piece."""
ts, cum, _ = energy_curve(rows) ts, cum, _ = energy_curve(rows)
single = res.get("single_stream") or {} single = res.get("single_stream") or {}
@@ -146,8 +147,8 @@ def roofline(single, c, m):
"pct_of_mem_bw": round(100 * eff / (bw * tp), 1)} "pct_of_mem_bw": round(100 * eff / (bw * tp), 1)}
def main(d): def main(d, results=None):
res = json.load(open(f"{d}/results.json", encoding="utf-8")) res = json.load(open(results or f"{d}/results.json", encoding="utf-8"))
meta = json.load(open(f"{d}/meta.json", encoding="utf-8")) meta = json.load(open(f"{d}/meta.json", encoding="utf-8"))
c, m = meta["collected"], meta["mandatory"] c, m = meta["collected"], meta["mandatory"]
t0, t1 = float(os.environ["T0"]), float(os.environ["T1"]) t0, t1 = float(os.environ["T0"]), float(os.environ["T1"])
@@ -242,4 +243,4 @@ def main(d):
if __name__ == "__main__": if __name__ == "__main__":
main(sys.argv[1]) main(*sys.argv[1:3])