Skip to main content

Engineering Report · 25 Nov 2026 · Apple M4 Max · v1.2 · CC BY 4.0

Single-copy ANE weight sharing for local 27B inference.

Offloading dense MLP prefill to Apple's Neural Engine more than doubles prompt speed on a Mac, but duplicates all 64 MLP layers in unified memory (25.20 GiB active vs 16.41 GiB GPU-only), causing XNU's VM compressor to thrash 343.5 GiB during 66k prefill and fault 9.06 GiB during decode on a 48 GiB M4 Max. We built a zero-Python C++20 and Metal runtime (mometal) that compiles 64-layer 4-bit ANE MLPs natively in 7.2–8.4 s and reads CoreML's model.hwx directly during GPU decode. Verified on AC power via XNU's byte-exact footprint --wired and vm_stat, single-copy sharing cuts wired memory by 8.90 GiB vs 2-copy (and v1.2 trims another 1.5–1.7 GiB to reach 0.00 GiB swap at 128k), reaches 707 tok/s exact 4k prefill (645 tok/s at 512, +81%), hits 98.2 tok/s greedy decode (118.9 on py_lru; 91.6 on exact g64), and adds universal M1–M5 Wave 3 NF4 cutting WikiText-2 KL by −44.3% (92.8% top-1 agree) at 41.6 ms M=8 decode.

Checkpoint Qwen3.8-27B-pi-adapted (MLX Q4)Hardware Apple M4 Max, 48 GiB (AC power)OS macOS 27.0 (26A428)Memory unit Binary GiB (bytes / 1024³)
707 tok/sexact 4k PF · 645 @ 512 (+81%)98.2 tok/sv1.2 greedy (118.9 py_lru · 38.9 ms M=8)0.00 GiBswap @ 128k (−8.90 GiB wired vs 2-copy)−44.3% KLWave 3 NF4 (92.8% top-1 · M1–M5)Preserves the full v1.1 n=3 interleaved AC-power 3-mode proof (622 cold 3.7k, 93.8 greedy, 91.6 exact g64, −8.90 GiB wired delta via footprint -f bytes --wired --swapped & vm_stat) alongside verified v1.2 release results: 10/10 green 256 → 128k sweep, 98.2 tok/s 4-task greedy, 550–629 ms warm load (2.7× faster), 7.23 / 8.39 s zero-Python C++ build-ane, and Wave 3 M1–M5 NF4.

Results

Three mometal modes and five peers

All benchmarks ran sequentially on one Apple M4 Max (48 GiB unified RAM) serving netprojects/Qwen3.8-27B-pi-adapted-MLX-4bit — harness-hub/Qwen3.8-27B-pi-adapted (an RL LoRA fine-tune for the pi coding agent) merged into Qwen/Qwen3.8-27B and quantized to MLX 4-bit affine group-64 (g64, 4.5 bpw) with Qwen's bundled 228 MiB multi-token prediction (MTP) head.1

Comparing our GPU-only exact g64 mode directly against peers isolates what actually drives each number. Across n=3 interleaved AC-power restarts on identical g64 weights (matching TensorFold and pmetal's greedy SHA-256 on 1 of 4 tasks, C++ refactor 3d678dbd2c6c), GPU-only mometal hits 91.6 tok/s greedy 4-task mean (range 91.1–91.8; +35% over mlx-serve at 68.1 tok/s, 3.4× over mlx-lm) and 271.5 tok/s cold 3.7k prefill inside 16.41 GiB. That shows the decode lead is independent of ANE and hf4, coming from our Metal decode and speculative tree path rather than weight sharing.

Turning on 1-copy ANE-Share (hf4) keeps active memory at 16.24 GiB (0 B swapped) and lifts cold 3.7k prefill 2.3× to 621.9 tok/s (n=3 AC median, range 620.2–623.7; 629.1 tok/s without --cache-dir; 684.7 tok/s at 4,077 tokens), while reaching 93.8 tok/s greedy mean (range 93.8–94.0) on 4.0 bpw per-channel hf4 MLPs.2 Notice that 2-copy ANE + g64 reaches 95.2 tok/s on the exact same greedy token stream as GPU-only g64 (91.6 tok/s) across all three interleaved trials, likely because offloading the 3.7k and 284-token prefills to ANE avoided 13.7 s of full-power GPU heating immediately before decode. Because hf4 weights produce a different greedy token stream from g64, we report exact g64 alongside hf4 and measure the full quality delta in Section 3.

v1.2 release step-up: Keeping the original n=3 interleaved v1.1 rows below as the controlled three-mode baseline, v1.2 pushes 1-copy hf4 significantly further across every regime—lifting 4-task greedy decode from 93.8 to 98.2 tok/s (py_lru 118.9, cpp_refactor 113.4, cpp_spsc 86.6, prose 73.8 tok/s; sampled T=0.7 py_lru 121.4 tok/s), cold 3.7k prefill to 646 tok/s (5.75 s; exact 4,096 tokens: 707.2 tok/s), warm model load down to 550–629 ms (2.7× faster than v1.1's 1.5–1.8 s; server ready in 1.04 s), and FULL M=8 verify down to 38.89 ms while cutting phys_footprint by another −1.5 GiB (6.22 GiB post-decode / 14.08 GiB wired; 5.05 GiB with --mtp off, −2.32 GiB).

Throughput and exact physical memory across Apple Silicon runtimes

mometal v1.2 (1-copy hf4)Shared ANE hwx · 14.21 GiB · 707 @ 4k
646 tok/s5.75 s TTFT
mometal v1.1 (1-copy hf4)n=3 AC median · 16.24 GiB · 685 @ 4k
622 tok/s5.98 s TTFT
mometal (2-copy ANE)ANE hf4 PF + g64 dec · 25.20 GiB · n=3 AC
465 tok/s8.00 s TTFT
mometal (GPU-only g64)Exact g64 weights · no ANE · 16.41 GiB · n=3
272 tok/s13.69 s TTFT
mlx-serve v26.11.3GPU-only Zig/MLX · exact g64 · KV8
263 tok/s14.14 s TTFT
oMLX v0.8.3GPU-only Python/MLX · exact g64
260 tok/s14.27 s TTFT
mlx-lm v0.31.3Apple Reference MLX · exact g64
256 tok/s14.52 s TTFT
pmetal v0.7.1GPU-only Rust/Metal · exact g64
254 tok/s14.64 s TTFT
TensorFold v1.3.4GPU-only Zig/Metal · exact g64
233 tok/s15.93 s TTFT
FIG. 1 · COLD 3,717-TOKEN PREFILL (WITH PREFIX CACHE WRITE)

Unique-salted prompt guaranteeing a cache miss on AC power. mometal v1.2 (1-copy hf4) reaches 646 tok/s cold 3.7k (5.75 s TTFT) and 707.2 tok/s on exact 4,096 tokens (644.9 tok/s at 512, +80.9% vs v1.1). The three v1.1 rows preserve the balanced interleaved n=3 fresh-restart AC medians (1-copy range: 620.2–623.7 tok/s; 2-copy: 450–497 with --cache-dir under 25.2 GiB pressure).

Head-to-head table · Qwen3.8-27B-pi-adapted (4-bit) on M4 Max 48 GiB
EngineMLPs / KVCold 3.7k PFWarmGreedyPy T=0.7Total GiB
mometal v1.2 (1-copy)Release · AC · 14.08 GiB wired · 0 swaphf4 / KV8646 tok/s255 ms98.2 tok/s121.4 tok/s14.21 GiB
mometal v1.1 (1-copy)ANE-Share · n=3 AC · 15.05 GiB wiredhf4 / KV8622 tok/s205 ms93.8 tok/s102.5 tok/s16.24 GiB
mometal (GPU-only)Exact g64 control · n=3 AC · 15.21 GiB wiredg64 / KV8272 tok/s198 ms91.6 tok/s116.7 tok/s16.41 GiB
mometal (2-copy ANE)n=3 AC · 23.95 GiB wired · 1.13 GiB swaphf4+g64 / KV8465 tok/s267 ms95.2 tok/s117.9 tok/s25.20 GiB
mlx-serve v26.11.3Zig/MLX 0.32.5 · MTP + warmup-fullg64 / KV8263 tok/s173 ms68.1 tok/s70.1 tok/s16.48 GiB
oMLX v0.8.3Python/MLX 0.32.4 · MTP · prefix cacheg64 / BF16260 tok/s314 ms64.0 tok/s68.4 tok/s18.44 GiB
TensorFold v1.3.4Zig/Metal · repacked MTP-6 · 32k allocg64 / BF16233 tok/s69 ms57.7 tok/s59.9 tok/s21.88 GiB
pmetal v0.7.1Rust/Metal+MLX · autoregressiveg64 / BF16254 tok/s14,809 ms28.5 tok/s28.1 tok/s19.69 GiB
mlx-lm v0.31.3Apple reference MLX 0.32.1 · ARg64 / BF16256 tok/s187 ms27.3 tok/s27.6 tok/s17.35 GiB

Single-copy sharing

Kernel memory proof and 256–128k scaling

Running 27B MLP prefill on the Neural Engine requires CoreML to compile all 64 MLP blocks into 64 model.hwx binaries totaling 7.99 GiB (8,579,448,832 B) plus 0.71 GiB of IOSurface I/O buffers (8.70 GiB in XNU's neural ledger). In naive 2-copy mode, Metal GPU decode still wires all 15.40 GiB of .safetensors—duplicating the 64 MLP layers (8.93 GiB) and pushing active physical memory to 25.20 GiB (23.95 GiB wired).3

To eliminate the duplicate MLP copy, mometal parses macOS 26A428's undocumented Mach-O (0xbeefface) __KERN 16-chunk round-robin asymmetric INT4 layout inside /Library/Caches/com.apple.aned/.../model.hwx, runs a boot-time spot check against weight.bin (32-byte group-0 fingerprint plus two 32-byte sampled-group checks at the midpoint and final group of all 16 projections per layer; ~215 ms across 8 threads), and maps those 64 files read-only with MAP_SHARED. SafetensorsStore then creates page-aligned Metal sub-buffers only for non-MLP tensors, leaving the 8.93 GiB of duplicate .safetensors MLPs unmapped and unwired.4

Rather than assuming com.apple.aned shares physical pages with our process, we verified it on AC power directly with footprint -f bytes --wired --swapped, vm_stat, lsof, and /usr/libexec/aned RSS across GPU-only, 2-copy, and 1-copy runs (raw dumps saved in benchmarks/raw_ac_proof/ and published below). Immediately after a 3.7k prefill and 64-token decode, 2-copy mode reports 192 unmapped neural regions totaling 9,335,472,128 B (8.69 GiB). In 1-copy mode, unmapped neural drops to 128 I/O regions (759,169,024 B = 0.71 GiB), and the remaining 8,579,448,832 B (7.99 GiB, matching lsof on the 64 model.hwx files to the exact byte) moves into shared wired mapped file while aned RSS stays at 6.6 MiB. Process wired RAM drops −8.90 GiB (23.95 → 15.05 GiB), matching the system-wide vm_stat wired delta drop of −8.90 GiB (+23.98 → +15.08 GiB). Note also a CoreML subtlety our raw dumps exposed: after ~20–30 s of pure GPU decode, CoreML marks unused ANE regions Reclaimable (dropping 2-copy's idle neural ledger to 4 MiB until the next prefill re-wires it, while 1-copy keeps all 7.99 GiB of model.hwx wired because GPU decode actively reads it).

AC-power XNU memory & paging proof · footprint -f bytes --wired & vm_stat (binary GiB)
State (AC power)phys_fpneuralTotal GiBProc wiredvm ΔwiredSwappedPF / Dec
GPU-only g64 (4k active)0 neural regions · aned 2.5 MiB · n=3 AC speeds16.410.0016.4115.21+15.251.10*272 / 91.6
2-copy ANE + g64 (4k active)192 unmapped neural · 630 PF w/o --cache-dir16.518.6925.2023.95+23.981.13465 / 95.2
1-copy ANE-Share (4k active)7.99 shared file + 128 I/O · 0 comp · aned 6.6 MiB7.548.7016.2415.05+15.080.00622 / 93.8
2-copy ANE + g64 (66k)69,632 KV · 343.5 GiB PF comp · 9.06 GiB dec decomp18.708.6927.4026.13+26.021.16312 / 37.0
1-copy Dense (66k)69,632 KV · 0 PF comp · 4 MiB dec decomp (63 pageins)9.798.7018.4917.26+17.330.00390 / 45.9

*4k memory rows were captured immediately after 3.7k prefill + 64-token decode on AC power (before CoreML's idle timer marks 2-copy's neural regions reclaimable); 4k PF/Dec columns show the interleaved n=3 AC medians (--cache-dir on). The ~1.10 GiB swapped in g64 modes is cold vision-tower .safetensors pages compressed out under 15.4 GiB IOAccelerator load; 1-copy holds only 6.49 GiB IOAccelerator and triggers zero compressions. 66k rows ran fresh servers with --cache-dir off on 65,867-token WikiText-2 prompts.

ON DISK · SHARED UNIFIED MEMORYNon-MLP .safetensors6.49 GiB · exact g64 sub-buffersDuplicate g64 MLPs (8.93 GiB)UNMAPPED · NEVER WIREDmodel.hwx (hf4 / nf4, 64L MLPs)7.99 GiB · single wired MAP_SHAREDAttention, GDN & MTP48 GDN + 16 GQA + 1 MTP (228 MiB)__KERN parser + spot check32B hdr + 2×32B groups · zero-copyEXECUTION · 16.24 GiB (15.05 WIRED)Metal GPU Decode (T7 + BitScreen)ane_hf4/lut4 swiglu + down_sk4 (s_lut2)98.2 TOK/S GREEDY · 0 B SWAP @ 128KApple Neural Engine Prefill0.71 GiB I/O + same 7.99 GiB hwx645 @ 512 (+81%) · 707 TOK/S (4K)DIRECT VIA COM.APPLE.ANED
FIG. 2 · SINGLE-COPY MEMORY MAP

CoreML/com.apple.aned executes model.hwx directly on the Neural Engine while Metal GPU decode reads the exact same 7.99 GiB wired physical pages through our __KERN parser and boot-time spot check (verified byte for byte via footprint --wired and lsof). Attention, GatedDeltaNet, embeddings, lm_head, and MTP remain exact g64.

Measured active physical memory at 4k load on AC power (binary GiB)

2-copy ANE + g64 decode (23.95 GiB wired)16.51 phys + 8.69 neural = 25.20 GiB
Non-MLP 6.5
Dup g64 MLPs 8.9
1.1
Neural 8.7
GPU-only exact g64 (no ANE, 15.21 GiB wired)16.41 phys = 16.41 GiB
Non-MLP 6.5
g64 MLPs 8.9
1.0
1-copy ANE-Share hf4 (15.05 GiB wired, 0 B swapped)7.54 phys + 8.70 neural = 16.24 GiB
Non-MLP 6.5
1.1
Shared hwx 8.0 + I/O 0.7
−8.96 GiB saved
Non-MLP + Metal buffers (6.49 GiB)Eliminated dup MLPs (8.93 GiB)Shared hwx (7.99) + ANE I/O (0.71)KV8 + GDN + scratch (1.06 GiB)
FIG. 3 · UNIFIED MEMORY FOOTPRINT (AC POWER, BYTE-EXACT)

Every bar is scaled to 25.20 GiB from footprint -f bytes --wired --swapped immediately after 3.7k prefill and 64-token decode on AC power (v1.1 AC proof). v1.2 trims phys_footprint an additional −1.5 GiB (7.54 → 6.05 GiB at 256–1k, 14.62 GiB wired; 5.05 GiB with --mtp off) via lazy Vision Tower, bundled MTP deduplication, MTLHeap scratch aliasing, and half2 KV scales.

The live kernel cost of 2-copy becomes unmistakable at long context. On AC power with 18.70 GiB free at idle, running a fresh 65,865-token prompt (69,632-slot KV tier, --cache-dir off) in 2-copy mode wires 26.13 GiB (27.40 GiB total, 1.16 GiB swapped). Capturing vm_stat right before prefill, at the first streamed token, and at the end of decode exposes the exact mechanism: during 66k prefill, XNU evicts and compresses the GPU's g64 weights to make room for ANE, thrashing 22,509,629 compressions (343.5 GiB) and 22,027,633 decompressions (336.1 GiB) and slowing prefill from 389.7 → 311.9 tok/s (−20%, +42.2 s). The moment decode begins, XNU faults 593,657 decompressions (9.06 GiB) and 11,012 pageins back into wired RAM (+11.40 GiB wired jump), cutting decode from 45.9 → 37.0 tok/s (−19%). Single-copy ANE-Share stays at 17.26 GiB wired (18.49 GiB total) with zero compressions during prefill, 264 decompressions (4 MiB) and 63 pageins during decode (2,249× fewer decompressions), and 0 B swapped, scaling cleanly across an isolated AC-power 4k–128k sweep up to 126.6k tokens in 21.18 GiB.5

Across all five isolated context lengths (4k–128k), prefill drops smoothly from 684.7 tok/s (5.95 s) at 4k to 273.2 tok/s (463.25 s, −26.0 s faster than our earlier build) at 126.6k, matching T(L) = 1.38·L + 0.0180·L²/1k (ms) to within 0.50% across every point, with the linear/quadratic crossover at 76.4k tokens. Because our new encode_mtp_kv_prime pass skips the unused 17th full-attention layer during prefill (Section 4), only 16 full-attention layers execute O(L²) attention (3,150 TFLOPs at 126.6k, 62.4% of prefill time), cutting the quadratic coefficient from 0.0190 → 0.0180 (−5.3%, matching 16/17) and implying ~10.9 TFLOPs of sustained FP16 simdgroup_matrix attention (vs ~15.0 TFLOPs pure tiled GEMM; derived from the fit, not hardware counters).6

v1.2 full 10-point 256 → 128k sweep (10/10 green): Across ten fresh-restart context points from 268 to 128,078 tokens (10/10 passkey recall, 10/10 64-layer single-copy), v1.2 beats the pre-v1.2 baseline on all 10 decode points and every mid/long prefill point. Single-half tail absorption (524 → 256+268 instead of double-padding both halves past a 64-row tile) and lock-free dispatch_group_t ANE pipelining catapult 512 prefill +80.9% (356.5 → 644.9 tok/s, TTFT 1.47 → 0.81 s) and push 1k to 674.4 tok/s (+18.9%), 2k to 673.7 tok/s (+13.3%), and exact 4,096-token bench prefill to 707.2 tok/s (658.2 in the 4,106-token sweep). At short context (N=256), our asymmetric qs={1,0} ANE+GPU split (192 tokens on ANE overlapped with 64 tokens on 376 GB/s AMX M=8 micro-batches) lifts pure bench prefill +19.5% to 414.8 tok/s. On long-context decode, lean-SRAM 4-barrier gqa6 (128k M=8/4/1: 34.25 / 18.82 / 10.57 ms, −11% to −18%), full-context 1-layer MTP KV4, and a shared-base T7 bandit fix lift dense decode to 53.4 tok/s at 64k (+21.6%) and 37.5 tok/s at 128k (+7.4%, 71.0 ms/rnd)—while cutting phys_footprint by −0.94 to −1.70 GiB and driving 128k swap from 1.17 GiB to 0.00 GiB with 8.31 GiB of ANE weights kept resident.

Opt-in Quest query-aware block-sparse decode (measured in v1.1 at the recommended 64k+ budget --sparse-kv-budget 12288, reusing exact Dense .micache checkpoints via shared prefix hashing) remains available for workloads trading slight output divergence for ~57–61 tok/s at 64k–128k (toggle the table below to inspect both the full 10-point v1.2 sweep and the v1.1 Dense vs Quest-12k comparison).

v1.2 full 10-point 256 → 128k sweep · AC power · 1-copy ANE-Share KV8 (10/10 needle, 10/10 64L share)
ContextPromptPrefill (TTFT)Decode (ms/rnd)phys_fpWired GiBSwap GiB
256needle 1/1 · 64/64 share268347.0* tok/s0.77 s (414.8 bench)71.1 tok/s43.9 ms (+3.2%)6.06 GiB−1.49 GiB14.62+8.70 neural0.03
512needle 1/1 · 64/64 share524644.9 tok/s0.81 s (+80.9%)84.8 tok/s44.4 ms (+5.9%)6.05 GiB−1.50 GiB14.62+8.70 neural0.00
1kneedle 1/1 · 64/64 share1,034674.4 tok/s1.53 s (+18.9%)82.0 tok/s46.6 ms (+10.7%)6.06 GiB−1.52 GiB14.62+8.70 neural0.00
2kneedle 1/1 · 64/64 share2,058673.7 tok/s3.05 s (+13.3%)74.9 tok/s45.0 ms (+10.1%)6.13 GiB−1.45 GiB14.69+8.70 neural0.00
4kneedle 1/1 · 64/64 share4,106658.2 tok/s6.24 s (+5.9%)62.5 tok/s51.9 ms (+1.1%)6.20 GiB−1.38 GiB14.76+8.70 neural0.02
8kneedle 1/1 · 64/64 share8,202654.5 tok/s12.53 s (+5.5%)66.9 tok/s49.7 ms (+10.0%)6.33 GiB−1.55 GiB14.90+8.70 neural0.01
16kneedle 1/1 · 64/64 share16,396604.7 tok/s27.11 s (+4.1%)66.4 tok/s53.6 ms (+6.9%)7.09 GiB−0.94 GiB15.65+8.70 neural0.02
32kneedle 1/1 · 64/64 share32,780514.0 tok/s63.77 s (+2.4%)52.8 tok/s55.8 ms (+5.4%)7.64 GiB−0.99 GiB16.20+8.70 neural0.04
64kneedle 1/1 · 64/64 share65,548396.1 tok/s165.47 s (+4.2%)53.4 tok/s63.9 ms (+21.6%)8.74 GiB−1.09 GiB17.30+8.70 neural0.03
128kneedle 1/1 · 64/64 share128,078278.9 tok/s459.18 s (+3.4%)37.5 tok/s71.0 ms (+7.4%)10.39 GiB−1.70 GiB18.55+8.31 neural0.00

*Every row restarted a fresh mometal serve process on AC power (deltas vs identical Pre-v1.2 baseline sweep). At 256 (268 tokens with chat template), client serve TTFT includes first-token decode + HTTP framing (0.77 s); isolated mometal bench prefill reaches 414.8 tok/s at exact 256 (+19.5%) and 707.2 tok/s at exact 4,096. At 128k, swap drops from 1.17 → 0.00 GiB while keeping 8.31 GiB of ANE weights resident (64k swap: 0.82 → 0.03 GiB; raw JSON in starmo-mometal-v12-sweep-2026.json).

Quality evaluation

Measuring Wave 3 NF4, hf4 and Quest tradeoffs

Apple's Neural Engine achieves full W4A8 prefill throughput on M4/M5 using per-channel asymmetric INT4 weights (hf4, 4.0 bpw with SmoothQuant and MSE clipping) rather than Metal's group-64 affine format (g64, 4.5 bpw). Because single-copy sharing reuses those compiled model.hwx MLPs during decode, we measured the exact quality delta directly against g64 on both language modeling and executed code.7

On eight evenly spaced WikiText-2 test passages (256-token prefill followed by 256 scored decode steps each; 2,048 scored tokens total), KV8 is nearly lossless (+0.003–0.007 PPL), while moving the 64 MLPs from 4.5 bpw g64 to v1.1 4.0 bpw hf4 increases perplexity by +0.23 (+2.98%, mean KL 0.0623, median KL 0.0299, 88.92% top-1, 99.56% top-5 preservation). On the full 164-problem HumanEval coding suite (greedy T=0.0, unit tests executed in isolated Python subprocesses), pass@1 moves from 92.07% (151/164) to 88.41% (145/164), with 93.9% exact per-problem outcome agreement (143 both pass, 11 both fail, 8 only g64, 2 only hf4).

Wave 3 NF4 quality breakthrough: Probing M4 ANE's compiler exposed a decisive hardware fact: blockwise g=128 affine quantization falls back to CPU (no .hwx), but non-uniform NormalFloat-4 palettization (--format nf4, constexpr_lut_to_dense) executes 100% on the Neural Engine at exact 0.5029 B/wt across M1–M5, embedding the 16-entry FP16 NF4 table directly in chunk header bytes [0..31]. On the identical 2,048-token WikiText-2 benchmark, nf4 cuts mean KL divergence vs exact g64 BF16 by −44.3% (0.0623 → 0.0347; median KL −49.3% to 0.0152) and lifts top-1 argmax agreement by +3.90 pp (88.92% → 92.82%, with 99.85% top-5 preservation). Paired with our 1 KB byte-pair threadgroup LUT (s_lut2[256], 0 B extra SRAM, 2.12× faster than simd_shuffle), nf4 hits 41.64 ms FULL M=8 decode (337.6 / 331.0 GB/s) and 429.6 tok/s 4k prefill on M4 Max. Note that MSE-clipped tail sharpness leaves raw NLL slightly above v1.1 hf4 (8.070 vs 8.016 PPL) even as full-vocabulary KL and argmax fidelity jump sharply; HumanEval pass@1 has not yet been re-run on nf4.

Quality evaluation · WikiText-2 (2,048 scored tok) & HumanEval (164 problems)
Configuration64L buildWT-2 PPLMean KLMed KLTop-1Top-5 / HE
Exact g64 (BF16 KV, reference)4.5 bpw MLPs · GPU-only (272 tok/s PF)—7.78730.00000.0000100.00%92.07% HE151/164
1-Copy Wave 3 NF4 (KV8)0.503 B/wt M1–M5 · 41.6 ms M=8 · 430 tok/s 4k PF7.23 s8.07030.0347−44.3% KL0.0152−49.3%92.82%+3.90 pp99.85% top-5HE unmeasured
1-Copy v1.2 hf4 (KV8, fixed SQ/zp)0.503 B/wt M4/M5 · 38.9 ms M=8 · 688–707 tok/s 4k8.39 s8.24850.0550−11.7% KL0.025389.75%+0.83 pp99.80% top-5argmax∈ref5
1-Copy v1.1 hf4 (KV8, on-disk)4.0 bpw MLPs + KV8 · v1.1 baseline & HumanEval16.9 s*8.01640.06230.029988.92%88.41% HE145/164 · 99.56% t5

*v1.1 originally converted MLPs in 4.0 min via Python; v1.2's initial C++ builder took 16.9 s and its ARM64 NEON L1 row-streaming builder cuts 64-layer conversion to 8.39 s (hf4, 2.0×) and 7.23 s (nf4, 2.3×). BF16 KV controls match within 0.0004 KL (nf4 BF16: PPL 8.0733, mean KL 0.0343, top-1 92.87%, ref-top1∈top5 99.85%, argmax∈ref-top5 99.90%; full matrix in JSON dataset).

This tradeoff is selectable at launch via --format auto|hf4|lut4|nf4 or --ane-models off. If a workflow demands exact g64 weights (92.1% HumanEval) and can tolerate 272 tok/s GPU prefill, disabling ANE still delivers 91.6 tok/s greedy decode in 16.41 GiB. For maximum prefill speed on M4/M5 (707 tok/s @ 4k, 98.2 tok/s decode), pick hf4; for the closest distributional fidelity to exact g64 (or native 4-bit single-copy on M1–M3), pick --format nf4.

We also measured opt-in Quest query-aware block-sparse decode against exact dense KV8 at 16k, 32k, and 64k WikiText-2 prefixes (257 scored continuation tokens each; because 257 tokens makes raw ΔPPL noisy, we focus on full-vocabulary KL divergence, Top-1 agreement, and Top-5 preservation). Up to 32k, Quest 8192 stays tight (mean KL 0.0027 at 16k and 0.0169 at 32k, both 100.0% Top-5). At 64k (12.5% coverage), however, Quest 8192 rises to mean KL 0.0916 (worse than 16k Quest 4096 at 0.0811) and drops Top-5 to 99.2%—so we mark Quest 8192 at 64k+ as not recommended. Raising the budget to 12288 halves 64k KL to 0.0492, restores 100.0% Top-5, recalls 3/3 passkeys planted simultaneously at 15%, 50%, and 85% depth (68.8 tok/s), and still runs 61.2 tok/s at 64k and 56.6 tok/s at 128k. We did not measure KL/PPL at 128k, so dense exact KV8 remains the default.

Opt-in Quest block-sparse quality · 16k, 32k & 64k WikiText-2 (257 tok) vs exact dense KV8
Prefix & budgetKV cov.PPL*Mean KLTop-1Top-5Multi-needle
16k · Dense Exact KV8100%7.17—100.0%100.0%—
16k · Quest 4096Not recommended25.0%7.730.081193.0%99.6%—
16k · Quest 8192Recommended ≤32k50.0%7.150.002798.1%100.0%—
16k · Quest 1228875.0%7.170.000599.6%100.0%—
32k · Dense Exact KV8100%6.77—100.0%100.0%—
32k · Quest 8192Recommended ≤32k25.0%6.800.016996.9%100.0%2/2 (top+50%)
32k · Quest 1228837.5%6.750.002899.2%100.0%—
64k · Dense Exact KV8100%6.97—100.0%100.0%—
64k · Quest 8192Not recommended · KL > 0.0812.5%6.620.091694.9%99.2%3/3 (72.8)
64k · Quest 12288Recommended 64k+ budget18.8%6.720.049295.7%100.0%3/3 (68.8)

*n = 257 continuation tokens per prefix; single-passage PPL swings (e.g., 6.97 → 6.62 at 64k) are small-sample noise, so KL divergence and Top-1/Top-5 agreement are the reliable fidelity indicators. Multi-needle 64k tested 3 simultaneous passkeys at 15%, 50%, and 85% depth. 128k KL/PPL was not measured.

Kernels, portability and ceilings

Metal kernels, M1–M5 portability and hardware ceilings

Reading Apple's compiled model.hwx directly from Metal is not free: the ANE compiler stripes output channels across 16 interleaved chunks rather than contiguous g64 rows. Our first kernel (matching ANE prefill logits to 10⁻⁶ relative error) ran 3.7 ms/rnd slower than 2-copy g64 (42.06 ms/rnd) on an internal 512→256 benchmark. Seven iterations—including two reverted regressions—closed the gap on M=8 verify to within 0.9 ms/rnd (reaching 360.2 GB/s across the 64 mmap'd model.hwx files, plus a dedicated M=1 ane_hf4 QMV that cut autoregressive step latency from 39.03 → 33.10 ms / 29.2 tok/s). We also empirically confirmed M4 Max's 4-bit compute ridge point at M=16 (26.64 ms / 13.7 TFLOPs), validating M=8 as the speculative verification optimum.

v1

BF16 simdgroup_matrix, TN=1, U=4, KS=1

First correct kernel matching ANE prefill logits to 10⁻⁶ relative error; slowed by half-to-bf16 casts and low register reuse.

45.74 ms171.4 tok/s
v2

Cross-chunk TN=2/4, KS=1 (reverted)

Striding ~700 KB across separate chunks regressed round latency by +2.33 ms/rnd.

48.07 ms163.7 tok/s
v3

K-split 8/4 + selective sub-buffer mmap

Coalesced K-split reads while unmapping all 64 duplicate .safetensors MLPs (−8.90 GiB wired RAM).

44.93 ms174.5 tok/s
v4

Adjacent-slot TN=2/4 in same chunk, KS=8

Pairing consecutive slots inside one chunk (20.5 KB / 8.7 KB apart) cut activation reads 2–4× and dropped latency by 1.57 ms/rnd.

43.36 ms182.8 tok/s
v5

Lane-split + simd_shuffle (reverted)

Adding inner-loop simd_shuffle reductions regressed round latency by +11.24 ms/rnd.

54.60 ms145.4 tok/s
v6–7

Interleaved load/MMA + slot-major swiglu + dedicated M=1 QMV

Interleaving FP16 simdgroup_matrix accumulation with native 16-bit ushort2 nibble unpacks and slot-major grid mapping hit 360.2 GB/s on mmap'd model.hwx (43.0 ms/rnd; M=1 AR 39.03 → 33.10 ms).

43.01 msM=1: 33.1 ms
v8

v1.2: PSO function constants, coalesced uint2, KS=4 down_sk4 & 1 KB s_lut2[256]

Compile-time shape specialization (pipeline_u32_constants), coalesced uint2 + simd_shuffle loads, zero-tail-waste 128-thr KS=4 down_sk4, and 0 B-overhead aliased s_lut2[256] push 64× hf4 MLP to 379 / 362 GB/s (FULL M=8: 38.89 ms, M=4: 22.75 ms, M=1: 32.78 ms) and nf4 to 41.64 ms (2.12× faster).

38.89 msnf4: 41.6 ms

Six first-principles engineering pillars lift v1.2 to 98.2 tok/s greedy decode, 707 tok/s exact 4k prefill, 0.00 GiB swap at 128k, and universal M1–M5 single-copy support:

0.16 ms draft head · 0.76–0.81 ms 1× MTP (B=1..3)

BitScreen, full-ctx MTP KV4 & shared-base T7

BitScreen packs 98,304 lm_head rows into 1-bit sign(W) (60.0 MiB) in stride-2048 order and scores 3-bitplane activations via popcount + register top-2 into a 32 KiB L2 table (0.16–0.17 ms). tri_probe expands 3 branches inside CB #1 alongside lazy fused GDN replay (−65.9 MB). In v1.2, keeping full-context 1-layer MTP KV4 (only ~128 MB at 128k, avoiding 4k-window acceptance drops) and replacing independent M=4/M=8 EMAs with a shared non-attention base EMA prevented cold-page 128k bandit inversion (64k: 53.4 tok/s, 128k: 37.5 tok/s).

128k gqa6: 34.25 / 18.82 / 10.57 ms (−11% to −18%)

Lean-SRAM FA-2, 4-barrier gqa6 & MTP dead-compute skip

encode_mtp_kv_prime skips dead prefill q_proj, 17th O(L²) attention, o_proj, and 267M MLP (32.31 → 4.86 ms at M=512, −26.0 s at 128k). v1.2 upgrades prefill FA-2 to 4 barriers/tile with disjoint sP[64][36] (22.1 KiB SRAM, 185.1 ms at pos=3072) and adds half2 KV8/KV4 scales + half split-K partials + 4-SG vsplit2 (+21% to +38% at 32k; −11% to −18% at 128k).

7.23 s nf4 / 8.39 s hf4 · −1.5 to −2.32 GiB RAM

Zero-Python C++ build-ane & MTLHeap aliasing

mometal build-ane eliminates Python/coremltools completely: ARM64 NEON L1 row-streaming (20 KB per worker, zero 1.07 GB FP32 matrices) plus branchless 4-level FP16 vqtbl + vfmlalq builds all 64 layers in 7.23 s (nf4, 2.3×) / 8.39 s (hf4, 2.0×). At runtime, MTLHeapTypePlacement aliases 13 disjoint scratch buffers (225.75 → 83.25 MiB, −142.5 MiB), lazy QwenVisionTower + bundled MTP dedup + stepwise KV allocation cut phys_footprint by −1.5–1.7 GiB (CpuMmapQ4Weight cuts −682 MiB more on --mtp off to 5.05 GiB), and 4-deep async warmup trims warm load to 550–629 ms.

h13g (M1) → h17g (M5) · 0.503 B/wt · strict 1-copy

Cross-chip M1–M5 single-copy & byte-pair TG LUT

All four shaders compile under Metal 3.0 (auto-enabling Metal 3.1 simdgroup_bfloat8x8 Vision on Apple9+). Because ANECompiler silently promotes linear hf4 to 8-bit on M1–M3 (h13g–h15g), --format auto selects universal 4-bit lut4 on M1–M3 and hf4 on M4/M5+, while opt-in --format nf4 delivers 0.503 B/wt across all five generations. On GPU, aliasing a 1 KB half2 s_lut2[256] table into existing reduction SRAM decodes 2 nibbles in one 32-bit TG load (2.12× faster, 338/331 GB/s).

rows=256 optimum · 512 PF +80.9% · N=256 +19.5%

Hardware ceilings proved on silicon

Direct hardware probes settled three architectural limits. First, rows=256 is the true ANE sweet spot (715–722 tok/s MLP, kts=16 single-copy): rows=128 hits the ANE weight-bandwidth floor (4.44 ms/L, 451 tok/s, −37%), while rows=384/512 hit the ANE SRAM cliff, shattering 16 linears into 144 sub-tiled __KERN tensors (−15% to −23% slower at 553–612 tok/s and breaking single-copy). Second, lean-SRAM occupancy beats wider tiles on Apple GPUs: GQA-2× FA-2 (28.25 KiB) spilled registers (32k: 498 → 452 tok/s) and uint4+float4 KV8 inside 192-thr M=8 gqa6 spilled (128k: 37 → 69 ms). Third, N=256 qs={1,0} with mA=192[ANE] + mB=64[AMX M=8] (414.8 tok/s) proved Pareto optimal over mB ∈ {16..128}.

Lock-free dispatch_group · single-half tail absorb

Async ANE pipelining & shared Quest cache

v1.2 replaces the worker thread/mutex/CV with per-slot persistent dispatch_group_t lock-free async ANE pipelining and absorbs 1–64-token tails onto Half B only (keeping Half A at exact 256/512 rows so 524-token prompts jump +80.9% to 644.9 tok/s and 4,112-token prompts hit 684 tok/s). Stripping decode-only Quest tags from PrefixCache hashes still lets Dense and Quest share exact .micache snapshots on SSD.

Cross-chip M1–M5 single-copy formats · verified via ANECompiler (h13g–h17g) & M4 Max live runs
Format flagANE targetB / wtGPU decode kernelM4 Max 4k PFM4 Max M=8Recommended use
--format hf4Default on M4 / M5+ (h16g, h17g)W4A8 INT40.503ane_hf4_* (379/362 GB/s)707.2 tok/s38.89 msPeak prefill & decode on M4/M5
--format nf4Universal M1–M5 (h13g–h17g)W4A8 NF4 LUT0.503ane_lut4_* + s_lut2[256]429.6 tok/s41.64 ms−44.3% KL quality / universal M1–M5
--format lut4Default on M1–M3 (h13g–h15g)W4 palettized0.503ane_hf4_* (2's-comp LUT)probe local*same as hf4Avoids M1–M3 8-bit promotion
--ane-models offStrict GPU-only fallbackNone (g64)0.563mma_qmm8_q4_g64_*271.5 tok/s91.6 tok/sExact g64 (92.1% HumanEval)

*lut4 / nf4 binary layouts were verified bit-exact across h13g (M1) through h17g (M5) via ANECompiler.framework; live throughput was measured on M4 Max. Users on M1–M3 or M5 Macs can run the 30-second local compatibility & throughput check via python3 scripts/probe_m_chip.py.

Method and disclosures

Controls, caveats, references and dataset

ParameterMeasured configuration
Hardware, power & idle loadApple M4 Max, 48 GiB unified memory (546 GB/s), macOS 27.0 (26A428). All three mometal modes (n=3 balanced interleaved restarts), matched controls, 66k paging check, and 4k–128k sweeps ran on AC power (100% charged, zero pmset -g therm warnings; idle baseline 2.78 GiB wired, 1.67 GiB compressor, 18.70 GiB free with desktop apps + Docker Desktop VM ~0.88 GB running; exact process list saved in starmo-mometal-ac-proof-2026.json).
Checkpointnetprojects/Qwen3.8-27B-pi-adapted-MLX-4bit (harness-hub/Qwen3.8-27B-pi-adapted RL LoRA merged into Qwen/Qwen3.8-27B; 64 transformer layers = 48 GDN + 16 full-attn GQA, plus 1 full-attn MTP layer = 17 full-attn layers total, 16 executed during prefill; 15.40 GiB .safetensors).
Runtime & native builderZero-Python C++20 / Objective-C++ / Metal for both inference and 4-bit ANE MLP conversion (mometal build-ane / auto-build on --ane-share: 8.39 s for 64L hf4, 7.23 s for 64L nf4 via ARM64 NEON L1 row-streaming, replacing v1.1's 4.0 min Python conversion; scripts/probe_m_chip.py checks M1–M5 compatibility in 30 s).
Trial counts & peer memory samplingAll three mometal modes ran n=3 balanced interleaved fresh restarts on AC power (1-copy PF 620.2–623.7, greedy 93.8–94.0; GPU-only PF 271.1–271.7, greedy 91.1–91.8; 2-copy PF 450.0–497.2, greedy 95.1–95.3; T=0.7 sampled rows are n=6 means with ±12–13% spread). Five peer speed rows ran n=1 sequentially on AC power (T=0.7 is 2-run mean); peer byte-exact footprint rows ran n=1 on battery power, sampled 0.5 s after 3.7k cold + 3.7k warm + 64-token greedy decode (where pmetal retained MLX prefill scratch buffers at 19.69 GiB vs 15.0 GiB rounded after 8 long decodes). “Cold” denotes a fresh process and cache-miss prompt with warm OS page cache.
Versions & repositorymometal (MIT license; AC benchmarked on pre-rename binary SHA-256 8941b000, renamed binary 203489f1; probe script benchmarks/verify_ac_3mode.py and raw footprint/vm_stat dumps in benchmarks/raw_ac_proof/), mlx-serve 26.11.3 (mlx 0.32.5), oMLX 0.8.3 (mlx 0.32.4), TensorFold 1.3.4, pmetal 0.7.1, mlx-lm 0.31.3 (mlx 0.32.1).
Disabled extrasmometal --suffix-dir (workspace repo suffix cache) turned OFF for all benchmark numbers.

In-session suffix cache isolation

Repeating prompts or sweeping multiple context lengths inside one mometal process allows its built-in session suffix cache to draft earlier turns. Every interleaved AC trial and every point of the 4k–128k sweep restarted a fresh server process to eliminate cross-turn carryover.

KV cache parity & prefix restore

mometal and mlx-serve ran KV8; TensorFold enforces BF16 KV on Metal (pre-allocating 32k slots up front, accounting for 21.88 GiB), while oMLX, pmetal, and mlx-lm default to dynamic BF16 KV. Our matched-KV AC control confirms BF16 KV vs KV8 shifts short-context greedy speed by <1% (93.0 vs 93.8 tok/s) and WikiText-2 by +0.0033 PPL, while warm SSD prefix restore (MICACHE2) slows from 205 ms to 355 ms on BF16 KV (vs oMLX at 314 ms).

Excluded engines & peer setup

MTPLX v2.13.1 and vllm-mlx v0.2.5 emitted corrupted tokens on this pi-adapted Qwen3_5 checkpoint even with KV quantization off. TensorFold required repacking MTP keys into language_model.mtp. to activate native --mtp-drafts 6. lithos-metal v0.1.2 requires NVFP4, and llama.cpp requires GGUF.

References

  • Dao, T. (2023). FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning. arXiv:2307.08691.
  • Xiao, G., Lin, J., Seznec, M., Wu, H., Demouth, J., & Han, S. (2023). SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models. ICML 2023.
  • Miao, X., et al. (2023). SpecInfer: Accelerating Generative Large Language Model Serving with Tree-based Speculative Inference and Verification. ASPLOS 2024.
  • Li, Y., Wei, F., Zhang, C., & Zhang, H. (2024). EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees. EMNLP 2024.
  • Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). QLoRA: Efficient Finetuning of Quantized LLMs. NeurIPS 2023 (NormalFloat-4 / NF4).
  • Tang, J., Zhao, Y., Zhu, K., Xiao, G., Kasikci, B., & Han, S. (2024). Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference. ICML 2024.

Serving command, source code and open dataset

Zero-Python launch flags for 1-copy 128k local serving on Apple Silicon (--ane-share automatically builds 64L 4-bit MLPs natively in C++ in 7–8 s; source code is open under MIT at github.com/tinjakr/mometal; the benchmark JSON, v1.2 sweep JSON, CSV summary, and raw AC-power proof JSON are published under CC BY 4.0):

# Zero-Python 1-copy 128k serving (auto-selects lut4 on M1-M3, hf4 on M4/M5+;
# add --ane-tag nf4 for universal M1-M5 NF4 quality: -44.3% KL, 92.8% top-1):
./build/mometal serve \
  --model ~/models/qwen38-pi-adapted-mlx4 \
  --ane-share \
  --max-seq 131072 --kv-bits 8 \
  --cache-dir ~/.cache/mometal-pi \
  --host 127.0.0.1 --port 8092
  # Optional explicit pre-build (8.39 s hf4 / 7.23 s nf4):
  # ./build/mometal build-ane --model ~/models/qwen38-pi-adapted-mlx4 --format nf4
  # Optional block-sparse decode (recommended 64k+ budget: 61.2 tok/s @ 64k [0.049 KL, 100% top-5]):
  # --sparse-kv-budget 12288

Cite as: Tinjak, R. (2026). Single-copy ANE weight sharing for local 27B inference on Apple M4 Max. starmo.ai. https://starmo.ai/reports/mometal-ane-share

Questions

What this report answers

How do we verify single-copy ANE sharing actually saves ~8.9 GiB in system RAM?

Using footprint -f bytes --wired --swapped alongside vm_stat, lsof, and /usr/libexec/aned RSS on AC power. Immediately after 3.7k prefill and 64-token decode in our v1.1 n=3 AC proof, 2-copy ANE reports 16.51 GiB phys_footprint plus 8.69 GiB in 192 unmapped neural regions (25.20 GiB total, 23.95 GiB process wired, +23.98 GiB system vm_stat wired delta, 1.13 GiB swapped). In 1-copy ANE-Share mode, unmapped neural drops to 128 I/O regions (0.71 GiB), the exact 8,579,448,832 B (7.99 GiB) of model.hwx weights move into shared wired mapped file, and wired RAM drops −8.90 GiB (15.05 GiB process wired, +15.08 GiB vm_stat wired delta, 0 B swapped, aned RSS 6.6 MiB). v1.2 trims phys_footprint an additional −1.5 to −1.7 GiB across 256→128k (6.05 GiB FP / 14.62 GiB wired at 256–1k; 5.05 GiB with --mtp off; 0.00 GiB swap at 128k).

Does ANE sharing cause the +35% to +44% decode speedup over mlx-serve?

No. With ANE completely disabled on identical group-64 (g64) weights, mometal still reaches 91.6 tok/s greedy decode (n=3 AC median, range 91.1–91.8, vs 68.1 tok/s for mlx-serve) in 16.41 GiB. The decode lead is independent of ANE and hf4, coming from our Metal decode and speculative tree path (0.16 ms BitScreen draft head, tri_probe trees, fused GDN replay, and in v1.2 specialized PSOs + lean-SRAM gqa6 pushing 1-copy greedy decode to 98.2 tok/s and 38.89 ms FULL M=8 verify). The trade of single-copy ANE-Share is 2.3× faster prefill (646 tok/s cold 3.7k; 707.2 tok/s exact 4k) with −8.90 GiB wired RAM vs 2-copy ANE.

What actually happens to 2-copy ANE at long context on a 48 GiB Mac on AC power?

On AC power with 18.70 GiB free at idle, 2-copy ANE at 66k (69,632-slot KV tier) totals 27.40 GiB (26.13 GiB wired, 1.16 GiB swapped). Live vm_stat instrumentation shows XNU's memory compressor thrashing 22.5M compressions (343.5 GiB) and 22.0M decompressions (336.1 GiB) during prefill as GPU weights are evicted to fit ANE, dropping prefill from 389.7 to 311.9 tok/s (−20%). When decode starts, XNU faults 593,657 decompressions (9.06 GiB) and 11,012 pageins back into wired RAM, cutting decode from 45.9 to 37.0 tok/s (−19%). Single-copy stays at 0 compressions and in v1.2 scales all the way to 128k (128,078 tokens) with 0.00 GiB swap, 10.39 GiB phys_footprint, 8.31 GiB ANE resident, and 37.5 tok/s dense decode (53.4 tok/s at 64k).

How does Wave 3 NF4 improve quality and enable M1–M5 single-copy sharing?

On M1–M3 (h13g–h15g), ANECompiler silently promotes linear int4 (hf4) to 8-bit (2× RAM), and on M4 it rejects g=128 blockwise quant to CPU. Encoding weights with 4-bit palettized lookup tables (--format lut4 or non-uniform --format nf4) executes 100% on the Neural Engine at exact 0.5029 B/wt across M1–M5 (h13g–h17g), embedding the 16-entry FP16 LUT directly in __KERN chunk bytes [0..31]. On WikiText-2 (2,048 tokens vs exact g64 BF16), NF4 cuts mean KL by −44.3% (0.0623 → 0.0347) and lifts top-1 agreement by +3.90 pp (88.92% → 92.82%, 99.85% top-5), while our 1 KB byte-pair threadgroup LUT (s_lut2[256], 0 B extra SRAM) runs GPU decode 2.12× faster at 41.64 ms M=8 (338/331 GB/s) and 429.6 tok/s 4k prefill on M4 Max.

Why does prefill slow down from 707 tok/s at 4k to 279 tok/s at 128k?

Prefill latency follows an O(L) linear term from projections, GatedDeltaNet, and ANE MLPs (~1.38 ms/tok) plus an O(L²) quadratic term from the 16 full-attention transformer layers (0.0180 ms/tok per 1k tokens; encode_mtp_kv_prime eliminates the 17th O(L²) MTP attention layer during prefill). The crossover sits near 76.4k tokens; at 128k quadratic attention dominates (~62% of prefill time). In v1.2, 4-barrier single-head FA-2 and single-half tail absorption push 512 prefill +80.9% (356.5 → 644.9 tok/s), exact 4k to 707.2 tok/s, and cut 128k TTFT by another −16.0 s (475.1 → 459.2 s).

Which Quest block-sparse budget should be used at 32k vs 64k+?

Against exact dense KV8 over 257 WikiText-2 continuation tokens, Quest 8192 is well-behaved up to 32k: mean KL 0.0027 (98.1% Top-1, 100% Top-5) at 16k and KL 0.0169 (96.9% Top-1, 100% Top-5) at 32k. At 64k (12.5% coverage), Quest 8192 crosses our quality bar with KL 0.0916 (worse than 16k Quest 4096 at 0.0811) and is not recommended; use Quest 12288 at 64k+ instead (KL 0.0492, 100.0% Top-5, 61.2 tok/s at 64k and 56.6 tok/s at 128k). KL/PPL was not measured at 128k, so dense exact KV8 remains the default.

Version 1.2, 25 Nov 2026: preserves the v1.1 AC-power interleaved n=3 3-mode verification and 66k vm_stat proof, and adds verified v1.2 release results (98.2 tok/s 4-task greedy, 707.2 tok/s exact 4k / 644.9 tok/s 512 prefill, 10/10 green 256–128k sweep with 0.00 GiB swap at 128k and 53.4 tok/s at 64k, 550–629 ms warm load, 7.23 / 8.39 s zero-Python C++ build-ane, M1–M5 cross-chip single-copy, and Wave 3 NF4 with −44.3% KL and 2.12× byte-pair TG LUT decode).