okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

jase100kCommunity benchmark: RX 7900 GRE (gfx1100, 16 GB), three Flash-Next quants (#740)7b52a0b62

main
2.4 KiB75 linesraw
1#!/usr/bin/env bash
2# One arm of the community quants report: 3 fresh bench runs of one quant, then one
3# 32k needle pass. The engine restarts before every run, because bench_prefill.py
4# refuses a fresh prompt that reused cached tokens. Only the quant differs between
5# the cfg-*.json files; every other setting is identical.
6#
7#   ./run-one-quant.sh coder-iq1_m | iq2_xs | iq3_xxs
8#
9# ROOT is this machine's Strata checkout; change it, and the absolute paths inside
10# ../data/cfg-*.json, before running this elsewhere.
11set -u
12ROOT=/home/jason/Projects/Strata
13HERE=$(cd "$(dirname "$0")" && pwd)
14Q=$1
15OUT=${OUT:-$HERE/out}
16CFG=$HERE/../data/cfg-$Q.json
17LOG=$OUT/$Q.engine.log
18PY=$ROOT/.venv/bin/python
19. "$HOME/.local/opt/strata-env.sh"
20
21MODEL=$("$PY" -c 'import json,sys; print(json.load(open(sys.argv[1]))["model_name"])' "$CFG")
22
23stop_server() {
24  pkill -f "[s]erve/server.py" 2>/dev/null
25  pkill -f "[e]ngine/strata --serve" 2>/dev/null
26  sleep 5
27}
28
29wait_loaded() {
30  local i=0
31  while [ $i -lt 900 ]; do
32    curl -s http://127.0.0.1:8080/health | grep -q '"loaded": true' && return 0
33    i=$((i + 2))
34    sleep 2
35  done
36  return 1
37}
38
39mkdir -p "$OUT"
40[ -f "$CFG" ] || { echo "no config $CFG"; exit 1; }
41rm -f "$OUT/$Q-stop"
42: > "$LOG"
43
44for run in 1 2 3; do
45  stop_server
46  : > "$OUT/$Q-server-run$run.out"
47  nohup "$PY" "$ROOT/serve/server.py" --engine strata --config "$CFG" --port 8080 \
48    > "$OUT/$Q-server-run$run.out" 2>&1 &
49  if ! wait_loaded; then
50    echo "$Q run $run: server never reported loaded"
51    tail -20 "$OUT/$Q-server-run$run.out"
52    exit 1
53  fi
54  echo "$Q run $run: loaded, benching"
55  "$PY" "$HERE/sample_mem.py" --out "$OUT/$Q-mem-run$run.csv" --seconds 600 --stop-file "$OUT/$Q-stop" &
56  sampler=$!
57  "$PY" "$ROOT/tools/hip/bench_prefill.py" --model "$MODEL" \
58    --url http://127.0.0.1:8080 --engine-log "$LOG" --label "$Q-run$run" \
59    --output "$OUT/$Q-run$run.json" | tail -1 > /dev/null || echo "$Q run $run: BENCH FAILED"
60  touch "$OUT/$Q-stop"
61  wait $sampler 2>/dev/null
62  rm -f "$OUT/$Q-stop"
63done
64
65echo "$Q: needle pass on the run-3 server"
66"$PY" "$HERE/sample_mem.py" --out "$OUT/$Q-mem-needle.csv" --seconds 900 --stop-file "$OUT/$Q-stop" &
67sampler=$!
68"$PY" "$ROOT/tools/needle_bench.py" --url http://127.0.0.1:8080 \
69  --lengths 32k --depths 10,50,90 --out "$OUT/$Q-needles.json" || echo "$Q: NEEDLE FAILED"
70touch "$OUT/$Q-stop"
71wait $sampler 2>/dev/null
72rm -f "$OUT/$Q-stop"
73
74stop_server
75echo "$Q: done"