§ 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

  1. · 9 min readMapping 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.
  2. · 15 min readRaising 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.
  3. · 12 min readA 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).
  4. · 9 min readRunning 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.
  5. · 11 min readMeasuring 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%).
  6. · 9 min readOne 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.
  7. · 8 min readChasing 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.

MetricValueUnitPostDate
Decode on the open stack — Qwen3-4B Q4_0, M2 Ultra, Linux
Upstream defaults (control)38.17-38.47t/sMapping Honeykrisp decode: +27%, and where the other half lives
Two environment knobsDMMV_WG=1 + SHADER_CORE_COUNT=6048.38t/sMapping Honeykrisp decode: +27%, and where the other half lives
Stock armthree local AGX compiler patches in every arm52.41tok/sA barrier after every dispatch
Barriers only where Vulkan asks (shipped default)63.26tok/sA barrier after every dispatch
ABI2 payload revision72.82tok/sMeasuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driver
Gate/up companion admitted84.04tok/sOne admission key: how a stalled GPU campaign found 16.8% in an afternoon
Vulkan (Honeykrisp)11.66 ms/token85.8tok/sChasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win
Direct runner, rebuilt (bypasses Mesa)9.98 ms/token100.2tok/sChasing 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 givenaround 160tok/sA barrier after every dispatch
Metal decode148tok/sMeasuring the dispatch tax: three dead hypotheses and +13% hiding in an open GPU driver
Metal decode148.5tok/sOne admission key: how a stalled GPU campaign found 16.8% in an afternoon
Metal decode7.71 ms/token, "Metal (macOS, reference)"129.7tok/sChasing 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 machine768.75tok/sMeasuring 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/s34µsMapping Honeykrisp decode: +27%, and where the other half lives
Fixed cost per operation, fittedwith 282 GB/s at the margin21.5µsA barrier after every dispatch
Cost of one barrier2.08x upper bound spread over 547 barriers18.1µsA barrier after every dispatch
Cost of one bit-7 barrier event20.7µsA barrier after every dispatch
Barrier drain, direct runner2.85 ms over 471 barriers≈ 6.05µsChasing 2.94ms: barrier drains, driver arms, and an accidental rebuild win
Same drain under macOS~2.3µsChasing 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 kernel126.5µsRunning Apple's compiled GPU kernels on the open driver
Apple binary on the open driver70.5µsRunning Apple's compiled GPU kernels on the open driver
Apple binary on Metal48.0µsRunning Apple's compiled GPU kernels on the open driver
Memory and the 284B model
Allocatable Vulkan storage, stock63.00GiBRaising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio
Allocatable Vulkan storage, wide + HK_SYSMEM151.00GiBRaising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio
284B decode, Q2_K-XLtg322.20t/sRaising 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 update3.15t/sRaising 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.7t/sRaising 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 envelope75.6 / 88.9WRaising 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.

GlossaryRDMA over a Thunderbolt cableAll reading paths

A wide horizon at dusk: layered hills in muted plum and ochre above a lake that holds the last light, a family of crested cranes at the water's edge, an acacia in silhouette and a single bright star above the ridge.