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

248 lines · 18038 bytes Raw Blame History Rendered
1# Qwen3.5-9B on one GB10: our Omega engine, stock llama.cpp on CUDA, and stock llama.cpp on Omega
2
3Version 3, 2026-10-27, frozen before any timed number exists. Changes:
4- v1 (sha256 d57ff4dc…) put OURS FP8 against llama.cpp Q8_0. That breaks the first ask in ggml-org/llama.cpp discussion #31092, so v1 is withdrawn.
5- v2 made the headline pair BF16 against BF16.
6- v3 adds Drake's third configuration (stock llama.cpp on our GPU stack with no NVIDIA CUDA user-space libraries) and an independent correctness oracle (HF transformers).
7
8No timed cell has run under any version. The GPU runs so far were untimed: the BF16 llama.cpp reference capture, the OURS FP8 and BF16 correctness checks, and the HF oracle.
9
10Drake in chat, 2026-10-27:
11- "run a test between Llama CPP and our system, Omega CUDA++ ... use the Qwen 3.5 9B model"
12- "make sure we are doing it collaboratively in the repo with Llama CPP ... Make sure we're doing what she asked"
13- "Omega versus Llama CPP (pure Omega); Pure Llama with CUDA; Omega and Llama together with no CUDA"
14
15## The three configurations
16| # | Configuration | Arms | Same-file pairing |
17|---|---|---|---|
18| 1 | Pure Omega: our own engine, no llama.cpp, no NVIDIA user-space libs | OURS16 | OURS16 vs LLAMA16: same BF16 values. Layout differs, see results/WEIGHTS.md |
19| 2 | Pure llama.cpp on NVIDIA CUDA (stock release b11913) | LLAMA16, LLAMA8 | the baseline for 1 and 3 |
20| 3 | Stock llama.cpp with our GPU backend (aien-dev/ggml-omega `OmegaGB10`), no libggml-cuda, no NVIDIA user-space libs | LLOMEGA8, LLOMEGA16 if BF16 lands | LLOMEGA8 vs LLAMA8 and LLOMEGA16 vs LLAMA16: the identical GGUF file, identical llama.cpp front end. Only the GPU backend differs |
21
22In configuration 3, any op ggml-omega does not take runs on ggml's CPU backend. The op placement table (GPU or CPU, share of decode time) is published with the numbers. A slow result there is reported as it is.
23
24## What the llama.cpp side asked for (SIDDARTHAREDDY8, discussion #31092, 2026-10-24) and how this run meets it
25| Ask | Here |
26|---|---|
27| Same model file, same quantization, same prompt, same context size | Config 3 against config 2 uses the identical GGUF file (Q8_0, and BF16 if supported), so this ask is met exactly. Config 1 cannot read GGUF, so it uses the HF safetensors the GGUF was converted from. Every tensor was checked to hold the same values (130 byte-identical, the rest reordered or exactly transformed by the converter: results/WEIGHTS.md). Same prompts, same chat template, context 32768 for every arm. |
28| Prompt processing and generation reported separately | pp tok/s and tg tok/s are separate columns. They are never blended. |
29| State the offload | LLAMA*: `-ngl 999`, all layers on the GPU, verified from the load log. LLOMEGA*: `-ngl 999` onto the OmegaGB10 device, plus a per-op table of what ran on the GPU and what fell back to the CPU. OURS*: every layer on the GB10 GPU, with embedding lookup and sampling locations stated from the code. |
30| Repetitions and spread | 3 rounds × 3 reps per cell (after warm-ups). Reported as mean ± sd and median with min..max. llama-bench `-r 5` is included as a cross-check. |
31| Correctness before speed | The `agree` cell runs first: greedy tokens from both arms on the same 16 prompts, with the first divergence index reported. Garbage output voids that arm. |
32| Freeze machine state, publish the recipe | Recorded per session: driver version, GPU clocks and power state (`nvidia-smi -q -d CLOCK,POWER,PERFORMANCE`), load and other processes. Exact commands, llama.cpp b11913 version string, both commits, and every file hash are published in the repo. |
33| Disclose that the stacks differ | LLAMA* uses NVIDIA's user-space libraries (libcudart, libcublas, libcuda). OURS* and LLOMEGA* load none of them, which is checked from /proc/PID/maps. Every arm uses NVIDIA's open kernel module and GSP firmware. |
34
35## Arms
36| Arm | Engine | Weights | Role |
37|---|---|---|---|
38| OURS16 | aien-serve-http `--engine omega` (sc #790 + omega-mv #905 build) | BF16 safetensors, HF Qwen/Qwen3.5-9B rev c2022362 | headline, config 1 |
39| LLAMA16 | llama-server b11913, CUDA 13.4 runtime, `-ngl 999 -fa on` | BF16 GGUF, sha256 5d6fe481… | headline, config 2 |
40| LLAMA8 | same binary | Q8_0 GGUF, sha256 e1dc8c27… | headline, config 2 (pair for LLOMEGA8) |
41| LLOMEGA8 | stock llama-server, backend dir = CPU + libggml-omega.so only | the same Q8_0 GGUF file | headline, config 3 |
42| LLOMEGA16 | same as LLOMEGA8 | the same BF16 GGUF file | headline, config 3, only if ggml-omega gains BF16 MUL_MAT; otherwise NOT_RUN |
43| OURS8 | aien-serve-http, FP8 block-128 checkpoint | FP8 | reference only, never a headline (no llama.cpp FP8 type exists) |
44
45## Correctness oracle
46HF transformers 5.16.1 (nvcr.io/nvidia/vllm:26.09-py3) runs greedy BF16 on the same 16 prompts with the same chat template and thinking off: results/ref/HF-ORACLE.jsonl. It is the model's reference implementation and shares no code with any arm. Every arm's `agree` output is compared with the oracle and with LLAMA16: first divergence in characters and in tokens, using the model's tokenizer.
47
48## Proof of "no NVIDIA user-space libraries"
49For OURS* and LLOMEGA*, the shared objects the running server mapped are captured from /proc/PID/maps (maps-so.txt). It must list none of libcuda, libcudart, libcublas, libcublasLt, libnvrtc, libnvidia-ptxjitcompiler. LLAMA* is the negative control and must list them. NVIDIA's open kernel module and GSP firmware are used by every arm and are disclosed.
50
51## Cells (one HTTP client for all arms: HeadToHead repo bench/bench.py, temperature 0, thinking off)
521. `agree`: c=1, 128 tokens, 16 decode prompts, 1 rep each. Correctness gate, runs first.
532. `decode-c1`: c=1, max 256 tokens, decode.jsonl, 2 warm-ups + 3 reps. Gives tg tok/s.
543. `prefill-p512`, `prefill-p2k`, `prefill-p8k`: c=1, max 1 token, `--nonce`, 2 warm-ups + 3 reps. Gives pp tok/s and TTFT.
554. `decode-c8`: LLAMA arms with `-np 8` only, as an aggregate reference. NOT_RUN for OURS, whose dense door has no batching.
56- Server cpus 5-9,15-19, client cpus 0-1. Quiet gate before every cell: bench/quiet.py `--window 60 --max-load 6`. A cell that runs without a quiet window is marked LOADED.
57
58## Design
59- 3 rounds. In each round every arm runs once with a fresh server start, and load time is recorded. Arm order per round comes from `random.Random(9)`, and the order is logged.
60- No re-runs by choice. A round is repeated only for a recorded machine fault, and both attempts are reported.
61
62## Metrics
63- tg tok/s per request = (completion_tokens − 1) / (t_last − t_first).
64- pp tok/s per request = prompt_tokens / (t_first − t_send). This includes HTTP and the first sampled token, and that is stated.
65- Per arm and cell: mean ± sd, median, min..max over all non-warm-up requests, computed in Wolfram with the queries saved.
66- Headline: OURS16 / LLAMA16 ratio of median tg (decode-c1) and of median pp per prompt size.
67
68## Not claimed
69- One machine, one model, single-stream generation. Not batch serving. Any cell not run is NOT_RUN.
70
71## Resumption amendment, 2026-10-29 (before any new timed run)
72
73The resumed campaign uses `bench/bench-node.mjs` on Node v24.21.0 as a
74verification-only measurement instrument. Python is not executed. It preserves
75the request fields, prompt rotation, warm-up selection, nonce prefix, streaming
76content/reasoning handling and busy-response retry policy of `bench.py`.
77Synthetic HTTP controls live in `bench/test-bench-node.mjs`; they exercise
78fragmented UTF-8/SSE, request shape, retries, failed/truncated responses, missing
79usage, concurrent requests, warm-ups and refusal to overwrite an existing output.
80
81The instrument records monotonic nanoseconds as decimal strings (`t_send_ns`,
82`t_first_ns`, `t_last_ns`). It calculates no rates or statistics. Wolfram converts
83those raw timestamps and applies the metric definitions above; queries and
84results accompany the report. The default request timeout is the same as the
85original client: Wolfram query
86`UnitConvert[Quantity[1800, "Seconds"], "Milliseconds"]` returned
87`Quantity[1800000, "Milliseconds"]`.
88
89Unlike the old client, malformed events, missing token usage and streams ending
90without `[DONE]` fail the request and make the client exit unsuccessfully.
91Failed rows are retained. Files from different client implementations are not
92pooled into one timing summary. The recovered R1 remains historical evidence;
93the resumed client needs its own complete repeated campaign before a headline
94comparison. No new timed run has been accepted under this amendment.
95
96Backend operator checks are a separate qualification level from model output.
97The existing `ggml-omega/tests/e2e-gb10.sh` requires an exclusive model window
98with the resident model stopped. That test remains NOT_RUN while the shared
99service is retained. Operator-only tests performed beside that service cannot
100replace this gate. This amendment grants no permission to stop the service.
101
102The archived Q35 launcher named a CUDA-runtime directory that does not exist.
103The resumed launcher uses the actual extracted companion release directory,
104`h2h/dl/llama-bin/cudart-llama-b11913-bin-ubuntu-cuda-13.4-arm64`.
105Its release archive SHA-256 is
106`f6a5a0236082be3a10e9418a47ba389d23097c1fe8926581835f22e3cdeb599a`.
107Library maps are retained for every arm. Historical maps show system-library
108paths, so historical and resumed CUDA rows are not treated as identical runtime
109configurations or pooled together.
110
111## Authorized model-window follow-up, 2026-10-29
112
113Drake explicitly authorized stopping the shared model unless it is doing a test.
114The saved operating rule now requires checking live activity and the shared
115board before stopping it, then restoring the original setup after testing.
116Exclusive windows performed under that instruction have now exercised the
117mixed backend's fixed-prompt model check. Qwen3.5-9B BF16 and Q8 each matched
118the CPU reference over all 16 generated tokens. Nonzero MUL_MAT, RMS_NORM and
119SWIGLU calls prove actual placement; post-inference process maps contained none
120of the forbidden NVIDIA user-space libraries. The checkpoint files are the same
121ones verified above. Full chat-corpus agreement and timing remain separate gates.
122
123The backend test driver and comparator were hardened after controls reproduced
124false success for empty output and a changed greedy token. The driver now
125preserves comparator failure, requires all three executed operations and checks
126an after-inference library snapshot. Twenty-one comparator controls and eight
127host-only driver controls passed. Backend test-source commit:
128`f4d4014` in `aien-dev/ggml-omega`, local experimental branch at this checkpoint.
129Its committed `evidence/gb10-model-20261029.json` binds the model results to the
130backend, CUDApp, llama.cpp and test-source hashes and records the numerical
131differences. Greedy agreement is not full numerical equality.
132
133The original shared model was restored after both completed windows, with the
134same binary, model, configuration and healthy endpoint. A subsequent full-corpus
135attempt refused to stop it while another worker had requests in progress. No
136comparison cell is accepted from that refusal, and no active request was stopped.
137The independent reference observations, repeated timing, quiet-window evidence,
138larger-model arms and final comparison report remain incomplete.
139
140## Full-server observations, 2026-10-29
141
142The resumed full-server attempt exposed two defects that the bounded model
143driver did not cover. Private CUDApp SHA helpers could resolve to incompatible
144`libmtmd` symbols; an export map now keeps all backend definitions private except
145`ggml_backend_init`. Empty graph nodes could also reach a chip routine requiring
146nonempty input; the GPU executor now skips them, matching the CPU executor.
147The original failures, debugger trace and failing empty-graph reproduction are
148preserved. Export isolation and empty-graph regression controls pass on the
149fixed backend, source `9b1d3d5` (local branch).
150
151With those fixes, LLOMEGA16 completed every original chat-corpus request without
152request errors. All three intended GPU operations executed, and the
153after-inference library snapshot passed. Responses differ from the resumed
154stock BF16 baseline on d04, d14 and d15. Against the frozen independent HF
155reference, three sequences are identical and thirteen first-divergence tuples
156have exact previously recorded observations. These observations do not establish
157full numerical equivalence or excuse later differences. No final accuracy or
158timing verdict follows from this run.
159
160The first full LLOMEGA8 run completed its requests but failed the unchanged
161placement gate: MUL_MAT was absent from its GPU profile. It remains a failed
162placement experiment. Source inspection found llama.cpp's CPU-only repacked
163weight buffers incompatible with this backend's host-buffer interface. The
164historical Omega launcher used `-nr`; the resumed command had omitted it. The
165corrected Q8 run uses stock `--no-repack`, the identical GGUF and the same staged
166backend. Its placement and output remain unverified until the run completes.
167This is a recorded configuration correction; results are not pooled across the
168two configurations.
169
170Local evidence: `handoffs/stack-comparison-20261029/llomega16-full-corpus-receipt.json`,
171`llomega16-token-audit.json`, `llomega8-token-audit.json`,
172`startup-collision-fix.json`, `q8-placement-diagnosis.json` and
173`llomega-correctness-3/`. The independent-reference observations still missing
174for other arms, repeated timing, quiet-window controls and larger-model arms
175remain outstanding.
176
177## Corrected Q8 result, 2026-10-29
178
179The `--no-repack` Q8 rerun completed all sixteen requests and passed the
180unchanged three-operation placement gate. MUL_MAT, RMS_NORM and SWIGLU all have
181nonzero GPU execution counts. The after-inference library snapshot passed, the
182window exited successfully, and the original shared model was restored healthy.
183Thus the two full-server defects and the Q8 placement configuration error have
184executed follow-up evidence; they are not merely proposed repairs.
185
186Against the frozen independent reference, corrected Q8 has one identical
187sequence, nine exact previously observed first-divergence tuples and six tuples
188without accepted observations. The BF16 result remains three identical and
189thirteen previously observed tuples. Prior observations alone do not establish
190whole-sequence equivalence or semantic correctness.
191
192The combined pending list in `results/PENDING-REFERENCE-20261029.json` contains
193thirteen distinct contexts across all resumed arms, with identical contexts
194deduplicated while preserving the affected arms. Every saved prefix and oracle
195token was checked against the hashed HF reference. No fresh independent score
196is inferred. The existing checker requires Python, which the current operating
197instructions forbid. This gate, the repeated timing campaign, larger-model
198comparisons and final performance report remain incomplete.
199
200Completed Q8 evidence is in `results/LLOMEGA8-CORPUS-20261029.json`; the local raw
201rows, post-inference maps, operation profile and token audit remain under
202`handoffs/stack-comparison-20261029/`. This correctness run is not a timed cell,
203and no speed winner is claimed.
204
205## Independent reference completion and timing start, 2026-10-29
206
207Drake clarified that external testing/reference/measurement tools may use Python
208while Aien architecture and structural implementation remain Python-free.
209Calculations may also use Python, with Wolfram preferred. This removes the
210earlier reference-tool prohibition; it does not add Python to the tested native
211engine or Omega backend.
212
213The original `tie_check.py`, byte-checked against this repository's pinned copy,
214ran in the pinned NVIDIA image
215`nvcr.io/nvidia/vllm@sha256:557747337846eecf34486866f3d992383c6f8af869fdb0e365b5093fcaee02c2`.
216All thirteen deduplicated pending contexts produced finite observations matching
217the exact prompt, position and token pair. The shared model was restored and
218healthy after exit. The updated five-arm token audit has no first-divergence
219tuple lacking a matching independent observation.
220
221In the thirteen new contexts, seven tested tokens rank equal to the reference's
222top score and six rank second. These are recorded observations, not an invented
223acceptance tolerance. LLAMA8 d08 scores its tested token above the token saved
224in the frozen generation reference; that negative gap is preserved. A
225first-divergence score does not verify later divergent continuation or establish
226whole-model numerical equivalence. Exact agreement remains reported separately.
227
228The resumed timing campaign retains all five arms across three rounds, with
229`random.Random(9)` determining the recorded arm order. Each fresh session reruns
230the agree cell, then uses the original warm-up/repetition counts, prompt sizes
231and nonce setting. Stock CUDA arms additionally run concurrency-eight and the
232llama-bench cross-check. Corrected Omega Q8 retains `--no-repack`; its earlier
233failed placement run remains separate. Each cell has a fresh output file.
234
235Client and prompt copies are frozen for the campaign. `bench-node.mjs` records
236raw monotonic nanoseconds as declared above; the existing external Python quiet
237checker enforces the declared window before cells. Request/library/placement
238failure stops the campaign. A quiet gate that cannot pass after its bounded
239attempts stops the session without accepting a timed cell. The original shared
240model is restored between configurations. Results are not pooled with historical
241clients or runtimes, and no speed conclusion is justified before the required
242cells finish and their observations are analyzed.
243
244New committed reference evidence: `results/REFERENCE-OBSERVATIONS-20261029.jsonl`,
245`results/REFERENCE-RECEIPT-20261029.json`, and
246`results/ALL-ARMS-TOKEN-AUDIT-20261029.json`.
247The live campaign manifest, frozen instruments, order and raw outputs are under
248`handoffs/stack-comparison-20261029/timing-campaign-1/`.