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

+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
`<run>` is the folder's name, `<YYMMDD>_<submitter>_<model>_<engine>_<N>x-<gpu>[_quick][_2]`
with `N` = tp × pp; see the README.
| file | what |
|---|---|
| `results.json` | BetterBench results; the notes below are under `env.notes` |
| `results.html` | the standalone report |
| `<run>.json` | BetterBench results; the notes below are under `env.notes` |
| `<run>.html` | the standalone report |
| `config.json` | the BetterBench config the run used |
| `meta.json` | every raw value: `mandatory` (declared), `collected` (detected), `measured`, `launch`, `post_run` |
| `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
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
`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
whole-run figure doesn't.
- **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" \
"$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
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
echo "bench.sh: warning: --power-limit $power_limit W but the GPU reports $pl W" >&2
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/-$//'; }
name=$(printf '%s-%s-%s' "$model" "$engine" "$gpu" | slug)
run_dir="$results_dir/$(date +%Y%m%d-%H%M%S)-$(printf '%s' "$submitter" | slug)-$name"
gpu=$(printf '%s' "$gpu" | slug)
name="$(printf '%s' "$model" | slug)_$(printf '%s' "$engine" | slug)_$((tp * pp))x-${gpu:-unknown}"
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
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
[ $no_conc = 1 ] && set -- "$@" --no-concurrency
# 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
# what the run measured. They come after the run, so they go to meta.json
# ("post_run"), not into the notes of results.json.
T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" ||
# ("post_run"), not into the notes of the results file.
T0=$t_start T1=$t_end python3 "$here/postrun.py" "$run_dir" "$results" ||
echo "bench.sh: warning: post-run figures failed" >&2
# 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
# 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
pci = ((json.load(open(sys.argv[1], encoding="utf-8")).get("env") or {}).get("gpu") or {}).get("pci")
if not pci:
+8 -7
View File
@@ -1,9 +1,10 @@
"""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
timeline.tsv (epoch<TAB>BetterBench progress line) from RUN_DIR. Writes
Reads RESULTS_JSON (default RUN_DIR/results.json), and meta.json, power.csv
(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
"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):
"""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."""
ts, cum, _ = energy_curve(rows)
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)}
def main(d):
res = json.load(open(f"{d}/results.json", encoding="utf-8"))
def main(d, results=None):
res = json.load(open(results or f"{d}/results.json", encoding="utf-8"))
meta = json.load(open(f"{d}/meta.json", encoding="utf-8"))
c, m = meta["collected"], meta["mandatory"]
t0, t1 = float(os.environ["T0"]), float(os.environ["T1"])
@@ -242,4 +243,4 @@ def main(d):
if __name__ == "__main__":
main(sys.argv[1])
main(*sys.argv[1:3])