Files
benchmarks/dev/build.sh
T
claudeandClaude Opus 5.5 5bb750cece
ci / check (push) Successful in 58s
0.5.0: model hash check, energy per phase, honest bandwidth %, CI
- The served model is hashed (cached) and checked against dev/models.tsv;
  the model_file note says standard or not, with warnings for a foreign
  file or a --quant that doesn't match. HASH_MODEL=0 skips it.
- The BetterBench build (git commit or describe) goes into meta and, when
  it isn't the release, into the run note.
- Energy per phase from a timestamped timeline.tsv: J/token for decode and
  each concurrency level, J/1k tokens for prefill.
- Bandwidth %: vLLM's loaded weight size when available, MTP files left out
  of the stored size, bandwidth scaled by tp.
- The notes and post-run Python moved to dev/notes.py and dev/postrun.py,
  with pytest tests; CI runs shellcheck, build --check and the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 14:00:00 +01:00

49 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
# build.sh - pack dev/ into the one bench.sh at the repo root, which is all
# people download. It unpacks the helpers to a temp dir and runs dev's
# bench.sh from there, with results and bench.local.env next to itself.
#
# usage: dev/build.sh (then commit the root bench.sh with dev/)
# dev/build.sh --check (exit 1 if the root bench.sh is out of date)
set -eu
dev=$(cd "$(dirname "$0")" && pwd)
out="$dev/../bench.sh"
files="bench.sh collect-env.sh gpu-power.sh mem-bw.py model_hash.py notes.py postrun.py models.tsv config.json standard.env"
eof=__BENCH_STANDARD_EOF__
. "$dev/standard.env"
for f in $files; do
if grep -q "$eof" "$dev/$f"; then echo "build.sh: $f contains $eof" >&2; exit 1; fi
done
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
{
cat <<EOF
#!/bin/sh
# bench.sh - bench-standard $STANDARD_VERSION, everything in one file: run ./bench.sh --help
# Generated by dev/build.sh from dev/ - edit there and rebuild, not here.
set -eu
BENCH_HOME=\${BENCH_HOME:-\$(cd "\$(dirname "\$0")" && pwd)}; export BENCH_HOME
d=\$(mktemp -d)
trap 'rm -rf "\$d"' EXIT
trap 'rm -rf "\$d"; exit 130' INT
trap 'rm -rf "\$d"; exit 143' TERM
EOF
for f in $files; do
printf "cat > \"\$d/%s\" <<'%s'\n" "$f" "$eof"
cat "$dev/$f"
printf '%s\n' "$eof"
done
printf 'sh "$d/bench.sh" "$@"\n'
} > "$tmp"
if [ "${1:-}" = --check ]; then
cmp -s "$tmp" "$out" || { echo "build.sh: bench.sh is out of date, run dev/build.sh" >&2; exit 1; }
echo "bench.sh is up to date"
else
cp "$tmp" "$out" && chmod +x "$out"
echo "built $(cd "$dev/.." && pwd)/bench.sh ($(wc -c < "$out") bytes)"
fi