Files
benchmarks/dev/build.sh
T
claudeandClaude Opus 5.5 a677cdcb2a
ci / check (push) Successful in 1m30s
0.6.0: GPU clocks and max context
Record the max core and memory clocks, sample the memory clock during
the run, and add a max_ctx note: vLLM's KV cache size from its log, or
for llama.cpp an estimate from free VRAM and the GGUF's KV bytes per
token (dev/gguf_kv.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 18:23:50 +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 gguf_kv.py 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