Set ubatch sweep context and batch to 16K

This commit is contained in:
Frank
2026-08-25 17:32:12 -07:00
parent babc823f11
commit 4cb67d7b33
3 changed files with 23 additions and 8 deletions
+18 -6
View File
@@ -3,7 +3,7 @@
# frank-default-large ROCmFPX standalone-MTP stack (dankclaw, gfx1151).
#
# Boots one llama-server instance per ubatch on a scratch port with a fixed
# -b and -c 8192, runs a standardized ~75%-of-ctx prose workload, and reads
# -b and -c 16384, runs a standardized ~75%-of-ctx prose workload, and reads
# authoritative prefill/generation tok/s from the server's own print_timing
# lines. Steps from UBATCH_MIN to UBATCH_MAX inclusive by UBATCH_STEP.
#
@@ -30,8 +30,8 @@ fi
: "${UBATCH_MAX:=6144}"
: "${UBATCH_STEP:=256}"
: "${UBATCH_VALUES:=256 512 768 1024 1280 1536 2048 3072 4096 5120 6144}"
: "${CTX:=8192}" # 8k contexts
: "${BENCH_BATCH:=$CTX}" # fixed batch = ctx, so the full 8k prompt fits
: "${CTX:=16384}" # 16k contexts
: "${BENCH_BATCH:=16384}" # batch is fixed to the 16k context size
: "${OUT_TOKENS:=256}"
: "${RUNS:=3}" # decode runs per ubatch
: "${PORT_BASE:=7894}" # scratch ports 7894..
@@ -118,7 +118,7 @@ run_one() {
local log="/tmp/ubatch-${ubatch}-p${port}.log"
: > "$log"
echo "=== ubatch=${ubatch} ctx=${CTX} port=${port} runs=${runs} ==="
echo "=== ubatch=${ubatch} ctx=${CTX} batch=${BENCH_BATCH} port=${port} runs=${runs} ==="
"$LLAMA_BIN" \
--model "$MODEL" \
"${MMPROJ_ARGS[@]}" \
@@ -142,13 +142,19 @@ run_one() {
-lv 4 >>"$log" 2>&1 &
local pid=$!
SCRATCH_PID="$pid"
wait_health "$pid" "$port" || { tail -30 "$log"; return 2; }
if ! wait_health "$pid" "$port"; then
tail -30 "$log"
kill "$pid" 2>/dev/null || true
wait "$pid" 2>/dev/null || true
SCRATCH_PID=""
return 2
fi
# one python pass per run; reuse the same boot across runs
local r
for r in $(seq 1 "$runs"); do
echo "--- run ${r}/${runs} ---"
python3 - "$ubatch" "$port" "$out_tokens" "$CTX" "$log" "$r" <<'PY'
if ! python3 - "$ubatch" "$port" "$out_tokens" "$CTX" "$log" "$r" <<'PY'
import sys, time, json, urllib.request
ubatch, port, out_tokens, ctx, log, run_number = sys.argv[1], sys.argv[2], int(sys.argv[3]), int(sys.argv[4]), sys.argv[5], sys.argv[6]
@@ -214,6 +220,12 @@ print(f"== RESULT ubatch={ubatch} run={run_number} "
f"PREFILL={grab(prefill)} GEN_TPS={g_tps} "
f"pt={pt} ct={ct} wall={dt:.1f}s")
PY
then
kill "$pid" 2>/dev/null || true
wait "$pid" 2>/dev/null || true
SCRATCH_PID=""
return 2
fi
done
kill "$pid" 2>/dev/null || true
wait "$pid" 2>/dev/null || true