This article also exists in French: read the French version.
One level down: #007.2 Graphics cards, one track at a time

In short
- On the RTX 4080, before this work, Herbert spent 1,091 ms of compute on an 8,192-token prompt, against 370 for vLLM: mostly in the Mamba-3 scan, the experts, and attention.
- Each track has its row: the machine, the measured gain, the check it passed, and whether it became the default. With the experts in a single pass, their time drops from 285 to 50 ms on the 4080, with the same bits.
- Drivers have their limits: 32 KB of group memory on AMD under Windows, no bf16 matrices on Intel under Windows, a sine that is not precise enough, a full compilation cache on NVIDIA.
This is a technical companion to #007 Herbert against OVH's engines, on their own model, published the same evening. It starts from the profiles that show where Herbert spent its time against vLLM and MLX, then gives each optimization track with its machine, its measured gain, and its check. It ends on the limits that the hardware and the drivers imposed.
Where the time goes
RTX 4080, 8,192-token prompt, 16 bits, GPU compute time per family (nsys profile on both sides, milliseconds). vLLM is OVH's version, with no CUDA graph at prefill. Herbert is the November 22 commit, before any of the optimizations in this article:
| Family | vLLM | Herbert | Gap |
|---|---|---|---|
| Mamba-3 scan | 57.8 | 313.4 | +255.6 |
| Routed experts | 80.3 | 288.9 | +208.6 |
| Attention | 67.1 | 162.9 | +95.8 |
| Mamba-3 projections (GEMM) | 77.7 | 117.4 | +39.7 |
| Router | 6.2 | 62.0 | +55.8 |
| Shared expert | 32.6 | 60.6 | +28.0 |
| Attention projections | 32.1 | 43.4 | +11.3 |
| Rest (latent, geodesic, lm_head) | 16.3 | 42.4 | +26.1 |
| Total | 370.2 | 1,090.9 | +720.7 |
The GPU is busy 96 to 99% of the time on both sides: the gap is in the kernels, not in the host.
Mac Studio M3 Ultra, same prompt, 16 bits. Herbert with blocks of 512, each MLX kernel replayed on its own on the real inputs:
| Stage | Herbert | MLX | Gap |
|---|---|---|---|
| Attention | 790 | 423 | +367 |
| Mamba-3 scan | 634 | 309 | +325 |
| Routed experts | 326 | 173 | +153 |
| Latent GEMM and shared expert | 250 | 204 | +46 |
| Router | 54 | 18 | +36 |
The Mamba-3 input projections are even (297 against 302). MLX's expert sorting and routing, about 78 ms, are counted separately in its profile.
Logs: 2026-11-22-olala-prefill-vllm-vs-herbert, 2026-11-23-olala-metal-vs-mlx-diag.
The tracks, family by family
| Track | Machine | Measured gain | Check | Fidelity | Default |
|---|---|---|---|---|---|
| Experts in a single pass over the whole prompt | RTX 4080, CUDA | with blocks of 512: 285 → 50 ms at 8,192 (consolidated commit 99d8321, same expert code, same bits) | same bits | yes | |
| Attention in FlashAttention 2 form | RTX 4080, CUDA | +8% at 8,192, +23% at 32,640 | KL and BFCL | BFCL 318 against 322, p = 0.67 | yes |
Scan fused into one causal pass over chunks of 64 (fL64) | RTX 4080, CUDA | scan −17 to −18% (21.6 against 26.1 ms at 2,048; 317.1 against 388.4 at 32,640) | KL and BFCL | BFCL 319 against 325, p = 0.405; KL --q4 0.0017. On November 24, chunks of 128 with slices of 1,024 gave BFCL 311, p = 0.038. That p = 0.038 is a significant drop on a neighboring form. Since November 26, chunks of 128 over the whole block are the default: they pass the extended quality gate (16 long: 0.0034 against 0.0038 in 16 bits, 0.0038 against 0.0039 in --q4), with no BFCL rerun. It is the least verified row of this table | yes until November 26; since then, chunks of 128 |
| Attention on 16 × 16 × 16 WMMA | RX 9060 XT, Vulkan | 754 → 2,059 tokens/s at 32,640 (--q4, blocks of 512); 2,436 with the other default kernels of the published commit, still with blocks of 512; 2,136 at the real default of 1bdf00b, which uses blocks of 256 on this card; 3,275 at the default of the published commit (53862d4; measured on 2f36c56, same bits), with all the Vulkan tracks (median of 6 runs) | KL and BFCL | KL 0.0365 against 0.0364; BFCL 302 against 295, p = 0.41. The tracks added since (Q4_ONE, EX_Q4_ONE) only have the KL of the 12 short items on this card: no extended gate on the RX | yes |
| Mamba-3 scan on 8 × 16 × 16 matrices | Arc 140V, Vulkan (Linux) | 698 → 878 tokens/s at 2,048 (16 bits, Mesa 26.0.8, remeasured on November 26); 1,164 at the default of the published commit, with all the Vulkan tracks and the cache keys in bf16 | KL and BFCL | BFCL 314 against 323 (p = 0.23), 294 against 297 (p = 0.79); extended --q4 gate (16 long, 36 short), see below | yes |
| Scaled f16 GEMM on 16 × 16 matrices | RX 7900 XTX, Vulkan (Linux) | 3,379 → 5,214 tokens/s at 512 (+54%), 1,433 → 1,718 at 32,640 (+20%) in 16 bits; --q4 +49% and +18% | KL and BFCL | KL 0.0019 against 0.0016 (16 bits), 0.0018 against 0.0017 (--q4), 12 short items, same arm as the speeds; BFCL 328 against 310, p = 0.011, a single draw, measured on November 24 on an earlier version of the same path; extended --q4 quality gate (16 long, 36 short) against CUDA: passes against each of the tracks turned off and against the old default (long 0.00394 against 0.00407 to 0.00461) | yes. The range check of the weights in f16 cost 5.1 → 27.2 s at load time in 16 bits, 3.3 → 13.8 s in --q4; since e5024dc, it is spread over all the cores and kept on disk; on the XTX, load 7.9 s the first time (3.2 s scan on 12 threads) then 5.2 s in 16 bits, 4.5 then 3.3 s in --q4, same md5 (18/18) |
| Attention in MLX form | M3 Ultra, Metal | 32,640: 1,742 → 2,119 tokens/s | KL and BFCL | KL 0.0016; BFCL 325 against 315, p = 0.13 | yes |
Router in two parts (SCORE_PARTS=2) | RTX 4080, CUDA | router scores 16.45 → 13.19 ms at 8,192 (16 bits) | KL | extended gate: 16 bits 0.00341 against 0.00491 on the 16 long; the worst item goes from 0.024 to 0.0066; --q4 0.00375 against 0.00368 | yes |
Mamba-3 blocks of 8 (M_BLOCK) and tiled attention (cpu-opt1) | Ryzen 7 5700G, processor | prefill +31 to +42% from 328 to 32,640 (--q4, measured together, 22ff678 → 2f36c56) | KL | extended --q4 gate against CUDA: 0.01072 against 0.01070 (blocks of 64) and 0.01172 (without tiles) on the 16 long; 16 bits not measured | yes on x86-64 |
| Prefill attention on coopmat2 | RTX 4080, Vulkan | 16 bits: 7,867 → 9,634 tokens/s at 2,048; --q4 7,352 → 8,848 | KL | extended gate against CUDA: 16 bits 0.00319 against 0.00329, --q4 0.00394 against 0.00396 | yes on NVIDIA |
The 22 other tracks
| Track | Machine | Measured gain | Check | Fidelity | Default |
|---|---|---|---|---|---|
| Chunked Mamba-3 scan on tensor cores | RTX 4080, CUDA | prefill +17 to +20% up to 8,192, +11 to +12% at 32,640 (chunks of 32, the November 23 form) | KL and BFCL | BFCL 316 against 322 (16 bits), 295 against 298 (--q4), p ≥ 0.49 | since replaced by the chunks of 128 of the fused scan |
| Block chosen by length, with the experts in a single pass | RTX 4080, CUDA | prefill time −17 to −22% (16 bits), −11 to −14% (--q4), from 2,048 to 32,640 (November 23 table) | same bits up to 16,384 rows; beyond that, KL | KL 0.0029 (16 bits, 32,640) | yes, with a different table since: block of 2,048 from 2,048 rows, of 1,216 from 28,672 |
Output of each chunk launched as soon as its state is ready (EARLY) | RTX 4080, CUDA | scan another −13 to −15% (274.4 ms at 32,640) | same bits as fL64 | yes | |
Router on tensor cores (SCORE=mma) | RTX 4080, CUDA | router scores 48.5 → 17.6 ms, profiled prefill 454 → 425 ms at 8,192 | KL and BFCL | KL 0.0019 (16 bits), 0.0022 (--q4); BFCL 320 against 325, p = 0.551 | yes |
ReLU² and residual addition fused into the GEMMs (GEMM_EPI) | RTX 4080, CUDA | profiled prefill 469 → 463 ms at 8,192 | same bits | yes | |
Tile dedicated to the MoE latent GEMMs (TILE_LAT) | RTX 4080, CUDA | profiled prefill 469 → 467 ms at 8,192 | same bits | no: the two-stage tile replaces it; it only acts under HERBERT_OLALA_TILE=table | |
MoE group GEMM over the whole group, in slices of 8,192 rows (GEMM_GROUP) | RTX 4080, CUDA | profiled prefill 469 → 462 ms at 8,192; at 32,640 in --q4, 12,454 → 12,514 tokens/s (+0.5%), where the whole group fell back to 11,766 | same bits | yes | |
Attention in two halves offset by half a tile (ATTN_PH=2) | RTX 4080, CUDA | attention −3.2% at 32,640; server 0.851 → 0.862 of vLLM (16 bits) | same bits | yes | |
| Dense GEMM tiles with two load stages | RTX 4080, CUDA | dense GEMMs 160.4 → 155.5 ms at 8,192; end to end, +0.7 to +1.4% in 16 bits, +0.0 to +0.4% in --q4 | same bits | yes | |
Router written as a GEMM (SCORE=gemm) | RTX 4080, CUDA | router scores 16.7 → 14.3 ms at 8,192 | same bits as SCORE=mma | no, see below | |
| Chunked Mamba-3 scan on WMMA | RX 9060 XT, Vulkan | +32% at 512, +6% at 32,640 | KL and BFCL | BFCL 320 against 316 (16 bits), 295 = 295 (--q4) | yes |
| Block of 2,048 | RTX 4080, Vulkan | +34.5% at 2,048, +24% at 8,192, +11% at 32,640 (16 bits) | KL and BFCL | KL 0.0013; BFCL 308 against 319, p = 0.13 | yes, with the two AMD tracks |
| Mamba-3 scan in MLX form, folded angles | M3 Ultra, Metal | +8 to +22% | KL and BFCL | see the rejected track | yes |
| Block of 2,048 | M3 Ultra, Metal | +8 to +9% | same bits | identical logits at 2,048 and 8,192 | yes |
| Factorized attention cache at decode | M3 Ultra, Metal | decode −19 to −31% | KL and BFCL | at the level of the defaults | no: slower |
| MoE group decoupled from the block | RTX 4080, CUDA | 16 bits: prefill 461 → 413 ms at 8,192, 2,477 → 2,462 ms at 32,640; --q4 unchanged | same bits | yes (HERBERT_OLALA_MOE_OVERLAY=0 restores the old one) | |
--q4 input experts decoded once per group | RTX 4080, CUDA | --q4: 408 → 389 ms at 8,192, 2,456 → 2,310 ms at 32,640; 93 → 108 ms at 2,048, hence the condition | KL | extended gate, --q4: 0.00375 against 0.00388 on the 16 long, 0.00225 against 0.00225 on the short; 16 bits: same bits | yes, from 4,800 rows per group |
Fused SSD (m3_ssd_fused) | RTX 4080, Vulkan | +3.4 to +3.8% at 2,048, +1.7 to +1.9% at 8,192 | KL | extended gate: 16 bits 0.00319 against 0.00354, --q4 0.00394 against 0.00380 | yes on NVIDIA with coopmat2 |
| SSD slices of 128 and angle scan 3 | RTX 4080, Vulkan | --q4 SSD class 153.5 → 145.0 ms at 8,192, 615.1 → 581.1 ms at 32,640 | KL | extended gate, both together: 16 bits 0.00319 against 0.00406, --q4 0.00394 (threshold 0.00432) | yes on NVIDIA with coopmat2 |
4 bits in a single product (Q4_ONE) | RTX 4080, Vulkan | --q4: 8,318 → 8,992 tokens/s at 2,048, 4,358 → 4,546 at 8,192 | KL | extended --q4 gate: 0.00394 against 0.00412; 16 bits: same bits | yes on NVIDIA, the RX, and the Arc |
4 bits in a single product, experts included (Q4_ONE + EX_Q4_ONE) | RX 9060 XT, Vulkan | --q4: +11.6 / +12.2 / +10.5 / +6.6% at 512 / 2,048 / 8,192 / 32,640 | KL | 12 short: 0.0018 against 0.0025; no extended gate on the RX | yes on the RX |
| 4 bits in a single product, experts included; blocks of 2,048 | Arc 140V, Vulkan (Linux) | --q4: 913 → 1,056 tokens/s at 2,048, 679 → 755 at 8,192 (commit message, 1 to 2 runs); blocks of 2,048: 646 → 678 at 8,192 (2 runs) | KL | extended --q4 gate (16 long, 36 short) against CUDA: passes against each track turned off alone, as against the old default | yes on the Arc |
Why the router written as a GEMM stays an option. It gives the same bits as the router on tensor cores and it is a little faster. But it takes 105 MiB more memory on the card. In 16 bits, on a 16 GB card, Herbert then no longer starts with a 32,768-token context. A 2% gain on reading the prompt is not worth giving up that context: it stays behind an option, until its memory goes down or it is reserved for --q4.
Each gain in this table is measured on its own, on its working copy. With all the options together, before the consolidated commit, the server went from 0.80 / 0.79 / 0.82 of vLLM to 0.93 / 0.90 / 0.90 in 16 bits. In --q4, it went from 0.81 / 0.82 / 0.84 to 0.94 / 0.95 / 0.94 (2,048 / 8,192 / 32,640 tokens). On the published commit, with all the tracks together, it is at 1.00 / 1.11 / 1.05 of vLLM in 16 bits and 1.01 / 1.06 / 1.04 in --q4 (table in #007).
Each row was checked again on November 27 against the measurement logs. The long KLs come from the extended quality gate: 16 well-formed long prompts (8 at 2,048 tokens, 8 at 8,192) and 12 short ones, with a rule written before the measurement; on the Arc, 36 short ones. The old long items, which were badly formed, are no longer cited. Several speed tracks that give the same bits (tiles, expert sorting, tokenizer, block tables) are not in this table: they are in the wiki.
What the hardware and the drivers impose
Group memory in the AMD driver under Windows. It is capped at 32 KB. The first version of the attention on WMMA, with 32 queries and tiles of 256 keys, asked for 57 KB. Herbert read the limit the driver announced: it wrote "tpa_fa_cm16 asked but not available here ... tpa_fo kept" and went back to the old kernel. The campaign ran with the old kernel and it was the per-dispatch profile that showed it. The version I kept works with tiles of 128 keys, 32,768 bytes.
No more silent fallback. Since then, Herbert no longer goes back to an old kernel without stopping. When you force a kernel that does not fit, it refuses to start and says which option to take. For the matrix kernels it picks on its own, it tries them at load time on small data whose result it knows. If they answer correctly, it takes them. Otherwise, it takes the old kernel and the load line says why. On an RX 7900 XTX (RDNA3, RADV 25.0.7), whose driver does not expose bf16 cooperative matrices, choosing by vendor would have stopped the load. With the trial, Herbert loads, writes "not taken: a limit of the driver", and gives the same bits as the old kernels forced by hand. On the RTX 4080, this trial costs about 70 ms at load time, 1.3 s on the very first launch, while the driver compiles. On this card, I then reused the Arc's f16 scaling for the matrix multiplications and the experts, since the driver offers 16 × 16 f16 matrices. It is the default of the published commit: prompt reading goes from 3,379 to 5,214 tokens/s at 512 tokens (+54%) and from 1,433 to 1,718 at 32,640 (+20%) in 16 bits, and by +49% and +18% in --q4. On the extended quality gate (16 long, 36 short), this default is closer to CUDA than each of the tracks turned off. At load time, Herbert checks that each weight fits in f16: this check, at first on a single thread, took the load from 5.1 to 27.2 s; spread over all the cores and kept on disk, it now costs only 3.2 s on the first load (7.9 s in all) and nothing afterward (5.2 s).
Only one kernel switch remains automatic, because it does not change any bit. At decode, the attention of a row keeps its scores in group memory as long as they fit there, then moves to a tiled form beyond that. The threshold depends on the driver: 7,792 positions on the RX under Windows, 11,888 on the 4080. I measured the other choice, the tiled form everywhere: it costs 1.4 to 1.9% on the 4080 and brings about 1% on the RX. So the switch stays as it is and the load line announces it.
Matrices in the Intel driver under Windows. On the Arc 140V, the Linux driver (ANV) offers cooperative matrices in bf16, the Windows driver (32.0.101.9150) only in f16. f16 stops at 65,504. Herbert then divides each row by a power of two so that it fits in f16, multiplies, then scales the result back. Dividing by a power of two only touches the exponent: as long as the scaled number stays exactly representable in f16, it keeps its digits. The trap is a row that mixes a huge value with small values: divided by the same power of two, the small ones fall below the smallest f16 and become zero. The third version stores these small values in a second f16 matrix, with its own power of two. Herbert then adds the two products. It is exact except for an extreme spread inside a row. The second version, with a single matrix, is about 10% faster. Both remain options: by default, under Windows, Herbert keeps the old computation, without the matrix circuits. Prefill 16 bits ×2.12 / ×1.53 / ×1.17 at 2,048 / 8,192 / 32,640 tokens; KL 0.0028 to 0.0032. These figures come from the working copy under Windows: this path is compiled into the published commit, but I did not measure it again there.
Sine and cosine in the Intel driver. At load time, Herbert measures the error of the driver's sine and cosine: 3.24 × 10^-5 under Windows as under Linux, 32 times the limit I set myself (10^-6). It then uses its own computation, which stays at 1.35 × 10^-7.
Smart App Control. Under Windows 11, it refuses any unsigned executable. Herbert's binaries could not run on the Arc while it was on.
Logs: 2026-11-23-olala-impl-vk-rx-attn, 2026-11-23-olala-arc-win-f16, 2026-11-23-olala-arc-windows, 2026-11-24-olala-vk-fa-dec, 2026-11-24-olala-vk-probe.
The NVIDIA driver cache. A first series, on the night of November 26 to 27, gave a scattered Vulkan prefill of 3,500 to 8,300 tokens/s at 512 tokens, which looked like a regression of the candidate. It was not one: the SPIR-V is identical byte for byte; each binary, once in cache, reads at the same speed (7,830 to 7,897 tokens/s in 16 bits for six commits). The driver keeps its compilations in a global cache of 1 GiB by default, indexed by the name of the executable. This cache was full: each new binary was recompiled at every launch, the load went from 2.3 to 5.8 s, and the prefill that followed ran slowly. For a user whose cache is full, it is the same thing. The fix will come after this issue: Herbert will keep its compiled pipelines on disk itself, for all drivers. In the meantime, __GL_SHADER_DISK_CACHE_SIZE enlarges the NVIDIA driver cache.
The cards with no OVH engine to compare against. Command line, defaults of the published commit, medians of 3 interleaved runs, in tokens/s, at 512 / 2,048 / 8,192 / 32,640:
| Prefill 16 bits | Prefill --q4 | Decode 16 bits | Decode --q4 | |
|---|---|---|---|---|
| RX 9060 XT (Windows) | 4,386 / 5,922 / 5,158 / 2,674 | 5,001 / 5,968 / 5,229 / 3,273 | 85.0 / 85.8 / 78.7 / 60.2 | 127.2 / 129.4 / 113.5 / 78.8 |
| Arc 140V (Linux, Mesa 26.0.8) | 1,088 / 1,164 / 825 / 339 | 1,063 / 1,087 / 791 / 332 | 32.3 / 31.4 / 28.3 / 20.4 | 48.4 / 46.3 / 40.0 / 25.9 |
On the RX, writing is 1 to 3% faster than before because the Vulkan engine no longer rereads its settings from the environment at each layer: under Windows, each read goes through the system. On November 26, in 16 bits at 32,640, one launch out of 7 had failed at load time for lack of memory on the card (14.5 GiB requested out of 14.7). On the Arc, the keys of the attention cache move to bf16 instead of 8 bits in the published commit: closer to CUDA on 51 items out of 52 of the extended gate (long KL 0.00412 against 0.00701), prefill ×1.71 at 32,640 in --q4 (194.7 → 332.1 tokens/s), decode ×0.93 at that size and unchanged up to 8,192, 0.34 GB more cache at 32,640. HERBERT_VK_OLALA_KV8=k gives back the keys in 8 bits.
One level down, or several...
- One level down: #000 an inference engine that writes its own code · 03-Oct-2026
- One level down: #001 a compiler for an LLM engine · 11-Oct-2026
- One level down: #002 the same compiler on a GPU · 18-Oct-2026
- One level down: #002.1 follow-up, the Arc in f16 · 02-Nov-2026
- One level down: #003 what CUDA has that Vulkan lacks · 25-Oct-2026
- One level down: #004 the same compiler on Apple's chips · 01-Nov-2026
- One level down: #005 Is Herbert better than Llama.cpp? · 15-Nov-2026
- One level down: #006 I started porting Olala, OVHcloud's model · 22-Nov-2026
- One level down: #007 Herbert against OVH's engines, on their own model · 29-Nov-2026
- One level down: #007.1 The rules: bits, KL, BFCL, and 4 bits · 29-Nov-2026
- One level down: #007.2 Graphics cards, one track at a time · 29-Nov-2026
- One level down: #007.3 The processor: AVX-512, AVX2 and SME · 29-Nov-2026
- One level down: #007.4 The option turned down, then accepted · 29-Nov-2026