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 / PROTOCOL.md

466 lines · 35798 bytes Raw Blame History Rendered
1# PROTOCOL: same-machine head-to-head, Qwen3.6-35B-A3B on one DGX Spark (bar P0)
2
3Predeclared before any timed run. This file is committed and pushed before the first arm starts; any
4later change to it is a separate, dated commit listed in section 10, and results say which protocol
5commit they were taken under.
6
7## 1. Question
8
9On one DGX Spark (GB10, sm_121, driver 580.173.02, 121 GiB unified LPDDR5x), serving the same model
10to the same prompts over the same HTTP API, how do three stacks compare **end to end**?
11
12- **OURS**: `aien-serve-http`, binary `bin-19173f9e`, run from its directory with the live cmdline.
13- **VLLM**: vLLM `0.29.0+5013de39.dev` from NVIDIA's NGC container `nvcr.io/nvidia/vllm:26.09-py3`,
14 digest `sha256:557747337846eecf34486866f3d992383c6f8af869fdb0e365b5093fcaee02c2` (torch
15 2.14.0a0 nv26.09, CUDA 13.4), pulled with `docker pull`; no system install.
16- **LLAMA**: llama.cpp `b11913` (commit `7aca0d2ea8d92b56911233b822db01f9fbb1ae50`), the
17 ggml-org CI release asset `llama-b11913-bin-ubuntu-cuda-13.4-arm64.tar.gz` (sha256 `55ee2ae4…18f4`)
18 run with its companion `cudart-llama-b11913-bin-ubuntu-cuda-13.4-arm64.tar.gz` (sha256
19 `f6a5a023…599a`) first on `LD_LIBRARY_PATH`. The release carries sm_121a machine code.
20
21Every number in this repo is end to end: an HTTP client on the same host, timestamps taken in the
22client. **No chip-only number (kernel time, GPU timer, per-launch microbenchmarks) appears in the
23results table.** Numbers from other repos are not mixed in.
24
25## 2. Model and weights
26
27- Checkpoint: `Qwen/Qwen3.6-35B-A3B-FP8` revision `95a723d08a9490559dae23d0cff1d9466213d989`,
28 local `~/models/qwen3.6-35b-a3b-fp8-95a723d0`, sha256 list `qwen3.6-35b-a3b-fp8-95a723d0.sha256`
29 (56 files verified 2026-10-20). FP8 e4m3, block-wise scales, dynamic activation scales.
30- OURS and VLLM load this folder directly (read-only).
31- LLAMA cannot load safetensors. A GGUF is converted from **the same folder** with
32 `convert_hf_to_gguf.py` at the same llama.cpp commit, `--outtype q8_0`.
33 **Quantization difference, labeled on every LLAMA row:** Q8_0 (int8, one fp16 scale per 32
34 weights, FP8 weights dequantized first and re-quantized) is not the FP8 e4m3 block-128 format the
35 other two arms run. Agreement numbers against LLAMA therefore mix engine and quantization effects.
36 If the converter refuses the FP8 checkpoint, LLAMA is NOT_RUN with the converter error quoted; no
37 GGUF from other weights (e.g. a third-party GGUF) is substituted.
38- Text only. Vision tower and MTP heads are not used by any arm (no speculative decoding anywhere).
39
40## 3. API and request shape (identical for all arms)
41
42`POST /v1/chat/completions`, one user message, `stream: true`,
43`stream_options.include_usage: true`, `temperature: 0`, `top_p: 1`, `seed: 0`,
44`chat_template_kwargs.enable_thinking: false` (OURS also runs `--thinking off`).
45The client is `bench/bench.py` (Python 3 stdlib, `http.client`, one thread per stream, a barrier
46releases concurrent streams together). One JSON row per request is written to `results/raw/`.
47
48Timestamps (client `time.monotonic()`): `t_send` before the request is written; `t_first` at the first
49SSE chunk carrying non-empty `content` or `reasoning_content`; `t_last` at the last such chunk.
50Token counts come from the server's `usage` (prompt_tokens, completion_tokens). If an arm reports no
51usage, the count is re-derived by tokenizing the returned text with the checkpoint's
52`tokenizer.json` and the row is labeled `count=retokenized`.
53
54## 4. Prompts (`prompts/`, generated by `bench/make_prompts.py`, committed before runs)
55
56- `decode.jsonl`: 16 distinct short instructions asking for long prose (≈30-60 prompt tokens).
57- `prefill.jsonl`: three documents of deterministic synthetic prose (seeded generator) plus one
58 closing question, calibrated with the checkpoint tokenizer so that the **chat-rendered** prompt is
59 ≈256, ≈2048, ≈8192 tokens. Actual `prompt_tokens` are reported per arm.
60- Agreement reuses `decode.jsonl` (all 16).
61
62## 5. Metrics
63
64| ID | Metric | Cell | Definition |
65|----|--------|------|------------|
66| M1 | TTFT | decode c=1 | `t_first - t_send`, short prompt |
67| M2 | decode tok/s, 1 stream | decode c=1, max_tokens 256 | `(completion_tokens - 1) / (t_last - t_first)` |
68| M3 | decode tok/s at 4/8/16 concurrent | decode c=4/8/16, max_tokens 256 | per batch: aggregate = `sum(completion_tokens) / (max(t_last) - min(t_send))`; also per-stream M2 |
69| M4 | prefill tok/s at 256/2k/8k | prefill, max_tokens 1, nonce prefix | `prompt_tokens / (t_first - t_send)` (end-to-end: includes HTTP, template, tokenizer, first sampled token) |
70| M5 | peak memory | whole arm session | `MemAvailable(baseline, before launch) - min(MemAvailable during session)` from `/proc/meminfo` at 1 Hz; plus peak summed `VmRSS` of the server process tree (host-side view; on GB10 device allocations are system memory) |
71| M6 | output agreement | agree c=1, 16 prompts, max_tokens 128 | per prompt, tokenize both outputs with `tokenizer.json`; matched = common-prefix length; rate = Σ matched / Σ max(len_a, len_b); also count of byte-identical outputs out of 16; pairs OURS–VLLM, OURS–LLAMA, VLLM–LLAMA; plus within-arm R1 vs R2 |
72
73A nonce line (`Request id <uuid>. Ignore this line.`) is prepended to every prefill prompt so that no
74arm's prefix cache can hit. Decode prompts carry no nonce (they are short; prefix caching of 40 tokens
75does not change decode rate; TTFT on a repeated short prompt is labeled as such in M1).
76
77Concurrency is what the arm is configured for as deployed: OURS runs the live `--batch-slots 8`. At
78c=16, OURS refuses requests beyond 8 with HTTP 503 `server_busy` ("retry shortly"); the client
79retries those every 50 ms with the clock running from the first send (amendment A1), and the retry
80count is stored per row. That is part of the end-to-end result and is stated beside it.
81
82## 6. Arm configuration
83
84- OURS: cwd `~/.local/state/aien-q36/bin-19173f9e`;
85 `./aien-serve-http --engine omega --model-dir ~/models/qwen3.6-35b-a3b-fp8-95a723d0 --port 18190
86 --max-context 49152 --max-tokens-cap 16384 --thinking off --batch-slots 8`;
87 env `AIEN_Q36_STROKE=1 Q36_BATCH_BIN=bin-19173f9e AIEN_SERVE_GPU_LOCK=/tmp/aien-serve-18190.lock
88 AIEN_GB10_LOCK_HELD=1` (the harness holds `/tmp/aien-gb10.lock` for the whole session).
89 Identical to the 2026-10-27T01:11:57Z live snapshot except port and lock path.
90- VLLM: `docker run --rm --runtime nvidia --gpus all --ipc host --network host --cpuset-cpus <SRV>
91 -v <model>:/model:ro <image@digest> vllm serve /model --served-model-name q36 --host 127.0.0.1 --port 18191
92 --max-model-len 49152 --max-num-seqs 32 (A3; was 16) --gpu-memory-utilization <U>
93 --language-model-only`. Everything else default (CUDA graphs, prefix
94 cache, chunked prefill as the image ships them). `<U>` is the smallest of 0.50/0.60/0.70 that starts;
95 the value used is recorded.
96- LLAMA: `llama-server -m q36-q8_0.gguf --host 127.0.0.1 --port 18192 -ngl 999 -fa on
97 -c 393216 -np 32 --jinja` (A3; was `-c 196608 -np 16`: 12288 tokens per slot either way). Everything else default.
98- Ports 18190-18193 only. Port 18091 is never touched.
99- CPU pinning (A2): cpus 5-9 and 15-19 are Cortex-X925 (`/proc/cpuinfo` CPU part 0xd85), cpus 0-4
100 and 10-14 are Cortex-A725 (0xd87). Every server arm gets the identical X925 set `5-9,15-17,19`
101 (core 18 excluded: the nvidia-modeset kthread sits there). OURS and llama-server via `taskset -c`,
102 VLLM via `--cpuset-cpus`. `bench.py` runs on A725 cores `12-13`. Both lists are stored in every row
103 (`server_cpus`, `client_cpus`). VLLM uses host networking so no docker-proxy sits in the path.
104- LLAMA16 (A2, optional BF16 reference arm): same llama-server and flags as LLAMA on port 18193,
105 with `q36-35b-a3b-bf16.gguf` (converted from the same checkpoint with `--outtype bf16`, i.e. the
106 FP8 weights dequantized to BF16) and `--no-mmap` (a 70 GB file mapped beside 70 GB of device
107 buffers would not fit in 121 GiB of unified memory).
108
109## 7. Schedule, repetitions, statistics
110
111- Two rounds, interleaved by arm: **R1 = OURS, VLLM, LLAMA; R2 = LLAMA, VLLM, OURS.** Then, only if
112 the night's quiet window still has room, LLAMA16 R1 and R2 (A2).
113- One model in memory at a time. Between arms: server stopped, process gone, `nvidia-smi
114 --query-compute-apps` empty, MemAvailable back to within 2 GiB of the pre-launch baseline.
115- Per arm session, cells in this order, each with **2 warmup batches then 3 measured batches**:
116 decode c=1, c=4, c=8, c=16; prefill 256, 2k, 8k. Then the agreement cell (16 prompts, once each,
117 no warmup). So each timing cell has 6 measured batches per arm across R1+R2.
118- Reported per cell: **median and IQR** over the measured values (6 batch values for aggregate
119 metrics; all per-stream values for per-stream metrics, count stated). Computed with Wolfram
120 Language `Median` and `InterquartileRange` (Wolfram's default quartile definition); the query and
121 result are kept in `results/wolfram/`. If the Wolfram MCP is not mounted, only exact counts and the
122 raw rows are published and the table says so.
123- No significance tests. A difference is called a win/loss only when the IQRs do not overlap;
124 otherwise "overlapping".
125
126## 8. Load and GPU-lock gates
127
128- (A2) A session starts only when, over a 60 s window, no process outside the harness used more than
129 20% of one CPU and `load1 < 6` (`bench/quiet.py`). Not gated, but recorded in every check: the
130 nvidia-modeset kthread and the `omp` agent-harness process that hosts this lane (it averages ~38%
131 of one core while other agents run; gating on it would never start). Before every cell the same
132 foreign-process check runs over 10 s with no load threshold (the arm's own server is excluded).
133 Every check is stored in `results/logs/<arm>-<round>/quiet.jsonl`; `vmstat -t 1` and `load1` (per
134 row) are recorded for every session. A cell that ran after the gate timed out (50 min into the
135 session) is labeled LOADED and excluded from the headline table.
136- (A2) The nvidia-modeset kthread (pid 1671, affinity 0-19, not pinned) has its `psr` (field 39 of
137 `/proc/1671/stat`) sampled every 1 s in `mem.tsv` (5th column) and logged at session start and
138 end. A cell during which any sample shows it on a server core is VOID: its id goes to
139 `results/voids.jsonl`, its rows stay in the raw file but are dropped by `extract.py`, and the cell
140 is re-run (at most 3 tries). The void count is reported.
141- GPU: each arm session runs inside `flock -w 900 /tmp/aien-gb10.lock`, at most 60 minutes, with
142 BOARD lines at START, T-5 (55 min) and END. The harness kills its own server at 60 min.
143 No module reloads, no reboots, `/dev/nvidia-modeset` is never opened by the harness.
144- An arm that cannot start (unsupported model, OOM, converter refusal) is recorded NOT_RUN with the
145 exact error and log; it is not retried with different weights.
146
147## 9. Publication
148
149Everything is published even if OURS loses: `results/RESULTS.md` (table), `results/raw/*.jsonl`
150(every request row incl. warmups), `results/logs/` (server stdout/stderr, memory samples, BOARD
151lines, versions), `bench/` (exact commands). Evidence label of every number: MEASURED, end to end,
152on this one Spark, on the stated date and load.
153
154## 10. Amendments
155
156- **A1 (2026-10-27, before any timed run, found with OURS `--engine stub` on port 18199, no GPU):**
157 OURS answers HTTP 503 `server_busy` when every generation slot is taken instead of queueing.
158 `bench.py` now retries 429/503 every 50 ms (bounded by the 1800 s request timeout), keeps `t_send`
159 at the first attempt, and records `busy_retries`. Section 5 updated. Server launches read
160 `/dev/null` as stdin (OURS exits silently when started in the background without it).
161- **A2 (2026-10-27, before any timed run, Main's decision):** `load1 < 4` is unreachable on this
162 host (the nvidia-modeset kthread holds one core permanently; other lanes' short bursts dominate
163 load1 while the CPU is ~68% idle). The gate is replaced by the 20%-CPU foreign-process check plus
164 `load1 < 6` (section 8), servers and client are pinned to fixed cores (section 6), VLLM uses host
165 networking, and vmstat is logged per session. Other lanes are in a declared quiet window (no local
166 builds or tests).
167 Additionally (Main, same day):
168 (a) The core sets of section 6: identical Cortex-X925 server set minus core 18 for every arm,
169 client on Cortex-A725, core lists in every row. The split is recorded in `results/env/cpu.txt`
170 from sysfs `cpu_capacity` (X925 997-1024, A725 718-731) and `/proc/cpuinfo` CPU part. Rule: P cores
171 are those with `cpu_capacity >= 990`; minus core 18 that is `5-9,15-17,19` (9 cores).
172 (b) The kthread `psr` sampling and void/re-run rule of section 8.
173 (c) Environment fact: nobody renices or pins the nvidia-modeset kthread during the study, so the
174 machine state is the same for every arm.
175 (d) Optional reference arm LLAMA16 (section 6). Cost: two more sessions of at most 60 min each,
176 during which the quiet window keeps blocking other lanes; they run last and are dropped (listed as
177 a follow-up, NOT_RUN) if the window closes first. If it runs, M6 also reports each arm's agreement
178 against LLAMA16, named as **llama.cpp b11913 with BF16 weights dequantized from the FP8
179 checkpoint**. It is a reference engine, not ground truth: no arm runs the model unquantized, and
180 the checkpoint itself is FP8. Pairwise agreement between OURS, VLLM and LLAMA is labeled as mixing
181 engine and quantization effects.
182- **A3 (2026-10-27, before any timed run; Main, after a second outside audit Drake adopted):**
183 (a) **More arms.** SGLANG: the official SGLang server, run like VLLM (container, host network,
184 same X925 core set, port 18194, `--context-length 49152 --max-running-requests 32
185 --mem-fraction-static 0.50`, raised 0.60/0.70 like VLLM if it does not start), only if an image
186 with an arm64 manifest that runs on sm_121 exists; the exact image digest is recorded in
187 `bench/arms.conf`. 4-bit arms, one per engine, each labeled **different numeric format from the
188 FP8 checkpoint OURS runs**: VLLM4 / SGLANG4 on a published NVFP4 checkpoint of the same model
189 (repo id and revision recorded), LLAMA4 on an MXFP4 (else Q4_K_M) GGUF produced with
190 `llama-quantize` b11913 from the BF16 GGUF of A2. An arm whose image or weights are not available
191 is NOT_RUN with the reason; nothing third-party is substituted silently.
192 (b) **Grid**, added to every session after the existing cells: N = 1, 8, 32 concurrent streams ×
193 prompts `p512` (502 chat tokens, added to `prefill.jsonl`; the other prompts are byte-identical)
194 and `p8k` (8184), 256 new tokens, nonce prefix per stream, 1 warmup + 3 measured runs. Reported:
195 TTFT; TPOT = `(t_last - t_first) / (completion_tokens - 1)` per stream, p50 and p99 over all
196 measured streams of a cell (Wolfram `Quantile`, count stated; the client records first/last token
197 times, not every token, so p99 is over streams, not tokens); aggregate tok/s as M3; peak memory as
198 M5. To serve N = 32, VLLM runs `--max-num-seqs 32` and llama-server `-np 32 -c 393216` (still
199 12288 tokens per slot); OURS stays at its deployed `--batch-slots 8` with the A1 retry.
200 (c) **Order and cost.** The 8-bit arm of every engine runs first, interleaved (R1 forward, R2
201 reversed); then LLAMA16 (A2), then the 4-bit arms, queued in `bench/schedule.txt`. Each session
202 is at most 60 min of GPU lock with the quiet window blocking other lanes: SGLANG +2 sessions;
203 VLLM4 +2; SGLANG4 +2; LLAMA4 +2, plus about 15 min of CPU quantization before them (no GPU).
204 The grid cells are last in each session, so a session that reaches 60 min loses grid cells first;
205 missing cells are listed as NOT_RUN (timeout). Arms that do not fit tonight's window stay queued
206 and are reported as follow-up, NOT_RUN.
207 (d) Published Spark figures for this model from other parties are quoted in the README as context
208 only, with their source and numeric format. The only claims are same-box results from this
209 protocol.
210 (e) GPU-lock priority (Main, 2026-10-27): after HeadToHead's FP8 sessions, OmegaVfio and the C1
211 lanes take the lock before any queued A2/A3 arm.
212- **A4 (2026-10-27, HeadToHead after restart; written before any OURS/LLAMA cell and before any
213 VLLM number was read):**
214 (a) **In-cell foreign-process check.** During every timed cell `bench/coremon.py` (pinned to
215 A725 core 11) samples the server cores every second; a process outside the session's trees with
216 more than 20% of one server core over the cell voids it, like the kthread rule of section 8.
217 Only a coremon summary that names offenders voids a cell. A monitor that wrote no summary makes
218 that cell's foreign check NOT_RUN (logged in `session.log`), not a void.
219 (b) **Harness defects found, with their effect.** OURS R1 attempt 1 (02:09:51Z) never started a
220 server: `run_arm.sh` ran `env VARS... exec taskset ...`, and `exec` is a shell builtin (`env:
221 'exec': No such file or directory`). No GPU work, no rows; log kept in
222 `results/logs/attempts/OURS-R1-a1-launch-bug/`. Fixed to `exec env VARS... taskset ...` and OURS
223 R1 re-runs after VLLM R1 (the only change in session order). The VLLM R1 session ran from a
224 snapshot in which `MON_CPU` was unset: `taskset -c python3 coremon.py` failed with exit 1, so
225 every VLLM R1 try was written to `voids.jsonl` with an empty foreign-process reason. Those
226 records are not voids under (a); `extract.py` honours a void record only when its reason names
227 the kthread or a non-empty offender list. The session was not killed (rule: a running session is
228 never disturbed); its foreign check is NOT_RUN for every cell, and that is stated in RESULTS.
229 (c) **One try per cell.** When re-runs leave several non-void tries of one cell, only the lowest
230 numbered non-void try is used; the others stay in the raw file.
231 (d) **Order and lock priority (A3(e)).** The FP8 sessions OURS, VLLM, LLAMA x R1, R2 run; LLAMA16
232 (A2) and the A3 arms are not started tonight. They are reported NOT_RUN (deferred: GPU-lock
233 priority for OmegaVfio W0 and C1 per A3(e)), with the BF16 GGUF kept for a later window.
234 (e) **Server core set per session.** At 02:17Z, 6.5 min into VLLM R1, the nvidia-modeset kthread
235 moved from core 18 to server core 17 and stayed there, so the A2 rule voided every try of VLLM
236 R1's cells (`mem.tsv` column 5). From OURS R1 on, each session takes the 10 X925 cores minus the
237 one the kthread is on when the session takes the GPU lock (core 18 if it is on an A725 core):
238 always 9 X925 cores, the set logged in `session.log` and stored in every row. The kthread is
239 still never pinned or reniced (A2(c)); the A2 void rule is unchanged.
240 (f) **Session re-run.** A session in which any cell ended void after its 3 tries is re-run once
241 in full after the other FP8 sessions; the re-run replaces it, and the first stays under
242 `results/logs/attempts/` and `results/raw/attempts/`.
243- **A5 (2026-10-27 ~02:48Z, HeadToHead after the second restart; before any OURS/LLAMA cell):**
244 (a) **Accidental stop.** At about 02:45Z Main relayed a STOP-all order that was a misread of
245 Drake's instruction (Drake afterwards: "I didn't mean to stop everything. Just keep them
246 going."). The driver was killed and the `h2h-vllm` container stopped with `docker stop`
247 during VLLM R1's grid cell `p8k-n1` (last memory sample 02:45:55Z; the server log shows the
248 shutdown with 7 requests running). No other session was running; OURS R1 had not started.
249 (b) **Effect.** None on any result: VLLM R1 attempt 1 was already void in every cell under
250 A4(e) (kthread on server cores 17, then 16) and had been scheduled for a full re-run under A4(f).
251 Its raw file, logs and void records move to `results/raw/attempts/VLLM-R1-a1.jsonl`,
252 `results/raw/attempts/VLLM-R1-a1-voids.jsonl` and
253 `results/logs/attempts/VLLM-R1-a1-kthread-void-stopped/`; none of its numbers is reported.
254 (c) **Order.** `bench/schedule.txt` now reads OURS R1, LLAMA R1, LLAMA R2, VLLM R2, OURS R2,
255 VLLM R1 (the re-run last, per A4(f)). Apart from (d), nothing changes: same cells, server core
256 rule and void rules.
257 (d) **Quiet window and client cores.** Other lanes resumed after the stop; their builds run on
258 A725 cores 10-14 only (Main's rule), which held the client (12-13) and coremon (11). From OURS
259 R1 on, the client runs on A725 cores 0-1 and coremon on A725 core 2 (`run_arm.sh`), so builds
260 never share a core with the measurement side; every row still records its core lists. The A2
261 gate and the A4(a) in-cell foreign-process check on the server cores are unchanged.
262 (e) **GPU-lock wait.** Other lanes take `/tmp/aien-gb10.lock` between sessions. A session whose
263 `flock -w 900` times out never took the GPU and ran no cell; `run_all.sh` now moves its pre-lock
264 logs to `results/logs/attempts/<ARM>-<R>-lockwait-<time>/` and retries the same session, instead
265 of recording it NOT_RUN and skipping it. The first OURS R1 lock wait (02:51Z, Provenance holding
266 the lock) was stopped by hand before that change and is kept the same way.
267 (f) **Loopback guard (Main).** OURS now gets `--bind 127.0.0.1` explicitly (VLLM, SGLANG and
268 llama-server already had `--host 127.0.0.1`). After the server answers and before the first
269 cell, `run_arm.sh` writes `ss -ltnH 'sport = :<port>'` to `results/logs/<ARM>-<R>/listen.txt`;
270 any listener that is not 127.0.0.1 makes the session a FAIL: server stopped, no cell run.
271 Self-test of that check (stub `--bind 127.0.0.1` PASS; negative control, a 0.0.0.0 listener,
272 FAIL): `results/receipts/A5f-loopback-guard-selftest.log`.
273 (g) **OURS R1 attempt aborted by the harness operator.** To add (f), HeadToHead stopped the
274 driver at 02:57Z believing the session was still in its quiet gate; it had taken the lock at
275 02:56:04Z and was uploading weights (no request served, no cell run). The server was stopped by
276 hand and the lock released; logs are in `results/logs/attempts/OURS-R1-prelock-restart-*/`.
277 OURS R1 then runs from the start with (f): driver relaunched 02:57:09Z, quiet gate and lock
278 taken 03:02:09Z (`results/logs/OURS-R1/session.log`), server cores 5-9,15-18 (kthread on 19).
279 (h) **Campaign-end contract (Main).** From Main's GPU-freeze order until the campaign ends, no other lane takes
280 `/tmp/aien-gb10.lock`, gaps between sessions included. The campaign ends with exactly one BOARD
281 line `<UTC ts> HeadToHead: ... FINAL IDLE`, posted even if the campaign ends early or aborts;
282 queued chip jobs wait on that anchored line. If HeadToHead is about to stop mid-run it posts
283 `HeadToHead: ABORTED, not FINAL IDLE` instead.
284- **A7 (2026-10-29, cold-start study; numbered A7 because A6 is the llama.cpp methodology amendment
285 d3426b2 on branch `results/2026-10-27-a6`, not yet on main):** a separate study, predeclared in
286 [coldstart/PROTOCOL.md](coldstart/PROTOCOL.md) and committed before its GPU window opens, measures
287 process cold start to first verified result on GB10 for CUDApp's own ioctl path (arm CUDAPP) against
288 NVIDIA's run-time compile paths (arms PTXC and NVRTC), with its harness in `coldstart/` and its results
289 in `results/coldstart/`. It is a chip-level microbenchmark, so section 1 still holds: none of its
290 numbers enters the main results table `results/RESULTS.md`, and none of this protocol's end-to-end
291 numbers is mixed into it. No `HeadToHead: ... FINAL IDLE` line (A5(h)) is on the BOARD as of
292 2026-10-29 22:15Z; the study takes `/tmp/aien-gb10.lock` only inside its own spark-window, under
293 Drake's GPU authorization for this lane given on 2026-10-29.
294
295
296### A8 (2026-10-29, before resumed 35B timing): external measurement integrity
297
298Numbered A8 and A9 because A6 is the llama.cpp methodology amendment on branch
299`results/2026-10-27-a6` and A7 is the cold-start study above.
300
301Drake clarified that Aien architecture and structural implementation stay Python-free, while
302external testing equipment, independent references and calculations may use Python, with Wolfram
303preferred for calculations. These host measurement tools are external equipment; this amendment
304introduces no Python production dependency.
305
306The legacy 35B runner could return success after a failed client, a missing foreign-process
307monitor summary, an exhausted disturbed-cell retry, or a session timeout. Its Python client also
308returned zero after failed HTTP requests and accepted truncated streams. Synthetic regressions
309reproduced these paths before the fixes. New resumed runs use the following controls:
310
311- The client retains failed raw rows, requires content, a finish reason and the SSE DONE marker,
312 and returns nonzero if any request fails. Missing usage remains eligible for the original
313 separately labeled retokenization path; it is not invented by the client.
314- No quiet gate means NOT_RUN. A monitor must exit 0 or 1 and provide exactly one summary with a
315 positive elapsed-tick count; missing or invalid kthread samples also mean NOT_RUN. Named
316 interference keeps the existing VOID rule and three-attempt limit.
317- Every attempted cell records PASS, FAIL, NOT_RUN or VOID in `results/cell-status.jsonl`.
318 When that ledger exists, `bench/extract.py` admits only cell ids with exactly one PASS record.
319 Missing, duplicate or conflicting records exclude a cell. Historical runs without this ledger
320 retain the legacy extraction behavior and are not retrospectively qualified by this fix.
321- DONE requires all fourteen declared cells accepted and no TIMEOUT. An incomplete session returns
322 nonzero and retains its rows and logs. Existing session files are refused rather than overwritten.
323 `H2H_RESULTS` selects a fresh results directory while leaving the frozen instruments and prompts
324 at `H2H_REPO`; for extraction, supply a parent directory containing that `results/` directory.
325
326CPU-only controls: `python3 bench/test-run-arm.py`, `python3 bench/test-bench-python.py`, and
327`python3 bench/test-extract-admission.py`; shell syntax: `bash -n bench/run_arm.sh`.
328This fixes acceptance/reporting defects only. The runner's shared-model coordination, lifecycle,
329current source/weight verification and resumed 35B execution still require qualification before
330use. The active 9B campaign uses frozen instruments recorded in its own manifest and is unchanged.
331
332
333### A9 (2026-10-29, before resumed 35B timing): owned-process lifecycle
334
335The external runner now sources `bench/session-lifecycle.sh`. It tracks child process identities
336using Linux `/proc/<pid>/stat` starttime, rechecks identity before signaling, snapshots descendants,
337waits for children, and refuses untracked or stale live process identities. A pid whose `/proc`
338entry is already gone was reaped by the shell and is not waited for again: Bash 5.2 `wait` on it
339from the EXIT trap that interrupted the client wait (the watchdog's TERM) blocked forever. It no
340longer searches process command lines to decide which server to stop or count for memory. Native
341server identity is published to the sampler because a sampler started before launch cannot see
342later shell-variable updates; container memory sampling includes the owned container root and
343descendants.
344
345Each container has a unique session name and `aien.stack-comparison.run` ownership label. Creation
346completes before `docker start --attach`; missing images are refused with `--pull never`. Shutdown
347checks the label before stopping a container. The historical shared container names are unused.
348
349EXIT, INT and TERM enter one cleanup path for the client, monitor, server, watchdog and samplers.
350The client runs as a tracked child so the parent can interrupt its wait. The watchdog warns at
35155 minutes from GPU-lock acquisition and ends request execution at 59 minutes, reserving the last
352minute of the original 60-minute limit for cleanup. Cleanup gives process waits a shared 30-second
353budget, bounds container stop and GPU inventory commands, and removes DONE on failure. These are
354host-exercised controls; an actual model/session and unload-baseline qualification remain required.
355
356Before model launch, the GPU inventory must be empty. The runner itself never stops the shared
35718091 model; the authorized exclusive-window controller must check activity, stop it only when
358idle, and restore its exact configuration afterward. `H2H_GPU_LOCK_FD=9` permits that controller
359to lend the already-open GPU-lock descriptor. The runner checks its path and acquires it
360nonblockingly; cleanup preserves a borrowed lock so the controller can retain exclusivity through
361restoration. A standalone runner releases only its own lock.
362
363CPU-only controls: `python3 bench/test-run-arm-lifecycle.py`, plus the A8 controls. Tests cover
364foreign container refusal, labeled owned launch, create failure, normal/failing/interrupted exits,
365watchdog interruption, stale/untracked process refusal, descendant shutdown, termination-resistant
366children, sampler identity and parent-versus-child lock ownership. No GPU, real model or real
367container is used by these controls. The active frozen 9B campaign is unchanged. Source and runtime
368pins, the shared-service controller, unload/memory evidence and full 35B execution remain separate
369requirements before this runner is used for the larger-model comparison.
370
371### A10 (2026-10-31, before DRA-74 35B timing): comparator arms, TTFT rows, window sessions
372
373Arms. `bench/arms.conf` declares every comparator arm; `run_arm.sh` hashes it into
374`driver-sha256.txt`, so the record carries the exact hooks.
375
376- OURS: the prebuilt `aien-serve-http` of bin-19173f9e, sha256 `19173f9e…f22b3aeb`, checked before
377 launch (`--max-context 49152 --batch-slots 8 --thinking off`, port 18190). The variable
378 `AIEN_OMEGA_FP8_GROUPED_WAVE` is passed explicitly and recorded as 0. That binary has no reader for
379 it (`grep -c GROUPED_WAVE` = 0 on `aien-serve-http` and `libomega_gpu.a`). The 0 therefore records
380 the binary's behaviour; it is not a setting.
381- VLLM_FP8, VLLM_FP8_MTP (MTP, 3 speculative tokens), VLLM_FP8_MTP2 (MTP, 2): checkpoint
382 `qwen3.6-35b-a3b-fp8-95a723d0`, KV dtype auto, FLASH_ATTN, DeepGEMM MoE, prefix caching off.
383- VLLM_NVFP4, VLLM_NVFP4_MTP (MTP 3, draft MoE on Triton), VLLM_NVFP4_NSYS: checkpoint
384 `nvidia/Qwen3.6-35B-A3B-NVFP4@1355db6a`, quantization modelopt, KV fp8, FLASHINFER, Marlin MoE,
385 prefix caching off. VLLM_NVFP4 supersedes the legacy A3 VLLM4 arm.
386- All vLLM arms use image `nvcr.io/nvidia/vllm@sha256:55774733…02c2` (release 26.09, image id
387 `8ec4dbb7a3d1`, vLLM 0.29.0) with `--max-model-len 49152 --max-num-seqs 32
388 --gpu-memory-utilization 0.50 --language-model-only` before the per-arm hooks.
389- KV-dtype confound: the FP8 arms run KV auto (bf16) and the NVFP4 arms run KV fp8, as each checkpoint
390 declares. A FP8-vs-NVFP4 difference therefore includes the KV dtype and is reported as such, not
391 as a weight-format effect alone.
392
393Cell sets. `H2H_CELLS` is a comma list without duplicates, so one model load can serve several
394sets:
395
396- `full`: the 14 A3 cells.
397- `dra74`: 7 cells. Decode at c1/c4/c8/c16 with `max_tokens` 256, plus prefill p256/p2k/p8k with the
398 per-request nonce.
399- `nsys-c8`: one c8 decode cell. It runs alone, only on an `ARM_PROFILE=nsys` arm. nsys starts with
400 `--capture-range=cudaProfilerApi`, and the capture opens and closes through vLLM's
401 `/start_profile` and `/stop_profile`. `bench/nsys_classify.py` classifies its kernels.
402 `extract.py` excludes every `*_NSYS` row from timing results.
403- `ttft-fresh`: one cell per item of `H2H_TTFT_PROMPTS` (distinct, from t2k, t8k, t32k), named
404 `ttft-fresh-2k/8k/32k`. Each cell runs 1 warmup on t2k, then `H2H_TTFT_REPS` (1-9) measured reps
405 numbered from `H2H_TTFT_REP_BASE` (0-99). Reps can therefore be split across sessions without
406 reusing a nonce. Prefix caching must be off.
407- `ttft-turn2`: one cell. OURS has no prompt cache (L375 is not in bin-19173f9e), so its row is
408 `ttft-turn2-reread`. On a VLLM_* arm the row is `ttft-turn2-cached` and needs `H2H_PREFIX=on`.
409 `H2H_PREFIX=on` is accepted only for a VLLM_* arm whose `H2H_CELLS` is exactly `ttft-turn2`.
410
411TTFT rows. `prompts/ttft.jsonl` (sha256 `348c36ec…2f0e59`) is generated by
412`bench/make_ttft_prompts.py`. The generator pins its sources by sha256 and exits 2 on a mismatch.
413
414- Sources: judge checkout b129e1ea `long-2048.txt` (`26a44c50…`), `long-8192.txt` (`2bcc84b2…`) and
415 `long-256.txt` (`153a5f88…`); DRA-85 `long-32768.txt` (`791ef12b…`, which is long-8192 ×3 +
416 long-2048 ×3 + long-256 ×2, 32771 raw-text tokens as measured by DRA-85).
417- Prompts: t2k, t8k and t32k are the fresh prompts. Turn 2 is t32k, a fixed short assistant reply,
418 then `turn2-new` (long-256 ×4).
419- Nonce: every request starts with a nonce line, the first 16 hex digits of
420 `sha256("h2h-ttft|<id>|<w|r><rep>")`. It contains no arm and no clock. Request bodies are
421 therefore byte-identical across arms, while no two reps share a prefix. Each row records
422 `messages_sha256`.
423- Turn 2, per rep: a priming request (the turn-1 conversation, metric suffix `-prime`), then the
424 3-message conversation, whose first message is byte-identical to the primed prompt
425 (`prefix_sha256`). For vLLM the runner records the `/metrics` prefix-cache lines before and after
426 each turn-2 request, so a cache hit or miss is observed, not assumed.
427- Token counts come from `usage.prompt_tokens` under each server's own tokenizer. They are recorded,
428 not asserted.
429- M1 TTFT is `t_first - t_send` (section 6). TPOT is `(t_last - t_first)/(completion_tokens - 1)` from
430 the usage counts (the M2 rule). All derived values are computed from the `h2hRows` that
431 `extract.py` emits.
432
433Session control.
434
435- Core 17 is excluded from every role. This supersedes A4(e); the kthread-core fallback is 18.
436- In a chip slice the client runs on core 5 at nice 19 (`H2H_CLIENT_CPUS`, `H2H_CLIENT_NICE`,
437 checked by `cpu_guard`).
438- Inside an exclusive spark-window, `AIEN_GB10_LOCK_HELD=1` is accepted only when `SPARK_WINDOW`,
439 `SPARK_WINDOW_DIR`, `spark-window id` and `$SPARK_WINDOW_DIR/gb10 = exclusive` all agree.
440- `H2H_DEADLINE_EPOCH` must lie more than 600 s ahead. Request execution stops at
441 min(lock + 3540 s, deadline − 60 s).
442- Defect fix: the `mark_complete` call that writes DONE had been lost. Before the fix every session
443 ended INCOMPLETE. It is restored and covered by `bench/test-run-arm-dra74.py`.
444
445These numbers are HTTP-only (client-side `t_send`, `t_first`, `t_last`) and are never placed beside
446chip-only measurements.
447
448Named limit: DRAM GB/s. The DRA-74 acceptance item "DRAM GB/s per arm" is NOT_RUN-able on this
449host as configured.
450
451- nsys 2025.3.2 has no DRAM-throughput metric for this GPU: `GpuMetrics/gb20b.config` lists only
452 NVENC/OFA counters, and SocMetrics ships only `t234.config`.
453- The driver runs with `RmProfilingAdminOnly: 1` (`/proc/driver/nvidia/params`), which restricts
454 hardware counters to root.
455- Changing that parameter needs root and an nvidia module reload, which takes down the live servers.
456 It is Drake's decision. The runner does not change it and does not work around it.
457- The available substitute is MODELED: bytes read per decoded token, multiplied by measured tok/s.
458 It is labelled MODELED and reported in a separate table, never as a measured DRAM rate.
459
460Not yet verified on the chip: whether vLLM prefix caching hits on this hybrid DeltaNet model (the
461`/metrics` capture will show it), and whether OURS accepts a multi-turn chat that includes an
462assistant message.
463
464CPU-only controls: `python3 bench/test-run-arm-dra74.py`, `python3 bench/test-ttft.py`,
465`python3 bench/test-nsys-classify.py` and `node bench/test-bench-node.mjs`, plus the A8 and A9 controls.
466They use fake servers and fixtures and never touch a GPU, model or container.