Raising the Honeykrisp memory cap from 63 to 151 GiB, and the first 284B model on a silent Mac Studio
An M2 Ultra advertises a 97 GiB Vulkan heap but refuses allocations past 63 GiB. Two independent Mesa limits cause it, a VA layout that halves the heap and a RAM-fraction budget, and one patch plus one environment variable raise the cap. With 151 GiB addressable, a 284-billion-parameter MoE model runs GPU-resident on a Mac Studio drawing 89 watts with its fans silent, at 2.2 tokens per second, which is decomposed below. Updated 09-14: decode reaches 7.7 t/s. The update covers a quant comparison the cap made possible, three fused ops ported, a sign-table bug only the get-rows gate caught, a control that turned out to be a strawman, and live page-cache corruption caught by comparing two digests.

- Was called
- a 63 GiB wall under a 97 GiB heap
- Was
- two independent Mesa limits
The previous post on this machine ended with the decode campaign: +27% from two environment variables, and the conclusion that the remaining gap lay below the kernel source. This post starts from an unmeasured limit, removes it, and runs the largest model this machine has held. That model decodes slowly, and the slowness is decomposed below.
Test bench
The 63 GiB wall
The Vulkan device advertises a device-local heap of about 97 GiB. The probe stopped at exactly 63.00 GiB: 63 one-GiB buffers were allocated and bound, and the 64th was refused with VK_ERROR_OUT_OF_DEVICE_MEMORY. Single buffers of 60 GiB allocated fine, so the limit is not per allocation. Something between the heap and the driver cut the addressable space by a third.
Two limits
Reading the Mesa source against the probe numbers turned up two independent limits that bind at different points.
Limit one: the VA layout halves the heap. In
src/asahi/lib/agx_device.c, after computing a sparse read-only alias
divide, the code tests whether user_size == user_start and divides again.
On this device that equality holds, so the second divide leaves the main RW heap at 64 GiB. Each buffer-object VMA also takes a 16 KiB guard (agx_va.c adds one to every BO). 63 complete one-GiB allocations fit, and the guard overhead pushes the 64th over. The probe result and the source arithmetic agree: floor(64 GiB / (1 GiB + 16 KiB)) is 63.
Limit two: the heap budget is half of RAM. With the layout limit removed, the same probe stopped at exactly 95.00 GiB, half the machine's 190 GiB. hk_physical_device.c:1162 defines SYSMEM_HEAP_FRACTION(x) (x * 1 / 2). Mesa already ships an override, HK_SYSMEM=<bytes>, which the available documentation does not mention.
The fix
The layout limit needs a patch and the budget limit needs an environment variable. The patch adds an opt-in ASAHI_VA_MODE=wide branch to the layout function. It keeps every existing reservation (the robustness reservation, the USC heap, the kernel region, the guards) and decouples the sparse alias stride from the RW heap length, which yields a 152 GiB main window. The default branch is untouched. An unknown value or no value gives the original layout, and the patched driver with no override measures exactly 63.00 GiB with byte-identical behavior.
Both levers are required. HK_SYSMEM alone on the stock driver still hits the 63 GiB VA wall, and wide alone hits the 95 GiB budget. The Vulkan loader ignores ICD manifests on some mount points, so the patched driver must be registered in /usr/share/vulkan/icd.d/ to load.
No performance cost
The same 4B benchmark with the same binary and flags, changing only the driver:
A compute-copy kernel and an FMA-chain kernel agree to three digits: 173.53 vs 173.46 GB/s copy and 2577 vs 2576 GFLOP/s. The patch changes address layout and not data movement, and all three measurements are consistent with that.
The 284-billion-parameter model
DeepSeek-V4-Flash Q2_K-XL is a 90.18 GiB, 284.33-billion-parameter mixture of experts with 43 blocks, 256 experts each, 6 routed plus 1 shared per token, and MLA attention. It could not load on this machine before the change, and the first attempt died with BO creation failed. With the cap at 151 GiB:
The model is fully GPU-resident at 97 GiB of resident memory in steady state. While decoding the 284-billion-parameter model, the Mac Studio draws 75.6 watts mean and 88.9 peak, of a roughly 370-watt envelope, with the fans at idle speed.
Decode at 2.2 tokens per second
The decode rate is low, and it decomposes cleanly. The GGUF header gives 10.46 billion active parameters per token, about 3.94 GiB of weights streamed per token. The perf-logger breakdown of one 455-millisecond token:
| component | ms | note |
|---|---|---|
| iq2_xs expert GEMMs | 136.6 | 84 calls, 8.0 GB/s effective |
| iq3_xxs expert GEMMs | 28.6 | 138–216 GFLOP/s |
| all other matmul | 45 | dense projections, router, embed |
| matmul total | 210.1 | |
| non-matmul | ~245 | attention, norms, copies, graph scheduling |
| token | 455 |
The expert kernel is the main problem. The same GPU streams dense Q4_0 matvec at a fitted 290 GB/s but moves expert weights at 8.7 GB/s end-to-end, which is 33 times slower, on the op that owns 65% of the matmul time. The non-matmul budget is the other half. Every block carries an unfused hash-comb chain of roughly 280 source-graph operations per layer, about 12,000 per token, because the Vulkan backend has no fused implementation of that operation. CPU and CUDA have one. This is a bounded gap that could be closed upstream.
The roofline for this active-parameter set on this machine is about 74 tokens per second. The distance to it now consists of three named problems.
A driver bug at model scale
At 90-gigabyte scale the wide driver has a defect. Every buffer-object VMA carries a 16 KiB guard, a model allocates buffers per tensor, and setup and teardown each take one ioctl per VMA. Loading a 90 GB model freezes for minutes in ASAHI_VM_BIND, and userspace CPU time stops advancing. Killing the frozen process strands its exit in exit_mmap, which leaves 149 GiB of kernel-held shmem with no owner and no userspace recovery short of a reboot. The kernel logs warnings in drm_gem_shmem_get_pages_sgt under this pattern. The 4B model is unaffected (49.27 t/s, champion speed), so the bug is a VMA-count pathology. The likely fix is buffer coalescing, meaning fewer and larger allocations, which would also reduce the per-dispatch overhead the decode campaign fought.
Splitting across two GPUs
With both caps measured, 151 GiB on the Mac and 81 GiB on the Strix Halo, the same model now splits across both GPUs over the Thunderbolt fabric. A rebuilt RPC server advertises the Mac's Vulkan heap (the old build advertised CPU memory), and a client on the Strix Halo places layers on both GPUs over the verbs path. On the 4B model this generated coherent text at 33.5 tokens per second. Weights do not cross the cable. Only activations do, about 10 KiB per token against a measured 20-microsecond one-way latency.
Raw hardware throughput
A minimal compute probe with no llama.cpp and no models, only a copy kernel and an FMA chain, tests whether the driver is the bottleneck:
| machine | copy (vec4) | FMA64 |
|---|---|---|
| M2 Ultra, stock driver | 178.8 GB/s | 2 577 GFLOP/s |
| M2 Ultra, wide driver | 178.8 GB/s (identical) | — |
| Strix Halo, RADV | 182.7 GB/s | 2 960 GFLOP/s |
On identical shaders the two machines agree to about two percent. Raw hardware and both drivers perform as expected, so the 20–33× expert-kernel gap lies in the kernels, the dispatch and the graph. The next campaign targets those.
Reproducing the cap fix
Power and temperature were monitored throughout: system draw, SoC rail, both fans and every channel the SMC exposes. Nothing in this work approached a thermal or power limit, so the ceilings here are structural.
Update, 2026-09-14: decode at 7.7 t/s, one bug caught, one correction
The previous section named three problems: the expert kernel, the dispatch, and the unfused graph chain. Work on the graph chain moved decode from 2.20 to 7.5+ tokens per second. It also exposed a measurement trap that matters more than the speedup, and it ended with a quality question still open.
Quant comparison enabled by the cap
The 151 GiB window admits a second quantization of the same model that did not fit before: Q4_K-XL with MXFP4 experts, 144.44 GiB on disk, four GiB under the raised cap. Same binary, same flags, both GPU-resident:
Decode improves 43% from the faster dequant despite 1.6× the bytes. The expert kernel's cost is bound by dequant structure and not by bytes. Nibble unpacking beats the 512-entry codebook lookup that 2-bit compression needs on a GPU with no integer dot product. Prefill is flat, as expected, because prompt processing was never bound by expert dequant. The cap raise is what made the faster arm possible. On the stock 63 GiB driver neither the Q4_K file nor this comparison can run.
Three custom ops
The "hash combiner" chain decomposes into three custom graph ops, HC_PRE, HC_COMB and HC_POST, for which the Vulkan backend had no handlers. Each became a small compute shader with an admission gate (literal contiguous F32 layouts only; every other shape falls back to the existing path). All three are env-gated behind GGML_VK_HC_COMB=1 and off by default.
The correctness gates matter more than the shaders. HC_COMB runs 20 rounds of Sinkhorn normalization whose error compounds, so it gets 23 strict parity cases against the CPU reference. The inputs are adversarial (equal values, huge opposite logits, subnormals, zero and negative scales) at three batch sizes, with an absolute-plus-relative tolerance. HC_PRE and HC_POST follow the same pattern. All pass, and startup banners confirm dispatch in the live server.
The gate caught a bug the speed benchmark could not see. An earlier "port CUDA's sign table" optimization of the iq2_xs dequant passed the entire matmul suite (991/991) while being wrong. The Vulkan reference computes its sign byte as sign7 | (popcount(sign7) << 7), a full popcount with values spanning ten bits, while CUDA's 128-entry byte table encodes only parity. The difference appears in one lane of sixteen (iqs % 8 == 7, second element). The matmul path never reads that lane and the get-rows path does. The matmul gate passed on a wrong table, and the get-rows gate caught it in one run. A table port is valid only where the table can represent the full range of the original function, and the proof can live in a different consumer of that function.
A/B and correction
Same binary, same model, one environment variable apart:
That is +137%. The controls reproduced to the second digit across both A/B pairs. The comparison is also a strawman.
The model builder has two paths for each HC stage: the fused custom op, and an unrolled chain of ordinary views, mul and add operations. An auto-probe at context creation disables the fused ops when no backend supports them. Benchmark defaults fuse them on, so with the kernels off the ops fell back to the CPU. The 3.18 control measured the model moving those three ops to the host every token. The unrolled chain, executed natively on the GPU by ordinary Vulkan ops, decodes at ~7.7 t/s (128.8 ms/token) with no kernels at all. The kernels reach parity with that chain and do not beat it.
The decode floor for this model on this machine is ~7.5–7.7 t/s either way. The 2.2 → 3.2 quant result stands on its own A/B. The kernels leave behind a proven admission gate, a strict-parity harness, and three fewer graph ops that need the CPU. The measurement lesson is that when a control is produced by a feature-flag fallback, the improvement may be measured against the fallback and not against the best path the system already had.
Garbled output: not the kernels
Serving the model and reading what it writes, which no throughput benchmark does, showed degenerate text. Greedy decoding emits <<<<<<< repeats and multilingual soup. The attribution matrix had six cells: two binaries (with and without every patch from this campaign), both model files, mmap and direct-IO loads, GPU-only and CPU-only, fused ops on and off, and the attention indexer enabled and disabled. All six garble identically. The patch-free binary garbles the same way with none of the new code in it, so the kernels are not the cause.
The search produced two findings. First, the Mac's page cache returned wrong data: a page-cache read and an O_DIRECT read of the same unchanged file disagree in 39,758 bytes, with the disk verified clean. A five-minute command shows whether the cache is currently wrong:
Load modes that bypass the cache (--load-mode dio) cost nothing and are now used everywhere on that host. Second, the remaining suspects are the converted model files themselves or the fork's model graph, neither of which was quality-gated before this work. A perplexity probe is the next instrument. Every speed number above is a throughput measurement, and weight values do not change dequant timing. The quality question is open.
