interplane.Get Omega
Read in your language

gpu-head-to-head

aien-dev/gpu-head-to-head

Brought by drakestapleton

branch main Branches Tags History

gpu-head-to-head / q35-9b / tools / correctness-node-20261029.sh

61 lines · 2937 bytes Raw Blame History
1#!/usr/bin/env bash
2set -euo pipefail
3ROOT=/home/drakestapleton/handoffs/stack-comparison-20261029/correctness-full-1
4REPO=/home/drakestapleton/workspace/stack-comparison-20261029
5LLAMA=/home/drakestapleton/h2h/dl/llama-bin/llama-b11913
6CUDART=/home/drakestapleton/h2h/dl/llama-bin/cudart-llama-b11913-bin-ubuntu-cuda-13.4-arm64
7mkdir "$ROOT"
8server_pid=
9stop_server() {
10 if [ -n "$server_pid" ]; then
11 kill -TERM "$server_pid" 2>/dev/null || true
12 wait "$server_pid" 2>/dev/null || true
13 server_pid=
14 fi
15}
16cleanup() {
17 stop_server
18 printf 'CodexStackCompare: full correctness driver ended; all own servers stopped; resident18091 unchanged.\n' >> /home/drakestapleton/handoffs/BOARD.md
19}
20trap cleanup EXIT
21export H2H_SRV_CPUS=5-9,15-19 H2H_CLI_CPUS=0-1
22for arm in OURS16 LLAMA16 LLAMA8; do
23 printf '%s %s start\n' "$(date -u +%FT%TZ)" "$arm" >> "$ROOT/status.log"
24 port=18290
25 if [ "$arm" = OURS16 ]; then
26 model=q35-9b-ours-bf16
27 (
28 cd /home/drakestapleton/work/Ours9B/bin16
29 exec env AIEN_GB10_LOCK_HELD=1 taskset -c "$H2H_SRV_CPUS" ./aien-serve-http \
30 --engine omega --model-dir /home/drakestapleton/models/qwen3.5-9b-c2022362 \
31 --model-id "$model" --max-context 32768 --max-tokens-cap 16384 \
32 --thinking off --bind 127.0.0.1 --port "$port"
33 ) > "$ROOT/$arm-server.log" 2>&1 &
34 else
35 if [ "$arm" = LLAMA16 ]; then format=bf16;port=18293;else format=q8_0;port=18292;fi
36 model=q35-9b-$format
37 LD_LIBRARY_PATH="$CUDART:$LLAMA" taskset -c "$H2H_SRV_CPUS" "$LLAMA/llama-server" \
38 -m "/home/drakestapleton/h2h/gguf/q35-9b-$format.gguf" --host 127.0.0.1 \
39 --port "$port" -ngl 999 -fa on -c 32768 -np 1 --jinja \
40 > "$ROOT/$arm-server.log" 2>&1 &
41 fi
42 server_pid=$!
43 ready=0
44 for attempt in $(seq 1 120); do
45 if curl --fail --silent --max-time 2 "http://127.0.0.1:$port/v1/models" > "$ROOT/$arm-models.json"; then ready=1;break;fi
46 kill -0 "$server_pid" 2>/dev/null || { echo "$arm server exited";exit 1; }
47 sleep 1
48 done
49 [ "$ready" -eq 1 ] || { echo "$arm startup timeout";exit 1; }
50 ss -ltnH "sport = :$port" > "$ROOT/$arm-listen.txt"
51 awk '$6 ~ /\.so/ {print $6}' /proc/"$server_pid"/maps | sort -u > "$ROOT/$arm-maps-so.txt"
52 nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv > "$ROOT/$arm-gpu.csv"
53 taskset -c "$H2H_CLI_CPUS" node "$REPO/bench/bench-node.mjs" \
54 --port "$port" --model "$model" --arm "$arm" --round CORRECTNESS \
55 --metric agree --prompts "$REPO/prompts/decode.jsonl" --concurrency 1 \
56 --max-tokens 128 --warmup 0 --reps 16 --out "$ROOT/$arm.jsonl" \
57 --cell-run correctness-only
58 stop_server
59 printf '%s %s complete\n' "$(date -u +%FT%TZ)" "$arm" >> "$ROOT/status.log"
60done
61printf 'COMPLETE\n' >> "$ROOT/status.log"