← back
Never miss a thing.
One email per new article, plus upcoming course announcements, nothing else. The full tech-watch news, figures and gifts are reserved for Subscriber Area members.

This article also exists in French: read the French version.

Discuss this article with your AI
The button copies the article with a short introduction for the model. Paste it all into Claude, ChatGPT, Le Chat or another AI, then ask it your questions.

One level down: #007.2 Graphics cards, one track at a time

One level down: #007.2 Graphics cards, one track at a time

In short

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:

FamilyvLLMHerbertGap
Mamba-3 scan57.8313.4+255.6
Routed experts80.3288.9+208.6
Attention67.1162.9+95.8
Mamba-3 projections (GEMM)77.7117.4+39.7
Router6.262.0+55.8
Shared expert32.660.6+28.0
Attention projections32.143.4+11.3
Rest (latent, geodesic, lm_head)16.342.4+26.1
Total370.21,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:

StageHerbertMLXGap
Attention790423+367
Mamba-3 scan634309+325
Routed experts326173+153
Latent GEMM and shared expert250204+46
Router5418+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

TrackMachineMeasured gainCheckFidelityDefault
Experts in a single pass over the whole promptRTX 4080, CUDAwith blocks of 512: 285 → 50 ms at 8,192 (consolidated commit 99d8321, same expert code, same bits)same bitsyes
Attention in FlashAttention 2 formRTX 4080, CUDA+8% at 8,192, +23% at 32,640KL and BFCLBFCL 318 against 322, p = 0.67yes
Scan fused into one causal pass over chunks of 64 (fL64)RTX 4080, CUDAscan −17 to −18% (21.6 against 26.1 ms at 2,048; 317.1 against 388.4 at 32,640)KL and BFCLBFCL 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 tableyes until November 26; since then, chunks of 128
Attention on 16 × 16 × 16 WMMARX 9060 XT, Vulkan754 → 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 BFCLKL 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 RXyes
Mamba-3 scan on 8 × 16 × 16 matricesArc 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 bf16KL and BFCLBFCL 314 against 323 (p = 0.23), 294 against 297 (p = 0.79); extended --q4 gate (16 long, 36 short), see belowyes
Scaled f16 GEMM on 16 × 16 matricesRX 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 BFCLKL 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 formM3 Ultra, Metal32,640: 1,742 → 2,119 tokens/sKL and BFCLKL 0.0016; BFCL 325 against 315, p = 0.13yes
Router in two parts (SCORE_PARTS=2)RTX 4080, CUDArouter scores 16.45 → 13.19 ms at 8,192 (16 bits)KLextended 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.00368yes
Mamba-3 blocks of 8 (M_BLOCK) and tiled attention (cpu-opt1)Ryzen 7 5700G, processorprefill +31 to +42% from 328 to 32,640 (--q4, measured together, 22ff678 → 2f36c56)KLextended --q4 gate against CUDA: 0.01072 against 0.01070 (blocks of 64) and 0.01172 (without tiles) on the 16 long; 16 bits not measuredyes on x86-64
Prefill attention on coopmat2RTX 4080, Vulkan16 bits: 7,867 → 9,634 tokens/s at 2,048; --q4 7,352 → 8,848KLextended gate against CUDA: 16 bits 0.00319 against 0.00329, --q4 0.00394 against 0.00396yes on NVIDIA
The 22 other tracks
TrackMachineMeasured gainCheckFidelityDefault
Chunked Mamba-3 scan on tensor coresRTX 4080, CUDAprefill +17 to +20% up to 8,192, +11 to +12% at 32,640 (chunks of 32, the November 23 form)KL and BFCLBFCL 316 against 322 (16 bits), 295 against 298 (--q4), p ≥ 0.49since replaced by the chunks of 128 of the fused scan
Block chosen by length, with the experts in a single passRTX 4080, CUDAprefill 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, KLKL 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, CUDAscan another −13 to −15% (274.4 ms at 32,640)same bits as fL64yes
Router on tensor cores (SCORE=mma)RTX 4080, CUDArouter scores 48.5 → 17.6 ms, profiled prefill 454 → 425 ms at 8,192KL and BFCLKL 0.0019 (16 bits), 0.0022 (--q4); BFCL 320 against 325, p = 0.551yes
ReLU² and residual addition fused into the GEMMs (GEMM_EPI)RTX 4080, CUDAprofiled prefill 469 → 463 ms at 8,192same bitsyes
Tile dedicated to the MoE latent GEMMs (TILE_LAT)RTX 4080, CUDAprofiled prefill 469 → 467 ms at 8,192same bitsno: 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, CUDAprofiled 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,766same bitsyes
Attention in two halves offset by half a tile (ATTN_PH=2)RTX 4080, CUDAattention −3.2% at 32,640; server 0.851 → 0.862 of vLLM (16 bits)same bitsyes
Dense GEMM tiles with two load stagesRTX 4080, CUDAdense 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 --q4same bitsyes
Router written as a GEMM (SCORE=gemm)RTX 4080, CUDArouter scores 16.7 → 14.3 ms at 8,192same bits as SCORE=mmano, see below
Chunked Mamba-3 scan on WMMARX 9060 XT, Vulkan+32% at 512, +6% at 32,640KL and BFCLBFCL 320 against 316 (16 bits), 295 = 295 (--q4)yes
Block of 2,048RTX 4080, Vulkan+34.5% at 2,048, +24% at 8,192, +11% at 32,640 (16 bits)KL and BFCLKL 0.0013; BFCL 308 against 319, p = 0.13yes, with the two AMD tracks
Mamba-3 scan in MLX form, folded anglesM3 Ultra, Metal+8 to +22%KL and BFCLsee the rejected trackyes
Block of 2,048M3 Ultra, Metal+8 to +9%same bitsidentical logits at 2,048 and 8,192yes
Factorized attention cache at decodeM3 Ultra, Metaldecode −19 to −31%KL and BFCLat the level of the defaultsno: slower
MoE group decoupled from the blockRTX 4080, CUDA16 bits: prefill 461 → 413 ms at 8,192, 2,477 → 2,462 ms at 32,640; --q4 unchangedsame bitsyes (HERBERT_OLALA_MOE_OVERLAY=0 restores the old one)
--q4 input experts decoded once per groupRTX 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 conditionKLextended gate, --q4: 0.00375 against 0.00388 on the 16 long, 0.00225 against 0.00225 on the short; 16 bits: same bitsyes, 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,192KLextended gate: 16 bits 0.00319 against 0.00354, --q4 0.00394 against 0.00380yes on NVIDIA with coopmat2
SSD slices of 128 and angle scan 3RTX 4080, Vulkan--q4 SSD class 153.5 → 145.0 ms at 8,192, 615.1 → 581.1 ms at 32,640KLextended 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,192KLextended --q4 gate: 0.00394 against 0.00412; 16 bits: same bitsyes 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,640KL12 short: 0.0018 against 0.0025; no extended gate on the RXyes on the RX
4 bits in a single product, experts included; blocks of 2,048Arc 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)KLextended --q4 gate (16 long, 36 short) against CUDA: passes against each track turned off alone, as against the old defaultyes 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 bitsPrefill --q4Decode 16 bitsDecode --q4
RX 9060 XT (Windows)4,386 / 5,922 / 5,158 / 2,6745,001 / 5,968 / 5,229 / 3,27385.0 / 85.8 / 78.7 / 60.2127.2 / 129.4 / 113.5 / 78.8
Arc 140V (Linux, Mesa 26.0.8)1,088 / 1,164 / 825 / 3391,063 / 1,087 / 791 / 33232.3 / 31.4 / 28.3 / 20.448.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...

  1. One level down: #000 an inference engine that writes its own code · 03-Oct-2026
  2. One level down: #001 a compiler for an LLM engine · 11-Oct-2026
  3. One level down: #002 the same compiler on a GPU · 18-Oct-2026
    1. One level down: #002.1 follow-up, the Arc in f16 · 02-Nov-2026
  4. One level down: #003 what CUDA has that Vulkan lacks · 25-Oct-2026
  5. One level down: #004 the same compiler on Apple's chips · 01-Nov-2026
  6. One level down: #005 Is Herbert better than Llama.cpp? · 15-Nov-2026
  7. One level down: #006 I started porting Olala, OVHcloud's model · 22-Nov-2026
  8. One level down: #007 Herbert against OVH's engines, on their own model · 29-Nov-2026
    1. One level down: #007.1 The rules: bits, KL, BFCL, and 4 bits · 29-Nov-2026
    2. One level down: #007.2 Graphics cards, one track at a time · 29-Nov-2026
    3. One level down: #007.3 The processor: AVX-512, AVX2 and SME · 29-Nov-2026
    4. One level down: #007.4 The option turned down, then accepted · 29-Nov-2026