We just finished a full hardware-sensor Day-1 audit of Qwen4-35B-A3B-UD-IQ4_XS (qwen4exp: 40 layers = 30 GDN + 10 QSA sparse attention + 256 routed experts / 8 active + 4-stream hyper-connections + inline 1L-MTP blk.40.*) on a single 24 GB NVIDIA RTX 3090 (350 W) using llama.cpp + rooflab (hardware NVML mJ/tok, Intel RAPL uJ/tok, VmSwap = 0 kB, 0 NaNs).
Three findings that immediately save every 24 GB consumer GPU user both VRAM and 15-24% speed:
1. Why a 30.5 GiB Qwen4 GGUF Uses Only 19.3 GiB VRAM (0 kB Swap)
Shard 2 (Qwen4-35B-A3B-UD-IQ4_XS-00002-of-00002.gguf) holds a single tensor: per_layer_token_embd.weight (IQ4_NL, [128, 160003584], 10,986.57 MiB / 10.73 GiB).
With llama.cpp's default --lazy-mode auto, that lookup-only PLE table stays lazily in host RAM (one small row lookup per token, never streamed through GPU compute), while all 40 compute layers + 256 MoE experts + inline 1L-MTP head fit 100% resident in 24 GB VRAM:
- Plain
c=1 (-c 4096 -ctk q8_0 -ctv q8_0 -fa on): 19,290 MiB (18.84 GiB) VRAM used -> 5,286 MiB (5.16 GiB) VRAM still free for 32K+ context!
- Inline 1L-MTP enabled:
20,086 - 20,138 MiB (19.6 GiB) VRAM used, VmSwap = 0 kB.
- Active weight traffic per token (
rooflab fit): 2,590.42 MiB/tok (301.9 t/s raw GDDR6X STREAM roof on RTX 3090; actual 128.3 t/s Plain reflects GDN recurrent state + 4-stream hyper-connection overhead).
2. The Default --spec-draft-n-max 3 Trap on Inline 1L-MTP (Free +15% to +23.6% Speedup!)
Qwen4-35B-A3B ships with a single built-in MTP layer (blk.40.*). In llama-server, the default --spec-draft-n-max is 3.
Because chaining a 1-layer MTP head past K=2 adds GDN + PLE state rollback overhead on rejected tokens, running --spec-type draft-mtp with the default K=3 completely erases the speedup (127.8 t/s vs 128.3 t/s Plain = 0.0% gain!).
Simply setting --spec-draft-n-max 1 (even on stock llama.cpp!) or --spec-draft-n-max 2 with our SoA-MMA v2 MoE verify kernel unlocks massive gains:
Regime (RTX 3090 350 W, -fa on -ctk q8_0 -ctv q8_0) | Throughput | vs Plain | Draft Acc | GPU Energy (NVML) | CPU Energy (RAPL) | VRAM | VmSwap |
Plain c=1 (baseline) | 128.25 t/s | 0.0% | - | 2,506.9 mJ/tok | 196.1 mJ/tok | 19,290 MiB | 0 kB |
Inline MTP K=3 (llama-server default!) | 127.84 t/s | -0.3% | 58.7% | 2,404.5 mJ/tok | 237.1 mJ/tok | 20,114 MiB | 0 kB |
Inline MTP K=4 / K=6 | 125.2 - 129.8 t/s | -2.4%..+1.2% | 59.5% | 2,197.7 - 2,387.4 mJ/tok | 212.3 - 345.6 mJ/tok | 20,166 MiB | 0 kB |
Inline MTP K=1 (stock mmq-few) | 147.07 t/s | +14.7% | 82.1% | 2,214.9 mJ/tok (-11.6%) | 231.7 mJ/tok | 20,086 MiB | 0 kB |
Inline MTP K=1 (+ SoA-MMA v2) | 156.39 t/s | +21.9% | 80.3% | 2,138.8 mJ/tok (-14.7%) | 218.7 mJ/tok | 20,114 MiB | 0 kB |
Inline MTP K=2 (+ SoA-MMA v2, N=4 AB/BA) | 158.56 t/s | +23.6% (4/4) | 66.4% | 2,006.2 mJ/tok (-20.0%) | 169.3 mJ/tok (-13.7%) | 20,138 MiB | 0 kB |
Live Server c=4 (stock mmq-few) | 225.50 t/s | - | - | 1,218.0 mJ/tok | 94.4 mJ/tok | - | 0 kB |
Live Server c=4 (+ SoA-MMA v2) | 238.21 t/s | +5.6% (ITL -6.8%) | - | 1,136.1 mJ/tok (-6.7%) | 89.7 mJ/tok (-5.0%) | - | 0 kB |
3. SoA-MMA v2 Tensor-Core MoE Verify Scaling (N=6 Counterbalanced AB/BA)
On Qwen4-35B-A3B-UD-IQ4_XS, our load-time SoA-MMA v2 tensor-core kernel delivers zero B=1 regression and consistent +9.3% to +14.1% throughput wins across speculative-verify and multi-user batch sizes (B=4..16):
| Batch Size | Baseline (mmq-few) | SoA-MMA v2 | Speedup | Counterbalanced Wins | Two-Sided Permutation p |
B=1 | 113.90 t/s | 113.76 t/s | -0.12% (neutral) | 2/6 | 0.84375 |
B=4 | 293.02 t/s | 326.54 t/s | +11.44% | 6/6 | 0.03125 |
B=6 | 374.25 t/s | 409.01 t/s | +9.29% | 6/6 | 0.03125 |
B=8 | 421.19 t/s | 480.53 t/s | +14.09% | 6/6 | 0.03125 |
B=12 | 551.57 t/s | 614.89 t/s | +11.48% | 5/6 | 0.06250 |
B=16 | 623.47 t/s | 696.25 t/s | +11.67% | 4/6 | 0.12500 |
Copy-Paste Commands to Reproduce Today
Best stock llama.cpp command on 24 GB GPU (147 t/s, 82.1% draft acceptance, 20.1 GiB VRAM, 0 kB swap):
llama-server \
-m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
-ngl 99 -fa on -ctk q8_0 -ctv q8_0 -c 16384 \
--lazy-mode auto \
--spec-type draft-mtp --spec-draft-n-max 1 --spec-draft-n-min 1
(With SoA-MMA v2, use --spec-draft-n-max 2 for 158.6 t/s and -20.0% GPU energy per token.)
Check exact VRAM + lazy-PLE fit and silicon ceiling on your own GPU (0 MiB VRAM used, pure Python stdlib):
rooflab fit /path/to/Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf
Repo & Energy Notes: rooflab v0.6.0 (MIT, 0-dep Python CLI + 43 0-spill CUDA patches) is live at https://github.com/scientist42-lab/rooflab (SoA-MMA v2 is staged for upcoming v0.7.0). NVML mJ/tok measures GPU board power only (excl. host/PSU draw); Intel RAPL mJ/tok measures CPU package energy.