Qwen4-35B-A3B on a V100: llama.cpp and Strata
First Qwen4-35B-A3B UD-Q4_K_XL measurements on a 16 GB V100: prefill and decode to 260K with MTP and engram. Not final.
Qwen4-35B-A3B is the first open Qwen4: 35B parameters, 3.8B active, another 20.5B in n-gram embeddings, Apache 2.0, a native 1M context, vision and MTP. We ran UD-Q4_K_XL on an X99 with a V100 in two builds: llama.cpp and Strata. These are not final numbers: Strata is still a PR and llama.cpp is a nightly build. But the order of magnitude is already visible.
The stand
Xeon E5-2698 v4, 120 GB DDR4, Tesla V100 16 GB, Windows 10. The model is unsloth/Qwen4-35B-A3B-GGUF, quant UD-Q4_K_XL, 36.2 GB. Context: 262,144 tokens.
What ran
- llama.cpp: Unsloth b12966, CUDA12 legacy,
ctx=262144, KVq8_0, MTP on GPU, vision on CPU, experts on CPU,moe-cache 5120 MiB. - Strata: 0.1.73,
q4_lite, KVint8, MTP--spec 4, engram--ple-io ram,expert-cache auto.
This is not a clean engine benchmark: KV, MTP and expert placement differ. But the model and quant are the same, so the gap shows what proper architecture support buys.
Method
Same corpus, warmup discarded, a unique token-accurate prefix per run. Prefill is measured on the cold prefix; code and prose requests then run from the same depth. Code up to 1,600 tokens, prose up to 900. One repeat for now: this is a first pass, not the final table.
Strata’s actual 32K prompt is 36,276 tokens versus 32,791 for llama.cpp — a difference in template and tokenisation. We compare by target depth, not by the absolute token count.
Results
| Depth | llama.cpp prefill | llama code | llama prose | Strata prefill | Strata code | Strata prose |
|---|---|---|---|---|---|---|
| 32K | 201.5 | 50.8 | 40.5 | 1363.0 | 103.5 | 66.2 |
| 64K | 196.2 | 48.9 | 36.7 | 1372.6 | 103.3 | 70.7 |
| 128K | 171.0 | 40.5 | 28.1 | 1381.7 | 97.0 | 68.4 |
| 260K | 132.7 | 29.0 | 19.7 | 1382.1* | 102.3* | 62.3* |
Values are tokens per second. Prefill is the cold prefix; decode is at the same depth.
* Strata’s first 262K run failed: a 292,090-token prompt left no room for an answer in the 262,144-token window, and the API refused to truncate it. A separate run at a depth of 260,288 passed (prompt 254,605 tokens); the table shows that run.
What stands out
- Prefill. llama.cpp starts at 201.5 tok/s and falls to 132.7 at 260K (−34%). Strata holds 1363–1382 tok/s at every depth; at 260K it is 10.4× faster.
- Code decode. llama.cpp: 50.8 → 29.0 tok/s (−43%). Strata: 103.5 → 102.3 (−1%). That is 2× at 32K and 3.5× at 260K.
- Prose decode. llama.cpp: 40.5 → 19.7 (−51%). Strata: 66.2 → 62.3 (−6%). Prose is slower than code everywhere, but under Strata it does not collapse with depth.
- 100 tok/s. The code target is met: Strata holds about 102 tok/s even at 260K. Prose is 62–70 tok/s, which is a different conversation.
- MTP. At 32K acceptance is almost identical: 59.8% in code for llama.cpp and 59.3% for Strata; in prose 27.4% and 22.1%. The speed gap is not an MTP story; it is prefill and expert handling.
Real sessions
Beyond bench.py, we let the model work. Four main sessions, each with 100+ requests, are real tasks, code and games rather than a synthetic prefix:
| Session | Start | Build | Requests | Max context | Decode median | Decode max |
|---|---|---|---|---|---|---|
serve-user | 04.12 15:38 | strata_qwen4 | 368 | 254,640 | 86.7 | 160.2 |
perf-1m-kvres256 | 04.12 18:30 | strata_qwen4_perf | 182 | 521,408 | 96.1 | 155.7 |
perf2-1m | 04.12 23:56 | strata_qwen4_perf2 | 534 | 786,073 | 91.1 | 148.4 |
perf3-1024 | 05.12 04:16 | strata_qwen4_perf3 | 180 | 560,261 | 95.8 | 155.3 |
These are builds from open, unmerged PRs. The builds and versions differ, so the rows are not strictly comparable: perf2-1m ran at 786K rather than 250–520K, and its 91.1 is a different regime. The overall shift is still visible: at a similar context, median decode rose from 86.7 at lunch to 95.8 by the night build, while maxima stayed around 148–160 tok/s.
One more run, perf-512k, was a five-request smoke test and is not in this table. The raw request rows and summaries are in the HF dataset.
Why Strata is faster
Qwen4 is not an ordinary transformer: three of every four layers run Gated DeltaNet, and the fourth uses Qwen Sparse Attention with a 512-block indexer. In llama.cpp this architecture runs through the generic CUDA path with CPU-offloaded experts; Strata has dedicated kernels, q4_lite and an automatic expert cache. That is also why prefill stays flat: linear attention does not pay for context growth the way full attention does.
The 16 GB V100 is still the limit: 36 GB of weights do not fit in VRAM, so experts and engram live in RAM or on SSD. Strata gets more out of the same hardware, but the model still does not fit on the card.
Limits
- Strata 0.1.73 and PR 7774 are not final; the numbers may move.
- llama.cpp is Unsloth b12966, CUDA12 legacy, not the freshest nightly.
- One repeat, no min/avg/max spread; the table needs at least three.
- Strata’s 260K run came after a failed 262K attempt; real sessions reached 786K, but on a 1M config with
--kv-resident 262144, not a clean 1M window. - The comparison is not perfectly fair: KV and MTP settings differ. But both run the same quant on the same card.
What comes next
Wait for the merged/open-PR final Strata build, repeat each measurement three times, add 512K and 1M, and check quality on long context. Then the numbers go into the main test table, followed by a separate piece on where llama.cpp is still usable and where a specialised engine is the only option.
Links
- Qwen4-35B-A3B: https://huggingface.co/Qwen/Qwen4-35B-A3B
- Unsloth GGUF: https://huggingface.co/unsloth/Qwen4-35B-A3B-GGUF
- Request-level data: https://huggingface.co/datasets/BatchOne/v100-inference-bench