§ series · 7 posts
The Apple GPU on Linux.
A Mac Studio with an M2 Ultra runs Fedora Asahi Remix, and a small language model (Qwen3-4B) decodes on its GPU through Mesa's open-source Vulkan driver. The series measures why that runs at a fraction of the speed the same chip reaches under macOS, and removes the causes one at a time. Along the way it raises the driver's memory cap far enough to run a 284-billion-parameter model on the same machine.
Read in this order
The posts
- Mapping Honeykrisp decode: +27%, and where the other half livesTwo environment variables recover +27% of decode speed, and six further experiments rule out the usual explanations for the rest of the gap.
- Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac StudioAllocatable GPU memory goes from 63.00 to 151.00 GiB; a 284B model runs GPU-resident at 2.20 t/s, and at ~7.7 t/s after the 09-14 update.
- A barrier after every dispatch547 barriers per token take 52% of the time; emitting only the ones Vulkan asks for ships +20.7% (52.41 to 63.26 tok/s).
- Running Apple's compiled GPU kernels on the open driverApple's compiled matvec kernel runs on the open driver in 70.5 µs, against 126.5 µs for the driver's own kernel and 48.0 µs on Metal.
- Measuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driverThree launch-overhead theories are refuted; a revision of how injected kernels receive their inputs takes decode to 72.82 tok/s (+13.07%).
- One admission key: how a stalled GPU campaign found 16.8% in an afternoonOne missing admission key for Apple's kernel binary is worth +16.8%: decode reaches 84.04 tok/s.
- Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win471 barrier drains at about 6 µs each account for the gap to Metal; a rebuilt direct runner reaches 9.98 ms/token (100.2 tok/s).
One table
The scoreboard
The headline numbers from every post in the series, exactly as each post prints them. Where posts report the same quantity differently, each figure keeps its own row and the group is marked.
| Metric | Value | Unit | Post | Date |
|---|---|---|---|---|
| Decode on the open stack — Qwen3-4B Q4_0, M2 Ultra, Linux | ||||
| Upstream defaults (control) | 38.17-38.47 | t/s | Mapping Honeykrisp decode: +27%, and where the other half lives | |
| Two environment knobsDMMV_WG=1 + SHADER_CORE_COUNT=60 | 48.38 | t/s | Mapping Honeykrisp decode: +27%, and where the other half lives | |
| Stock armthree local AGX compiler patches in every arm | 52.41 | tok/s | A barrier after every dispatch | |
| Barriers only where Vulkan asks (shipped default) | 63.26 | tok/s | A barrier after every dispatch | |
| ABI2 payload revision | 72.82 | tok/s | Measuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driver | |
| Gate/up companion admitted | 84.04 | tok/s | One admission key: how a stalled GPU campaign found 16.8% in an afternoon | |
| Vulkan (Honeykrisp)11.66 ms/token | 85.8 | tok/s | Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win | |
| Direct runner, rebuilt (bypasses Mesa)9.98 ms/token | 100.2 | tok/s | Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win | |
Read this column as a sequence of different set-ups, not one tuned line. The barrier post's stock arm already carries three local compiler patches (its test bench says so), which is why its baseline sits above the decode-map control. The decode-map post's stat strip gives the same step as 38.5 → 48.9 t/s while its table gives 38.17-38.47 → 48.38. The dispatch-tax and fix-wave posts both describe the unpatched stock stack as 38 tok/s. The last two rows are the latest measurements (2026-09-26). | ||||
| Metal reference — the same model on the same Mac under macOSPosts disagree | ||||
| Metal decodethe post says the source of this figure is not given | around 160 | tok/s | A barrier after every dispatch | |
| Metal decode | 148 | tok/s | Measuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driver | |
| Metal decode | 148.5 | tok/s | One admission key: how a stalled GPU campaign found 16.8% in an afternoon | |
| Metal decode7.71 ms/token, "Metal (macOS, reference)" | 129.7 | tok/s | Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win | |
Four figures for one reference. 129.7 tok/s (2026-09-26) is the latest and the only one printed with its per-token time; the 160 figure is marked unsourced in its own post. None of the posts says why the reference changed, so each post's gap figure (about 2.5x on 09-18 and 09-21, 1.77x on 09-22, 2.27 ms on 09-26) is only comparable with the reference quoted in that same post. | ||||
| Prefill | ||||
| pp512 prefilldescribed as Metal parity on the same machine | 768.75 | tok/s | Measuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driver | |
| Fixed cost per dispatch and per barrierPosts disagree | ||||
| Fixed cost per dispatch, fittedt ≈ 34 µs + bytes/290 GB/s | 34 | µs | Mapping Honeykrisp decode: +27%, and where the other half lives | |
| Fixed cost per operation, fittedwith 282 GB/s at the margin | 21.5 | µs | A barrier after every dispatch | |
| Cost of one barrier2.08x upper bound spread over 547 barriers | 18.1 | µs | A barrier after every dispatch | |
| Cost of one bit-7 barrier event | 20.7 | µs | A barrier after every dispatch | |
| Barrier drain, direct runner2.85 ms over 471 barriers | ≈ 6.05 | µs | Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win | |
| Same drain under macOS | ~2.3 | µs | Chasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win | |
The two fitted fixed costs (34 µs and 21.5 µs) come from different posts and harnesses, and neither post reconciles them. The 18.1 µs and 20.7 µs barrier costs are on the Vulkan driver; the barrier post itself says the cost belongs to bit 7 rather than to the barrier as such. The 6.05 µs drain is on the direct runner, which keeps 471 barriers per token against the Vulkan driver's 547. | ||||
| One kernel — q4_0 matvec, 4096×14336 | ||||
| Honeykrisp's own kernel | 126.5 | µs | Running Apple's compiled GPU kernels on the open driver | |
| Apple binary on the open driver | 70.5 | µs | Running Apple's compiled GPU kernels on the open driver | |
| Apple binary on Metal | 48.0 | µs | Running Apple's compiled GPU kernels on the open driver | |
| Memory and the 284B model | ||||
| Allocatable Vulkan storage, stock | 63.00 | GiB | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
| Allocatable Vulkan storage, wide + HK_SYSMEM | 151.00 | GiB | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
| 284B decode, Q2_K-XLtg32 | 2.20 | t/s | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
| 284B decode, Q4_K-XL (MXFP4 experts)09-14 update | 3.15 | t/s | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
| 284B decode, unrolled chain on plain Vulkan128.8 ms/token, 09-14 update | ~7.7 | t/s | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
| Decode power, mean / peakof a roughly 370 W envelope | 75.6 / 88.9 | W | Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio | |
The 09-14 update in the same post reports that the 3.18 t/s control it first compared against was a CPU fallback, so ~7.7 t/s is the post's own floor for this model on this machine. It also reports that the model's output text was garbled in every configuration tested, and leaves the quality question open. | ||||
