You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every measured result behind the cluster's choices, on one page. Four 256 GB M5 Ultra Mac Studios serve
DeepSeek-V4.1-Flash-1017 through ds41-router.py. The full method, flags and raw paths for each row are in
perf-ledger.md, under the date shown.
Updated 2026-11-13. Add a row here whenever you add a ledger row that changes a decision.
One iQ box outputs 66 / 81 / 91 / 103 tok/s at 1 / 2 / 4 / 8 agents, EXL3 2.81 falls 55 / 53 / 51 / 45; iQ answers image turns, EXL3 returns 400
11-13
Live context: 1M tokens
Sam's requirement; the 1M memory gate runs at cutover
11-13
TP2/TP4 when idle: held
TP2 beats a TP1 box by 1.18x for one session, and a switch loses every cached session (below)
11-13
Pipeline-parallel prefill: steps 2-6 held
~35 requests/day carry 16k+ uncached tokens, ~30 min/day of prefill; PP4 would return ~15 min/day
11-13
No more benchmarking without a decision waiting on it
Sam, 2026-11-13
11-13
Quality: API KLD to the FP8 teacher
16 prompts, 7,495 rows, bench/kld/api-kld.py. Lower is closer to the full model.
Pack
KLD
Top-1 match
Date
Lossless (TP4 stack5)
0.0172
0.9701
11-08
Lossless (TP4 stack8)
0.0147
0.9697
11-10
Lossless (TP2, stack7 flags)
0.0138
0.9732
11-10
EXL3 2.81bpw
0.0688
0.939
11-06
EXL3 2.25bpw
0.1430
0.911
11-06
iQ-MLX 3.0bpw v1.1
0.1527
0.9090
11-12
iQ-MLX 3.0bpw v1.0
0.1832
10-28
Sushi-STQ 1.75bpw (served until 11-11)
0.1589
0.899
11-06
iQ's mean hides a split: code, math, reasoning, design and agent prompts sit at 0.018-0.098; prose is where it
loses. TP width does not change quality (lossless TP2 0.0138 vs TP4 0.0147, inside the 0.002 gate).
Capacity: many agent sessions at once
Each worker is a growing omp subagent conversation (agent-load.py, agent-load-sweep.sh).
Layout
Pack
Output tok/s at 4 / 8 / 16 sessions
TTFT p90 at 4 / 8 / 16
Date
4x TP1
EXL3 2.81
214.2 / 211.6 / 206.1
2.9 / 14.4 / 30.5 s
11-10
2x TP2
lossless
175.8 / 207.7 / 179.5
5.9 / 12.5 / 49.8 s
11-10
TP4
lossless
116.6 / 132.9 / 99.5
9.8 / 24.5 / 111.6 s
11-10
One box, one width per fresh server (tp1-par.sh):
Agents
iQ out tok/s
EXL3 2.81 out tok/s
iQ / EXL3
Decode p50 iQ / EXL3
TTFT p90 iQ / EXL3
1
66.3
55.1
1.20x
88.3 / 77.5
2.5 / 3.5 s
2
81.2
53.0
1.53x
56.4 / 71.9
2.7 / 21.4 s
4
91.0
50.7
1.79x
28.0 / 74.5
5.3 / 35.1 s
8
102.7
44.9
2.29x
16.6 / 74.1
16.2 / 77.7 s
So 4x TP1 iQ projects to ~364 tok/s at 16 sessions (4 x 91.0), against 207.7 for today's 2x TP2 at its best.
That is arithmetic on single-box rows, not a cluster measurement.
iQ at TP2 (studio3+4, fallback MoE kernels, so a lower bound), 11-13: one agent 77.4 tok/s out, decode p50 103.8
(TP1: 66.3 / 88.3), 1.18x.
Single-stream decode
Pack
Layout
Plain decode at 2k
Agent replay (DSpark, 16 captures)
Date
Lossless
TP4 stack8
198.3 tok/s (24.61 ms/round)
11-10
Lossless
TP4 stack6
104.6-106.2 tok/s
192.1
11-08
Lossless
TP2 stack7
147.0
11-09
Lossless
TP2 stack3
78.0-78.5
11-08
iQ
TP1
108.6
11-12
EXL3 2.81
TP1
34.4-35.4 (11-10)
99.5 (11-12)
11-10, 11-12
STQ 1.75
TP1
69.4 (11-07)
116.3-118.0 (11-05, 11-07)
11-05, 11-07
Prefill (cold, tokens per second)
Pack
Layout
8k
32k
64k+
Date
Lossless
TP4 stack3
3,623-3,697
3,550 at 64k, 3,151-3,178 at 128k, 2,303-2,322 at 320k
11-08
iQ
TP2
2,919-3,009
3,978-4,065 (8,191 cached)
11-13
EXL3 2.81
TP1
2,017
2,415
2,461 at 128k
11-12
iQ
TP1
1,553
1,639
1,505 at 128k
11-12
iQ
TP1, random ids vs a 16-id loop
2,413 vs 3,950
11-13
STQ 1.75
TP1
2,705
3,345
3,398 at 64k
11-05
iQ's 32k gap between random ids and a loop is Engram SSD reads: 39% of a random-id 32k prompt (11-13), 359-396 ms
per 2,048-row chunk on layers 1 and 14 against 26-116 ms on the rest.
Prefix cache
Result
Numbers
Date
RAM prefix cache on vs off, lossless TP4, 16 captures
summed TTFT 255.3 vs 1,016.8 s, decode unchanged
11-07
Hot cache 2 GB vs 32 GB, lossless TP4
uncached share 3.2% vs 1.6%
11-10
SSD tier across a restart, lossless TP2, 41k-token conversation
cold turn 12.4 s, after restart 1.2 s (41,252 cached)
11-10
SSD entry across an iQ TP1 -> TP2 -> TP1 switch, same HOME
not restored: cached 0 after each switch (entry 106.3 MB written on SIGTERM)
+9% output (70.9-74.9 vs 77.5-81.6) at 4 GB; no gain at 2 GB; dropped as B1
11-12
Peer fetch of a 41k-token entry between groups (plan 60)
1.2 s, 132 MB
plan 60
The 11-13 switch result has no same-layout restart control, so whether iQ's SSD tier restores at all is open.
The cutover checks it: one box, a 32k prompt, kill, reconcile restarts it, resend.
Memory and switch costs
Result
Numbers
Date
iQ TP2 group start
46 s to GROUP-UP
11-13
iQ TP1 warm restart
30 s to ARM-UP
11-13
iQ wired per rank
TP2 110 / 116 GiB, TP1 ~193 GiB
11-13
Lossless resident per rank
TP2 143,020 MiB, TP4 72,668 MiB; pack 287.9 GB, so it cannot run on one box
11-07
Borrow recovery after the holder is SIGKILLed
group B back in 97 s, A in 87 s, 0 errors in 219 requests
11-11
Derived, not measured (from plan 61 rev 9; the 1M gate at cutover measures them):
Quantity
Value
Source
KV of one full 1M-token session
3.1 GiB (3,200 B/token)
bill.zig kvPerToken
Metal ceiling on a 256 GiB Studio
~222.7 GiB, ~22.4 GiB free beside iQ weights and an 8 GB cache
memory_ceiling.zig
Admission bill for a 1M prompt
3.1 GiB KV + 4.57 GiB prefill working set at 8,192 rows
deepseek_v41.zig prefillBytes
Traffic
From the lossless TP2 rank-0 logs, 2026-11-10 to 11-13 (studio1:~/bench/uncached.py):
Measure
Value
Prompt tokens served from cache
95-98%
Requests with 16k+ uncached tokens
122 in 3.5 days, ~35/day
Time spent prefilling them
~30 min/day across the cluster
Requests with 64k+ uncached tokens
27 in 3.5 days; most of the prefill seconds
The router request log (~/.mlx-serve/logs/ds41-requests.jsonl, being deployed 2026-11-13) replaces this parser
and answers the open traffic questions: how much solo time the cluster sees (plan 62's close rule) and how often a
request lands on a backend two or more sessions busier than the lightest (plan 60b's gate).
Engine changes measured on lossless TP4 (kept unless marked)
Decode tok/s, plain at 2k or the agent replay as noted.
Every speed lever tried on mlx-serve for Qwen3.8-Flash-Next (mid48 pack, M5 Ultra Studio), one row
each, prefill and decode kept apart. Check an idea here before measuring it, and add a row for every
result, wins and dead ends alike. The skills inference-perf-survey (competing engines) and
inference-perf-novel (autoresearch loop from our own profile) read and write this file. Methods
and full tables are in studio-bench.md.
Live build: main 933566c plus ddalcu/mlx-serve#653 (stack-wsum-933566c,
2026-09-30), about 4,500 tok/s prefill at an 8.9k prompt. The block split below predates it.
Bar for a PR: a steady gain of at least 2% (A B B A with separated ranges, or a ladder that holds it
across context sizes). Every new kernel path carries some risk of a decode regression or of breaking
another model, and a smaller gain doesn't pay for that risk. Levers under the bar are logged here and not
proposed.
Prefill
A/B is bench/studio-bin-ab.sh (A B B A, 8.9k prompt) unless the row says otherwise.
Where one 8,192-row chunk goes (kv 8,192, synced per block, stack-b634187)
mlp 697 ms 37% MoE, 42.5 TFLOP per chunk -> 61 TFLOPS
gdn 569 ms 30% 36 layers; the recurrence is ~3.4 ms/call, the rest is projections/conv/norm
attn 267 ms 14% 12 layers: QSA 120, proj+RoPE+KV 89, gate+o_proj 41, indexer 17-19
hcRead 221 ms 12% hyper-connection reads
hcWrite 85 ms 5%
ple 27 ms 1%
Only attention grows with depth (361 ms at kv 65,536). The pipelined GDN kernel landed after this
split, so gdn now reads roughly 50 ms lower. Synced profiles inflate cheap blocks: use them to rank.
hcWrite's 85 ms is mostly a profiling artifact: with timing on, the layer loop flushes the deferred HC
residual after every block (if (prof.timing) try self.hcFlush(...) in the qwen4 layer loop), where
production folds that write into the next HC norm. Rank HC leads against hcRead.
refused on M5 Ultra (the NAX GPU outruns the ANE seam); gate opened for qwen4_exp in a test build (GDN qkv/z, 36 layers, int8 ~640 MB), cold 25k prefill vs GPU 4,191-4,264 tok/s: dual ANE share 0.20 4,293 (+0.7..2.4%, noise), 0.30 -1.5%, 0.40 -4.4%, 0.45 -3.3%; single 0.20 -2.9%, 0.45 -11.5%. FLOP ceiling: GDN in_proj is 29% of 10.3 GFLOP/token, the ANE runs it ~3.6x slower than the GPU, so the break-even share is ~0.2 single / ~0.35 dual and the ceiling +6-10% before the seam; routed experts (46%) cannot ride a fixed-shape graph. Mixed load (bench/studio-mixed-probe.py, 4 decoding streams + 1 or 2 rolling cold ~17k-token prefills, 90 s, 400-token replies): decode off 84.4 / 71.1 tok/s, dual 0.20 66.7 / 71.1, dual 0.30 81.6 / 68.3, single 0.20 71.1 / 68.4, off again 66.7 / 73.1 (1 / 2 prefillers); prefill tok/s 1.4-2.0k in every arm; prefill-active vs decode-active time unchanged (~47 s / 44 s at 1 prefiller). The off-vs-off spread (84.4 vs 66.7) is larger than any ANE arm's difference, so the ANE moves neither decode nor the prefill/decode split
MLX pin bump d73eb75 -> 9c3d355 (v0.32.3-18, has ml-explore/mlx#4594, so gated_delta_update_nax builds on macOS 27; mlx-c needs patches/mlxc-gather-qmm-global-scale.patch, applied by build-mlx.sh on branch perf/pin-bump)
MLX
2026-09-30 A B B A vs stack-933566c: prefill 0.991, decode geomean 0.979 (one prompt 0.914 from ml-explore/mlx#4461 sigmoid text change). Dropped as a perf lever. The +2.5% measured 2026-09-28 came from MLX's gather_qmm (ml-explore/mlx#4572), which main's own NAX sorted gather has since replaced
studio-bench "MLX pin bump"
Stack the GDN input projections into one matmul per pair (qkv+z are 4-bit g64, a+b 8-bit g64 in mid48, so four-way is impossible)
TensorFold prefill_mm.deltanet_in
M5 Max microbench per layer: qkv+z at 8,192 rows 15.8-17.2 -> 17.6-17.8 ms (slower; that GEMM runs near peak); a+b 0.145 -> 0.084-0.107 ms, ~0.06-0.09% of a chunk. Bit-identical at >= 2,048 rows only. Dropped: below the 1% bar for the load-time fusion it needs
branch perf/gdn-stack, not merged
Direct kernel for the dilation-3 PLE conv1d (MLX sends dilation > 1 through a grouped GEMM)
bit-identical, 21 -> 0.8 ms per call on the M5 Max; Studio A B B A prefill 1.006 (4,300 -> 4,328, ranges overlap), decode geomean 1.006, greedy text identical 4/4. With wsum, 1.054 vs wsum alone 1.048. Dropped: under the 2% bar; PR closed
Fused MoE weighted sum for prefill: the verify expert-reduce kernel widened to widths above 32 tokens, replacing unsort take_axis, multiply and sum_axis over [81,920 x 2,560] bf16 per layer
M5 Max 4.1-4.6 -> 0.84-0.96 ms per layer; Studio A B B A prefill 1.048 (4,293 -> 4,500, ranges disjoint), decode geomean 0.987 (noise: decode never runs it). Parity test passes on the Ultra. Greedy prompt 1 differs from main, but so does the same build with the kernel gated off, so that's a timing flip. With PLE, prefill 1.054 (4,299 -> 4,529), decode geomean 0.995
needs their locally patched MLX (split-K short matmuls, MiMo attention) that doesn't fit our shapes; stock MLX gives them 3,881-3,910
survey 2026-09-30
vllm-metal, exo, mistral.rs, LM Studio mlx-engine
no prefill mechanism that applies
survey 2026-09-30
TensorFold's prefill kernels on M5
TensorFold 9cd52ab
nothing to port: on applegpu_g17+ prefill_mm.tiles() is false and it runs stock MLX quantized_matmul/gather_qmm, stock gated_delta_update, and SIMD (non-tensor-unit) sparse attention, all of which we've passed. Third-party M5 Ultra run (issue #22, 4-bit g32 pack): 2,869 tok/s at 8K vs our ~4,300 at 8.9k
survey 2026-09-30
--mtp-greedy-tail (later drafts by argmax, pairs with --mtp-typical 0.2)
iQ pack, one replayed 120-300k agent stream, 2 x 47 s per arm, interleaved: base 119.9/124.3 and 123.7/124.6 -> 135.4/132.8 tok/s (+9%), MTP tokens per round 2.98 -> 4.30, accept 80% -> 84%. Lossy: sampled output leans toward high-probability tokens
studio-bench, 2026-10-01
--mtp-typical 0.2 -> 0.35
ours
119.4/118.3 against 123.2 base: no gain (accept 75%)
studio-bench, 2026-10-01
Loop rate and speed by MTP acceptance mode: exact, typical 0.2, typical + --mtp-greedy-tail (live until 2026-10-04 10:33), --mtp-tokenv3 0.95, tokenv3 + greedy tail
ours
2026-10-04, bench/studio-accept-loop.sh as one Latch measurement job, main + PR 725 + PR 711 binary 7af9de2, iQ-MLX 4.7bpw pack, live flags minus the acceptance flags (--prefix-cache-mem 16GB), model's own sampling, thinking on, 2 prompts (voxel pagoda opener, extend a 12 KB Zig file) x 30 samples = 60 per arm, 8 streams, 2048-token cap (every sample hit it), omp paused, one pass in this order. Loop-stops by the server's guard: exact 0, typical + greedy tail 0, tokenv3 0, typical 0, tokenv3 + greedy tail 1; each 0/60 has a 95% upper bound of 6.0% and the 1/60 reads 0.3-8.9%; lowest distinct-8-gram share 0.972 (exact) to 0.996. The maintainers' 10% for typical + greedy tail is rejected on this workload (0.9^60 = 0.2% to see none). Aggregate tok/s, completion tokens over arm wall time, prefill included: exact 119.3, typical 130.6 (+9%), typical + greedy tail 133.9 (+12%), tokenv3 142.4 (+19%), tokenv3 + greedy tail 147.6 (+24%). Order was not randomized: exact ran first on a cold chip, so drift would favor it, and differences under about 10% are not a ranking. Not tested: long-context agent traffic, where the maintainers saw loops, and generations past 2048 tokens (thinking never finished in any sample)
~/bench/accept-loop/20261004-1115 on the Studio; first try (8192 cap, 4 streams) cancelled after 20 exact samples, 0 loops, because it projected to 4 h
2026-10-04, bench/studio-bench-window.sh part B, binary 7af9de2, iQ-MLX 4.7bpw pack, exact acceptance, MLX_SERVE_MTP_LOOKUP=0, 12 greedy solo prompts of up to 400 tokens, order lazy eager eager lazy, omp paused, watcher clean. Same 8476 tokens in both arms. Tokens per [mtp-plan] line 3.739 lazy against 3.808 eager (-1.8%); wall tok/s 171.8 against 165.1 (+4.1%, runs 170.8 / 172.8 against 165.9 / 164.2); plan sequences differ at 289 of 1104 aligned positions. A fix recovers at most the 1.8%
2026-10-04, bench/studio-bench-trace.sh, 7af9de2, --serve under xctrace, solo greedy MTP, two 400-token requests, omp paused, watcher clean. Last 2000 ms: GPU 92.9% busy, 48 rounds, idle between rounds 1.27 ms median / 2.10 ms per round (5 to 9% of the untraced 23.75 ms round_ms), inside rounds 0.84 ms per round (2.0%, median gap 0.8 us). The lazy pre-draft was on (lazy=87/86). A one-shot --prompt trace is plain pipelined decode (99.8% busy, no rounds) and does not answer this. Tracing slows rounds (41.7 ms traced); counters unusable; table is per encoder, so barrier cost inside an encoder is invisible
2026-10-04, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards, no sampling), 7af9de2 against the same tree with the constant at 32, 4096 and 32768 context, omp paused, watcher clean. 4096 context, ms (ops): S=8 27.2 (4922), 9 31.9 (6019), 14 41.4 (6016), 15 43.1 (6019), 16 44.6 (5875), 17 51.4 (7099); the variant is within 0.1 ms through S=16 and slower at 17 (53.7). Steps at 8 to 9 (+4.7 ms) and 16 to 17 (+6.9 ms) follow op count and code thresholds (MoE rows arm S <= 8, GDN MAX_SEQ = 16, NAX qmm max_m = 16); 15 to 16 is +1.5 ms. The served-round S=16 cliff (47.9 to 61.2 ms) is not in the forward
2026-10-04, dce06d2, iQ-MLX 4.7bpw pack, MLX_SERVE_MTP_TRACE=1, MLX_SERVE_MTP_LOOKUP=0, lazy pre-draft on, 12 greedy prompts of up to 400 tokens, 960 rounds, live idle. Per round: draft 0.21, verify graph build 1.64, eval 18.24 (dispatch 15.45, readback wait 0.10), commit 0.06, gap 0.03, total 20.19 ms. A sample of the scheduler thread over 8 s of a 1800-token greedy decode: of the 2680 samples inside mlx_async_eval, 1643 (61%) are a blocked condition_variable::wait (MLX waiting for the GPU to free a command-buffer slot) and 862 (32%) are encoding. The decode is GPU-bound, so a threaded or faster encoder would not help; the idle between rounds (1.3 to 2.1 ms) matches the host critical path after the readback (build 1.64 + draft 0.21 + commit 0.06)
2026-10-04, bench/studio-bench-standin.sh, dce06d2, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards, no per-block syncs), kv 4096, omp paused. Saving when the block is swapped for a trivial op, S=6 (23.54 ms) / S=9 (32.02 ms): mlp 9.98 ms (42.4%) / 14.23 (44.4%); attn 4.64 (19.7%) / 5.38 (16.8%); gdn 4.36 (18.5%) / 5.15 (16.1%); hc 2.58 (11.0%) / 5.60 (17.5%); attn_sdpa 2.66 / 3.16; moe_shared 0.55 / 1.73; gdn_recur 0.01 / -0.05. The QWEN4_PROFILE_FWD=1 block split (syncs per block) read hcRead + hcWrite as 53% at S=6 and over-weights blocks that run in all 40 layers; use the removal numbers. moe_router, moe_gateup, moe_down, gdn_proj and attn_qsa at S=9 are slower than the blocks they replace and are unusable. The 8 to 9 row step is the MoE rows arm ending (mlp ops 1104 to 2112). A per-kernel ranking failed: the Metal shader profile is empty under --serve
2026-10-04, MOE_UBENCH=1 (src/moe_gather_ubench.zig: top-10 of 512 experts, hidden 2560, intermediate 640, 4-bit g64, bf16), dce06d2, 3 runs, omp paused. gatherQmvGateUp (18.4 MB per call) 31.7 / 19.4 / 17.3 us = 582 / 950 / 1063 GB/s; gatherQmvDownReduce (9.2 MB) 24.7 / 23.4 / 26.5 us = 373 / 395 / 348 GB/s; stock gather_qmm gate+up 338 to 368 GB/s, down 374 to 408 GB/s. The down kernel runs at 33 to 64% of gate-up's rate and about where stock down sits; matching gate-up would save 0.42 to 0.77 ms per decode token over the 48 layers (5 to 9% of 8.7 ms; first posted as 0.35 to 0.64 over 40 layers, corrected). Gate-up moves 582 to 1063 GB/s between runs and is probably cache-assisted, so achieved GB/s is relative; no streaming peak was measured; decode kernels only, not the verify rows arm
2026-10-04, dce06d2, test file on mlx-serve branch perf/moe-rows-ubench, bench/studio-bench-moe-ubench.sh rows, 6 runs in 2 windows, omp paused, watchers clean. gatherQmvGateUpRows + gatherQmvDownReduceRows at S=2..8 rows (top-10 of 512 experts, hidden 2560, intermediate 640, 4-bit g64, random routing per row), GB/s over the distinct experts: pair 726 to 792 GB/s at every S (gate+up 707 to 811, down+reduce 607 to 870); a sum over 2 GiB bf16 reads at 1031 to 1066 GB/s median (best 1089), so the rows pair runs at 69 to 75% of it. S=6 pair 212 us per layer x 48 layers = 10.2 ms, matching the mlp block's removal cost (9.98 ms). Headroom at S=6: 1.7 ms at 85% of the streaming rate, 2.1 ms at 90%, 2.9 ms at 100% (7 to 12% of a 23.5 ms forward). Random routing is the worst case for bytes; the streaming rate is relative, not a datasheet peak; the harness's S decode pairs arm is not a fair baseline (independent, overlapped, cache-assisted) and is excluded
Retune of the verify-width MoE rows kernels: threadgroup size, lanes per row, vectorized x loads (follow-up to the row above)
ours
2026-10-04, M5 Ultra, omp paused, Latch measurement jobs, bench/studio-rows-variants.sh (interleaved there and back, 2 passes) and bench/studio-rows-fwd.sh; variants are one-line edits of dce06d2. Microbench, rows gate+up + down+reduce pair at S=6 (stream peak 1030 GB/s): base 208 to 213 us, 750 GB/s. Gate+up threadgroup of 32 simdgroups instead of 8: 160 to 163 us, 985 to 996 GB/s (-24%), 970 to 1015 GB/s across S=2..8; 16: +3%; 4: -1%. Down+reduce lanes per row (the constant is shared with the solo kernel): 16 +4%, 32 0%, 4 -40%. 8-byte x loads: 380 us (1.8x slower) behind an in-kernel alignment branch, 213 to 216 us (no change) with the branch removed. Whole verify forward (MLX_SERVE_DECODE_FWD_UBENCH, 60 forwards, no sampling, A B B A, dce06d2 against dce06d2 with the 32-simdgroup change, bit-identical to the solo kernel in the rows tests): S=4 18.84 / 18.87 ms base against 19.02 / 19.10 patched, S=6 23.57 / 23.55 against 23.58 / 23.58, S=8 27.21 / 27.25 against 27.27 / 27.17. No gain. In the base trace the two rows kernels are 28.8% + 21.1% of sampled GPU time at S=6. xctrace returned no shader samples for the patched binary on two tries, so there is no per-kernel time for it. Why: retracted, the next row has the measured answer. Items (1) and (2) of this row's earlier text (four extra dependent gate+up dispatches costing 13 us each, with and without shifted expert ids) are void: the diagnostic's zero was float32, so the duplicate's input became float32, the rows kernel declined it, and the layer fell back to the sorted path; those runs timed the fallback, not the kernel. Measured: Real generation (bench/studio-rows-real.sh: 12 real greedy prompts through MTP, one binary, MSV_GU_SGS picks the width, order 8 32 32 8 8 32 32 8): 8 simdgroups 167.9, 171.3, 174.8, 176.2 tok/s (mean 172.6), 32 simdgroups 169.7, 167.5, 163.6, 167.8 (mean 167.2), about 3% against the change at a spread of about 3%. The microbench gain does not carry into real rounds. Follow-ups the same day. Real rounds: 5.42 rows per verify forward read a mean of 32.4 distinct experts per layer (MSV_COUNT_DISTINCT, 51,840 layer calls over 12 greedy prompts), against 54 requested slots, so about 40% of slots are repeats; the microbench's random sets averaged 53 distinct. Overlap test (rows pair, S=6, same binary): 60 slots over 53 distinct experts 210 to 212 us, 60 slots over 10 distinct experts (every row repeats row 0's) 176 us, so cutting distinct weight bytes 5.8x cut the time 16%: the kernel's cost follows slots, not DRAM bytes. Loop the solo decode pair once per row instead of the rows kernels (MSV_ROWS_AS_SOLO, real generation, order rows solo solo rows rows solo solo rows): rows 173.2, 165.1, 167.6, 167.4 tok/s (mean 168.3), solo 144.2, 142.3, 144.9, 144.8 (mean 144.1), 14% slower, identical token counts within 1%. The microbench's S decode pairs arm (65 us at S=6, 2.4 TB/s) is a cache-warm artifact and stays an unfair baseline. The 1.7 to 2.9 ms headroom in the row above is not reachable through these three levers. Expert-major gate+up prototype (bench/patches/mlx-serve-moe-expert-major-gateup.patch: a grouping kernel lists each distinct expert with the rows that chose it, then one simdgroup per output row and distinct expert loads and dequantizes the weights once and serves up to two member rows per pass; bit-identical to the rows kernel in four overlap configurations): rows gate+up against expert-major at 5 to 6 rows with a hot pool of 42 experts (about 35 distinct, the real overlap), marginal medians, two interleaved passes: S=2 48 / 56 us, S=4 94 / 94, S=6 134 to 137 / 130 to 131 (-3%), S=8 176 / 159 (-10%); random experts (57 distinct) S=6 144 / 156 to 160 (+10%). The grouping kernel is one more dispatch per layer, so the S=6 gain does not survive it. Cutting the simdgroups per output row from 60 to about 35 did not cut the time, so the cost sits in per-row x loads and multiply-adds, which sharing the weights does not touch. Not wired into the forward, no real-generation run. Staging the row's x in threadgroup memory (one copy per 8-simdgroup threadgroup, which shares a row; bit-identical in the rows tests) is 8% slower, rows gate+up S=6 157 to 159 us against 144 to 146 off, S=8 212 to 215 against 191 to 195, equal at S=2, two interleaved passes. Of the per-row costs tried (x loads vectorized, x staged, weights and dequantization shared across rows) none moves the kernel by more than 3%, and the rows pair stays near 750 GB/s of slot bytes at every S
not built; bench/studio-rows-*.sh; benchmark tests for the rows kernels kept on mlx-serve branch perf/moe-rows-ubench, unpushed
Where the time goes in the rows pair when the calls are chained, and why every overlapped-microbench win lost in real generation (follow-up to the row above)
ours
2026-10-05, M5 Ultra, omp paused, Latch measurement jobs. The microbench times independent calls issued back to back, which overlap each other's ramp-up and tail. Added a chained arm (each call's input depends on the previous call's output through a bf16 zero, three small ops, 14 us per call on their own) and it reproduces the real-generation sign. Two kernel variants, both bit-identical to the rows kernel, win overlapped and lose chained and real: gate+up with 2 output rows per simdgroup (bench/patches/mlx-serve-gateup-rows-per-simdgroup.patch, MSV_GU_R): S=6 overlapped pair 185 us against 210 (-12%), chained 212 against 201 (+5%), S=8 chained +7%, real generation 165.6 tok/s against 172.8 (4 interleaved arms each of 12 prompts, -4%); R=4 worse everywhere, R=8 spills (505 us). The 32-simdgroup threadgroup lost 3% in real generation the same way. Chained S=6, marginal us per call: pair 200, gate+up alone 114, down alone 84, dependency ops alone 14, so gate+up costs about 100 us for 105 MB (1.05 TB/s) and down about 70 us for 53 MB (0.76 TB/s). Ablation of the gate+up kernel, chained pair at S=6 (outputs garbage, time only; overlapped pair in brackets): all in 201 [212]; scale and bias loads removed 192 [191]; x loads removed 200 [161]; weight loads removed 164 [155]; dequantization arithmetic removed 190 [169]; x, weights and scales removed 150 [126]; everything removed 144 [117]. The x loads that cost 50 us overlapped cost nothing chained, which is why the vectorized and staged x variants did nothing. Read ceiling: a 2 GiB streaming read with 16-byte loads, 1 to 8 loads in flight per lane, per-simdgroup spans or grid-strided, tops out at 1.03 TB/s median and 1.06 best in every form, and the reduction kernel gives the same 1.03 to 1.09, so the machine's practical DRAM read rate here is about 1.05 TB/s, not 1.4. Reading it: in a chain the gate+up kernel is already at that ceiling and only the down kernel (0.76 TB/s) has room, about 19 us per layer if it reached it, 0.9 ms of a 22 ms forward (4%)
not built; bench/studio-rows-r.sh, bench/patches/mlx-serve-gateup-rows-per-simdgroup.patch; chained arm, wide-load ceiling and overlap switch committed on mlx-serve branch perf/moe-rows-ubench (3aa89a1), unpushed
Lanes per output row in the down+reduce kernels, 8 against 16 (ddalcu/mlx-serve#732)
ours
2026-10-05, M5 Ultra, omp paused, Latch measurement jobs. Chained bench (bench/studio-rows-variants.sh-style variants of DOWNRED_LPR, two interleaved passes agree): rows pair us per call at S=2/4/6/8: 8 lanes 84/141/200/253, 16 lanes 79/128/177/224 (-6% to -12%); down alone 42/63/86/106 against 37/52/71/88 (-11% to -17%); 32 lanes at S=6 pair 192, 4 lanes 238. One-token down kernel unchanged (11.0 to 13.8 us against 11.4 to 13.8). The down kernel went from 0.76 to 0.93 TB/s. Real generation, bench/studio-ab-env.sh (12 greedy prompts through MTP, A B B A, MSV_DN_LPR): window 1 172.0 -> 175.5 tok/s (4 arms each, +2.0%), window 2 170.4 -> 172.5 (8 arms, +1.2%), window 3 165.1 -> 174.8 (4 arms, +5.9%), pooled 169.5 -> 173.8 (+2.5%). The watcher's only findings were the arm server itself (not on its allowlist) and 1 to 2 ticks of mobileassetd. Full suite on the PR tree 3066 passed, 0 failed. Kept: PR #732, which also carries the chained bench
PR ddalcu/mlx-serve#732; the first positive real-generation result of the kernel work
Existing switches and probes, real-generation A/B on top of 16 lanes (4 arms each, A B B A, same harness)
ours
2026-10-05, M5 Ultra. MLX_SERVE_DECODE_ASYNC_LADDER 4: 170.4 -> 174.7 tok/s (+2.6%); 8: 173.8 -> 172.3 (-0.9%). Null: ladderStepMulti returns unless seq_len == 1, so it never fires on a verify forward, and the two strides disagree in sign. MLX_SERVE_MOE_VERIFY_PAIRED_GU=1 (installs for 48 layers, S=4 only): 172.9 -> 175.6 (+1.6%), ranges overlap, inconclusive. MSV_ROWS_MAX=16 with --mtp-depth 10 in both arms (rows arm past S=8; this chip's auto depth cap is 8, so S=9 rounds exist): 173.6 -> 175.0 (+0.8%), null. MLX_SERVE_DISPATCH_PROBE=8 (eight trivial kernels per MoE layer): 170.5 (sd 0.9) -> 163.2 (sd 1.5), -4.3%, about 0.8 ms per round for about 390 added ops, so one real kernel launch costs about 2 us in the live graph. The earlier reading of that figure was wrong: the 3,737 'ops' of a verify forward are FFI graph-building calls (mlx.op_count counts check calls, and free reshapes and same-dtype casts count), not launches. A forward launches about 717 kernels (445,767 launches over about 622 forwards in the base trace, counted from the per-kernel section only): affine qmv 98, hc_read d/n/u_v 50/50/48, router 49, MoE gate+up and down 48 each, swiglu 39, multiply 36, gdn recur 35, add 32, sigmoid 18, rms 13, the four qsa kernels 12 each. The small elementwise glue (multiply, add, sigmoid, copies) is about 117 launches, 0.2 ms at 2 us, 1% of a forward; every launch of every kernel is at most 1.4 ms, 6%. Fusing glue is not a lever Window-to-window noise on the unchanged arm is about 2% (169.5 to 173.8 across windows), so anything under 2% needs the pooled figure. A kernel ranking at S=6 kv=32768 returned no shader samples; the forward there is 24.2 ms against 23.6 at 4096, so attention length is not a lever
bench/studio-ab-env.sh; op counts at S=6 per forward: hcRead 1181, mlp 1104, attn about 730, hcWrite 768, gdn 432, ple 48
8-bit dense projections (affine qmv, about 95 launches per forward, 8.6% of sampled GPU time) on the plain-SIMD verify lane: MLX_SERVE_VERIFY_QMM_MIXED_PLAIN=1
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, perf/down-reduce-lpr16 at b6e95488. Why stock serves them: mixedPlainShapeEnabled is false for 8-bit, and the q8 NAX lane starts at M=7 and only for N >= 5120, so M=6 8-bit goes to stock by design. Microbench (MLX_SERVE_VQMM_FN_UBENCH, overlapped, so optimistic): plain lane 0.87-0.94x stock on the N >= 2560 shapes at M=3 and 5 (gdn_qkv, gdn_z, gdn_out, attn_q, attn_o), about 0.6 ms per forward summed at M=5, a 3% ceiling. Real generation, 8 arms each interleaved, 12 greedy prompts through MTP: default 175.7 tok/s (sd 3.5), MIXED_PLAIN=1 173.2 (sd 3.3), -1.4%, inside the 2% noise. Engagement checked: the B logs carry [vqmm] plain-SIMD verify lane engaged at 8-bit, the A logs do not. Null, consistent with the M4 Max 8-bit result (1.01-1.04x) in the mixedPlainShapeEnabled comment. Shape-gated variant tried the same day (8-bit g64 with 2560 <= N < 100000, so the shared expert and lm_head stay on stock; arm A is MIXED_PLAIN=0, arm B the new default, 8 arms each, same harness): A 171.9 tok/s (sd 3.6), B 173.2 (sd 3.3), +0.7%, null; engagement checked in the B logs (plain-SIMD 8-bit line, and the q8 NAX line at M=8). Dead end: the 8-bit dense projections on a plain-SIMD or NAX lane do not move generation
bench/studio-ab-env.sh with BASE_FLAGS plus --skip-mem-preflight (the live server is resident); window ~/bench/window/20261005-0922-ab-env, watcher flagged it unclean only for the live and arm servers and one foreign peer at 09:35:22
Hyper-connection read in two launches at verify width (S rows), MLX_SERVE_HC_DECODE2_ROWS: the existing one-row two-launch kernels (src/hc_decode2.zig) with the row on the grid z axis, replacing the compiled three-kernel graph
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, mlx-serve 17b91c9c (off origin/mainc84a5a63), bench/studio-bench-hcrows.sh, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards), kv 4096, arms A B B A A B B A per shape, live server stopped for the run, watcher CLEAN (60 ticks). S=6: 23.59 ms (range 23.56-23.62, 3587 ops) against 23.61 ms (23.58-23.66, 3393 ops), -0.1%. S=9: 31.89 ms (31.86-31.94, 5874 ops) against 31.55 ms (31.54-31.57, 5680 ops), +1.1% (0.34 ms), ranges disjoint. Launches drop by 194 per forward at both widths, yet S=6 does not move: the cause is not weight traffic (see the sweep row: loading the weights once for all rows changed nothing). Under the 2% bar at S=9 and null at S=6. Parity test at 2, 6 and 9 rows passes. Not proposed. Running a second 70 GB copy beside the live server got the live server killed (OS_REASON_JETSAM, launchd runs = 2); the note that two copies fit in 256 GB is wrong
the code is commit 17b91c9c on the local branch perf/launch-trim-bundle (not pushed); raw files ~/bench/window/20261005-1157-hcrows on the Studio
Same multi-row HC read, width sweep S=2..9 and 16 (A = rows 1: one-row kernels, the compiled graph up to 6 rows, the three-launch read from 7; B = rows 16)
ours
2026-10-05, same setup as the row above, bench/studio-bench-hcrows.sh with SHAPES over nine widths, arms A B B A (two per side, thin), live server stopped, watcher CLEAN (130 ticks). B against A: S=2 +3.5% (15.11 to 14.58 ms), S=3 +1.3%, S=4 +0.7%, S=5 +0.3%, S=6 -0.4%, S=7 -1.4% (25.40 to 25.74), S=8 -1.8% (27.19 to 27.67), S=9 +1.2%, S=16 +0.4%. Launches fall by about 194 at every width. Gains at 2-3 rows and losses at 7-8 rows, so it is not flat everywhere; the joined multi-slot path cannot be driven by the ubench and was not measured. Dropped as a simplification that deletes the compiled graph (about 200 lines) because 7-8 rows lose. Retest with the row loop inside the kernels (weights loaded once, 401032b0, reverted), 4 arms per side, watcher CLEAN (260 ticks): S=2 +2.3%, S=3 +1.0%, S=4 +0.3%, S=5 +0.3%, S=6 -0.1%, S=7 -1.5%, S=8 -1.8%, S=9 +0.4%, S=16 +0.1%. Weight traffic was not the cause; the loop only gave up parallelism. Likely cause, not verified: the old three-launch read has a tuned uv variant for 2-8 rows (uint4 loads, activations staged in threadgroup memory) that beats a plain per-element kernel at 7 and 8; test with MLX_SERVE_HC_UV=0 on the A arm. Raw files ~/bench/window/20261005-1223-hcrows
local branch perf/launch-trim-bundle17b91c9c; raw files ~/bench/window/20261005-1211-hcrows on the Studio
Why the two-launch HC read loses at 7-8 rows: the tuned uv variant of the three-launch read (hcUvEligible: 8-bit, hc 4, 2-8 rows; uint4 loads, activations staged in threadgroup memory). Arms A (today), U (A with MLX_SERVE_HC_UV=0), B (two-launch, rows 16)
ours
2026-10-05, same setup, bench/studio-bench-hcrows.sh, arms A U B B U A A U B B U A (4 per arm), grid-z kernels 73fe598e, live server stopped, watcher CLEAN (132 ticks). A / U / B: S=6 23.62 / 24.11 / 23.69 ms; S=7 25.42 / 26.18 / 25.73; S=8 27.14 / 28.01 / 27.63. Switching uv off costs A 2.1% (S=6), 3.0% (S=7), 3.2% (S=8), and then the two-launch kernels beat it by 1.4-1.7%. So uv is worth about 3% and merging the launches about 1.5%; B sits between. A kernel with both would gain about 1.5% over today, under the 2% bar. Closed. S=6 also moves with uv off, so A at 2-6 rows takes the uv path in this ubench; the path description in the sweep row (compiled graph up to 6 rows) is unverified
raw files ~/bench/window/20261005-1246-hcrows on the Studio; code 17b91c9c and 73fe598e on the local branch perf/launch-trim-bundle
Two-launch HC read with the uv lane layout ported into the up launch (U2V_SOURCE: lanes split [part][stream][column], 16-byte weight loads, all rows' activations staged once per threadgroup; hc 4, 8-bit, 2-16 rows), B against A (today)
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, mlx-serve 8162cb18, bench/studio-bench-hcrows.sh, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards), kv 4096, arms A B B A A B B A, live server stopped, watcher flagged one tick of mobileassetd at 42% CPU during two B arms (S=6, S=7; it could only slow B). B against A: S=2 +3.6% (15.12 to 14.58 ms), S=3 +2.2%, S=4 +2.2%, S=5 +1.5%, S=6 +1.4% (23.61 to 23.27), S=7 +1.2%, S=8 +0.7%, S=9 +3.6% (31.91 to 30.75), S=16 +1.7%. Faster at every width; every range disjoint. Parity test at 2, 6 and 9 rows asserts the vectorized launch served. Single-slot ubench only: the joined multi-slot path and real generation are not measured
local branch perf/launch-trim-bundle8162cb18; raw files ~/bench/window/20261005-1344-hcrows on the Studio
Real-generation A/B of the two-launch HC read at every verify width (default on): arm A MLX_SERVE_HC_DECODE2_ROWS=1 (today's paths), arm B MLX_SERVE_HC_DECODE2_ROWS=16, same binary
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, mlx-serve 1d3082bb, bench/studio-ab-env.sh (12 greedy prompts per arm through MTP), arms A B B A A B B A, live server stopped, watcher CLEAN (112 ticks), --skip-mem-preflight. A 172.8 tok/s (runs 167.5 174.3 176.1 173.3, sd 3.2), B 176.1 (174.4 176.4 177.5 176.1, sd 1.1): +1.9%. A's first arm is a cold start; without it A is 174.6 and B is +0.9%, which the width ubench predicted (about 1%). Faster, not provably so at n=4; the case for the change is the code it lets us delete
raw files ~/bench/window/20261005-1410-ab-env on the Studio
One hyper-connection read for 1-16 rows (the two-launch kernels with the uv lane layout at every row count; the compiled graph, the three-launch read and its tuned variant, and the .hc_graph feature deleted), against main 0f01d29
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, branch at bb38572c then rebased as eabd2233, arms A B B A A B B A, live server stopped, watcher CLEAN (294 ticks forward, 118 generation). Forward ms, main to this: S=1 11.25 to 11.37 (-1.0%, ranges overlap), S=2 +3.5%, S=3 +2.6%, S=4 +2.1%, S=5 +1.7%, S=6 +1.3%, S=7 +1.2%, S=8 +1.0%, S=9 +3.6%, S=16 +1.8%. Real generation 170.5 (sd 0.8) to 170.9 (sd 1.3) tok/s, +0.2%, inside the noise. Row-count invariance (a row sums the same at every row count) needed the vectorized launch at 1 row too and a lazy up weight evaluated before the choice; the unit tests pin both. Net about -420 lines. Full suite with the model: the same 11 tests fail on main and on the branch. M5 Max and older chips not measured
merged 2026-10-05 as ad65559bddalcu/mlx-serve#740. The maintainer reproduced it on a second M5 Ultra: faster at 2-16 rows (+0.6% to +4.2%), 1 row 1.6% slower with non-overlapping ranges (the vectorized up launch serves 1 row so a row sums the same at every row count; the generic launch at 1 row would restore it and give up that identity at 8-bit). M5 Max chained read bench, graph against two-launch, rows 2-16: two-launch 18% to 35% faster in 3 runs of 9 passes with one cache-hot weight set (bench on the fork branch scratch/hc-chained-bench); corrected with 80 distinct weight sets, as a forward streams them: 11.9% to 22.2% faster at every width 2-16 (fe141f1f)
One-row up launch with a 16-simdgroup threadgroup (rows 2 and up keep 8), ddalcu/mlx-serve#750
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, kv 4096, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards), live server stopped, watcher CLEAN (139 ticks for the final A/B). Cause of the 1-row cost found in PR 740 (vectorized up launch 0.15 ms slower than the generic one in an 11.2 ms forward): the 8-simdgroup threadgroup. Same binary, 1-row forward, vectorized against generic up launch, 8 arms per side: 2 simdgroups -1.9%, 4 -1.2%, 8 -1.0%, 16 -0.2%. 16 simdgroups at other rows: 2-12 rows within 0.4% of 8, 16 rows 1.3% worse, so only 1 row takes 16. Branch against main: S=1 11.36 to 11.29 ms (+0.6%), 2/4/8/16 rows +0.1/+0.1/+0.1/+0.0%. Both read-level microbenches (one weight set, and 80 sets) said the vectorized read was equal or faster at 1 row: only the forward showed the cost, so a read bench cannot clear a read change by itself. The threadgroup shape changes no arithmetic, so the bit-identity tests are untouched
branch 0be5709b on the fork, bench 8b9b88bf on scratch/hc-onerow-bench; open, watcher armed
Verify forward cost by row count on main, and what it says about grouped MTP rounds (ddalcu/mlx-serve#685, fixed depth 3, 4 rows per stream)
ours
2026-10-05, M5 Ultra, iQ 4.7bpw pack, kv 4096, one slot, MLX_SERVE_DECODE_FWD_UBENCH (60 forwards), live server stopped, watcher CLEAN (155 ticks for the 8-16 window). Main, ms: 2 rows 15.11, 3 17.02, 4 18.94, 8 27.19, 9 31.91, 12 38.09, 16 44.59; about +2 ms per row except +4.7 ms at 8 to 9 (op count 4772 to 5874). A/A control, main 0f01d29 against main c84a5a63: within 0.2% at 8-16 rows. Break-even for grouping against a plain tick (group ms over plain ms, minus 1 = accepted drafts per stream-round): 2 streams 0.80, 3 streams 1.24, 4 streams 1.35. Predicts code above and prose near the line at 4 streams, which fits the PR's +15.8% and -1.2%; acceptance counts for those rows not yet seen. Ultra at kv 4096 against the PR's M5 Max at 8192. The grouped path itself was not run
review posted on ddalcu/mlx-serve#685; raw files ~/bench/window/20261005-1644-hcrows on the Studio
Fixed --mtp-depth 5 against the adaptive controller
ours
124.4/122.3 against 123.2 base: no change
studio-bench, 2026-10-01
Long-context MTP gain (server log, iQ era, 300+ token outputs at 256k+ context)
ours
MTP ~1.35x over plain decode at ~400k (128 vs ~95 tok/s), against +94% at short context; think_bound closes MTP for the rest of 14% of requests and costs them ~6% (~1% overall)
studio-bench, 2026-10-01
Survey 2026-10-06 (oMLX 79f4488, TensorFold cb2ebf0 plus branch zig-flashnext, MLX main 54 commits past our pin, llama.cpp c479922). Nothing ported; read from source, no Studio runs. oMLX: top-k fold (1-3 rows only), 2-rows-per-simdgroup MoE down at one token, row-exact unrolled tiles (they hit a Metal compiler bug on M5 Ultra and added a runtime canary against stock quantized_matmul), FP16 compute, TurboQuant KV and SSD expert offload are under the bar or on other shapes. Their 8-rows-per-simdgroup down kernel was -0.9% in real generation. Deferred GDN rollback states net 0-2% once partial accepts replay. Fused attention rows cap at 3.8% of our 2.2 ms block. TensorFold: row-parallel router logits +2.1% decode for them (~1.6% for us); GPU-resident MTP rounds +1.7%; they measured and rejected weight prefetch beside dependent launches, two-queue decode lane groups, one-launch experts, grouped or packed experts, a persistent grid-barrier kernel, per-round adaptive depth, and 32- and 128-row prefill expert tiles. MLX: ml-explore/mlx#4596 (SDPA 2-pass unroll) was measured on an M1 and Flash Next's verify never reaches MLX SDPA because our fused QSA kernel serves widths 2..15; mlx-lm #1559 is already merged (0-1.3%); ml-explore/mlx#4568 is host-only, under 1%; MLX #4562 repeats the command-buffer dead ends above. llama.cpp runs Flash Next at ~800 t/s prefill on an M2 Ultra (pp8192 817) against our ~4,500, so there is nothing to port. Corrections to rows above: the TensorFold "nothing to port" row holds for its Python engine only (frozen at 0.6.5, TensorFold issue 286); its Zig engine has its own NAX prefill at ~4.2k tok/s at 8k on 6-bit. The QSA "29-39 against 7-10 ms" gap was a harness mismatch (TensorFold issue 457 reads 9.42 and 8.73 ms per layer; ours is ~10). The counting-sort lead is already built (transformer.zig:33021, prefill route packing)
not ported
survey 2026-10-06; reports in ~/.claude/tmp/perf-survey-*.md
Leads
Lead
Source
Block
Estimate
Status
GPU keep-warm ticker between requests: 1.0-1.7 s TTFT stalls after 2-6 s idle
open: measure the peak on the Studio with a plain matmul first
Packed gated-delta layout, 4 lanes per value row
mlx-lm #1559 (no figure published)
gdn
0-0.8%
open: microbench against ours
Fused hyper-connection read: normalize while loading the down-projection tiles, mix at the end of the up projection, so normed and up never reach memory
30-45 ms of the chunk (1.6-2.4%), 12-20 h, new tensor-unit kernel
open
bf16 instead of 4-bit weights for the small dense matmuls (HC down/up, GDN projections)
TensorFold issue #97, M2 Max only: bf16 +41-47% at 2,048 rows
hcRead, gdn
unknown on M5; costs 0.6-3 GB, not bit-identical
open: 1 h microbench of one HC matmul at 8,192 rows
MoE tensor-unit peak: TensorFold measured 130 TFLOPS on the M5 Ultra (65 on the M5 Max; FZ_MMA_PEAK=1, commit 090f43ad8be2), so our 61 TFLOPS MoE sits at 47% of a synthetic peak
TensorFold
mlp
the ~118 TFLOPS derived peak above was low. Dequantized 4-bit tiles will not reach a synthetic mma peak, so read it as a ceiling
open: sets the ceiling only; TensorFold has no better MoE kernel to port
Routed Q4 g64 gate+up on INT8 tensor ops with SwiGLU fused, on our shapes (hidden 2560, intermediate 640, 512 experts)
their M5 Max: +6.1% to +7.8% prefill at 1K-128K (8K: 2,929 -> 3,155 tok/s). Lossy (NLL +0.0032, top-1 agreement 0.919) and opt-in. Ours ~+5-7%, 30-40 h. Differs from the Bonsai int8 row, which is dense 2-bit g128 only; no routed INT8 exists in src
open: the PR is hours old and unmerged; the only prefill lead above the bar
Staggered two-queue prefill: one chunk runs as two segments on two Metal queues, so one segment's scans and glue overlap the other's matmuls
TensorFold commits c1fb804d123e, c2bede8fd7d3
gdn, glue
their M5 Ultra: +5.5% at 8k, +8.5% at 32k, +7.4% at 256k (4,017 -> 4,238 tok/s at 8k). Ours +3-6% cold prefill, 24-32 h. Needs 4,096 rows per segment, so it does nothing while anyone decodes (chunk is 1,024 or 2,048 then)
open: 3 h probe first; check that two queues overlap on our kernels (src has no second mlx_stream_new)
Native NAX chunk-parallel gated delta against our pipelined recurrence
the recurrence is 36 x 3.36 ms = 121 ms of a chunk: 1.5x faster saves 2.2%, 2x saves 3.2%. Needs an mlx-c binding, a pin with 4594, and a state dtype check (ours is bf16); 10-16 h
These act only while several streams decode or a prefill overlaps decode, which is why a quiet A B B A never shows them. Probe: bench/studio-mixed-probe.py or bench/studio-padmix-probe.py with the live flags.
Lead
Where
Why it could cost
Test
Status
mlx_clear_cache() after every prefill chunk with no check for decoding peers. Each decode stream also clears on its own clock (advanceStep, every CACHE_CLEAR_INTERVAL steps per Generator), so N streams clear N times as often
generate.zig:3014, generate.zig:3586
a clear drops every stream's parked buffers, so the next ticks allocate again. The prefill clear also bounds transient memory, so skipping it carries a memory risk
env switch that skips the per-chunk clear and runs one shared decode clock while another slot is live; A B B A under the mixed probe
measured 2026-10-06, no gain (screen below); dropped
Prefill chunk is 1,024 rows whenever --prefill-decode-share > 0 and someone decodes (DECODE_SHARE_PREFILL_CHUNK; the live flag is 0.5). TensorFold keeps 2,048
scheduler.zig, companyPrefillChunk
rows per expert at 1,024 rows are 8x lower than at 8,192, so MoE prefill runs less efficiently. PR 568 recorded only that 2,048 helps other streams
prefill and decode tok/s at 1,024 / 2,048 / 4,096 rows under the mixed probe
measured 2026-10-06: 2,048 gives +20% prefill with decode not lower (screen below). Closed by Sam the same day: prefill chunking is very low yield, do not pursue or confirm it
Joined verify groups past 8 rows leave the MoE rows arm (+4.7 ms per forward from 8 to 9 rows, row 87). Three or more streams at 3-4 rows each land there
transformer.zig rows arm gate; 41896655 kept the join
a microbench found that capping joins at 8 rows was slower; real grouped generation was not measured
MSV_ROWS_MAX=16 with grouped rounds at N=3-4 (row 78 tested solo only)
open
Solo against N=4 acceptance and text identity. llama.cpp fixed row-to-slot mixing in ggml-org/llama.cpp#29019 (+16.9% acceptance at concurrency 16)
mtpBatchedAcceptGraph, generate.zig:6914-6959
the mixed probes record tok/s only. The 2026-10-06 log read of the live run shows acceptance flat across in-flight counts (51 / 55 / 55 / 50% at 1 / 2 / 3 / 4+, above 100k context), so no sign of row mixing. The solo drop (95% -> 55-60%) stays unexplained
same greedy prompts solo and at N=4; compare tokens per round and output text
replay 2026-10-06: the drop is the workload, not the binary (below); N=4 identity check still untested
MLX_MAX_MB_PER_BUFFER 50 against 200 at 137k-305k decode. MTPLX 2.12.0 on an M5 Max with Flash Next at 128K: 51-54 -> 65.9 tok/s (+22-29%), +11.7 GB peak at 16K prefill
MLX device init reads it once
row 147 tested short context only; live traffic is 120-300k (row 89)
A/B with studio-padmix-probe.py at the PR 716 contexts; a decode-only cap needs an MLX patch
measured 2026-10-06 at 137k: -0.4%, null; dropped
Idle unwiring: macOS 27 drops wired GPU pages after ~2 s idle (ml-explore/mlx#4609: 342 ms against 58 ms for the first compute after 12 s idle). Alternative to the oMLX ticker above: ml-explore/mlx#4633 (MLX_METAL_RESIDENCY_REFRESH_INTERVAL_MS), whose refresh thread holds mtx_ while re-requesting residency and could stall malloc
MLX Metal residency
TTFT after idle, not tok/s
same probe as the keep-warm row
open
Screen 2026-10-06 (mixedenv1): one experiment binary (origin/main 431ac5d7 plus env switches MSV_NO_CHUNK_CLEAR, MSV_DECODE_CLEAR_INTERVAL, MSV_SHARE_CHUNK, MSV_COMPANY_CHUNK, MSV_ROWS_MAX; worktree mixed-load, not pushed), live flags, bench/studio-binab.sh with E.NAME=VALUE arms and bench/studio-mixed-probe.py (4 decoding streams plus 1 rolling cold ~17k-token prefill, 90 s, 400-token replies, server generation_tokens_total), Latch measurement job, omp paused, order b c s2 s4 r16 d2k then reversed, twice (24 arms). 14 arms clean; 10 dropped, all for mlxtop on the Studio (busy_process, until paused) and connections from this Mac (remote_peer, source unidentified; the hermes gateway was paused from A14 on and A16, A18 and A20 were still flagged). Clean-arm means, Welch 95% against the plain arms (n=3):
Variant
n
decode tok/s
prefill tok/s
base
3
99.4 (106.7, 84.4, 106.7)
1,720
MSV_SHARE_CHUNK=2048
3
105.4 (+6.0%, -25% to +37%)
2,063 (+20.0%, +12.6% to +27.4%)
MSV_SHARE_CHUNK=4096 and MSV_COMPANY_CHUNK=4096
1
92.9
2,398 (+39%, n=1)
MSV_NO_CHUNK_CLEAR=1
3
92.0 (-7.4%, -39% to +24%)
1,642 (-4.5%, -17% to +8%)
MSV_DECODE_CLEAR_INTERVAL=2048
2
106.2 (+6.8%, interval spans zero)
1,752 (+1.9%)
MSV_ROWS_MAX=16
2
99.7 (+0.3%)
1,784 (+3.7%)
Reading: skipping the per-chunk clear and moving the decode clear clock show no gain; both are dropped. MSV_ROWS_MAX=16 shows nothing at 4 decoders. The decode column is coarse: five arms read 106.7, which is 24 finished 400-token requests in 90 s, and the plain arm alone ranges 84-107, so a decode difference under about 20% cannot be seen at this n. The one signal is prefill: starting a prefill beside decoders at 2,048 rows instead of 1,024 raised prefill tok/s by 20% with decode not lower. It is not yet a result: decode latency (inter-token stall per chunk doubles to ~0.45 s), the 137k-300k contexts the live traffic runs at, and 4,096 rows (decode 71-93 across the four arms, the contaminated ones included) are untested. The server's adaptive hook already widens a capped prefill from 1,024 to 2,048 after the first chunks ([prefill] width 1024 -> 2048 at pos 2048), so the gain comes from the first chunks.
Binary replay 2026-10-06 (replay1, answers whether the live acceptance drop is the build): 0f01d29 against the live 431ac5d7, bench/studio-replay-probe.py, six captured agent requests (426 KB to 1.06 MB, 86k to 296k prompt tokens; captures 70, 155, 207, 54, 108, 171), solo, temperature 0, 300 tokens, iQ 4.7bpw pack with the live flags, order A B B A, omp paused, 4 arms clean. Mean per-draft acceptance (per_draft_pct from the server's [spec-stats] line): 0f01d29 79.1% (n=12, sd 15.8), 431ac5d7 84.0% (n=12, sd 17.3), so the new build is not lower. The request sets the acceptance: captures 54, 70 and 207 read 91-100% on both builds with identical output hashes, 108 reads about 70% on both, 155 reads 48-66%, and 171 split (0f01d29 66.7 and 69.8, 431ac5d7 92.7 and 94.3). Temperature-0 output is not repeatable across restarts for 108, 155 and 171 (the hashes differ between arms of one binary), so one request's acceptance moves by up to 18 points between runs of one build. Conclusion: the live drop from 95% to 55-60% is the workload, not a binary. The probe's decode rate column is not usable (the reasoning text arrives in one burst and reads 1,000+ tok/s); only acceptance and hashes are.
MLX_MAX_MB_PER_BUFFER 50 against 200 at 137k, 2026-10-06 (mbbuf1): live binary 431ac5d7 for both arms, live flags, bench/studio-padmix-probe.py with the live load shape (2 long contexts of 137,497 and 136,650 tokens plus 2 short streams, 90 s, server generation_tokens_total), PADMIX_MAX_BYTES=600000, order A B B A A B B A, omp paused, 8 of 8 arms clean. Base 165.0 tok/s (165.3, 159.6, 170.9, 164.2), 200 MB 164.3 (167.0, 163.8, 166.8, 159.5), -0.4%, ranges overlap. Null at 137k, so MTPLX's +22-29% at 128K on an M5 Max does not carry to the Ultra with this stack. 305k was not run. Dropped.
Decode
Served decode comes from MTP verify forwards of 2-8 rows. A/B is bench/studio-bench.sh rounds or
fwd-ubench GPU ms; a 3-round ladder is noise for decode (MTP acceptance swings 38-66% of drafts).
Where an S=5 verify forward goes (20.2 ms, 18.5 ms GPU; GPU ms each stand-in saves)
mlp (whole MoE) 8.2 ms
gdn 3.5
attn 2.2
hc reads 1.8
moe_router 1.1
moe_shared 0.6
About 7.9 ms of a 13.2 ms S=1 forward is the dependent-dispatch chain (~1,430 kernels at ~3.1 µs
each), which doesn't scale with bandwidth. The floor is ~1.8 µs per dispatch on the Ultra, and
indirect command buffers, persistent kernels and argument packing don't move it
(ddalcu/mlx-serve#514).
Tried
Lever
Source
Result
Where
--mtp
ours
+94% decode, text identical
tuning loop
MoE verify rows through the fused rows arm (Ultra)
S=1 -14.7% GPU, but +12.8% output tokens: no net win
studio-bench
Plain decode tick at 3+ streams with an image in the transcript (M-RoPE slot, 120-300k ctx)
ours
N=3 22.5 -> 105.5, N=4 22.3 -> 113.6 tok/s total on replayed agent transcripts; the batched group dropped the QSA gather arm and ran the dense mask (161 ms of attention per step at 141k). First fix (serial decode for such slots) scaled badly past N=4 (N=6 93, N=8 83); letting the batched gather arm serve M-RoPE slots (nothing in it reads the rope tables) gave N=4 126, N=6 141, N=8 149
Pad-waste cap splitting a short slot off a gather-arm group (qwen4 bills long slots at the 2052-row sparse cap, so 443 beside 2052 reads as 2.08x)
ours
mixed load, 2 long image streams + 2 short sub-agent-sized streams, interleaved A B A B, 90 s: wall 86.5 / 87.2 -> 121.0 / 115.7 tok/s (+36%), decode-phase 93 -> 130, pad_waste splits 1,311 / 1,413 -> 0. Live N=8 agent traffic saw 18 splits in 15 min, so the gain there is far smaller. Change: a group whose longest billed slot is <= 4096 rows is never split
branch perf/pad-waste-small-kv, not merged
Same pad-waste floor (PR 675 rebased 49474a1) against main c25ec62 (668 inside), re-measured after ddalcu's review reported 68 -> 41 tok/s
ours
HIGH-CONFIDENCE run 2026-10-02, iQ-MLX-4.7bpw pack, bench/studio-binab.sh ARMS=A B B2 A2 A3 B3 B4 A4 + studio-padmix-probe.py, 90 s, server generation_tokens_total, omp paused, every arm under studio-excl-watch.py, stats bench/studio-ab-stats.py (Welch 95% CI). 305k live flags: main 119.6 (n=4) -> 143.7 (n=3) = +20.2% (+11.9% to +28.4%). 77k live flags, 20-arm batch (10 per binary, v3-77k): 157.1 (n=10) -> 147.3 (n=9) = -6.2% (-10.2% to -2.2%), a real loss; pooled with the earlier 4-arm batch -5.7% (-8.7% to -2.6%); halves of the run -6.4% / -5.7%. 77k with the review's flags (--mtp --metrics --max-concurrent 8 --ctx-size 131072 --prefix-cache-mem 40GB, 4 warmed contexts, 256/128-token streams): 137.7 (n=3) -> 147.9 = +7.5% (+4.5% to +10.5%). splits ~1,300-1,900 -> 0 everywhere. Two arms dropped for a macOS photolibraryd burst (sensitivity <= 0.7 points). Reproduces an earlier 2-arm clean run within 2.6% per cell. ddalcu's 68 -> 41 not reproduced (worst interval bound about -10%). An earlier set (+109% / +50% / +16.5%) is VOID: an orphaned probe loaded the same port. ddalcu/mlx-serve#675 (comment) 2x2 CROSS (8 arms per binary per new cell, all clean, fixed probe): live flags + review load 138.1 -> 116.8 = -15.4% (-21.2% to -9.6%); review flags + live load 149.8 -> 166.3 = +11.0% (+8.4% to +13.6%). Together with the earlier cells the FLAGS decide the sign: live flags lose at 77k (-6% / -15%) and gain at 305k (+20%); the review's flags gain at 77k (+7.5% / +11%). The load shape changes the size, not the sign. ddalcu's -38% never reproduced.
PR 675 CLOSED 2026-10-02 (no benefit that holds across configs); a narrowed floor needs the interacting live flag found first
Which live flag flips PR 675's floor at 77k
ours
2026-10-03, review load (4 warmed 75-78k contexts, 256/128-token streams), studio-binab.sh per-arm flag variants, server generation_tokens_total, omp paused, every arm under studio-excl-watch.py, studio-ab-stats.py. SCREEN (v5-screen, floor binary only, 22 clean arms, one live flag moved to the review's value per arm, against 4 plain arms at 121.7): the prefix-cache pair (--prefix-cache-mem 40GB, no --prefix-cache-disk) 148.8 = +22.3% (+15.1% to +29.4%). Every other flag's interval includes zero: --ple-gpu off -5.1%, yarn override off -1.5%, --ctx-size 131072 +1.0%, --prefill-decode-share off +0.7%, --mtp-greedy-tail and --mtp-typical off -1.1%. SPLIT (v6-split, 14 clean arms, B4 dropped for an OrbStack burst): floor 116.9 -> no disk tier 148.7 = +27.2% (+23.1% to +31.3%); -> mem 40GB with the disk tier 136.7 = +16.9% (+13.0% to +20.9%). Main 140.0 -> no disk tier 148.1 = +5.8% (-13.9% to +25.4%, inconclusive). Without the disk tier the floor ties main on this load (148.7 against 148.1). The disk tier arms qwen4's SSD-first mode (prefix_cache.ssdFirstActive), which costs the floor's all-batched tick about 21% and main little
the interacting flag is --prefix-cache-disk (SSD-first)
Why SSD-first costs PR 675's floor 20% at 77k
ours
2026-10-03 v7-prof, timing builds of main c25ec62 and floor 49474a1 ([tickprof]: wall ms per serial tick, per batched tick, and per finish-path step), review load, 8 clean arms. tok/s reproduced: floor 118.9 / 118.2 with the disk tier, 148.7 / 148.8 without; main 145-148 either way. Per 111 s arm, floor with the disk tier: spillIdleEntries took 17.0 s on the inference thread (15% of wall, 215 ms per finish; main 2.0 s, 26 ms per finish). The floor arms held ~12.5 idle entries under the 64 GB allowance and evicted none, so every finish re-verified all of them (940 entry checks against main's 103). The floor's 4-wide batched tick also ran 27.2 ms with the disk tier against 22.0 ms without (main 16.4 / 15.4); the disk tier persisted 46 entries per arm under the floor against 18 under main, so the background writer's readback is the likely bandwidth competitor (not yet isolated). The two costs, ~17 s + ~15 s, account for the gap
superseded by the next row: the cost is the free-space probe, not the durability check
Where the spill's 215 ms per finish goes
ours
2026-10-03 v8-prof, floor with the disk tier, sub-step timers inside spillIdleEntries and appendCommitWithSpec, 2 clean arms (117.6 / 115.3 tok/s), 64 spill passes: 207 ms per pass on average, all of it in DiskTier.refreshDiskBudget (~18 ms per idle entry); the per-chunk stat durability check read 0 ms in total. refreshDiskBudget runs before the superseded check, so every idle entry already on disk paid for statfs plus NSURLVolumeAvailableCapacityForImportantUsageKey at every finish
fixed on fix/ssd-spill-recheck (360a44a): the probe runs only before a store, ddalcu/mlx-serve#711
Disk-probe fix on main alone
ours
2026-10-03 v9-fix-revload, main 7c90027 vs main + 360a44a, live flags, review load, ARMS=A B B2 A2 A3 B3 B4 A4, 6 clean arms (B2 dropped for a signpost_reporter burst, A4 for a Halo probe): 144.5 -> 147.6 tok/s = +2.1% (-8.2% to +12.5%), inconclusive, as main's 1.8% spill share predicts
2026-10-03, main 7c90027 + 360a44a vs the same + the floor (49474a1), live flags (disk tier on), 8 clean arms each. Review load (v10-floor-revload): 149.8 -> 145.4 = -3.0% (-5.9% to -0.0%), was about -20% before the fix. Live load (v11-floor-liveload): 154.3 -> 161.2 = +4.5% (-1.9% to +10.8%), inconclusive, was -6.2% before the fix. The fix removes most of the loss; the floor still does not win on the review load. The leftover is likely the floor's slower batched tick under the disk tier (27.2 against 22.0 ms in v7-prof), not yet explained
floor not re-proposed; the batched-tick gap under the disk tier is the next lead (closed by the next row)
PR 711 evidence with timer builds
ours
2026-10-03, review load, live flags, 8 clean arms per run. v12-pr711 main 7c90027 vs branch 5a9217e: spill 5.0 s per 110 s arm (0.9-9.9 s, 4.6% of wall) -> 0.01 s; batched tick 16.9 -> 15.8 ms; 141.0 -> 148.2 tok/s = +5.1% (-4.8% to +14.9%). v13-pr711-floor branch vs branch + floor: spill 0.02 s; the floor's 4-wide batched tick 22.5 ms, the same as with no disk tier (was 27.2 ms before the fix), so the batched-tick gap was the probe too; 149.6 -> 146.2 = -2.3% (-5.9% to +1.4%), a tie
PR 711 approved by the maintainer's review bot on 5a9217e; live binary on the Studio is now mlx-serve-stack-main-711-5a4b871 (main + feat/monitor-clients + PR 711 + the floor), rollback path in ~/bench/live-prev.txt
PR 675's floor by context length, with the disk-probe fix
ours
2026-10-03, main 7c90027 + 360a44a vs the same + the floor, live flags (disk tier on), live load shape (2 long + 2 short), 8 clean arms each. ~137k (v14-floor-141k, PADMIX_MAX_BYTES=600000, 137,497 / 136,650-token contexts): 122.5 -> 151.5 = +23.6% (+16.4% to +30.9%). 305k (v15-floor-305k): 115.4 -> 143.3 = +24.2% (+19.8% to +28.7%). Against the 77k tie (v10, v11, v13), the floor helps only at long context
gate it on context: perf/pad-floor-long-ctx, floor on when the group's longest true context is >= 131072
Context-gated floor (4b404e7, PAD_FREE_MIN_CTX 131072) against fix-only
ours
2026-10-03, both with 360a44a, live flags, live load shape, 8 arms each. ~77k (v16-gated-77k): 160.2 -> 157.5 = -1.7% (-5.4% to +2.1%), pad_waste splits unchanged (1,433-1,942 per arm on both), so the gate holds the floor off. ~137k (v17-gated-137k, B4 dropped for one foreign-peer tick): 120.2 -> 154.0 = +28.1% (+24.8% to +31.5%), splits -> 0
ddalcu/mlx-serve#716 (merged 2026-10-04 as b2bb469); Studio live binary is now mlx-serve-stack-main-711-gated-291f7d8 (main + monitor-clients + #711 + #716)
Leads
Lead
Source
Block
Estimate
Status
Better lookup-vs-MTP predictor (oracle 1.35x vs 1.12x on hermes traffic)
ours, bench/pldreal.py
round policy
up to ~20% on copy-heavy agent turns
open
Fold the shared expert into the routed launches: gate/up into gate+up+SwiGLU, down and the sigmoid(gate)*down + sum tail into down+reduce. Ours runs the shared expert as ~8 separate ops per layer (moeSharedDown, moeSharedGateTail)
ceiling 0.6 ms of 18.5 ms at S=5 (3.2%); a fold catching 60-75% is 1.9-2.4%, at the bar. Not bit-identical
tail fold dropped 2026-09-30: fused es + sigmoid(g)*dn kernel vs the 3 ops, 48 chained layers, S=5, H=4096 bf16, M5 Max, three A B A B rounds: 0.323-0.467 ms vs 0.323-0.429 ms per step, saving 0.00-0.08 ms (under the 0.15 ms floor, noise-level); max abs diff 0.0156. Gate/up stacked into one qmatmul (microbench, 48 layers, S=5, 8-bit g64, M5 Max, 3 interleaved rounds, model dims not read): H=2048 saves 0.03-0.07 ms/step, H=4096 saves 0.20-0.30 ms/step (1.1-1.6% of 18.5 ms), so under the 2% bar at best; oMLX measured -2.8% on theirs. Not proposed. The tail kernel is committed on the local branch perf/shared-tail-fold in mlx-serve (3225fc9, not pushed). Rerun with bench/shared-tail-ubench.py and bench/shared-gateup-ubench.py (Metal, run with the sandbox off)
Below the bar from oMLX 0.7.0 (survey 2026-09-30): HC read in 2 launches instead of 3 (1.3-1.6%, jundot/omlx#4038), grouped GDN in-projection launch (0.6-1.5%), wider router gemv (theirs is dense bf16, ours 8-bit; 0.5-1%), lazy GDN state replay (~1.3%, jundot/omlx#3958), row-exact verify (costs them 3.5%, jundot/omlx#4023). The launch trims together are ~0.9 ms (4-5%) if all landed
oMLX 0.7.0
several
each < 2%
not proposed alone; revisit as one PR only if the shared fold pays
GDN state f32 (mlx-serve PR 815), 2026-10-12
Lever
Source
Result
Where
qwen4_exp GatedDeltaNet state and decay gate in f32 (main 6e15b046 vs 785d1ec4), M5 Ultra, Flash Next iQ-MLX-4.7bpw, 1 run per cell
no-MTP decode -1.7% to -3.2% at 1 stream, -2.5% to -3.6% at 4 streams (aggregate) over 3.2k/11.3k/26.5k tokens; prefill -0.5% to 0.0%; MTP-on decode is acceptance noise (-8.5% to +9.8%). Checkpoint 58.8 MB -> 115.5 MB (from the PR's test, not live)
GLM-5.3-Flash iQ-MLX-5.1bpw live on the Studio, 2026-10-12
Lever
Source
Result
Where
ddalcu/GLM-5.3-Flash-MLX-Serve-iQ-MLX-5.1bpw (202.8 GB), mlx-serve 26.10.2, --mtp --max-concurrent 4 --prefix-cache-mem 16GB, quick probe on the live server (not clean-measure; load average 3.9 at start), 1 run per cell
3,040-token prompt: prefill 1236 tok/s (median of 4), decode 72.1 tok/s at 1 stream, 89.2 aggregate at 4. 10,448 tokens: prefill 1472, decode 69.7, 88.5 aggregate
bench/studio-gdn-state-probe.py (ran as ~/bench/glm-probe.py)
Qwen3.8-27B 4-bit against Flash Next iQ-MLX-4.7bpw, 2026-10-14
bench/studio-bench.sh 2 with bench/studio-arms-q27-vs-fn.txt, mlx-serve v26.10.2, M5 Ultra, Latch measurement job, live service stopped for the window, omp paused. Two rounds in alternating order, --mtp --max-concurrent 8 --prefill-decode-share 0.5, no prefix cache. The 27B DFlash arm runs --drafter Qwen3.8-27B-DFlash2 and no --mtp. Accuracy is one greedy pass (GSM8K 60 + MMLU-Pro 70) and 6 coding tasks per arm, so a gap of 4 questions or 1 task is noise.
Metric
Flash Next
27B MTP
27B DFlash2
Decode, short prompt, t/s
197.5
156.0
296.5
Decode after 8k, t/s
116.3
89.0
100.0
Decode after 32k, t/s
119.5
73.8
62.4 (37.0 / 87.8)
Prefill 8k / 32k / 64k, t/s
3,697 / 4,682 / 4,823
1,569 / 1,387 / 1,205
1,287 / 1,421 / 1,214
1 stream / 4 streams, aggregate t/s
169.1 / 207.4
123.8 / 253.5
196.8 / 104.7
GSM8K + MMLU-Pro, of 130
112
107
108
Coding tasks, of 6
4
5
4
Flash Next prefills 3.4x faster at 32k and 4x at 64k. The 27B is dense, so prefill reads all 27B weights per token.
27B DFlash2 wins short-prompt decode by 1.5x, then loses it: 32k decode swung 37.0 (round 1) to 87.8 (round 2), and 4-stream aggregate is half of one stream (104.7 against 196.8). Round 1's first 8k prefill read 963 t/s against 1,611 in round 2, so the first long request after load runs cold.
27B MTP scales to 4 streams (253.5, the best aggregate), and Flash Next's 4-stream gain is small (169 to 207).
Accuracy and coding scores are inside noise; no arm is better on quality at this sample size.
27B DFlash2 findings (logs read and gate probe run 2026-10-14)
The sticky yield gate fires on some prompts after 8 rounds.dflashGateShouldDisable (src/generate.zig, DFLASH_GATE_WARMUP = 8, gate_min 2.00) turns drafting off for the rest of a request when the first 8 rounds average under 2.00 accepted tokens. The 32k word-salad request read 8 attempts / 14 accepts (1.75) in round 1 and ran 37 t/s with runtime_disabled=true; the same request in round 2 read 2.60 over 111 rounds and ran 88.7 t/s. Break-even for this dense trunk at 32k looks near 1.2 (round ~29 ms against a 25 ms serial step), so 2.00 gives up speed that 1.75 would still win. Measured 2026-10-14 with bench/studio-dflash-gate-probe.sh (Studio, 27B DFlash2, greedy 32k word-salad prompts, one fresh server per arm, Latch measurement jobs):
DFLASH_GATE_WARMUP
Prompts gated off
Decode t/s, gated prompt
Decode t/s, the rest
8 (default)
1 of 6
38.1 (11 rounds, 21 accepts)
86.0-92.1
32
0 of 6
none
86.0-92.1
64
0 of 6
none
86.7-92.1
The misfire is deterministic per prompt. A second job ran w32 first (cold) and base second (warm): w32 request 1 held 87.1 t/s, and base request 1 was gated off again with the same 11 rounds and 21 accepts (38.12 t/s). So cold load is not the cause. Setting DFLASH_GATE_WARMUP=32 fixes it with no code change. The cost is unmeasured: a prompt that truly loses (prose near 1.2 accepted per round) now spends 32 rounds before the gate acts.
A DFlash slot that gains company stays plain, and loses 2x at 2-5 streams. The first request of a burst is admitted alone and arms DFlash, the rest arm MTP. specYieldTick yields the DFlash slot (SpecDisableReason.company) after two ticks of company, and a yielded slot is a one-slot plain tick beside the MTP verify group, so each iteration runs two forwards. The yield is sticky, so it stays plain after the others finish. In the 4-stream cell three slots ran mode=mtp (44-47 t/s) and the DFlash slot ran plain at 26 t/s, so it set the wall time (15 s for 400 tokens). Aggregate 104.7 t/s against 253.5 for the MTP arm.
Fix: a dense DFlash slot yields only once the others reach mtpCrowdThresholdFor (5 others on the M5 NAX tile). PR ddalcu/mlx-serve#852 (draft), A/B on the Studio with bench/studio-dflash-company-ab.sh, boots A B B A, mean of 6, aggregate tok/s control to patched: 2 streams 57.0 to 123.7, 3 83.1 to 170.6, 4 107.8 to 213.3, 5 129.0 to 250.3. 1 stream (197.7 to 197.5) and 6-8 streams (197.1 to 198.3, 217.5 to 222.8, 237.2 to 237.5) are flat.
An earlier head that never yielded lost 4.5% to 10% at 6-8 streams (178 / 201 / 226 against 197 / 217 / 237), which is why the yield stays above the crowd threshold.
llmprobe v0.6.16 agrees on direction and says less (2026-10-14, bench/studio-dflash-company-llmprobe.sh, --bench-only --concurrency N --rungs 512 --runs 3, boots B A A B, Latch measurement job, Photos daemon paused). Burst aggregate tok/s control to patched, mean of 2 boots: 2 streams 65.6 to 126.5 (1.93x), 3 streams 80.6 to 101.0 (1.25x), 4 streams 88.6 to 121.7 (1.37x), 5 streams 104.5 to 156.2 (1.49x); llmprobe's own 4-stream cell, 8 runs per arm, 97.1 to 145.1 (1.49x). Every patched run beats every control run in each cell, boots of one arm differ a lot (patched 4 streams 105.5 and 137.8), and the 3-stream burst still reads below one stream (101 against about 120). Control logged 16 and 18 company yields per boot, patched 0 and 0. The load client reads about 2x and llmprobe 1.3x to 1.9x, so quote the llmprobe range.
Agent sessions do not reach the path (2026-10-14, bench/studio-dflash-agent-test.sh, boots B A A B, 3 parallel omp -p sessions started 2 s apart, peak 3 streams, prompts up to 129k tokens). All 12 sessions answered with no error output. Each boot armed DFlash on 1 of 31 to 44 requests and logged 0 company yields in both binaries. Wall time 427 / 567 s patched against 467 / 386 s control: agent variance, no verdict. A single session that did not fan out ran 109 s (patched) and one that fanned out to 4 streams ran 356 s (control), which are different workloads and not a comparison. The 2x is measured only with the load client.
First load is cold for prefill, not for the gate. Round 1 warmup took 2,492 ms against 113 ms in round 2, and its first 8k prefill read 963 t/s against 1,611. Drop or repeat the first request of a fresh server in 27B DFlash prefill numbers. The 32k decode gap between rounds came from the gate above.
Qwen3.8-27B dense prefill survey, 2026-10-15
Live 27B MTP prefill is 1,569 / 1,387 / 1,205 tok/s at 8k / 32k / 64k (table above). At 54 GFLOP per token that is 84.8 / 74.9 / 65.1 TFLOPS against TensorFold's 130 TFLOPS synthetic peak on the M5 Ultra; the reachable ceiling measured 2026-10-16 is 87-91 TFLOPS for MLX GEMM at these shapes (see "Ceiling and attribution for the 27B" below), so 8k prefill is already near it. The 27B has no block split of its own (the split in "Prefill" is the MoE model's). Two survey agents read oMLX, TensorFold, mlx-lm, MLX core, llama.cpp and the Apple-silicon engines; reports in ~/.claude/tmp/perf-survey-*-27b.md. Verified by me: prefillDqGemm and its M>=2048 floor exist (src/generate.zig, server.zig:3831), src/qmm_int8.zig is the 2-bit Bonsai path and default off (MLX_SERVE_BONSAI_INT8_PREFILL), src/ane.zig carries MLX_SERVE_ANE_SPLIT / MLX_SERVE_ANE_FORCE and records a measured ANE loss on M5 Max. Everything else below is a quoted claim or arithmetic from the reports, not measured by us.
Lead
Source
Block
Estimate
Status
Dense W4A8: INT8-activation prefill for 4-bit g64 weights on NAX (oq_a8_qmm_t_nax_v8, oq_a8_quantize)
ceiling +6-10% by the ledger's own FLOP arithmetic (ANE ~3.6x slower than GPU); our Ultra row above read +0.7..2.4% noise on Flash Next GDN and the gate refuses M5 Ultra
open, expect noise: 2-3 h with --ane-prefill MLX_SERVE_ANE_FORCE=1 MLX_SERVE_ANE_SPLIT=0.18
Staggered two-queue segments
TensorFold c1fb804d123e, c2bede8fd7d3
glue
+2-4% on the 27B, 24-32 h
open, needs the block split
Tool-schema key sorting so reordered requests hit the prefix cache
3-5% at 1,024 rows, 0 at 8k; 4-8 h patch to lib/mlx-src
not ported: the cold 8k ladder never shows it
Dequant+GEMM against fused qmm, measured 2026-10-16.bench/studio-ladder-env.sh with ORDER="A B B A A B B A" (4 boots per arm), live cachestack binary 806458f1, Qwen3.8-27B-MLX-Serve-4bit, --mtp --max-concurrent 8 --prefill-decode-share 0.5, no prefix cache, ladder.py 3 rounds median per point, Latch measurement job, live service stopped for the window, omp in halo and the Photos daemon paused. A is the default (prefillDqGemm on at M >= 2048), B sets MLX_SERVE_PREFILL_DQ_GEMM=0. ladder.py's prompts come out short of the label (4096 is 3,294 tokens), so the table gives measured prompt tokens. Raw: ~/bench/ladder-dq27-ab.json on the Studio.
Prompt tokens
dq+GEMM t/s
fused qmm t/s
Delta
842
1,286.7
1,286.4
0 (below the floor, control)
3,294
1,490.9
1,532.6
-2.7%
8192 label
1,530.2
1,522.8
+0.5%
16384 label
1,520.5
1,494.0
+1.8%
32768 label
1,423.0
1,399.3
+1.7%
Spread inside an arm is under 0.4%, and every boot of one arm beats every boot of the other in each cell. Decode after the prompt also moved (102 against 108 t/s at 3.3k, 94 against 88 at 16k) but the two paths differ numerically, so greedy output and MTP acceptance differ too; that is not a decode verdict. The FFN headroom this lead was meant to size is small: switching paths moves prefill under 3% either way. The measured ceiling below puts the remaining gap in SDPA at depth, not the FFN.
Dequant+GEMM crossover on NAX, measured 2026-10-16. Same harness, binary and flags as above, CTX=2560,...,8192, 4+4 boots A B B A A B B A. The 27B admits prefill at width=8192 (server log [admission] ... width=8192), so each prompt here is one chunk and its token count is the matmul M.
Rows (M)
2,067
2,690
3,294
3,901
4,502
5,135
5,725
6,536
dq+GEMM t/s
1,478.6
1,429.2
1,490.6
1,511.3
1,532.9
1,567.3
1,574.8
1,526.5
fused qmm t/s
1,478.6
1,507.7
1,533.0
1,534.5
1,530.2
1,533.1
1,528.2
1,522.5
Delta
0
-5.2%
-2.8%
-1.5%
+0.2%
+2.2%
+3.0%
+0.3%
Break-even is about 4.5k rows on the M5 Ultra against the 2,048 floor tuned on an M4 Max, whose stock qmm was the 32x32 steel tile rather than the fused NAX kernel. The win is not monotonic: 6,536 rows reads +0.3% between +3.0% at 5,725 and the 8k-chunk wins in the first table. Proposed: a NAX floor of 4,608 (prefillDqGemmMinRowsFor, worktree .claude/worktrees/dq-floor), env MLX_SERVE_PREFILL_DQ_GEMM_MIN_ROWS for A/B.
NAX floor 4608 confirmed, 2026-10-16. Patch dee717cb in ~/git/forks/mlx-serve/.claude/worktrees/dq-floor (on 806458f1; full Debug suite green on the Studio), built ReleaseFast as mlx-serve-dqfloor-dee717cb. studio-ladder-env.sh BIN_A live 806458f1 against BIN_B, 4+4 boots A B B A A B B A, same flags, Latch measurement job. Intervals from bench/ladder-ab-stats.py (Welch 95%).
Rows
live t/s
floor t/s
Delta
95% interval
2,690
1,427.7
1,505.8
+5.47%
[+5.19, +5.76]
3,294
1,489.8
1,532.4
+2.86%
[+2.75, +2.97]
3,901
1,511.2
1,534.7
+1.56%
[+1.50, +1.62]
5,725
1,574.7
1,574.2
-0.03%
inconclusive
16,325
1,491.5
1,489.7
-0.12%
inconclusive
Decode after the prompt moved where the numerics changed (2,690: -2.6%, 3,294: +5.0%) and also at 16,325 (-1.7%, [-3.34, -0.04]), where both 8k chunks take the same path in both binaries. Open until the greedy-identity check says whether the generated text differs.
Greedy identity (bench/studio-greedy-identity.sh, 20 token-exact prompts cut from the SSD cache's real sessions, /v1/completions greedy 64 tokens, --no-pld, no MTP, live service stopped for the window): the new binary's text matches the old binary with MLX_SERVE_PREFILL_DQ_GEMM=0 on 11 of 11 prompts in the 2,048-4,607 band (same kernel there now) and differs from the old default on 4 of 11 (the numerics changed with the kernel). Below 2,048 all three agree 5/5; above the floor new matches old default 6/6 and old-with-dq-off differs on 1. Every difference sits where the two arms run different kernels. The echo/logprobs column read 0.0000 even where the generated text differed, so prompt log-probabilities are computed on a path the floor does not reach and that column proves nothing. Old and new outputs are identical at 7.2k and 8k rows, so the -1.7% decode reading at 16,325 rows above did not come from different text; it stays open and small.
The 4608 floor regresses Flash-Next, 2026-10-16. Same binary dee717cb both arms, A MLX_SERVE_PREFILL_DQ_GEMM_MIN_ROWS=2048 (old floor), B default 4608; Qwen3.8-Flash-Next iQ-MLX 4.7bpw, --mtp --max-concurrent 8 --prefill-decode-share 0.5, 4+4 boots, Latch measurement job, live service stopped for the window. Welch 95%:
Rows
floor 2048 t/s
floor 4608 t/s
Delta
95% interval
2,067
3,502.1
3,504.3
+0.06%
inconclusive
2,690
3,849.3
3,743.1
-2.76%
[-3.56, -1.96]
3,294
4,122.1
3,906.7
-5.22%
[-5.49, -4.95]
3,901
4,242.1
4,004.7
-5.60%
[-5.86, -5.33]
4,502
4,332.8
4,130.5
-4.67%
[-4.98, -4.36]
5,135-6,536
within ±0.2%
inconclusive
Flash-Next's dense projections have K 2,560, half the 27B's, and dequant+GEMM already wins there from 2,048 rows. The crossover follows the shape, not the chip, so a single NAX floor cannot serve both models; dee717cb is not shippable as written.
K-aware floor 449f5236, 2026-10-16. On NAX: floor = 2048 when K >= 3N (split-K), else max(2048, 0.9K); full Debug suite green; ReleaseFast mlx-serve-dqshape. Live 806458f1 against it, 4+4 boots, same harness:
Model, rows
live t/s
K-aware t/s
Delta
95% interval
27B, 2,690
1,429.6
1,535.4
+7.40%
[+7.12, +7.69]
27B, 3,294
1,491.9
1,555.0
+4.23%
[+4.12, +4.34]
27B, 3,901
1,512.0
1,559.0
+3.11%
[+3.04, +3.17]
27B, 5,725 / 16,325
0.00 / +0.04%
inconclusive
Flash-Next, 2,067 / 2,690
+0.46 / -0.70%
inconclusive
Flash-Next, 3,294
4,111.3
4,062.9
-1.18%
[-1.50, -0.85]
Flash-Next, 3,901
4,240.7
4,206.8
-0.80%
[-0.99, -0.61]
Flash-Next, 4,502
4,330.4
4,277.1
-1.23%
[-1.49, -0.98]
Flash-Next, 16,325
-0.03%
inconclusive
The 27B gain beats the global floor's (+5.47% at 2,690) because the tall-K down projection keeps dequant+GEMM while the K 5,120 shapes go to fused qmm. Decode after the prompt did not move (103.4 against 103.4-103.5 t/s at 3.3k). Flash-Next still loses ~1%: its two K 6,144 shapes (N 2,560) sit at the 5,529 floor but cross near 3k in the shape sweep, half the 27B's crossover for the same K, so the smaller of N and K sets it. Next: 0.9 * min(N, K).
min(N, K) floor 018d83ba, Flash-Next, 2026-10-16. Floor = max(2048, 0.9 * min(N, K)) on NAX, 2048 for K >= 3N; full Debug suite green; ReleaseFast mlx-serve-dqminnk. Live 806458f1 against it, 4+4 boots: every row from 2,067 to 16,325 is inconclusive and within ±0.31% (3,294: +0.04% [-0.16, +0.24]; 4,502: -0.13% [-0.36, +0.11]). The regression is gone; Flash-Next gains nothing because the live 2048 floor already suited its shapes.
Same binary on Qwen3.8-27B, 4+4 boots: 2,690 rows +7.51% [+7.38, +7.64], 3,294 +4.26% [+4.13, +4.39], 3,901 +3.15% [+3.11, +3.19], 4,502 +1.58% [+1.51, +1.65], 5,135 / 5,725 / 16,325 inconclusive within ±0.2%. This is the version to ship: it gains on the 27B, is flat on Flash-Next, and regresses nothing measured. Sized against real traffic (6.8% of last week's prefilled rows sit in 2,048-4,607-row chunks), it is worth roughly 0.3% of the 27B's prefill time.
PR branch against upstream main, 2026-10-16. The 1bf4e81e..d3fa00ae floor diff applied on main 1c34059e as 7f57f4fb (branch perf/dq-floor-nax, worktree ~/git/forks/mlx-serve/.claude/worktrees/dq-floor-pr; full Debug suite on the Studio, 0 failures). studio-ladder-env.sh, BIN_A mlx-serve-main-1c34 against BIN_B mlx-serve-dqfloor-pr, both ReleaseFast on the same libmlx, 27B 4-bit, --mtp --max-concurrent 8 --prefill-decode-share 0.5, 4+4 boots A B B A A B B A, Latch measurement job D56E169A, all 8 boots served. Welch 95%: 2,690 rows +7.36% [+7.27, +7.44], 3,294 +4.23% [+4.14, +4.33], 3,901 +3.11% [+3.03, +3.19], 4,502 +1.65% [+1.58, +1.73], 5,725 +0.09% [-0.12, +0.31] inconclusive. Decode within noise (94.6-104.4 t/s both arms). The gains match the cache-stack run, so the floor does not depend on that stack. Opened as ddalcu/mlx-serve#874.
Review fix f3c9b709 (PRBot on ddalcu/mlx-serve#874): 0.9 * min(N, K) put Flash-Next's K 2560 shapes at 2304, but the Ultra sweep (~/bench/qmm-ceiling-ultra-fn.json) has them winning from 2048 (qmm/dq 1.01-1.09 at M 2048), so a 2048-row company chunk lost the route. The floor now starts at K 4096; below that, and at K >= 3N, the base floor stands. Same harness as above, BIN_B mlx-serve-dqfloor-pr2, CTX adds 2560 (2,067 rows), Latch jobs CE6B558F (27B) and 0554D993 (Flash-Next), all 16 boots served. 27B: 2,067 rows -0.02% [-0.15, +0.11] inconclusive, 2,690 +7.33% [+7.13, +7.54], 3,294 +4.21% [+4.12, +4.29], 3,901 +3.08% [+2.96, +3.21], 4,502 +1.54% [+1.46, +1.61], 5,725 -0.14% [-0.42, +0.14] inconclusive. Flash-Next: every row count inconclusive within ±1.2% (2,067 rows -0.03% [-0.62, +0.55]). Open: the 27B ties at 2,067 rows although the sweep puts stock qmm 5-12% ahead on its K 5120 shapes at 2048 rows; the dispatched kernel at that width is unconfirmed. Debug suite on the Studio: 4225 of 4804 passed, 579 skipped, 0 failed.
27B tie at 2,067 tokens explained, 2026-10-16: the prompt is 31 rows longer than what the qmm calls see. A diag build of f3c9b709 (logs each distinct rows, N, K at 1,024+ rows; Latch job 55C4D2F6, 27B beside the live server) shows prompt_tokens 2,055 / 2,565 / 3,015 / 4,140 / 5,515 reaching prefillDqGemm as rows 2,024 / 2,534 / 2,984 / 4,109 / 5,484. So the ladder's "2,067" is 2,036 rows, under the 2,048 floor on both arms: main and the branch ran stock qmm everywhere and the cell ties by construction. The 5,725 cell is 5,694 rows, past 4,608 on both, so it ties for the same reason. The sweep's stock-wins band starts at 2,079 tokens. 4+4 band A/B (studio-ladder-env.sh, BIN_A mlx-serve-main-1c34, BIN_B mlx-serve-dqfloor-pr2, 27B 4-bit, same flags, Latch measurement job D10A302D, all 8 boots served, results ~/.claude/tmp/dq-floor-pr874/ladder-dqfloor-band-27b.json): 2,096 tokens +8.46% [+8.29, +8.64], 2,247 +8.21% [+7.95, +8.47], 2,411 +7.29% [+7.12, +7.46]. The sweep was right for the 27B; only the ladder's row labels were off.
Flash-Next in the same band (Latch job 8EC40D6C, 8 boots, ladder-dqfloor-band-fn.json): 2,096 tokens -1.39% [-2.90, +0.13] inconclusive, 2,247 -0.93% [-1.08, -0.77], 2,411 -0.20% [-0.33, -0.07]. The one shape where the arms differ there is 2560x6144 (GDN out, attn o): the branch kept stock qmm below 2,304 rows on the sweep's say (stock ahead 10% at 2048 in Python MLX 0.32.2), and the server's forward reads slower with it. Same wheel-against-server gap as the 27B down shape. The earlier Flash-Next "2,067 rows" cell sat under the floor on both arms and tested nothing.
Fix, 2026-10-16 (dqfloor-pr3, worktree perf/dq-floor-nax): the raised floor now needs both N and K at 4096 or more, so 2560x6144 keeps 2048 and every Flash-Next shape matches main. The unit test pin (2560, 6144) == 2048 failed on the old rule (found 2304) first. Same band A/B, BIN_B mlx-serve-dqfloor-pr3, Latch job C84BD46C, all 8 boots served (ladder-dqfloor-band-fn3.json): 2,096 tokens +0.08% [-1.31, +1.47], 2,247 +0.02% [-0.52, +0.57], 2,411 +0.07% [-0.28, +0.42], all inconclusive. The 27B's shapes all have min(N, K) of 5120 or more or K >= 3N, so its rows above carry over unchanged. Test binary on the Studio (run directly, since the second zig build test was a cache hit): 3500 passed, 292 skipped, 0 failed, 3792 tests; the earlier suite line above read 4804 tests and I did not reconcile the two counts.
27B on the Neural Engine after ddalcu/mlx-serve#866, 2026-10-16: PR 866 is already inside 1c34059e (mlx-serve-main-1c34), so no build was needed. --ane --ane-slots 1 on Qwen3.8-27B-MLX-Serve-4bit beside the live server (Latch measurement job FD3F5A3E, port 11297, bench/ane27b-smoke.sh pattern): cold ANE compile 145 s to up (24 chunk and head programs, 23-65 s each, cached after), then 1,024 tokens prefill 140.8 / decode 6.9 tok/s, 4,096 tokens prefill 259.8 / decode 6.9. GPU 27B is about 1,500 prefill and 98-108 decode, so the ANE engine is roughly 6-10x slower on prefill and 15x on decode (2 slots would give about 1.75x the decode, per the flag help, still under 13 tok/s). --ane-prefill on the same pack (job 7B20E2FA, port 11296): the server logs "disabled: NAX-class GPU prefill already outruns the ANE seam (measured a loss on M5 Max, PR #223); MLX_SERVE_ANE_FORCE=1 overrides" and runs plain GPU, 2,600 tokens prefill 1358.8 / decode 98.0, 4,096 1489.8 / 103.5, 8,192 1530.0 / 107.2. Not forced: the flag help calls it lossy (int8/fp16). Output check of --ane against the GPU (Latch job A8E802D1, bench/ane-compare.sh, main-1c34 on both, GPU arm --no-mtp --max-concurrent 1, greedy temperature 0 top_k 1, 128 tokens, 9 prompts incl. one 900-token): 7 of 9 identical; prompt 0 diverges at char 141 ("it scatters off the gas molecules" against "it collides with gas molecules and scatters") and prompt 4 at char 203 ("the ongoing conflict between their families" against "escalating violence between their families"). One run each, no GPU-against-GPU repeat, so the cause is attributed to the ANE numerics and not separately confirmed.
Short prefills on a Neural Engine server instead of the decoding GPU, 2026-10-16 (Latch measurement jobs 892F2E5C and 31080384, bench/ane-offload-probe.sh with ane-mixed-probe.py, a copy of studio-mixed-probe.py with separate DEC_URL and PRE_URL, per-chunk gap stats and a PRE_PERIOD pacer). Two main-1c34 servers on the Studio at once, the 27B 4-bit: G on the GPU with --mtp --max-concurrent 8 --prefill-decode-share 0.5 decodes 4 streams of 400 tokens, A with --ane --ane-slots 1 takes the prefills (max_tokens 1, unique prompts, 60 s per condition). Closed loop first: no prefill 173 / 160 decode tok/s; 1k-token prefills on G: decode 26.7 (-84%) with 982 tok/s of prefill; on A: 166.6 with 283 tok/s; 4k on G: 80.0 (-52%) with 797 tok/s; on A: 146.7 (-12%) with 273. That is not equal load, so the paced run: prefill rate held near what A delivers (G paced to 3.6 s per 1k prompt and 14.6 s per 4k prompt). Decode tok/s / p99 chunk gap / max gap: no prefill 160.0 / 114 ms / 247 ms and 153.3 / 129 / 307; 1k on G 140.0 / 210 / 914 and 126.7 / 204 / 1,043; 1k on A 160.0 / 118 / 288 and 146.6 / 134 / 535; 4k on G 160.0 / 148 / 3,172; 4k on A 160.0 / 130 / 205. At equal prefill load the ANE server keeps decode at its no-prefill p99 and caps the worst stall near 0.5 s, where 1k prompts on the GPU add 75-80% to p99 and a 4k prompt delays the first token of a request that arrives during it by up to 3.2 s (corrected in the next-but-two row: those long gaps were new requests waiting, not frozen streams). Costs: the ANE prefills at 250-300 tok/s, so a 1k prompt takes about 4 s instead of 0.7 s, its numerics are int8 (7 of 9 greedy prompts identical), and the prefilled state sits in a different process, so there is no handoff to the GPU engine yet. The probe counts only completed 400-token requests, so decode tok/s moves in steps of 6.7; the C0 spread (153-173) is the noise floor. Single run per condition except the 1k pair.
Prefill census of the live server, 2026-10-16 (Opus review step 0 for the ANE prefill-assist design): ~/Library/Logs/mlx-serve.log on the Studio, 74,822 requests, 514,140,947 uncached prefill tokens, from the prompt=N tokens lines and the [hot-cache] reused X/Y tokens lines that follow (cold = under 64 tokens reused, tail = prompt minus reused). Traffic is Flash-Next and earlier models, mostly omp agents, so it is the shape of agent load and not the 27B's. Requests (tokens): cold tail <=256 34.7% (0.7%), 257-1,024 12.5% (0.7%), 1,025-2,048 0.6% (0.1%), 2,049-4,096 0.2% (0.1%), over 4,096 6.4% (85.0%); warm tail <=256 18.8% (0.2%), 257-1,024 13.1% (1.1%), 1,025-2,048 6.0% (1.3%), 2,049-4,096 4.9% (2.0%), over 4,096 2.6% (8.9%). Short tails (<=2,048) are 85.7% of requests and 4.1% of prefill tokens, so they cost decoders interruptions and little GPU time. In the 257-2,048 band warm tails (14,338) outnumber cold ones (9,847). Total context of those warm tails: <=8K 0.1%, <=16K 0.4%, <=32K 2.3%, <=64K 10.1%, over 64K 87.0%; median 229,802 tokens, p90 592,552. The ANE engine's context ladder stops at 65,536 (Options.ctxs in arch/ane_lm.zig), so it can serve about 13% of those warm tails and about 11.7k of the 74.8k requests overall (9,847 cold 257-2,048 plus 1,872 warm). It also cannot serve the live model (Flash-Next is MoE; the ANE engine takes dense qwen3_5/Qwen3 only). No timestamps in the log, so no per-minute arrival rate and no count of how many arrived while a stream decoded.
Where the "4k prefill stall" really comes from, 2026-10-16 (Latch measurement jobs 8483CDBC, D238D6DE, 4D7AA48B; main-1c34 for the first, a diag build mlx-serve-stalldiag (not committed: five log.info lines in scheduler.zig for prefill start, each chunk boundary, prefill end, slow ticks) for the others; probes stall-probe.py, stall-run.sh, stall-diag-run.sh in ~/bench). 27B, --mtp --max-concurrent 8 --prefill-decode-share 0.5, 4 decoders plus a 4k-token prefill every 14.6 s. The interleave works as designed: prefill-start always read cap=1024 with decoders live, each chunk ran about 700 ms, and the boundary then ran about 15 decode ticks (about 720 ms, share 0.5). Once a prefill ran as one 8,192-wide chunk (3,260 tokens, 2.15 s) because it started with no decoder counted, which is the uncapped path in decodeShareAdmissionCap; it is rare (1 of 29 prefills over 2,000 tokens). The multi-second gaps in the earlier rows were not running streams freezing. They were requests that arrived during a prefill: the diag log shows dec=3 at the boundaries (one stream missing from decoding), and a 31-token prefill starting right after the big one ended. The server sends a first chunk before the first token, so the probe's gap counter included that wait. With the first-token wait split out (150 s, 49 requests): mid-stream gaps p99 153 ms, max 1,121 ms; first-token wait p50 147 ms, p99 5,168 ms, max 5,168 ms, 8 requests (16%) over 1 s. Cause: the interleave hook only ticks slots already in decoding; pending is admitted at the top of the inference loop, so a new request waits for the whole in-progress prefill, up to the remaining 3-5 s here and far longer behind a 100k-token prompt. The ANE-server runs above improved p99 and max because decoders' new requests no longer queued behind the prefill on the same inference thread, so much of that benefit may be had without any ANE, by admitting small pending requests at chunk boundaries. Not built; the chunk-cap sweep is dropped since mid-stream gaps are already at one chunk.
Boundary admission v1 proof, 2026-10-16 (Latch measurement job 75C3B248, bench/studio-stall-ab.sh order A B B A, 150 s per arm; A mlx-serve-main-1c34, B mlx-serve-boundary-v1 = branch perf/boundary-admission at 4cd12dad in ~/git/forks/mlx-serve; 27B 4-bit, --mtp --max-concurrent 8 --prefill-decode-share 0.5, 4 decoders plus a 4k-token prefill every 14.6 s; spec boundary-admission.md). First-token wait (requests / p50 / max / over 1 s): A1 54 / 136 ms / 5,126 ms / 11; B2 60 / 135 / 1,449 / 4; B3 46 / 125 / 1,685 / 11; A4 50 / 129 / 3,633 / 11. Mid-stream gap p99 / max: 125 / 1,147, 125 / 1,127, 124 / 1,180, 136 / 1,090 ms. Prefill tok/s 234, 235, 235, 234 (10 prompts per arm). Decode tok/s 144.0, 160.0, 122.7, 133.3 (steps of 6.7; the arms spread 123-160, so no decode claim). Worst first-token wait fell about 3x (3.6-5.1 s to 1.4-1.7 s) with mid-stream gaps and prefill speed unchanged; requests over 1 s went 22/104 to 15/106, not significant, because v1 admits only at the start of a boundary so a newcomer waits the owed ticks (about 0.7 s) plus the next chunk (about 0.7 s). The E2E (tests/test_boundary_admission.sh, Qwen3.8-27B): first-token wait over the big prefill's remainder 0.026 against 1.002 on main, share 0 1.002 unchanged. The first attempt of this job (8B211404) was cancelled: arm 1's server did not exit after kill and held the port, so arm 2 failed to start ("Port 11293 is already in use") and its probe talked to a dead listener for 20 minutes; the harness now uses a fresh port per arm and waits for the server to exit.
Boundary admission v1.1 proof, 2026-10-17 (Latch measurement job 80A45852, same harness and load as the v1 row above, order A B B A, 150 s per arm; B mlx-serve-boundary-v11 = branch perf/boundary-admission at d0cc5df2, which also admits between the owed decode ticks and allows 4 nested prefills per boundary). First-token wait (requests / p50 / max / over 1 s): A1 54 / 131 ms / 5,876 ms / 10; B2 50 / 127 / 825 / 0; B3 57 / 129 / 828 / 0; A4 51 / 146 / 4,108 / 10. Pooled over 1 s: main 20/105 (19.0%), v1.1 0/107, one-sided Fisher p = 2.9e-7; worst wait 7.1x and 5.0x lower (5.9 and 4.1 s to 0.83 s), which is about one chunk (0.7 s) plus the newcomer's own prefill. Mid-stream gap p99 / max: A 125 / 1,081 and 133 / 1,174 ms; B 151 / 1,166 and 125 / 1,083 ms (unchanged within noise). Prefill tok/s A 246, 227 and B 250, 231 (means 236.5 and 240.5), so the big prefill is not slowed; decode tok/s A 144.0, 136.0 and B 133.3, 152.0 (means 140.0 and 142.7, steps of 6.7, no claim). v1.1 build: full unit suite 3,509 passed, 0 failed; tests/test_boundary_admission.sh first-token wait over the big prefill's remainder 0.002 with a share against 1.002 for share 0, and its cancel arm (the small request dropping mid-wait, the big prefill dropping after a small one was admitted) passed. tests/test_prefill_interleave.sh fails its decode-share assertion (hosted fraction 0.098 against 0.099) with this 27B setup on main (mlx-serve-main-1c34) as well as on the branch, with identical gaps and output hashes, so that failure predates this work.
M5 Max crossover: run, inconclusive. bench/qmm-ceiling.py on this Mac (16 weight sets, 5 shapes, M 1k-8k), with the GPU at 92-98% busy from another session's ASR benchmark (q3bench.py, then asrbench) all night. bf16 peak read 20.6 TFLOPS, about half an idle M5 Max's, and the dequant+GEMM / stock qmm ratio swings ±30% between neighboring M values (Qwen 27B GDN in-qkv: 1.40, 1.06, 1.46 at 2,560 / 3,072 / 3,584 rows), so no crossover can be read from it. The one stable reading: dequant+GEMM loses badly at 1,024 rows on every K 5,120 shape (0.38-0.42). Re-run when the Mac is idle.
Re-run at 05:09 after a background watcher saw the GPU under 15% for a minute (Device Utilization % 0 at start), 80 weight sets, 6 shapes; the other session resumed during the run (99% at the end), so later rows may be contaminated. The early, consistent rows show the M5 Max crossing the other way from the Ultra: dequant+GEMM / stock qmm is 1.08-1.15 on Qwen 27B gate/up (17408x5120) and 1.08-1.15 on GDN in-qkv (10240x5120) from 2,048 to 4,608 rows, where the Ultra loses up to 12%; the tall-K down projection (5120x17408) is 0.94-0.98 from 2,048 to 4,608 rows, where the Ultra wins. MLX's dense GEMM picks different tiles for arch s (Max: bm 64, bk 64/256) than d (Ultra), per matmul.cpp read above. Consequence: the min(N, K) floor in 018d83ba, keyed on NAX, would likely cost an M5 Max 5-15% on K 5,120 shapes in the 2-4.6k band. Before it ships it should key on the Ultra (gpuArchitecture ending in d) and leave other NAX chips on 2048, then get a server A/B on the M5 Max. Raw: bench/data-m5max-qmm-idle-20261016.json.
Done the same night as d3fa00ae on top of 018d83ba: dqShapeFloorArchFrom(nax, arch) is true only for NAX on an arch ending in d; every other chip keeps the 2048 base floor. Red test first (!dqShapeFloorArchFrom(true, "applegpu_g17s") failed on the stub), full Debug suite green, ReleaseFast mlx-serve-dqultra. Smoke boot on the Ultra, 27B: 1,534.3 / 1,555.1 t/s at 2,690 / 3,294 rows, the same as 018d83ba's confirmed 1,535.8 / 1,555.0, so the Ultra keeps the gain. The M5 Max now runs the live floor unchanged.
M5 Max server A/B (bench/local-ladder-env.sh, MLX Core's bundled mlx-serve, Qwen3.8-27B-MLX-Serve-4bit, --max-concurrent 1, 4+4 boots A B B A A B B A, A default (dequant+GEMM from 2048 rows) against B MLX_SERVE_PREFILL_DQ_GEMM=0): inconclusive. The other session's asrbench held the GPU intermittently (the uncontended smoke read 641 t/s at 2,690 rows; the A/B arms read 400-480 with sd up to 113). Stock qmm against dequant+GEMM: 2,690 rows -13.1% [-51.4, +25.1], 3,294 -15.1% [-50.3, +20.2], 3,901 -16.6% [-51.4, +18.3], 4,502 -13.9% [-39.9, +12.1], 6,536 -6.4% [-17.3, +4.4], all intervals spanning zero. The means point the same way as the shape sweep (dequant+GEMM ahead on this chip below 4.6k), which is the direction that motivated gating the floor to the Ultra; it needs a rerun on an idle Mac to confirm.
Rerun at 06:26 after two minutes of 0% GPU with no asrbench process (checked by exact name; the first watcher's pgrep -f asrbench matched its own command line and never fired), none running during or after: still inconclusive, and the per-boot numbers show why. Boot 1 ran cold (694 t/s at 2,690 rows), boots 2-6 settled near 470, and boots 7-8 dropped to ~400-440: the 14-inch chassis throttles under sustained prefill, which swamps the kernel difference. On the four steady middle boots (2+2), dequant+GEMM leads by 0 to 2.5% from 2,690 to 4,502 rows (3,294: 486/485 against 476/480; 4,502: 487/487 against 471/479). Same direction as the shape sweep and much smaller. On this laptop the chassis sets prefill speed, and gating the floor to the Ultra (leaving the M5 Max on the live floor) is the safe choice.
Third attempt with 120 s cooldown between boots (COOL=120 in bench/local-ladder-env.sh), 2.7k and 3.9k rows: contaminated. The GPU read 83% busy at the start from a process other than asrbench, and boots split into two clusters, 650-680 t/s and 320-390, as that load came and went (A: 496/554, 354/322, 342/334, 677/663; B: 658/650, 678/654, 356/370, 381/392). Every interval spans zero by ±50-75%. Three attempts were spoiled by load this session does not own. The M5 Max crossover stays unconfirmed in the server: the shape sweep says dequant+GEMM leads there below 4.6k rows, and the steady boots of the second attempt say by 0-2.5%. Greedy identity on the shipped 018d83ba (same harness and 20 prompts as above, arms: live default, live with MLX_SERVE_PREFILL_DQ_GEMM=0, mlx-serve-dqminnk): the new binary's text matches the live binary's on 20 of 20 prompts, all 11 in the 2,048-4,607 band included, and differs from live-with-dq-off on 5 (2,600, 3,350, 4,100, 4,550 and 4,700 rows). The tall-K down projection, which writes straight into the residual stream, takes dequant+GEMM in both the live binary and this one, which is the likely reason the outputs agree even though the K 5,120 projections changed kernel.
6.5k dip, from MLX's dispatch at our pin (mlx/backend/metal/matmul.cpp): with NAX, a GEMM takes the split-K kernel when K >= 3 * max(M, N). For the down projection (K 17,408, N 5,120) that holds up to M = 5,802 rows and the regular NAX kernel takes over above it, which sits between the +3.0% at 5,725 rows and the +0.3% at 6,536. At 8,192 rows the server's down projection still runs near 87 TFLOPS (MLP 3,211 ms in the block split less ~2,129 ms of gate/up), so the regular kernel is fine at 8k; the loss is mid-range only, and its size per shape was not isolated. The stock side cannot cause it: qmm_nax at the pin (mlx/backend/metal/quantized.cpp:836-842) uses one tile for every M above 32 rows, bm 64, bn 64, bk 64, wm 2, wn 2, with no split-K and no M-dependent switch, which matches stock qmm's flat 82-88 TFLOPS across M in the ceiling sweep. The dip comes from the dense GEMM the dequant route calls, where MLX does switch kernels with M. Confirmed from the kernels actually dispatched (metal-shader-profiler-shader-list of the two labeled traces above, debug build of the pinned MLX): stock prefill qmm ran affine_qmm_t_nax_bfloat16_t_gs_64_b_4_bm64_bn64_bk64_wm2_wn2_alN_true (the bm32 variant only at M <= 32), one tile for every prefill width. The dense GEMM behind dequant+GEMM ran steel_gemm_splitk_nax_nt_bfloat16_float32_bm128_bn64_bk512 + steel_gemm_splitk_accum on the 2,048-row chunks and only steel_gemm_fused_nax_nt_..._bm64_bn128_bk512_wm2_wn4 / ..._bm128_bn64_bk512_wm4_wn2 (regular) on the 8,192-row forwards: the split-K to regular switch the dip sits on. Caveat on "at the pin": the live binaries link ~/opt/mlx-serve-stack/lib/mlx, a Sep 29 build whose stamp is a one-commit snapshot hash (mlx=41da16d6b460), and a libmlx built today from the pinned source 64ea011c is not ABI-compatible with that build's libmlxc (missing gather_qmm overload). The dispatch rules above are read from the pinned source; the measurements are from the live library, so a dispatch change between the two would not show in this reading.
Fourth M5 Max attempt, 07:35 (a watcher waited for 3 minutes of GPU under 10% with no asrbench): contaminated. asrbench was running again by the end, and prefill fell boot over boot regardless of arm (2,690 rows: 702, 663, 699, 615, 558, 447, 357, 339 in order A B B A A B B A), so dequant+GEMM against stock reads -2.2% [-54.8, +50.5] and -7.0% [-57.4, +43.4] at 2,690 / 3,901 rows. No more M5 Max server A/Bs from this session: the shipped gate leaves that chip on the live 2048 floor, so the open question is only whether a non-2048 floor would help it.
Real traffic: where prefill rows come from, 2026-10-09 to 2026-10-16.bench/prefill-rows-dist.py, bench/prefill-miss-split.py, bench/gen-mismatch.py and bench/kv-divergence.py over the Studio's ~/Library/Logs/mlx-serve.log (from the first Today: 2026-10-09 line omp writes; the log has no timestamps and does not name the model per request) and the SSD cache's tokens.bin records. 4,496 requests prefilled 16.1M rows; median 187 rows.
Rows prefilled per request
Requests
Share of rows
0-2,047
89.0%
8.1%
2,048-4,607 (the dq floor band)
6.0%
5.8%
4,608-32,767
3.2%
11.6%
>= 32,768
1.7% (78)
74.5%
By cause, all requests: partial disk restore 46.9%, past the cached prefix 27.5%, cold 20.6%, SSM checkpoint granularity 4.4%. Requests whose match broke inside the model's previous reply (generated tokens that re-tokenize differently: " TEST"+"ING" against " TESTING" at row 50,065 of e34/e35) were 77 of 2,767 turns, 188k rows (1.2%); most matched to within 1-2 tokens of the reply's end and fell back 7-17k rows because no SSM checkpoint sits at the prompt boundary.
Where long sessions diverge, read from cached token records (kv-divergence.py): the omp system prompt's alphabetical skills list (a new skill, halo-lavapipe-debug, shifts everything after row 9,499), the tool list (row 1,841, different sessions), and omp's <experimental-context-notes> block at the top of history (row ~21,800: every notebook revision changes it, so the whole session after it re-prefills). Two requests matched exactly 8,258 rows and re-prefilled 898k rows between them (5.6% of the week); a 540k session matched only to 396-428k on consecutive turns and re-prefilled 118-148k rows each turn.
The dq floor fix touches 6.8% of prefilled rows at about 3%, roughly 0.2% of real prefill time.
By time, not rows (bench/prefill-time-dist.py; a request's prefill seconds = prefilled rows / its logged prefill rate, checked against a logged 78.7 s): last week's prefill took 4.18 h. Requests prefilling >= 32k rows took 63.6% of it; requests under 2,048 rows took 23.3% at 224-600 t/s. Splitting the long ones by where reuse stopped: a partial SSD restore stopping at 10k-64k took 31.4% of all prefill time, deeper partial SSD restores 14.1%, fully cold 10.5%, early divergence (< 10k) 3.8%. 35 of the 37 partial-SSD-restore requests carried images (1.91 h, 45.6% of all prefill time). The log shows why: Flash-Next runs SSD-first, so [hot-cache] skipped oversized entry (240139 tokens, 17106.81 MB > 0.00 MB budget), and the SSD tier of that binary persisted only the text before a session's first image, so turn after turn restored the same depth (restored 51648/239894, ten consecutive turns of one ~240k session, each re-prefilling ~188k rows in ~290-315 s). The cache stack's image-aware SSD tier (piece A, live since the stack deploy; the first shutdown persist line is log line 1,683,404) restores past images: restored 137729/138522 tokens from SSD in 1209ms on a 5-image session at line 1,686,466. Upstream, #795 and ddalcu's port of #871-#873 carry it. That is the biggest prefill lever of the week, about 45% of prefill time, already live on the Studio. Prompt stability on the client side (append-only skills and notebook, nothing mutable near the top) is worth an order of magnitude more than any kernel lever measured tonight.
Ceiling and attribution for the 27B, 2026-10-16.
Ceiling (bench/qmm-ceiling.py, Python MLX 0.32.2 wheel, 80 distinct weight sets per shape, Latch measurement job, live server idle beside it): bf16 8192³ GEMM peaks at 87.0 TFLOPS on the M5 Ultra, and the 27B's projection shapes reach 82-91 TFLOPS from 4.6k rows up (stock qmm 82-88, bf16 GEMM 86-92), not the 130 TFLOPS TensorFold quoted. Summed over every projection of one 8,192-row forward (counts per forward: gate+up 128, down 64, GDN in-qkv/in-z/out 48 each, attn q 16, k+v 32, o 16): stock qmm 4,617 ms, best kernel per shape 4,487 ms. At 48.7 GFLOP/token of projections the forward's floor at the 91.4 TFLOPS shape peak is ~4,365 ms. The wheel's bf16 GEMM drops to ~60 TFLOPS at (N 5120, K 17408) from M 6,144; the server's MLX (pin 64ea011c) does not: there dequant+GEMM beats stock qmm by 2.1% at 8,192 rows (5,148 vs 5,260 ms) and 0.9% at 6,144 rows (3,885 vs 3,922 ms), bench/studio-fwd-ubench.sh, two boots per arm, spread under 0.3%. So the wheel is fine for shapes but not for the cliff.
Attribution (studio-fwd-ubench.sh, binary dee717cb, MLX_SERVE_DECODE_FWD_UBENCH with MLX_SERVE_DECODE_PROFILE, a sync after each block, which adds ~1.6% to the total):
One 8,192-row forward, ms
Empty cache
32-45k keys deep
MLP (gate/up/down)
3,211 (63%)
3,250 (47%)
GDN (projections + recurrence/conv)
1,330 (26%)
1,337 (19%)
Attention (projections + SDPA)
526 (10%)
2,287 (33%)
lm_head (deep case runs it)
0.6
342
Total
5,067
7,218
The MLP runs at 87 TFLOPS, at the GEMM ceiling. GDN's projections sum to ~1,017 ms by the ceiling table, so recurrence, conv and norms take ~313 ms (6%). Attention's projections take ~312 ms, so SDPA is ~214 ms at <=8k keys and ~1,975 ms at 32-45k keys: about 132 TFLOP in 1.98 s, ~67 TFLOPS, ~74% of the GEMM ceiling. Live 8k prefill (1,569 t/s, ~50 GFLOP/token) is ~85% of that ceiling.
Live prefill as a share of the 91.4 TFLOPS shape ceiling, FLOPs per token = 48.7 GFLOP of projections + 4 x (mean keys per query) x 24 heads x 256 x 16 full-attention layers, live rates from the 2026-10-14 table:
Prompt
Mean keys per query
GFLOP/token
Live t/s
TFLOPS
% of ceiling
8k
4,096
50.3
1,569
78.9
86%
32k
16,384
55.1
1,387
76.4
84%
64k
32,768
61.6
1,205
74.2
81%
Metal System Trace (bench/studio-xctrace-ubench.sh, xctrace record --template 'Metal System Trace' over the same 8,192-row microbench, metal-gpu-intervals exported and unioned per second): the GPU is busy 100% of every second across the ~57 s of forwards, so the forward is GPU-bound with no host-side gaps to recover. Per-kernel names were not obtained: MLX leaves encoders unlabeled ("Compute Command 0"), and the template's shader timeline (metal-shader-profiler-intervals) records nothing unless switched on, which xctrace record does not expose. The block split above is the attribution; a 32k-deep trace was not run because the busy-fraction answer would not change.
Grouped by the goal's categories, combining the profiled block split with the per-shape projection times from the ceiling sweep (dequant+GEMM path at 8,192 rows); derived, not read from per-kernel GPU timestamps:
Glue (embedding, residual, sync gaps; unprofiled total less profiled blocks)
~81
2%
At 32-45k keys deep, SDPA + RoPE grows to ~1,975 ms of a 7,218 ms forward (27%); the rest stays within 2%.
Per-primitive GPU time, measured, 2026-10-16. libmlx rebuilt from the pinned source with -DMLX_METAL_DEBUG=ON (bench/studio-mlx-debug-build.sh), patched mlx-c and the 018d83ba server built against it (bench/studio-mlx-debug-stack.sh), run with MLX_MAX_OPS_PER_BUFFER=1 so each Metal command buffer carries exactly one primitive and its label (verified: every compute interval reads <Primitive>:Compute Command 0). Metal System Trace over the load-time microbench (8,192-row prefill forward from an empty cache; 3 warm + 1 metered + 3 no-lm_head = 7 forwards), metal-gpu-intervals exported, overlapping intervals split evenly (bench/xtrace-by-label.py). One op per buffer serializes kernels that normally overlap and adds a fixed cost to every small op: 6,588 ms per forward here against 5,148 ms in the normal-mode microbench.
Cross-check against the normal-mode split: projections 4,814 ms here against 4,540 ms derived (FFN 3,211 + projections 1,329), +6%; glue 1,106 ms here against ~81 ms of unprofiled-minus-profiled time, most of the gap being the one-op-per-buffer cost landing on small ops. SDPA disagrees: 517 ms measured per kernel against ~214 ms derived (attention block less the shape-sweep projection times), so the derived SDPA figure undercounted and the attention projections are likely faster than the wheel sweep put them. The dequant route splits into three primitives, and 2,374 ms lands under Transpose. That is not a cost a normal run pays: in normal mode the MLP block of the same forward runs at 87 TFLOPS (3,211 ms, the GEMM ceiling for its FLOPs), which leaves no room for a 2.4 s weight copy, so the Transpose time is an artifact of forcing one primitive per command buffer and is not a lever.
Deep forward cross-check, normal mode (studio-fwd-ubench.sh, binary 018d83ba, KV=8192, metered forwards at 32-40k keys): unprofiled 7,463.5 ms per forward (lm_head included), profiled 7,182.6 ms = attention 2,271.8 (31.6%) + GDN 1,336.3 + MLP 3,249.9 + lm_head 322.7 + embed 1.9. The labeled trace's SDPA share (15.9%) averages 8k-57k keys and includes four 2,048-row pre-fill chunks, so it sits below the single 32-40k forward's 31.6%.
The same setup over the deep microbench (MLX_SERVE_DECODE_FWD_UBENCH_KV=8192: four 2,048-row pre-fill chunks, then 8,192-row forwards whose keys grow 8k, 16k, 24k, 32k (metered), 40k, 48k, 57k), whole run, exclusive time over 65.4 s of GPU-busy wall: projections (Transpose 27.4%, Matmul 15.7%, Quantize 11.5%, QuantizedMatmul 2.7%) 57.3%, ScaledDotProductAttention 15.9% (8.0% of the 8k run's time went to SDPA, so it doubles over this depth range), GDN core (Sigmoid 4.1%, CustomKernel 0.8%, Convolution ~0.5%) ~5.7%, glue and layout (Unflatten 8.9%, Full 3.7%, RMSNorm 3.6%, Reshape 3.5%, Multiply 0.8%, others) ~21%. The trace averages depths; the normal-mode microbench's 32-45k forward put attention at 33% of that forward alone, and the two agree on direction. Traces: ~/bench/xtrace-q27-{8k,32k}-lab.trace on the Studio, debug server ~/build/dq-floor-mtldbg. The headroom left is SDPA at depth: attention FLOPs pass the projections' from ~200k keys, and real traffic's rows sit mostly in 32k-600k prompts.
Cache stack E2E on Flash-Next, 2026-10-16.tests/test_prefix_cache_disk.sh from ~/build/cache-stack against the live cachestack binary 806458f1, model and VISION_DISK_MODEL both Qwen3.8-Flash-Next iQ-MLX 4.7bpw (qwen4_exp), via bench/studio-e2e-wrap.sh (live service booted out for the window, health wait raised to 600 s), Latch sensitive job: ALL PASS. Sections 1-6 pass (restart restore 2,475/2,506 tokens, byte-identical output, 199 ms against 853 ms cold), 8 passes (38,886/38,917 restored under a 129-fd limit in 63 ms; an unreadable chunk falls back to a cold prefill), 9 passes (an image session restores 10,049/10,115 past the image at row 3,102, RAM-first and SSD-first; a different image stops the restore at 0). Sections 7, 10 and 11 skip without a qwen3_5 model at the path; 10 and 11 passed on Qwen3.8-27B in the PR 872/873 runs.
Live SIGTERM on the cache stack, 2026-10-16.bench/studio-shutdown-deadline.sh on the live service (cachestack 806458f1, Flash-Next, the plist's flags and ExitTimeOut 60), stopped with launchctl bootout (the real SIGTERM path) and brought back with bootstrap; lines quoted from ~/Library/Logs/mlx-serve.log.
Case
What happened
Exit
Next boot, same prompt
A 120,582-token prompt completes, then SIGTERM
the end-of-request commit had already written all 120,583 rows (413 + 210 ms); shutdown persist: 0 written (0.0 MB), 0 left (deadline) ... 0.0 s
1.4 s
restored 120551/120582 tokens from SSD in 234ms, 0.5 s against 26.5 s cold
SIGTERM 15 s into a 401,663-token prefill
committed 73728/401663 prompt tokens from a cancelled prefill, persisted 73728/73728 (+63 chunks, 1512.1 MB, 122ms); shutdown persist: 0 written ... 0 left
2.9 s
restored 73728/401663 tokens from SSD in 96ms (ssm@73728), then 327,935 rows at 4,197 t/s
Owed work at SIGTERM, live, 2026-10-16 06:5x (same script, OWED_TOKENS=200000): a 401,434-token prompt, bootout the moment the response arrived. The end-of-request flush was still running: <- 401434+1 tokens (94626ms) is logged before persisted 217088/401435 (+86 chunks, 2064.2 MB, 342ms), 305152 (280 ms), 393216 (283 ms) and 401435/401435 (+9 chunks, 192.6 MB, 132ms). That is about 1.0 s of writes still owed when SIGTERM landed; the connection drain finished them, then shutdown persist: 0 written (0.0 MB), 0 left (deadline) ... 0.0 s. Bootout took 2.0 s. Next boot: restored 401403/401434 tokens from SSD in 1398ms (ssm@401403); the same prompt answered in 1.9 s against 94.6 s cold. The mid-prefill case repeated: bootout 3.8 s, the cut prefill restored on the next boot. With a 120k prompt nothing was owed at shutdown, because Flash-Next runs SSD-first and its end-of-request commit lands before SIGTERM can arrive. The owed-slice flush did run tonight in tests/test_prefix_cache_disk.sh section 11 on ddalcu's port 141fc561 (Qwen3.8-27B, RAM-first, 2,048-row chunks, scratch port; report ~/.claude/tmp/cache-stack-rebase-report.md). Default deadline: shutdown persist: 1 written (256.0 MB), 0 left (deadline) ... 0.1 s, and both sessions restored after reboot. 1 s deadline: 0 written (0.0 MB), 2 left (deadline) ... 896.0 MB dropped at the deadline, 0.0 s, and at reboot e2: all SSM checkpoints invalid — dropping hybrid entry (3 of 3 runs). The cut session's last manifest lists only checkpoints above its kv_len, so it prefills cold. Nothing restored wrong. A cancelled prefill keeps what it computed, and exit stays far inside the 60 s ExitTimeOut.
Dead ends the surveys found: thin-N GEMM (ml-explore/mlx#4640) about 0.3%, native NAX gated-delta kernel at most 1.6% (the 27B has 48 GDN layers, so check against the real split), CPU co-prefill 1.3-2.2%, llama.cpp tensor flash attention (its baseline was ALU, ours is about 59 TFLOPS equivalent), oMLX jundot/omlx#4337 (routed Down A8, closed at about +2%), ANE numbers from oMLX jundot/omlx#2756 and jundot/omlx#3133 (M3 Ultra, no NAX). Checked 2026-10-15 with gh api repos/ml-explore/mlx/compare/<merge commit>...64ea011c: ml-explore/mlx#4447 (M5 Ultra tunings for non-quantized matmuls, merge 2d27ab05fb) and ml-explore/mlx#4416 (head-dim-256 prefill with array mask on the fused NAX kernel, merge f99e916be6) are both ancestors of our pin, so neither is a lead.
ANE drafter against GPU drafter, 27B 4-bit single stream, greedy, 3 prompts x 256 tokens, warmed, 2026-10-16 (Latch measurement job C96EB9C3, drafter-arms.sh). ANE whole-model with the DFlash2 drafter: draft 14.7-15.4 ms + head 4.5 + select 1.3 = ~21 ms per round, 24.6 tok/s. GPU DFlash2: assist 2.6 + head 0.8 + append 0.6 = ~4 ms, verify 27.7-28.2 ms, round 31.5-32.3 ms, 167.5 tok/s (3.6-5.7 accepted per round). GPU MTP head: round 24.4-27.6 ms, 120.2 tok/s. Moving the drafter to the ANE adds ~17 ms per round for one stream (the next draft needs the last round accepted tokens) and the GPU draft is ~12% of the round, so the ceiling is 12%. Open: GPU DFlash2 beats MTP by 39% single stream; the 4-stream comparison is not run.
SageAttention-style int8 QK on the M5 Max (MLX 0.32.2, g17s, 2026-10-17, matmul2d int8xint8->int32 against half->float, results checked against mx.matmul; scripts in the 2026-10-16 session scratchpad sage/{tops,sweep,qk}.py). Raw tensor-op matmul 8192x8192xK4096, best tile each: int8 90.2 TOPS (32x128 tile, K-step 128, 2 simdgroups) against half 47.5 TFLOPS, 1.9x. QK^T-shaped loop (a threadgroup keeps its Q tile and walks every key block, summing the result tile, 16384x16384): D 256 int8 57.4 against half 42.6 T, 1.35x; D 128 33.3 against 29.2, 1.14x. QK is about half of attention FLOPs and PV stays fp16, so int8 QK saves ~13% of SDPA time at best: ~3.5% of a 32-45k-key forward (SDPA is 27% there) and ~0.5% at 8k, before the Q/K quantization pass and softmax glue, and it is lossy. Verdict: not worth a kernel on the 27B; the int8 tensor ops do reach 2x on a pure GEMM, so the lead for them is the GEMMs (MLP is 47-63% of a forward), not attention.
int8-activation x 4-bit-weight GEMM on the M5 Max tensor unit, 2026-10-17 (sage/q4i8.py in the session scratchpad, a 4-bit adaptation of src/qmm_int8.zig: weights stay packed MLX affine 4-bit g64, the int8 right operand is built in registers from nibble planes, activations quantized per 64-group with a K permutation, epilogue C = a*(sP + browsum)). Numerics: rel rms error against stock mx.quantized_matmul 0.0065 on 27B shapes. Speed at M 4096, bf16 out, 16 weight sets cycled, GEMM only (activation quant not included): 17408x5120 int8 10.05 / 10.43 ms (72.6 / 70.0 TOPS) against stock qmm 13.23 / 16.27 ms (55.2 / 44.9 TFLOPS), 1.32x / 1.56x; 5120x17408 11.27 against 14.40 ms, 1.28x; 10240x5120 6.37 / 8.48 against 7.65 / 11.93 ms, 1.20x / 1.41x. Stock readings swing 36-56 TFLOPS between runs on this shared Mac, so read the range 1.2-1.5x, not a point. The bare int8 matmul reaches 90 TOPS, so the kernel leaves ~20% on the table. Open: Ultra numbers (the live path there is prefillDqGemm, not stock qmm), activation-quant cost, end-to-end NLL on a real 27B, and the route would be opt-in and lossy.
int8 Q/K inside the hd-256 NAX prefill attention (SageAttention-1 style), M5 Max, 2026-10-17 (worker alpha; report docs/plans/alpha-hunt-report.md; logs in the 2026-10-16 session scratchpad sage/alpha/; GPU lock held per run). MLX's own attention_nax_dsplit (byte-identical in the 0.32.2 wheel and the mlx-serve pin) re-instantiated through mx.fast.metal_kernel, with Q int8 per 64-row tile, K int8 per 32-key block after removing each KV head's mean key, int32 scores scaled back to fp32 before the head-dim exchange, P and V unchanged. qL 2048, 24/4 heads, causal, 3 Q/K/V sets cycled, quant pass excluded: 8k keys 8.56 -> 6.81 ms (1.26x), 32k 38.25 -> 29.53 ms (1.30x), 64k 79.38 -> 62.42 ms (1.27x), i.e. 21-23% less SDPA time. M5 Ultra, same wheel kernel (Latch C042622D, reps within 1%): 8k 6.05 -> 4.66 ms (1.30x), 32k 26.65 -> 20.61 (1.29x), 64k 55.17 -> 41.69 (1.32x), 128k 112.54 -> 87.26 (1.29x); stock sdpa there runs 58-60 TFLOPS-equivalent. Scope: dense hd-256 causal prefill through fusedSdpa256Prefill; Flash-Next past 2048 tokens takes the QSA mask arm and is not affected. Error against fp32 attention on keys with per-channel offsets: rel rms 1.3e-2 with the mean removed, 2.0-2.1e-2 without, 4e-4 fp16, 7.6-8.1e-4 MLX sdpa. This supersedes the "~13% of SDPA at best" estimate in the int8-QK row above (that row timed a QK-shaped loop, not the kernel). Built into mlx-serve on local branch perf/alpha-int8qk (4b62de31, ac07c526, 2e770b5d, not pushed): a QT template parameter on the oMLX-ported nax_attention.metal (192/128 MiMo path unchanged), nax_attention.attention256Int8 with a fused strided quantizer, called from fusedSdpa256Prefill, opt-in MLX_SERVE_INT8_QK=1; zig build test -Dtest-filter="nax attention" 7/7. 27B 4-bit on the M5 Max, same binary, env toggle: 23,311-token echo NLL 2.26701 off against 2.26802 on (+0.00101 nats), teacher-forced top-1 agreement 98.31% (off-vs-off bit-exact), greedy 64 tokens after 17k / 16k / 10k prompts 64/64, 48/64, 64/64 equal. Per-call K quant: fp16 MLX ops 0.90 / 1.89 / 3.59 ms at 8k / 32k / 64k keys, fused kernel 0.41 / 0.52 / 0.89 ms. Server speed on the Mac inconclusive (32k ABBA 369.0 / 359.4 / 355.0 / 326.2 tok/s, falling every boot). Ultra end to end, 27B server, single request, unique prompts, ABBA (Latch 083E65EC, Studio build at 2e770b5d linked to ~/build/deploy-main-657/lib/mlx; the live stack's MLX lacks the gather_qmm global-scale overload the current mlx-stream pin calls), prefill tok/s A1 / B2 / B3 / A4: 8k 1,544.1 / 1,543.3 / 1,546.9 / 1,540.2 (+0.2%); 32k 1,387.5 / 1,419.0 / 1,439.7 / 1,387.1 (+3.0%); 64k 1,215.5 / 1,301.6 / 1,300.2 / 1,214.4 (+7.1%); 128k 947.8 / 1,080.4 / 1,084.6 / 949.8 (+14.1%); every int8 arm above every off arm from 32k up. Quality at depth on the Ultra (Latch 1C163FFE, 113,784-token echo of repo text): NLL 2.22690 off against 2.22720 on (+0.00030), top-1 agreement 98.23%; by 32k bucket ΔNLL +0.00064, +0.00048, +0.00003, -0.00026 and top-1 98.30 / 98.17 / 98.25 / 98.16%, so no drift with depth.
Attention nulls on the M5 Max, 2026-10-17 (worker alpha, same logs): fp16 accumulate on matmul2d is no faster than fp32 accumulate (62.7 against 62.8 TFLOPS; QK loop 43.7 against 43.6). MLX fused sdpa at the 27B shape runs 40.1-43.4 TFLOPS from 8k to 128k keys, ~67% of the 62.4 TFLOPS fp16 tile. Retiling MLX's hd-256 kernel loses (bk64 28.3, bk128 22.6, bq128 35.7 against 41.0 TFLOPS at bq64/bk32). Heads-first dispatch +8% at 32k inside a wrapper only, flat at 8k and 128k. Key-range passes at hd 256: no gain past ±10% noise. An own flash kernel on matmul2d cooperative tensors is correct but 10-12.5 TFLOPS: input cooperative tensors are single-simdgroup and a 16-row PV runs at 8.8-12.9 TFLOPS.
Neural Engines beside the GPU on the 27B, M5 Ultra, 2026-10-17 (worker alpha, Latch 68FF7E5D and 637C22F2, bench/alpha-conc.sh, bench/alpha-depth.sh, main-1c34, a GPU server and an --ane --ane-slots 1 server beside the live one, unique prompts). ABBA: GPU alone 1,504.2 / 1,501.7 tok/s (6k prompts); ANE alone 265.3 / 280.1 (3k prompts); both at once GPU 1,458.6 / 1,458.6 (-3.0%) and ANE 262.8 / 260.6; aggregate 1.145x the GPU alone. The ANE engine compiled two lanes (lane 0 and lane 1 programs in its log); engine pinning was not verified with energy counters. By depth, GPU / ANE tok/s: 3k 1,431 / 282, 12k 1,486 / 215, 30k 1,396 / 190, 60k 1,232 / 150 (ratio 0.20 to 0.12); a 64-row ANE block is 209 ms at the start of a request and ~650 ms near 60k. A Python/MLX proxy of a single-request split (ANE as a timed worker, real 21 MB handoffs, M5 Max, lock held) holds the GPU 90.8% busy (producer-consumer prefix, ANE stage 0.8x, ±30% jitter) or 86.3% (ping-pong, 2 chunks); against the 10-13% of work the ANE can take and 3% contention that nets about +1% (±30% jitter) to +9% (no jitter, 97.8% busy). With the fill removed (chunk 0 whole on the GPU) the proxy cannot resolve the gain: one arm read 1.423x, above the ~1.17x physical ideal, and identical GPU-only work ranged 2,277-3,227 ms. Bound from measured physics: the 0.12-0.20 ANE/GPU ratio less 3% contention caps a single-request split at roughly +9-17%. Verdict: ~+14% for independent work is measured; a single-request prefix split is an open lead, realized gain unmeasured, dense models only, under the engine's 64K cap, and needs engine surgery.
DFlash2 drafter vs MTP head, Qwen3.8-27B 4-bit, M5 Ultra, 1/2/4 concurrent streams, 2026-10-17 (Latch job 6480481F, 12 boots A B C C B A twice, 4 boots per arm, median aggregate tok/s, --max-concurrent 4, results ~/bench/dvm/run-20261017-105909/results.jsonl, synthetic chat/code/math prompts plus one estimated 6-8k-token context prompt). DFlash-only / MTP-only: 1 stream chat 1.16-1.17x, code 1.81-1.86x (280.0 vs 150.4 tok/s at 1024 tokens), math 1.66x, long ~1.01x (prefill-bound); 2 streams chat 1.04-1.11x, code 1.47-1.49x, math 1.46x; 4 streams chat 0.68-0.75x, code and math 0.94x, code at 1024 tokens 1.13x. DFlash aggregate is flat from 1 to 4 streams (chat ~120) while MTP scales (101, 110, 179). The default with both loaded hands later requests to MTP and loses to DFlash-only at 2 streams (code 1024 tokens 146.1 vs 271.2, math 186.6 vs 239.1). The summarizer dropped the four MTP boots as contaminated; that was a false positive (MTP is slower on its 48-token canary, 0.49-0.55 s against 0.22 s, the four MTP boots agree to a 3.7% median spread). Open: 3 streams unmeasured, so the crossover is between 2 and 4; a default boot has no drafter folder, so DFlash never engages without --drafter.
Update to the int8-activation x 4-bit-weight GEMM row above (its Open list is closed), 2026-10-17: the kernel was tuned to 88.4 TOPS on the Max (bias term as one half tensor-op matmul, whole-word unpack) and shipped opt-in as mlx-serve perf/int8-gemm-prefill 1e4242c7, not pushed. Qwen3.8-27B 4-bit prefill, A B B A, repeat arms within 0.2%: M5 Ultra 1.41 / 1.37 / 1.33 / 1.30x at 2k / 4k / 8k / 16k tokens (Latch C3F4CB28); M5 Max 1.40-1.59x (paired A/B, 32 of 32 pairs at least 1.334; the sequential palindromes on the Max were discarded for off-arm drift 755 to 482 tok/s). Ultra kernel plus activation quant 1.31-1.52x over dq+GEMM, bare int8 162.0 T against fp16 97.3 T (Latch 9E018C3A). NLL 2.37760 off / 2.37577 on over 6,938 tokens, teacher-forced top-1 97.45%. Opt-in and lossy, default off. Report: docs/plans/int8-gemm-prefill-report.md.
Correction to the two M5 Max tensor-op rows above (SageAttention-style int8 QK; int8-activation GEMM), 2026-10-17, coordinator run under the shared GPU lock, MLX 0.32.2, M=4096, 8 weight sets cycled (/private/tmp/claude/coord/onewin.py): the fp16 denominator is MLX's own GEMM, not the 47.5 TFLOPS matmul2d tile. dequant+bf16 matmul measured 60.6 T at 17408x5120, 56 T at 5120x17408 and 60 T at 10240x5120; dense bf16 63.0 T; stock qmm 55-57 T in the same window. The int8 worker's no-unpack, no-epilogue ablation reached 116.4 T on the same Mac, and the Ultra measured bare int8 162.0 T against fp16 97.3 T (Latch 9E018C3A). So raw int8 over fp16 is ~1.9x on the Max and ~1.67x on the Ultra, and the "~90 TOPS ceiling" was a tile artifact. In the real hd-256 attention kernel int8 QK cut SDPA time 21-23%, above the 13% the QK-loop row estimated. Coordinator summary: docs/plans/alpha-coordinator-summary.md.
DeepSeek V4.1 Flash 1017 pack choice under mlx-serve v26.10.3, M5 Ultra, 2026-10-26 (outcome: iQ now served, oQ2.5e trashed; Latch job 0484C451, live server stopped, order oQ iQ iQ oQ, DSpark on, 1 stream, --ctx-size 139264, watcher clean, results ~/bench/ds41-mlx-20261026-1517). ddalcu iQ-MLX 3.0bpw against mlx-community oQ2.5e-mtp, mean of 2 rounds: short decode 86.6 vs 80.8 tok/s (1.07, inside oQ's 14% round spread: tie), decode after 32k 82.4 vs 68.0 (1.21), prefill 8k 1,850 vs 1,321 (1.40), prefill 32k 1,686 vs 1,535 (1.10), 400-token answer 86.5 vs 83.7 (1.03, tie). Quality published for iQ only (KLD mean 0.104, top-1 89.8%). An oQ-only run beside a 125 MB/s download to the same SSD read 15-25% slower (Engram tables are pread per token). Detail: docs/studio-bench.md, "DeepSeek V4.1 Flash under mlx-serve".
DeepSeek-V4.1 conversations in the engine's generic prefix cache (branch generic-cache-p1 baeb1ccd against upstream main d0a51ca8), M5 Ultra, iQ-MLX 3.0bpw, 2026-10-27 (Latch F00C30F1, live server stopped, omp paused, order A B B A A B B A, both ReleaseFast, --ctx-size 139264 --prefix-cache-entries 4 --prefix-cache-mem 8GB --prefix-cache-disk 0 --shutdown-persist-secs 0, MLX_SERVE_DSV41_STATES=4, DSpark on, temperature 0, results ~/bench/ds41-alt-20261027-1144). Two 26.8k-token conversations alternating, 3 turns each, 32 tokens out: time to first streamed token, 8 requests per cell. Turn 1 (cold) main 16.35 s, branch 16.35 s. Turns 2 and 3: main 16.41 / 16.45 s with 0 tokens cached (the one snapshot is replaced by the other conversation every time); branch 0.134 / 0.134 s with 26,840 / 26,859 cached (122x). Decode on a fresh 41-token prompt, 400 tokens: 70.52 vs 70.42 tok/s (tie; one branch arm 68.3). Watcher: the live server once before bootout, and mlxtop (Sam's dashboard on the live port, about 22% of a core) busy for 6 ticks in arm A1; nothing touched the bench port. Harness: bench/studio-live/ds41-alt-bench.sh + ds41-alt-probe.py.
DeepSeek V4.1 Flash 1017: beamster Sushi-STQ 1.75bpw under sushi v1.4.0 against ddalcu iQ-MLX 3.0bpw under mlx-serve (gc-493b7e4f), M5 Ultra, 2026-10-27, NOT CLEAN (indicative only). Run headless after a power-cut reboot with no console login: live server down, Latch in foreground (latch service run) in batch mode with no GPU reservation (the GPU idled at 4-6% and never met the 2% gate), order iq stq stq iq, 1 stream, --ctx-size 139264, stq --ssd-budget-gb 150, DSpark on in both, results ~/bench/ds41-mlx-20261027-1850. Watcher flagged audiomxd (~70%) and configd (~43%) spinning since boot, plus the Metal compiler during sushi's load. STQ round 1 restored every long prompt from sushi's on-disk cache left by the smoke run (ttft 0.2-0.3 s), so its prefill figures are round 2 only. iq30 / stq175: decode after 32k 76.1-84.1 / 90.3-97.8, after 64k 73.9-76.5 / 83.8-87.7, cold prefill 8k 1,589-1,852 / 1,809, 32k 2,057-2,090 / 1,906, 64k 2,061-2,070 / 1,877, 400-token answer 70.2-88.3 / 95.6-95.9 tok/s. iq30's 46-token decode (53.4, 69.4) is the first request after each load; stq's was 97.8-101.7. Reading: STQ decodes 10-20% faster at depth and prefills ~9% slower at 32-64k, at 120 GiB of weights resident against iQ's 207 GB. Quality (same-set KLD) not yet measured. Superseded by the console-session rerun below; its "prefills ~9% slower" reading did not reproduce.
DeepSeek V4.1 Flash 1017, Sushi-STQ 1.75bpw (sushi v1.4.0) against iQ-MLX 3.0bpw (mlx-serve gc-493b7e4f), M5 Ultra on macOS 27.2, 2026-10-28, console session (Latch isolated measurement with GPU gate, live server stopped by the wrapper, order iq stq stq iq, 1 stream, --ctx-size 139264 --prefix-cache-disk 0 on both so no long prompt restores from disk, stq --ssd-budget-gb 150, DSpark on, results ~/bench/ds41-mlx-20261028-1119). Watcher: the live server once before bootout, and MTLCompilerService at 86-98% during the iq round-1 and stq round-1 loads (Metal shader cache rebuilt after the OS update; it ran before each arm's first request). Ambient: mediaanalysisd peaked at 373% (iCloud Photos library re-analysis; the library was deleted at the window's start). Two arms per pack, below the 4 the clean-measure skill asks for an interval. iq30 r1, r2 / stq175 r1, r2 (tok/s): 46-token decode 47.0 (first request after load), 83.5 / 100.8, 98.9; decode after 32k 74.8, 83.6 / 93.0, 91.2; after 64k 70.7, 74.8 / 107.5, 91.2; 400-token answer 62.3-70.9, 88.7-89.4 / 97.2-97.6, 97.4; prefill 8k 1,326, 1,555 / 1,706, 1,822; 32k 1,864, 1,930 / 1,888, 1,926; 64k 1,905, 1,924 / 1,880, 1,892. Reading: STQ decodes faster at every depth (means 92.1 vs 79.2 after 32k, 1.16x; 99.3 vs 72.7 after 64k, 1.37x) with a tighter spread (iq's round 1 ran slow throughout), prefill ties at 32-64k and STQ leads at 8k, at 120 GiB of weights resident against iQ's 207 GB. Quality (same-set KLD) not measured.
DeepSeek-V4.1 conversations in the SSD tier as module records (phase 2b, ddalcu/mlx-serve#1000 at 0496c643, against phase 1 gc-493b7e4f), M5 Ultra, iQ-MLX 3.0bpw, 2026-10-27 (headless after the power-cut reboot: live server down, Latch in foreground, batch mode, no stop/restore wrapper; --ctx-size 139264 --prefix-cache-entries 4 --prefix-cache-mem 8GB --prefix-cache-disk 32GB --shutdown-persist-secs 45, DSpark on, order A B B A, results ~/bench/ds41-alt-20261027-2031). Turn 1 of a 26.8k-token conversation, SIGTERM, a new server on the same disk directory, turn 2: phase 1 16.33 / 16.30 s with 0 cached; 2b 0.162 / 0.160 s with 26,840 cached (~100x). Cold control (turn 2 on an empty directory) 16.29-16.63 s on every arm. SIGTERM to exit 0.002-0.005 s on both: the idle loop had already written the record. Watcher not clean: foreign_peer and busy_process on short-lived Xcode Python processes, matching the bench's own per-stage probe (no wrapper ancestor to mark it ours); not a decode measurement. Harness: bench/studio-live/ds41-alt-bench.sh restart arms.
DeepSeek V4.1 Flash 1017 quality, same-set KLD against the released FP8 checkpoint, M5 Ultra, 2026-10-28 (headless after a kernel panic, live server down, one model at a time; results ~/bench/kld/ds41-20261028-1523). Teacher: sushi kld capture of deepseek-ai/DeepSeek-V4.1-Flash-1017 streamed at --ssd-budget-gb 120, 16 original prompts x 512 greedy tokens (bench/kld/ds41-prompts.jsonl: two each of code, math, reasoning, design, prose, multilingual, story, agent), 682 s, peak 127 GB, 4.0 GB fixture. Exact full-vocab (sushi kld compare): STQ 1.75bpw KLD 0.1869 to first EOS, top-1 89.34% (7,498 positions; its card reads 0.1843 on its own 8-category set). sushi refuses the iQ pack (ExpertStreamingUnsupportedLayout), and fresh mlx-serve builds segfault at start (CLAUDE.md, build step 3), so both packs were also scored through /v1/completions top_logprobs 1024 (bench/kld/api-kld.py: KL over decoded-text classes, flat tail): STQ under sushi serve 0.2022 / 89.26%, iQ 3.0bpw under the live gc-493b7e4f (8-bit served LM head) 0.1832 / 89.62%, 7,495 positions each (3 rows whose next token is a stop return no logprobs on either server). The API method reads high against exact (STQ 0.2022 vs 0.1869; 1.00-1.23x per prompt), so compare packs only within it. Reading: iQ 0.91x STQ's KLD, lower on 11 of 16 prompts (code, reasoning, design, prose, story, agent), higher on math and multilingual; per-prompt ratios 0.54-2.07x, so a small edge, not a gap. Against the speed rows above: STQ decodes 1.16-1.37x faster at depth on 120 GiB resident; iQ is slightly closer to FP8 on 207 GB.
MLX sliding-window SDPA (ml-explore/mlx#4734, merged 2026-10-23 as 360078a8: window_size in fast::scaled_dot_product_attention, Metal vector and matrix kernels; its own M5 bench is 1.2-1.4x at 1-4 query rows and 1.5-2.8x at 2-4k rows, windows 1024-2048, against a dense bool mask) for DeepSeek V4.1, reviewed 2026-10-28, not measured. Outcome: does not apply. V4.1 attention is one softmax over the last sliding_window = 128 rows plus the index_topk = 512 selected compressed rows (head_dim 512, 1 KV head, both packs' config.json), which mlx-serve already runs in its own kernels bounded to the window (src/deepseek_v41.zig, decode kernel lo = max(0, pos - window + 1)). A window-only SDPA covers 128 of the ~640 keys and would need merging with the compressed part through logsumexp, which the PR refuses with a window (window support for backward attention is NYI, so it falls back). mlx-serve's lib/mlx-src pin 64ea011c is 122 commits behind the merge in any case, and sushi v1.4.0's bundled libmlx.dylib has no has_window string. Where it could pay: the DFlash drafter's dense buildBlockMask with sliding_window (src/dflash.zig) and SWA models (MiMo-V2, ACE-Step's slidingBandMask), none served on the Studio now.
DeepSeek V4.1 Flash 1017 Sushi-STQ 1.75bpw: CommunityServe sushi_ds41 outside plugin under mlx-serve main 49977fe7 (-Dunits=false, plugin ported to main's ABI) against sushi v1.4.0 on the same pack, M5 Ultra, macOS 27.2, 2026-10-28 (Latch isolated measurement, live server stopped by the wrapper, omp paused, watcher clean over 313 ticks, 2 rounds alternating, 1 stream, --ctx-size 139264 --prefix-cache-disk 0, sushi --ssd-budget-gb 150; both hold every routed expert resident: the plugin logs 119.59 GB, 384 slots a layer; results ~/bench/ds41-mlx-20261028-2205). plugin / sushi: prefill 8k 924.5 / 1,811.3 tok/s (0.51x), 32k 1,004.5 / 1,904.2 (0.53x), 64k 1,053.3 / 1,863.9 (0.57x); decode short 98.5 / 100.5, after 32k 91.3 / 92.4, after 64k 84.7 / 99.4 (0.85x). Both prefill in 2,048-row chunks (sushi's ladder tops at 2048 here; the plugin's prefill_width is 2048), so chunk width is not the gap. The plugin runs sushi's own model code (extendAhead calls planCed), so the next step is a per-pass trace (SUSHI_DS41_TRACE=1) of CED engagement and pass wall time.
Root cause of the row above, and the fix, 2026-10-28 (Latch isolated, watcher clean over 284 ticks, same arms and flags, results ~/bench/ds41-mlx-20261028-2237): a per-pass trace showed CED engaged in the plugin (ced_split=20 on every 2,048-row pass) and the pass itself at 2,131-2,358 ms against sushi's 1,067 ms ([expert-stream] wall_ms), while a 128-row warm pass matched stage for stage ([dsv41-prof] total 350.1 vs 338.9 ms). The plugin pinned MLX's buffer pool at 1 GiB for the whole process; sushi's server raises it per forward (dsv41_borrow.enterForward: the 1 GiB decode cap up to a 17-row verify, growing to dsv41_prefill_pool_bytes 8 GiB at a 2,048-row chunk, RAM-wide cap min(8 GiB, RAM/16)), so a 2,048-row chunk in the plugin freed and remade its buffers op after op. Fix in the plugin (uncommitted, ~/git/forks/communityserve-plugins): each pass moves the cap with sushi's own borrow.poolCap, and the load bills the 7 GiB growth in the expert room (still 384 slots a layer). plugin / sushi after: prefill 8k 1,733.4 / 1,805.8 (0.96x, was 0.51x), 32k 1,521.2 / 1,903.8 (0.80x), 64k 1,236.1 / 1,872.6 (0.66x); decode short 97.9 / 100.4, after 32k 91.5 / 92.3, after 64k 85.0 / 99.0. Open: a second gap that grows with depth, in prefill and in decode after 64k.
The depth gap, and the fix that puts the plugin ahead of sushi, 2026-10-28 (Latch isolated, watcher clean over 251 ticks, same arms and flags, results ~/bench/ds41-mlx-20261028-2311). A per-entry trace (time inside forward/nativeStep/verify/finish and the host's gap before each) showed mlx-serve's host costing almost nothing (gaps of 0.6-4.5 ms per 64 decode steps), but at 64k the host fed the plugin ~1,000-row prefill calls (64 calls of 423 ms on average; 4,096 at 8k). Each host call cost a CED decoder tail of 128 rows, a lone last-token pass and a pool drop and regrow, and the DSpark stages, which read the decoder's rows, accepted 1.50 tokens a round at 64k against sushi's 2.36 on the same greedy text. Fix (plugin config.zig): declare whole_prompt_prefill, so the host hands the prompt over in one forward and the plugin chunks it at prefill_width as sushi does. plugin / sushi after: prefill 8k 1,903.1 / 1,803.7 (1.06x), 32k 2,074.1 / 1,903.9 (1.09x), 64k 2,049.8 / 1,871.2 (1.10x); decode short 100.3 / 100.1, after 32k 91.6 / 92.5, after 64k 98.5 / 99.4; round 1 at 64k accepted 2.36 a round over 119 rounds, sushi's exact figures. Cost: a 64k prefill is one uncancellable host call (~31 s), as for the built-in streamed V4.1. Live since 23:26 on this build.
DeepSeek V4.1 STQ prefill under sushi_ds41 (live build), chunk width and top-k pick overlap, M5 Ultra, 2026-10-29 (Latch isolated, watcher clean over 255 ticks, 2 rounds, results ~/bench/ds41-mlx-20261029-0719 and -0735). Chunk width via a temporary SUSHI_DS41_PREFILL_WIDTH (pool cap scaled with it): 2,048 / 4,096 / 8,192 rows gave prefill 8k 1,812.0 / 1,629.7 / 1,765.2 tok/s, 32k 2,075.5 / 2,136.4 / 2,058.1, 64k 2,050.6 / 2,177.1 / 2,174.1; decode unchanged (~100). RETRACTED as a conclusion (independent review, https://github.com/STRML/local-llm/issues/21#issuecomment-6496177412): no log line shows the wider arms ran wider chunks or raised the pool cap, the 2,048 arm alone ran with the picks dump on, and the 4,096 arm's 8k drop is real (rounds within 0.3%) and unexplained; rerun with identical env and a per-chunk width/pool log before calling width a lever or not. Picks (global group ids, positions 8k-64k, bench/kld/picks-overlap.py): union over sum of a tile of T rows 0.76 / 0.59 / 0.46 / 0.34 / 0.23 at T = 2 / 4 / 8 / 16 / 32. Also found: with packed compressed rows compressedPicks unpacks every row's 512 picks into a [rows x K, 512] bf16 buffer the fused kernel reads back (~128 MB a 256-row span a layer, profiled under indexer). Plan in https://github.com/STRML/local-llm/issues/21.
DeepSeek V4.1 prefill core attention, heads per threadgroup (#21 S1), M5 Ultra, 2026-10-29 (branch dsv41-attn-s1 c985de6 in the local CommunityServe clone; self-test SUSHI_DS41_ATTN_AB=1 in the plugin load on a spare port beside the live server, no weights loaded; L=256 H=64 D=512 window 128 K=512 bf16, 80 input sets cycled, 7 rounds, first dropped). Exact on all 11 failure-matrix cases; slower in every shape that fits 32 KB of threadgroup memory: old HB16/NSG8/KT16 1.528 ms a call, generalized kernel at the old shape 1.526, HB16 KT8 1.681, best HB32/SH1/SD8/KT8 1.652 (0.925x), HB64 shapes 1.747-1.898. Not landed. The arithmetic says the kernel is matrix-bound: QK 10.7 + hi/lo P x V 21.5 = 32.2 GFLOP a call, ~21 TFLOPS of simdgroup_matrix work; key-tile reads ~671 MB a call (~439 GB/s, mostly L2). Fewer key loads is not the lever; single-pass f16 P and the M5 neural-accelerator matmul2d tiles are (https://github.com/STRML/local-llm/issues/21).
DeepSeek V4.1 prefill core attention, round 2 (https://github.com/STRML/local-llm/issues/21), M5 Ultra, 2026-10-29 (branch dsv41-attn-s1 85b028a, same self-test harness, 80 input sets cycled, 7 rounds, arms interleaved; packed picks / realistic overlapping picks). ms per call: old attnFused 1.528 / 1.509; HB32 KT8 1.656 / 1.565; HB32 KT16 with the score reduction folded to fit 1.695 / 1.618 (head sharing loses at KT16 too, so the S1 KT confound is settled); one-pass bf16 P 1.143 / 1.114 (1.34x / 1.35x); one-pass f16 q/keys/P 1.194 / 1.164 (1.28x / 1.30x). Measured matrix peak, no memory traffic: simdgroup_matrix bf16 25.3 TFLOPS (f16 25.4), matmul2d 16x32x16 94.8 bf16 / 97.5 f16 TFLOPS; the old kernel's ~21 TFLOPS is 83% of the simdgroup peak (matrix-bound, measured). Precision vs CPU f32: output-peak rel 2.58e-3 (bf16 one-pass) and 2.55e-3 (f16 one-pass) vs 2.55e-3 today; small elements 13-22x (bf16) and 1.7-3.5x (f16) outside bf16 rounding. Not wired yet: KLD on the real pack decides; matmul2d attention arms written, not built (Studio unreachable mid-run).
DeepSeek V4.1 prefill core attention on M5 matmul2d tensor tiles (https://github.com/STRML/local-llm/issues/21 round 3), M5 Ultra, 2026-10-29 (branch dsv41-attn-s1 1a30106, self-test harness, L=256 H=64 D=512 window 128 K=512, 80 sets cycled, 7 rounds; packed / overlapping picks). dsv41_attn_fused_nax with today's hi/lo P split: exact (S1 bound on all 11 failure-matrix cases, 55 PASS lines; fragment layouts M16/N16/K32 and M16/N32/K16 exact to 9.5e-7), 0.710 / 0.675 ms a call against attnFused's 1.528 / 1.509 (2.15x / 2.24x). One-pass bf16 P on matmul2d 0.682 / 0.643 (2.24x / 2.35x), only ~4% more at a precision cost; one-pass on simdgroup_matrix 1.144 (1.34x); f16 one-pass without the q pre-scale 1.195. Relaxed precision changes nothing. Core is ~25% of a 2,048-row chunk, so ~13% off the chunk is the estimate to check in a model-level A/B.
DeepSeek V4.1 STQ prefill, exact matmul2d core attention in the live plugin path (https://github.com/STRML/local-llm/issues/21), M5 Ultra, 2026-10-29 (Latch isolated, watcher clean over 240 ticks, 2 rounds alternating; plugcur = live sushi_ds41 build cb9f922, plugnax = branch dsv41-attn-s1 796ffb3 with SUSHI_DS41_ATTN_NAX=1 from a throwaway plugin HOME; --ctx-size 139264 --prefix-cache-disk 0; results ~/bench/ds41-mlx-20261029-1059). plugcur / plugnax: prefill 8k 1,906.0 / 2,137.7 (1.12x), 32k 2,075.1 / 2,368.2 (1.14x), 64k 2,049.8 / 2,342.8 (1.14x), as estimated from core's ~25% share. Decode short 100.6 / 96.8, after 32k 91.9 / 91.1, after 64k 99.0 / 86.7. The kernel runs only on prefill (> 16 rows); decode moved with the text: greedy output differs from line 2 in both rounds (the kernel matches the f32 reference within the S1 bound but is not bit-identical to the old kernel), and at 64k the live build's text slid into a repeated word list that DSpark drafts well (2.36 / 1.67 accepted a round) while plugnax's stayed structured (1.65 / 1.29). Not landed: quality needs the KLD harness against the FP8 teacher before it can replace the live kernel.
KLD of the exact matmul2d core attention (row above), M5 Ultra, 2026-10-29 (Latch isolated, live server stopped by the wrapper, omp paused; bench/kld/ds41-api-plugin-window.sh, API method against the FP8 teacher fixture ~/bench/kld/ds41-20261028-1523/teacher, tokenizer from the STQ pack; results ~/bench/kld/ds41-20261029-plugin). Live plugin build / matmul2d build: mean KLD 0.1854 / 0.1849, top-1 89.27% / 89.10% over the same 7,495 positions; the matmul2d build is lower on 8 of 16 prompts, per-prompt ratios 0.967-1.025. Within noise: the +12-14% prefill costs no measurable fidelity. (The API method reads above the exact full-vocab figure; compare only within it.)
DeepSeek V4.1 STQ, sushi_ds41 with its vendored sushi slice synced from 3fc47d8a to sushi main cc1981df (178 commits: packed picked rows in fused attention 05ec573, one-kernel hyper-connection expand ac8e5c7, top-k width probe 6b84c34, bf16 router 8fe1082, shared expert inside routed decode 702eff4, SSD token embedding 0dcb205, 8-bit vision tower 34e8cb3; transient cap not adopted), M5 Ultra, 2026-10-29 (Latch isolated, live server stopped, omp paused, both arms mlx-serve main 0fd72980; plug0fd7 = plugins 1437696, plugsync = branch sushi-ds41-sync-cc1981d 5645154 from a throwaway HOME; 2 rounds palindromic, --ctx-size 139264 --prefix-cache-disk 0; results ~/bench/ds41-mlx-20261029-1248). plug0fd7 / plugsync: prefill 8k 2,136.7 / 2,453.4 (1.15x), 32k 2,367.3 / 2,751.1 (1.16x), 64k 2,340.8 / 2,724.9 (1.16x); decode short 96.9 / 100.3, after 32k 91.2 / 92.5, after 64k 86.7 / 88.1. Round-to-round spread under 0.6% on every prefill tier. Watcher not clean: 4 busy_process hits 12:51-12:54 inside plug0fd7-r1 (mlxtop.py at 25-31% CPU, one MTLCompilerService tick); plug0fd7-r2 had none and reads within 0.6% of r1. KLD (API method, FP8 teacher, 7,495 positions, ~/bench/kld/ds41-20261029-sync): 0.18489917 for both, top-1 0.89099 for both, every prompt's KLD and top-1 equal, so the sync is exact on this fixture. Load: expert cache still 384 slots a layer; room 205.23 -> 198.32 GB (the bill's 8,192-row chunk term grew 7.29 GB). Mind the dashboard: close mlxtop on the Studio before a window, or pause it.
DeepSeek V4.1 STQ prefill stage shares on the live build (mlx-serve main 0fd72980, sushi_ds41 plugins c8ec5b2: matmul2d core attention plus the sushi cc1981df sync), M5 Ultra, 2026-10-29 (Latch isolated, live server stopped, omp paused, mlxtop and the wallpaper extension SIGSTOPped; SUSHI_DSV41_PREFILL_PROFILE=1, which evaluates after every stage, so its prefill reads 2,092 / 2,315 / 2,294 tok/s at 8k / 32k / 64k against 2,453 / 2,751 / 2,725 unprofiled; results ~/bench/ds41-mlx-20261029-1451, shares by bench/studio-live/prof-shares.py). A chunk logs [dsv41-prof] (layers before the CED split) and [dsv41-prof-dec] (the decoder tail) labelled with its last 128-row span, so rows=128 lines are whole 2,048-row chunks. Per chunk 852-886 ms; shares at positions 0-16k / 48-64k: routed experts 31.3 / 29.2%, core attention 20.7 / 25.5%, trunk linears (attn_in + q + attn_out + shared) 31.9 / 29.5% (attn_out alone 14.5 / 13.2%), engram 4.5 / 2.5%, indexer 1.2 / 3.3% (was 11-16% before the sync's packed picks, https://github.com/STRML/local-llm/issues/22), hc and expand ~7%. The per-chunk sum checks out against TTFT: 32 chunks x ~864 ms = 27.6 s against the 64k request's 27.9 s. The shares mix the 2,048-row pre-split pass with the 128-row decoder tail, so the FLOP rates below use the pre-split line alone (20 layers, ced_split=20; chunk at position 49,024, profiled): routed experts 17,398 GFLOP in 234.1 ms = 74.3 TFLOPS (78% of the 94.8 TFLOPS bf16 matmul2d peak measured in https://github.com/STRML/local-llm/issues/21), shared expert 2,899 / 46.8 ms = 61.9 (65%), q (wq_b) 3,436 / 55.9 ms = 61.5 (65%), attn_out (wo_a + wo_b) 6,174 / 109.2 ms = 56.5 (60%), core attention 5,152 / 217.3 ms = 23.7 (25%). The profile's per-stage syncs slow it ~15%, so true rates are higher. Reading: the trellis linears and experts already run near the matrix units' peak, so decoding each trunk weight once instead of 64 times a chunk (32-row GEMM windows) has little to win; not pursued. Core attention is the outlier: the matmul2d kernel alone measured 0.71 ms a 256-row span (issue 21), which predicts ~114 ms a chunk against the 217 ms the stage takes.
Correction to the row above, same day (corrected-profile window, Latch isolated, live server stopped, omp paused; arm profidx = the live plugin plus a one-line profiler fix from a throwaway HOME; results ~/bench/ds41-mlx-20261029-1513). The core gap was a profiler mis-attribution: with a packed compressed store the indexer mark evaluated only keys_w (comp_rows is null on that path), so the indexer's top-k ran lazily inside core. A microbench of the live kernel first ruled the kernel out (SUSHI_DS41_CORE_BENCH, plugins branch dsv41-core-bench, production span, 16 cold sets, 16-row tiles drawing on a 0.34-union pool): attnFusedNaxPacked 0.728 / 0.727 / 0.732 ms a call at stores of 2,048 / 8,192 / 16,384 rows, the kernel on pre-gathered bf16 rows 0.734 / 0.732 / 0.735, gather-then-kernel 1.092 / 1.083 / 1.098; so reading packed picks in the kernel costs nothing and store size does not matter. With the mark evaluating topk too, shares at positions 0-16k / 16-32k / 32-48k / 48-64k: indexer 3.7 / 6.7 / 9.5 / 11.7% (was booked 1.2-3.3%), core 18.6 / 18.8 / 18.4 / 17.3% (flat, as the kernel's fixed key count predicts); pre-split chunk at 49,024: indexer 79.7 ms, core 151.7 ms. The indexer is again the stage that grows with context (https://github.com/STRML/local-llm/issues/22). Its prefill tile scorer (IDX_TILE_SOURCE) runs one threadgroup per query row and key tile, so every row reloads every key tile (the compressed ratio is 2, so a row at position p scores p/2 blocks: ~24k at the 48k chunk, 2,048 x 24k x 128 x 2 B = ~12.6 GB of key reads a layer a chunk, mostly L2; 32k blocks and ~16.8 GB at 64k). Pre-split, only layers 2, 8 and 14 own an indexer: ~1,210 GFLOP of scores in the 79.7 ms stage at that chunk, ~15 TFLOPS, ~60% of the simdgroup_matrix peak, and the stage also holds idx_wq_b, weights_proj, the q rope and the streaming top-k on simdgroup_matrix with M = 32 heads.
DeepSeek V4.1 prefill indexer split, M5 Ultra, 2026-10-29 (SUSHI_DS41_INDEX_BENCH, plugins branch dsv41-core-bench, Latch isolated beside the idle live server; one 256-row span, 32 heads x 128, ratio 2, top 512, packed fp4_ue8m0 g32 key store, 8 sets, 6 rounds first dropped). ms a span at p0 47,104 (23,680 blocks) / 63,744 (32,000): tile scorer with the unpack 2.32 / 3.11, whole indexStream 2.60 / 3.39, top-k alone 0.10 / 0.14, MLX matmul plus head sum (GLM-5's IndexPool NAX shape, bf16 dot plane) 5.77 / 7.69. The scorer is the stage: 49.7 GFLOP in 2.32 ms = 21.4 TFLOPS, 85% of the simdgroup_matrix peak, so it is now matrix-bound; 3 owner layers x 8 spans x 2.6 ms = ~62 ms of the 79.7 ms profiled stage at 48k. GLM's unfused port loses (it writes a 400 MB bf16 dot plane a span). Lever: a matmul2d scorer with relu, weights and head sum fused and R rows a threadgroup so a key tile serves several rows (key reads are ~1.5 GB a span from L2 at one row a threadgroup).
DeepSeek V4.1 STQ, matmul2d prefill index scorer (src/index_nax.zig, plugins branch sushi-ds41-index-nax: 16 query rows share each staged 32-key tile, 16 heads x 32 keys over 16-channel steps, relu, weights and head sum in registers), M5 Ultra, 2026-10-29. Microbench (SUSHI_DS41_INDEX_BENCH, one 256-row span, packed key store): 0.703 / 0.934 ms a span at 23,680 / 32,000 blocks against indexScoresTile's 2.323 / 3.116 (3.30x / 3.34x, ~71 TFLOPS, 75% of the matmul2d peak); R 4 / 8 with 64-key tiles 0.771 / 0.716 ms; scores within 1.2e-7 of the peak, the same -inf columns and the same top-512 on random data. A/B (Latch isolated, live server stopped, omp paused, 2 rounds palindromic, --ctx-size 139264 --prefix-cache-disk 0; plug0fd7 = live c8ec5b2, plugidx = branch 92ceab2's dylib from a throwaway HOME; results /bench/ds41-mlx-20261029-1538; watcher: one busy_process tick at 15:47:34): prefill 8k 2,460.1 / 2,471.2 (+0.5%), 32k 2,757.1 / 2,813.0 (+2.0%), 64k 2,727.0 / 2,841.6 (+4.2%), rounds within 0.3%; decode short 100.6 / 100.4. Decode after 32k / 64k read 92.6 / 84.4 and 88.0 / 84.0, but each round's prompt differs (the bench seeds a fresh prefix a round), so the per-round spread is 6-10 tok/s within one build (live 88.8, 96.4; index-nax 79.5, 89.3 after 32k) and decode never calls the scorer (verify blocks are <= 16 rows, the narrow kernel): no decode effect is shown either way at n=2. API KLD (/bench/kld/ds41-20261029-indexnax): 0.18489917004724493 / top-1 0.890994 for both, identical to every digit, because the fixture's prompts are short enough that each row's top-512 keeps every block; it does not exercise the scorer. The long-prompt check is the next window's in-process picks comparison.
DeepSeek V4.1 STQ, CED state pass for prefill chunks another chunk follows (plugins branch sushi-ds41-ced-state e2ea5d9, patches/ced-state.patch: dsv.extendState runs layers 0-19 and layer 20's compressor over every row and stops, instead of the CED decoder over the chunk's last 128 rows plus a dropped head), M5 Ultra, 2026-10-29 (Latch isolated, live server stopped, omp paused, mlxtop and the wallpaper extension SIGSTOPped, 2 rounds palindromic, --ctx-size 139264 --prefix-cache-disk 0; plug0fd7 = live c8ec5b2, plugced = the branch from a throwaway HOME; results ~/bench/ds41-mlx-20261029-1625). plug0fd7 / plugced: prefill 8k 2,465.9 / 2,561.7 (+3.9%), 32k 2,758.2 / 3,079.1 (+11.6%), 64k 2,728.9 / 3,062.6 (+12.2%); decode short 100.9 / 100.8, after 32k 92.9 / 93.0, after 64k 88.9 / 88.8. Why the tail was waste: the plugin sent every intermediate chunk with want = .last and dropped the logits; the decoder's and DSpark's rings hold window (128) rows, and the next chunk's tail overwrites them before any query reads one (cedReplay's band starts at the tail's first row); index keys and ratio-1 compressed rows come from layer 20's compressor over every row, which still runs. Byte-for-byte equivalence on long prompts is the gate before merge.
Equivalence gate for the two prefill changes above, M5 Ultra, 2026-10-29 (bench/kld/ds41-equiv-window.sh, Latch isolated, live server stopped, omp paused; fixed prompts cut from this repo's docs and tokenized by the server: 8k, 32k, 64k, a 2,048 x 4 + 300-row prefix (merged tail), a 32k prompt then the same plus 40 tokens (RAM prefix-cache restore), and an image with 10k text tokens; 64 greedy tokens with top-5 logprobs; results ~/bench/kld/ds41-20261029-equiv4). CED state pass against live c8ec5b2: text and logprobs identical on all seven. Index-nax build with SUSHI_DS41_INDEX_CHECK=1 (both scorers on every wide span, top-512 compared row by row): 193,989,110 of 193,989,120 picks equal; 8k, merged-tail and image identical, but 32k, 64k and both restore prompts diverge (first differing token 1 / 13 / 12 / 52, max |logprob diff| before it 0.12-0.20 nats). Shipped as rounding-level on Sam's call: CommunityServe/plugins#11 (merged 24c5744e) and CommunityServe/plugins#12 (merged 01a5cef1).
DeepSeek V4.1 STQ, prompt-lookup copy arm in sushi_ds41's DSpark round (plugins branch perf/ds41-copy-arm a57667c on the STRML fork: an n-gram index of the request's ids, mlx-serve's matchBest and dsparkCopyLen ported; a 16-token agreement whose copy outruns the 5-token block verifies up to 15 copied drafts instead of a stage draft), M5 Ultra, 2026-10-30 (bench/kld/ds41-copy-window.sh, Latch isolated, live server stopped, omp not paused; mlx-serve 0fd72980-pp both arms, A = live plugin 508450ff, B = a57667c from a throwaway HOME; order A B B A; results ~/bench/kld/copy-20261030). Greedy decode, bench/kld/copy-arm-probe.py, one run per arm: echo a 330-line Python file A 141.8 / 142.2, B 193.6 / 196.2 tok/s (+37%); rename a function across it A 141.3 / 141.7, B 194.7 / 194.7 (+37%); free prose A 66.8 / 66.8, B 69.6 / 66.4 (no copy round fires). Copy rounds: echo 249 rounds kept 3,735 of 3,735 drafts, rename 248 kept 3,710 of 3,720. equiv-probe.py (logprob answers, drafting off) EQUIV-OK for B2 and B3 against A1. Text: echo and rename identical in all four arms; prose A1 = A4 but B2 and B3 each differ (first at char 820, a near-tie "a crown of glass" / "a dormant jewel"). Prose re-check (next row): the live build's own two arms disagree on prose too, so greedy prose under DSpark is not deterministic run to run; the copy arm is not the cause.
Candidate swap check and DSpark draft audit, M5 Ultra, 2026-10-30 (one Latch isolated window, live server stopped, bench/kld/ds41-combo-20261030.sh; results ~/bench/kld/combo-20261030, audit-20261030, copy2-20261030). Copy window, probe now prose first, A = live 0fd72980-pp + plugin 508450ff, B = mlx-serve main db128461 (233 MLX imports; carries da964cf1, a DSpark round no longer re-feeds a reasoning-budget close token) + plugin c873b70 (copy arm + PR 13 prefill progress, db128461 kit); order A B B A: echo A 142.0 / 142.2, B 196.3 / 196.3 (+38%); rename A 141.4 / 141.7, B 194.8 / 194.7 (+37%); prose A 69.7 / 66.7, B 70.6 / 67.8. equiv-probe EQUIV-OK for A4, B2, B3 against A1. Echo and rename text identical in all four arms. Prose text differs in all four, A4 against A1 included (first at char 2,182), so greedy decode with drafting on varies run to run on the live build itself (a timed rows policy picks verify widths, and a width changes near-tie argmaxes); the copy arm adds no divergence of its own. DSpark draft audit (plugins exp/ds41-draft-audit e8a9148, teacher-forced along the FP8 fixture's greedy text, 16 prompts, every drafted block verified in full; bench/kld/draft-audit.py): per draft offset k, A_q = P(draft = STQ argmax) / A_f = P(draft = FP8 token): k1 73.67 / 72.31% (n 2,503), k2 70.91 / 68.97, k3 70.31 / 68.70, k4 74.00 / 72.47, k5 75.12 / 74.96. Where STQ and FP8 disagree (|D| 307 at k1), the draft follows STQ 32.3%, FP8 21.2%, neither 46.6%. Headroom at k1 (STQ != FP8 and the draft follows FP8) 2.60 pp (2.54 on the 14 prompts that ran exactly on FP8 text): DSpark already tracks the quantized verifier more than FP8, so distilling it toward STQ (the Soft-MTP lesson, arXiv 2610.38331) has at most ~2.6 pp of acceptance to win; not pursued. Confidence head against STQ: calibrated at k1 (bins within 0.01-0.07), under-confident from k2 on (predicted 0.45 -> observed 0.50-0.65, 0.55 -> 0.60-0.75, 0.65 -> 0.73-0.82, 0.75 -> 0.82-0.86), so a rows policy that trusts it verifies fewer drafts than pay at offsets 2-5. That is the open lever (a per-offset calibration prior for dspark_rows), not the drafter's weights.
DSpark verify-row policy replay, 2026-10-30, offline (bench/kld/dspark-calib-sim.py over the 2,483 rounds of the draft audit above; each round verified its full block, so its greedy acceptance at every row count is known; round cost = 4 ms draft + verify ms by rows from live plugin logs, 15.9 / 19.8 / 22.9 / 27.3 / 30.6 / 33.5 at 1-6 rows; every policy reset per prompt). Today's plugin policy (one calibration pooled over offsets, identity prior, online) 95.33 tok/s, 2.650 tokens a round (live reads ~100, so the model holds). Per-offset calibration, leave-one-prompt-out priors: 95.84 (+0.5%). A logistic acceptance predictor over what the plugin knows before verifying (each draft's confidence, the block's minimum and mean, the request's recent acceptance, the offset), leave-one-prompt-out: 96.46 (+1.2%). Verify the whole block: 81.66 (-14.3%). Oracle row count: 111.92 (+17.4%). Reading: the confidence head's calibration is not what costs speed; its discrimination is (which draft will fail). Closing part of the oracle gap needs a better per-draft signal than today's confidence logit, i.e. retraining the confidence head on the STQ verifier's accepts with its hidden-state inputs; untested, and the two cheap levers here are under the 6-10 tok/s decode noise.
DeepSeek V4.1 STQ, sushi_ds41 with its vendored sushi slice synced from cc1981df to sushi v1.4.1 (078012e6; CommunityServe/plugins branch sushi-ds41-1.4.1 615c227 by Theinruj Toranavikrai, unmerged: attention epilogue in the kernel's store be10df9b8, shared expert riding the routed prefill launches 0e709341d, 2 x 12 HC mix tile b358cd383, EXL3 file split; drops attn-nax.patch and ced-state.patch as native, rebases index-nax.patch), merged with our copy arm (STRML/plugins exp/ds41-v141-copy f27a23b = 615c227 + perf/ds41-copy-arm 9334467, no conflicts; dylib ~/opt/mlx-serve-main/sushi_ds41-f27a23b.dylib, sha256 417d78ca..., built against the db128461 kit, tests run by scripts/build.sh), M5 Ultra, 2026-10-30 20:35-21:12 (bench/studio-live/ds41-plugin-ab-window.sh, one Latch isolated window, live server stopped by studio-bench-hcrows-wrap.sh and restored at 21:12:31, /health 200, runs = 1; both arms mlx-serve main db128461, --ctx-size 139264 --prefix-cache-disk 0; plugdb12 = live plugin 9334467 from the real HOME, plugv141 = f27a23b from ~/bench/plugin-home-v141; 4 rounds palindromic A B B A A B B A, FIXED_PROMPTS=1 so every round sends the same prompts, each arm a fresh server, so prefill stays cold; results ~/bench/ds41-v141-20261030). Mean of 4 arms each, plugdb12 / plugv141, Welch 95% interval on the difference: prefill 8k 2,578.9 / 2,626.6 (+1.85%, [+31.7, +63.6] tok/s), 32k 3,141.1 / 3,184.0 (+1.37%, [+39.3, +46.5]), 64k 3,187.9 / 3,224.2 (+1.14%, [+32.2, +40.4]); round sd 1.1-8.8 tok/s (A's r1 8k 2,592.1 is the only outlier), every B round above every A round on every tier. Decode, greedy, fixed prompts: short 97.2 / 97.3 ([-0.1, +0.4]), after 32k 84.8 / 84.8 ([-0.5, +0.5]), after 64k 90.6 / 90.8 ([-0.7, +1.2]): no change. So the claimed +3-5% at 32-64k reads +1.1-1.4% here on top of the live build (index-nax and the CED state pass already in it); the gain is largest at 8k. Equivalence (ds41-equiv-window.sh, 64 greedy tokens with top-5 logprobs on 8k, 32k, 64k, merged tail, both restore prompts and the 10k-token image): text and logprobs identical on all seven, EQUIV-OK. API KLD (FP8 teacher ~/bench/kld/ds41-20261028-1523, 7,495 positions): 0.18489917004724493 / top-1 0.890994 for both arms in this window, every prompt equal, the same as the live figure. Load: expert cache 119.59 GB, 384 slots a layer in 197.15 GB of room for both. B's log no longer prints wide-span attention: matmul2d (the patch that logged it is gone; the path is native in the slice), and it still prints prefill index scores: matmul2d. Watcher: the speed A/B ran clean; one busy_process tick at 20:57:35 (searchpartyd at 74.6% CPU) fell during the equivalence stage's second load, which compares bytes, not speed; ambient mediaanalysisd 67.8%. omp was not paused: another agent's ledger held ~/.cache/claude/omp-pause.json, so this window left both stop and restore alone, per the coordinator. No foreign or remote peer reached the bench port. Verdict: adopt. It is a byte-exact +1.1-1.9% prefill with no decode cost, but smaller than claimed.
DeepSeek V4.1 STQ, sushi_ds41 prefill chunk width 2,048 vs 4,096 vs 6,144, M5 Ultra, 2026-10-30 (Latch isolated, live server stopped; mlx-serve db128461, plugins exp/ds41-width d51a73cf with SUSHI_DS41_PREFILL_CHUNK, which refuses any width whose widest pass would pass 8,192 rows; every prompt logs its passes, e.g. 64k ran 32 x 2,048 / 16 x 4,096 / 11 x 6,144, and a 7,682 request logged its refusal and ran 2,048; 2 rounds; full write-up docs/research/ds41-width-ab-20261030.md). Against 2,048 (8k 2,582-2,591, 32k 3,138-3,145, 64k 3,187 tok/s): 4,096 is -7.5% on a first 8k prompt and -3.6% on a warm 8k, +0.3% at 32k, +2.1/+2.3% at 64k; 6,144 is -10.4% at 8k, +0.7% at 32k, +3.1% at 64k; decode ~98-100 throughout. Memory: all 384 expert slots in every arm, expert room 197.15 / 188.56 / 179.97 GB, MLX peak at 64k 132.2 / 135.7 / 139.1 GB. Equivalence: 8k, merged tail and image byte-identical; 32k, 64k and restore flip at near-ties (0.04-0.32 nats), the index-nax rounding class. This replaces the retracted 2026-10-29 07:19 width row. Verdict: keep 2,048; a length-keyed width could win at most ~0.5 s of a 20 s 64k prefill. Open: the pool cap falls back to 1 GiB after each request's decode, so every prompt re-allocates (untested lead for the first-prompt cost); an all-row-logits request skips the chunk loop and with it the 8,192-row check (predates this branch). Not reachable from mlx-serve db128461: the plugin sets owns_decode_state, so the driver asks for .last_row except on a capture or a spec verify (src/engines/mlx/plugin/driver.zig:453), both sent as mode = .verify, which the plugin refuses, and the batched path (:863, .batched_rows) is refused too. mlx-serve's own deepseek_v4 plugin refuses all-rows past one sub-chunk (src/plugins/deepseek_v4/plugin.zig:109); the same explicit guard belongs in sushi_ds41.
DeepSeek V4.1 STQ DSpark round, Metal System Trace on the M5 Ultra, 2026-10-30 21:13-21:24 (mlx-serve db128461 + live plugin 9334467, Latch isolated, live server stopped; greedy, 1,000 tokens of prose after agent-transcript filler at 3,306 and 62,084 prompt tokens; bench/kld/ds41-trace-window.sh, ds41-round-split.py; full write-up docs/research/ds41-trace-copyreplay-20261030.md). GPU busy 81.7% at 4k and 81.5% at 64k. A ~22.4 ms traced round: ~18.3 ms GPU, 2.94 ms idle across ~6 host syncs (~0.45 ms each), 1.17 ms idle between command buffers (median gap 0.79 us); 197-210 one-encoder command buffers a round (~4-5 a layer in a verify). Tracing cost ~10% (68.0 untraced / 62.1 traced tok/s at 4k), text identical. This prompt accepted only 0.24-0.43 drafts a round. Reading: fewer host syncs a round is the decode lever (~13% of a round here; estimated, not traced, 7-9% of a 33-43 ms agent round); folding command buffers is worth at most ~5%.
sushi_ds41 copy arm on six captured agent requests (~/bench/capture, 86k-296k prompt tokens), 2026-10-30 21:25-21:43 (Latch isolated, live stopped, watcher clean; A B B A, both arms db128461; A = plugins 9c29d3f on the db128461 kit, which is main d8b7656 less PR 13's progress counter, since 508450ff refuses db128461; B = live 9334467; bench/kld/ds41-replay-window.sh, ds41-replay.py). Same-plugin arms agree within 1.5% and greedy outputs match exactly. Greedy decode: request 54 132.8 -> 169.1 tok/s (+27%), 108 +15%, but 70, 155, 207 and 171 lose 4-11% (1.7-7.8 ms more a round, not growing with context); all six 125.4 -> 138.7 (+10.6%). Temperature 0.6 outputs differ between arms, so those rows are unpaired. Only request 54's greedy run logged its copy line (39-40 rounds, 585-600 drafted, 273-274 kept), because the plugin logs it when the next request resets the state; accepted averages above 5 a round show copy rounds also fired on 108 greedy and on 54 and 70 at 0.6. Reading: copy rounds that fail early verify ~16 rows for little, and the arm has no backoff; next: a cost backoff for copy rounds and a copy line per request.
sushi_ds41 copy arm, backoff and sizing, on the six captured agent requests, M5 Ultra, 2026-10-30 23:11-2026-10-31 00:09 (three Latch isolated windows, live stopped, greedy, db128461 binary every arm, bench/kld/ds41-replay-window.sh; results ~/bench/kld/replay3-20261031, replay4-20261031, replay5-20261031). A = no copy arm (9c29d3f), B = live copy arm 9334467, C = sushi v1.4.1 slice + copy arm. Window 1 (A B C C B A), C = 92b52b7 with a cost backoff (a copy round that loses to the request's stage rounds, priced in ms per token, makes later matches skip a stretch that doubles to 16) and copy stats/backoff restarted on a prefix restore: short tool-call turns 70 / 155 / 207 still lost 6.5 / 7.5 / 8.4% to A, while 54 and 108 won 29.1 and 15.3%. Window 2 (A C C A), C = f66f476 adding mlx-serve's lookup sizing (a copy round verifies ceil(kept copies, smoothed, prior 5) + 2 drafts, the whole cap only after a copy landed whole; when copies keep ~1 the width falls to the 5-token block and the stage draft takes the round): A / C tok/s 70 138.2 / 124.6-134.4, 155 111.9 / 107.1 (-4.2%), 207 145.4 / 138.8 (-4.6%), 54 133.3 / 168.7 (+26.6%), 108 131.0 / 158.6 (+21.1%), 171 99.0 / 99.9. Window 3 (A C C A), C = 236688a, the same plus the prompt's n-gram index built on a thread during prefill, which logged 0.8-2.8 ms for 88k-297k ids: the inline build was never the short turns' cost, so the thread was reverted (head tree = f66f476). Its two C arms read identically: 70 134.4 (-2.7%), 155 109.4 (-2.4%), 207 138.9 (-4.4%), 54 168.7 (+26.6%), 108 158.7 (+21.2%), 171 101.7 (+2.8%); all six by decode time 126.1 -> 145.1 tok/s (+15.1%). Copies kept: 54 1,330 of 1,393, 108 1,164 of 1,187, 171 76 of 103, 70 25 of 50, 207 15 of 29, 155 1 of 13. Swapped live 2026-10-31 (f66f476, PLUGIN-SWAP-OK, rollback label 20261031-v141-copy). Open: the short turns' remaining 2-4% (a few 7-10-row copy rounds at 88k-137k context that keep about half).
JetSpec++ (arXiv 2610.19792, https://arxiv.org/abs/2610.19792; read 2026-10-31): draft-verify pipelining with a draft model on a second GPU, a trained hidden-state adapter and decoder that predict the verify outcome ("foresight"), and Jacobi self-refinement of a draft trained on clean-prefix/noisy-suffix blocks; up to 1.54x over DSpark on GB200. Not portable to the Studio: one GPU queue (verify already 81.6% busy, trace row above), no trained adapter/decoder or refinement-trained draft for V4.1, and their ablation shows mask-input drafts (DSpark's kind) gain little from refinement. Their Table 3 matches our DSpark round: 3.8-4.5 ms of exposed draft a round. Transferable: the exposed-overhead accounting, and a one-GPU form of foresight (queue the next draft behind the verify on the GPU, assuming full acceptance, anchor = the verify's last-row argmax, no host round trip; keep it on full-accept rounds, waste ~4 ms on the rest), handed to the host-sync work. Also cited: DPara (Liu et al. 2026) pipelines a stock DSpark draft by precomputing its backbone for every acceptance count; it too needs a second device to pay off.
Fewer host waits per sushi_ds41 DSpark round, M5 Ultra, 2026-10-31 (Latch isolated windows, live server stopped and restored by studio-bench-hcrows-wrap.sh; mlx-serve db128461; candidate STRML/plugins exp/ds41-fewer-syncsa72ddff = live f66f476 + one cut + an env-gated round profile, dylib ~/opt/mlx-serve-main/sushi_ds41-a72ddff.dylib, sha256 cf80bf00; scripts bench/kld/ds41-replay-window.sh, ds41-replay-compare.py, ds41-copy-window.sh, ds41-trace-window.sh). The cut: a verify's main rows and head are submitted rather than evaluated (finishVerify only slices the main rows; the round's argmax, or the engine's sampling, is the first read of the head), and the pooling groups a rejection cuts go to the GPU in one async_eval instead of one blocking eval per layer. Waits a greedy stage round, from the code: draft ids + confidences, trunk main rows, head, argmax (+ cut groups) before; draft, argmax after (sampled: draft + the engine's accept eval). Metal trace on the 10-30 prose prompt, live -> candidate: GPU busy 81.7 -> 84.2% (4k) and 81.8 -> 83.8% (64k), sync idle 2.87 -> 2.24 and 2.84 -> 2.35 ms a round, segments between waits 5.31 -> 4.25 and 5.50 -> 4.37 a round, the 2-buffer head and 1-buffer argmax segments gone (<= 4-buffer segments 1.5 -> 0.1-0.2 a round); the remaining extra segments split some verifies and plain rounds into 10-40-buffer pieces in both plugins (host stalls, cause open). Six replayed omp captures (88k-297k prompt tokens), greedy, three windows: aggregate 145.0-145.1 -> 146.4 tok/s (+0.9-1.0%), per request +0.6% (54, 108: copy-heavy) to +2.0% (171), every greedy hash equal to live in every arm. At temperature 0.6 seed 7: +3.0% and +3.3% on the two captures whose text matches in all arms, +2.7% aggregate, no failed rounds. Logprob equivalence (equiv-probe.py, 8k-64k prefill, merge, restore, image): identical to live. Echo and rename decode +0.6%, identical text. A second cut (one submit per GPU-routed decode layer instead of ~4, e3663f8) measured -1.6% against the first and was reverted (1b2c0b5), cause open. A round profile (SUSHI_DS41_ROUND_PROF=1) puts the host's own work between GPU passes at ~0.3 ms of a 50-57 ms agent round; the draft's wait is 2.1-2.4 ms. Results ~/bench/kld/{syncs,syncs2,syncs3}-replay-20261031, syncs-copy-20261031, syncs-trace-20261031, live-trace-20261031, syncs-sampled-20261031. Incident: the agent's session died during the live-trace window and the wrap's EXIT trap did not restore the live server, which was down 01:42-07:12 until launchctl bootstrap (/health 200, runs = 1, f66f476); a dead session can strand the live server, so check /health after any window whose driver exits early. Verdict: adopt (byte-identical, +1% greedy, +3% sampled where paired); swap queued 2026-10-31 behind the morning's Latch jobs.
DSpark confidence head retrained on STQ accepts, 2026-10-31 (dump plugin STRML/plugins exp/ds41-conf-dump 47c567b; 42 items = 16 fixture prompts + 26 agent captures, 37,245 records, dump ~/bench/kld/confdump-20261031/dump on the Studio; trainer bench/kld/conf-head-train.py; doc docs/research/ds41-conf-head-20261031.md). Offline replay over 7,440 rounds, live head 110.63 tok/s: recalibration alone +0.43% (+0.73% without the plugin's calibration), (i) hout+markov retrained +0.47% / +0.91%, (ii) plus the draft row's top-1 prob, margin and entropy +1.40% / +1.66%, oracle +12.94%. Held-out AUC by item 0.885 live, 0.886 recal, 0.890 (i), 0.912 (ii); the gain is on agent captures, fixtures within 0.004. Every replay gain is below the 6-10 tok/s decode noise; a small MLP did no better. Loadable head built (exp/ds41-conf-head e1b181a, SUSHI_DS41_CONF_HEAD, optional SUSHI_DS41_CONF_DIRECT=1), not yet served. Verdict: at most ~1.5%, unproven; next is one A/B (bench/kld/ds41-confhead-ab-job.sh, A C C A) after retraining (ii) on a lower lambda grid and rebasing onto a72ddff.
DSpark confidence head (ii) + direct rows, live A/B, M5 Ultra, 2026-10-31 08:24-08:40 (Latch measurement job via the latch-studio MCP, bench/kld/ds41-confhead-ab-job.sh, live stopped and restored 08:39:50, /health OK; greedy replay of the six agent captures, A C C A; A = f66f476, C = exp/ds41-conf-head e1b181a with SUSHI_DS41_CONF_HEAD=head-ii.bin (sha256 afe78406; retrained with a lower lambda grid 1e-4..1e-2 it picks 0.01 again, byte-identical file) and SUSHI_DS41_CONF_DIRECT=1; results ~/bench/kld/confhead-ab-20261031). A1 = A4 and C2 = C3 to 0.1 tok/s, every hash equal across all four arms. Decode tok/s A / C: 70 133.2 / 137.4 (+3.2%), 155 108.7 / 109.7 (+0.9%), 207 137.0 / 136.4 (-0.4%), 54 168.5 / 172.8 (+2.5%), 108 158.4 / 160.5 (+1.3%), 171 102.3 / 97.7 (-4.4%); all six by decode time 144.8 -> 146.0 (+0.8%). Verdict: real but small, lossless; stackable on a72ddff after a rebase (not done). 171 loses 4.4% (more rows on low-accept rounds).
ANE wavefront bound: DS4.1 cold prefill with the dense trunk off the GPU, M5 Ultra, 2026-10-31 08:41-08:48 (Latch measurement job via the latch-studio MCP, bench/ane/ds41-standin-window.sh, live stopped and restored 08:48:33, LIVE-HEALTH-OK; plugin STRML/plugins exp/ds41-trunk-standin 2426297 = live a72ddff + SUSHI_DS41_TRUNK_STANDIN: 1 returns zeros from every trellis trunk projection of a call with >= 256 rows, 2 also the shared expert; fresh server per arm, order 0 1 2 2 1 0, random-nonce prompts, 0 cached tokens; results ~/bench/ane/standin-20261031). Mean of 4 per cell, tok/s: ~6.4k 2,415.8 / 2,940.5 / 2,928.6 (x1.217), ~25.6k 3,190.1 / 4,262.5 / 4,260.8 (x1.336, sd <= 55), ~64k 3,235.4 / 4,386.9 / 4,383.0 (x1.356, sd <= 6.5). So the GPU work left without the trunk is 73.8% of a chunk at 64k, 74.8% at 25.6k, 82% at 6.4k. Level 2 = level 1: the shared expert's linears are already trellis trunk projections (zeroed at 1) or it rides another path; the profiled control decides. Caveat: zeros change router inputs, so routed-expert time may be skewed; a profiled 0 1 1 0 control (SUSHI_DSV41_PREFILL_PROFILE=1) is queued to compare routed ms per chunk. Reading: the GPU-side ceiling of moving the whole trunk off the GPU is x1.36 at 64k; the wavefront's real gain is min(this, the ANE's trunk time), see docs/research/ane-wavefront-design-20261031.md (estimate x1.15 at 32k, x1.21 at 64k if the ANE holds >= 13 TOPS a die on the trunk shapes).
ANE wavefront bound, routed-skew control, 2026-10-31 08:51-08:57 (same plugin 2426297, order 0 1 1 0, SUSHI_DSV41_PREFILL_PROFILE=1 in every arm, live restored, LIVE-HEALTH-OK; ~/bench/ane/standin-prof-20261031, shares by prof-shares.py, bucket 32k). Profiled ms per chunk at positions 0-32k, stand-in off / on: chunk 711.7-712.4 / 554.1-557.3; routed experts 263.3 / 260.3-260.4 (unchanged: the zeros did not skew routing cost); core attention 155.9 / 159.4; attn_out 12.9% -> 0.9%, q 8.0% -> 2.5%, attn_in 2.5% -> 0.8%. The shared stage reads 0.0% in every arm: on a72ddff the shared expert is folded into the routed launches, so the x1.36 bound above leaves it on the GPU (moving it too would raise the ceiling). The bound stands.
DeepSeek V4.1 STQ, Neural Engine numerics emulated on the GPU, op by op (STRML/plugins exp/ds41-ane-numerics 5977ec9 = a72ddff + SUSHI_DS41_ANE_EMU: at >= 256 rows a selected trunk linear takes fp16 x, the weight requantized to int8 with one fp16 scale per output channel as mlx-serve's int8Rows, an fp16 matmul, fp16 out; the shared expert also runs its clamped SwiGLU in fp16), M5 Ultra, 2026-10-31 10:03-11:12 (Latch measurement, live server stopped by studio-bench-hcrows-wrap.sh and restored, /health 200, runs = 1; mlx-serve main db128461; bench/kld/ane-emu-*; results ~/bench/kld/ane-emu-20261031). Control: emulation off scores 0.18489917004724493 / top-1 0.890994 by the standard API method, the live figure exactly. Method: API KLD against the FP8 teacher on positions whose whole >= 256-row prefix is re-prefilled (no prefix cache, round-robin), every 8th: 556 positions, off 0.186420 / top-1 0.888489. Only layers 0-19 run at prefill width (layers 20-39 run on the last 128 rows), which matches what the wavefront would move. Delta vs off [95% CI over prompts]: all-on (attn_in, wq_b, wo_a, wo_b, shared, engram_wkv, idx_wq_b) +0.0042 [-0.0013, +0.0106], with 4,608-wide fp16 K-chunk sums -0.0009, with row prescale +0.0049; wq_a +0.0046, wkv +0.0017, attn_in +0.0012, wq_b +0.0053 [+0.0005, +0.0099], wo_a -0.0008, wo_b +0.0015, shared +0.0008, engram_wkv +0.0049, comp +0.0037; idx_wq_b and idx_wproj byte-identical and idx_wk -0.0006 (the fixture's top-512 keeps every block, so the indexer is not exercised); shared_gpu (fold bypass, no emulation) byte-identical. Every trunk op moves a position's KLD by 0.027-0.032 on average either way (idx_wk 0.0017), and all seven together by 0.027, so the signed means are noise of about +-0.005 at this N (part of that floor may be the API method's top-1024 boundary). No fp16 overflow in any op: 0 non-finite values, max |x| 87.1 (shared input), max |y| 245.5 (Engram wkv). Every request was a full re-prefill (median 0.312 s at prefixes <= 328 rows, 0.381 s at >= 488, correlation 0.905), and attention ops logged ~20 calls a request (layers 0-19 only). Verdict: no op needs activation pre-scaling on this fixture (range at >= 16k not measured); 95% upper bounds per op <= +0.0136 (engram_wkv), all-on +0.0106, all-on @pre +0.0153; the +0.002 gate is not resolvable at 556 positions. Next: all-on vs off at stride 1 with saved logprobs (student-vs-student KL), and a long-prompt fixture for the indexer. Write-up: docs/research/ane-numerics-kld-20261031.md.
DeepSeek V4.1 STQ, shared expert on both ANE dies at prefill, window 2, 2026-10-31 (sushi_ds41 exp/ds41-ane-shared eb259ac = a72ddff + SUSHI_DS41_ANE_SHARED=2: int8 SwiGLU with the swiglu clamp, rows split 1,024 a die, the 20 CED-encoder layers of each 2,048-row chunk; the ANE starts once the FFN input is ready and runs beside the host's picks read and the routed launches; zero-copy IOSurface handoff both ways; Latch measurement job, live restored, LIVE-HEALTH-OK 11:31:38; ~/bench/ane/shared-ab-2). Cold prefill against live a72ddff: 25.6k 3,311 vs 3,192 tok/s (+3.7%), 60k 3,372 vs 3,243 (+4.0%), 6.4k +1.8%; the wait for the ANE is 0.01-0.02 ms a layer, so it is fully hidden. Removing the shared expert outright gains +3.2-3.5% (window 1; the live tree folds it into the routed launches, about 1 ms a layer). Window 1's order (ANE after the routed launches) lost 1.5-2.1%; one die or alternating dies lose 13-16%. 0 eval failures. Lossy: KL about 0.009 against live (12 fixed 6.4k prompts, 30 positions), top-1 at position 0 agrees on 8/12. Verdict: works, not adopted. It hides only while the host's routing prep (about 7.3 ms a layer) covers the ANE's 4.9 ms. Before adopting: a long-prompt teacher KLD, a same-window S and GPU-only control (E beats window 1's S by ~0.5%, unexplained), a concurrent-prefill check, and a measurement of the ~1.4 GB of int8 programs. Inferred lead: live prefill leaves the GPU waiting ~7 ms a covered layer on host routing prep. Write-up: docs/research/ane-shared-expert-prefill-20261031.md.
GPU-only wavefront prefill substrate for the ANE trunk plan, DeepSeek V4.1 STQ, M5 Ultra, 2026-10-31 (sushi_ds41 STRML/plugins exp/ds41-wavefront, base live a72ddff: SUSHI_DS41_WAVEFRONT=<N> runs N state-only 2,048-row prefill chunks as a layer-lagged wavefront, chunk c+1 one layer behind chunk c, WaveSchedule the one place the order is decided; images, the CED tail chunk and diagnostics stay sequential; SUSHI_DS41_PREFILL_LOG=1 logs per-chunk wall, blocked and Engram ms; two Latch measurement windows, live server stopped and restored, /health 200, runs = 1; bench/ane/ds41-wavefront-window.sh, results ~/bench/ane/wave-20261031 (378ecb9) and wave2-20261031 (0ca16f5 = 378ecb9 + stage refactor, log fields, next-group Engram read-ahead)). Equivalence (ds41-equiv-window.sh, 64 greedy tokens with top-5 logprobs on 8k/32k/64k, merged tail, restore pair, image): live, flag off, N=2 and N=4 identical on all seven in both windows, and the wave arms logged wavefront groups. Cold prefill W0 / W2 / W4, window 1 (378ecb9): 6.4k 2,528.4 / 2,277.4 (x0.901) / 2,272.0 (x0.899); 25.7k 3,199.1 / 3,068.2 (x0.959) / 2,538.7 (x0.794); 51.3k 3,224.2 / 3,203.5 (x0.994) / 2,754.3 (x0.854). Window 2 (0ca16f5): 6.4k 2,430.9 / 2,294.1 (x0.944) / 2,288.4 (x0.941); 25.7k 3,199.4 / 3,050.8 (x0.954) / 2,588.3 (x0.809); 51.3k 3,227.2 / 3,154.9 (x0.978) / 2,849.1 (x0.883). W0 held across windows while W2 fell at 51.3k, so 0ca16f5 may add ~8-10 ms a chunk (unsettled, needs a same-window A/B). Host waits 2.10 a chunk-layer in every arm. Sequential pays one cold chunk a request (Engram 101-179 ms), N=2 one cold group (219-353 ms): ~260 of ~390 ms lost a request at 25.7k, ~160 of ~364 at 51.3k. N=4: GPU blocked time itself up (614-645 against ~580 ms a chunk) with the same waits, cause open. The prefill hook reads no picks on the host (resident experts), so the shared-expert doc's ~7.3 ms a layer of host routing prep most likely includes GPU time. Host time outside blocking evals is 2.7 ms a layer, a lower bound on GPU idle; no trace taken. Verdict: substrate byte-exact; N=2 not faster; keep behind the flag (off) as the ANE step's base. Needs a window: 378ecb9 vs 0ca16f5 A/B, Metal trace N=1 vs N=2, N=4 diagnosis. Write-up: docs/research/ds41-wavefront-substrate-20261031.md.
Prefill layer pipelining in sushi_ds41, DeepSeek V4.1 STQ, M5 Ultra, 2026-10-31 (STRML/plugins exp/ds41-prefill-pipe 8d45380 = wavefront 0ca16f5 + SUSHI_DS41_PREFILL_PIPELINE=<depth>: at prefill widths a layer's arrays are async_eval'd and the routed output submitted, instead of the end-of-layer evalAll and moe's routed eval that drained the GPU twice a layer; the host waits on the oldest of more than depth layers in flight; the queue drains before the restore point and after the last chunk; dylib sha256 83ef7121; Latch measurement window 13:44-14:02, live stopped and restored, /health 200, runs = 1; bench/ane/ds41-prefill-pipe-window.sh, results ~/bench/ane/pipe-20261031). Equivalence: live, off, pipe 2, wave 2 + pipe 2, and wave + pipe + cold-group lag identical on all seven probe prompts (64 greedy tokens, top-5 logprobs). Cold prefill, palindromic, n = 4 a cell, off / pipe 2: 6.4k 2,431.3 / 2,526.9 (+3.9%); 25.7k 3,197.0 / 3,278.1 (+2.5%, every pipe sample above every off sample); 51.3k 3,230.8 / 3,304.8 (+2.3%, same). Wave 2 + pipe 2 is below pipe alone (x0.935 / 0.970 / 0.993); wave 2 alone x0.946 / 0.954 / 0.972 of off; the cold-group lag does not help. Steady chunks: off 606-607 ms, pipe 593-595, wave + pipe 612-620. MLX peak 132.1-132.4 GB in every arm (expert cache included), pipe +1.1 GB active, no peak growth. The ring's waits read ~0 ms: the host is throttled inside mlx_async_eval (MLX scheduler backpressure), so per-chunk blocked time is not comparable across arms. Verdict: the per-layer waits, not the wavefront, were the lever; pipelining is a byte-exact +2.3-3.9% prefill candidate for live (default depth 2, needs a decode-unchanged check and a concurrent-request check before a swap); the GPU-only wavefront stays off. Write-up: docs/research/ds41-wavefront-substrate-20261031.md, section "Prefill pipelining".
DeepSeek V4.1 STQ, ANE numerics emulation, windows 2-3 (Sam-approved follow-up), M5 Ultra, 2026-10-31. Window 2 (11:46-12:45, plugin 5977ec9, ~/bench/kld/ane-emu-long-20261031; cancelled after its stride-1 pair, live restored 12:45:15, /health 200, runs = 1): all-on (attn_in, wq_b, wo_a, wo_b, shared, engram_wkv, idx_wq_b) against the FP8 teacher at stride 1, 4,409 positions: off 0.163219 / top-1 0.901565, all-on 0.164237, delta +0.0010 [-0.0013, +0.0035], top-1 +0.07 pp (40 lost / 43 gained). Student-vs-student KL(off || all-on) 0.0053 [0.0032, 0.0076] short, 0.0088 [0.0057, 0.0120] at 18k (7 prompts x 64 steps), tail share (classes outside both top-1024) 0.000 / 0.001, so real logit movement. Window 3 (14:04-14:22, plugin 51c963f with SUSHI_DS41_ANE_EMU_EXACT benign f32 control and SUSHI_DS41_ROUTE_DUMP; 32 prompts of 16,385 tokens x 12 decode steps, bench/kld/ane-emu-long32.jsonl; ~/bench/kld/ane-emu-long32-20261031; live /health 200 at 14:22:11, runs = 1): off vs off byte-identical; KL(off || ANE all-on) 0.0077 [0.0051, 0.0103], argmax 97.1%; KL(off || f32 control) 0.0084 [0.0056, 0.0115], argmax 95.8%; ANE vs control 0.0080. Routed top-6 sets in layers 0-19 differ from off in 32.89% of prefill rows under the ANE emulation (6.44% of picks) and 31.55% under the f32 control (6.16%), from 8-12% at layer 0 to ~52% at layer 17: a rounding-level change re-rolls a third of the routing, which is why every op's effect saturates. fp16 at 16k: 0 non-finite, max |y| 250.9 (Engram wkv). Verdict: ANE numerics are indistinguishable from a benign re-implementation of the same ops; the +0.002 teacher gate is not clearable on this fixture (+0.0010 [-0.0013, +0.0035]); no op needs pre-scaling. Write-up: docs/research/ane-numerics-kld-20261031.md.
2026-10-31, DS4.1 prefill host cost (Studio-free, M5 Max mlx-c microbench, commit 723f8efb). A 2,048-row non-final chunk runs 20 layers (CED split at 20) and builds ~3,230 MLX primitives, ~1,035 custom-kernel applies, ~1,275 new_data arrays and ~510 page_allocator mmap pairs. Measured per call: primitive build 0.04-0.20 µs (encode 0.7-1.6), kernel apply 0.71-0.85 µs (encode 1.26-1.73), 8 KB mmap+munmap 1.35 µs, 12.6 MB new_data 158 µs. Layer replica: ~3.0 ms a chunk to build, ~8.5 ms with encode, against 37.0 ms of "other host" in the Studio prefill log (53.6 ms outside waits = Engram 16.5 + begin 0.9 + other 37.0). The rest is likely mlx_async_eval back-pressure (>10 command buffers in flight; wide ops each get their own buffer past 50 MB) counted as host time; unproven until the queued Metal trace. Pipelined at depth 2 a stand-in layer runs as fast as unbounded queueing (7.260 vs 7.264 ms), so prefill is GPU-bound once pipelined. Dead: mx.compile/graph caching (custom kernels, stateful layers, growing index shapes), elementwise fusion, op-count cuts, second-thread graph build, wider chunks. Open: the first chunk's cold Engram read (101-179 ms a request, est. ~5% at 6.4k, ~1.7% at 25.7k; start it before beginPass); fewer command buffers (<= ~2%, wait for the trace; blind MLX_MAX_MB_PER_BUFFER lost 3.9% on Qwen); ~1 ms a chunk of hygiene (unused span band ops, page_allocator in exl3 run/windowTable, managed Engram arrays). Write-up: docs/research/ds41-prefill-host-cost-20261031.md.
2026-10-31, DS4.1 concurrency: requests run one at a time (live log read, commit 44a541f4). sushi_ds41 sets owns_decode_state without slot_state, so mlx-serve's modelExclusiveDecode makes the model exclusive and admitPendingTick holds every later request in FIFO pending until the running one finishes prefill and decode; the host's prefill interleave never fires (exclusive slot, whole-prompt prefill). No mid-stream stalls; the cost is time to first token behind whole earlier requests. Live log, DS4.1 era: 8 of 98 agent requests arrived while another was unfinished; two non-streaming meeting-notes jobs (max_tokens=auto, thinking on, 190 of 213 s in decode, one resent while queued) held agent turns ~159-223 s before their first token. Levers: keep batch jobs off the agents' queue (cheapest); shortest-expected-work-first with aging in mlx-serve's pending queue (agent wait ~215 s -> <6 s in that burst, est.); per-slot plugin state (slot_state, high risk if half-done: the "chat leaked into a pi stream" bug); decode ticks between plugin chunks (needs slot_state). Write-up: docs/research/ds41-prefill-decode-concurrency-20261031.md.
Attribution of the ANE shared expert's prefill gain, DeepSeek V4.1 STQ, M5 Ultra, 2026-10-31 (sushi_ds41 STRML/plugins exp/ds41-ane-shared-ctl fc2ee90 off eb259ac: SUSHI_DS41_ANE_GPU=live|fold|queue|skip run E's covered layers (20 CED-encoder layers of each 2,048-row chunk) with the shared expert on the GPU, timed; one Latch measurement window 5C00BAF3, 28 arms palindromic A V E G H Z S, live server stopped and restored, LIVE-HEALTH-OK, runs = 1; ~/bench/ane/shared-ab-3). Cold prefill vs live A, 25.6k (n = 8) / 60k (n = 4): V live order on the new tree +0.05% / +0.05%; E (ANE) +3.77% / +4.15% (3,308.9 vs 3,188.6, 3,374.1 vs 3,239.5); G (E's exact sync order, shared expert folded on the GPU) -0.49% / -0.43%; H (live fold, picks and routed queued ahead of the one eval) +0.10% / +0.11%; Z (E's order, no shared expert, wrong output) +2.56% / +3.05%; S (window 1's S, live order) +3.15% / +3.48%. Split of E: shared expert off the GPU +3.05% / +3.47% (fold costs 1.2-1.3 ms a covered layer), E's order -0.55% / -0.48% (the mid-layer sync, ~0.3 ms a layer), extra speed while the ANE runs +1.22% / +1.11% (E beats Z, per-arm ranges 3,303.6-3,313.1 vs 3,263.9-3,272.8, cause open). V, G and H are bit-identical to live (16 tokens, top-20 logprobs, 4 seeds); E is bit-identical to window 2's E. The 7.3 ms hwait is not a host picks read (experts resident, no read): G and Z show it too, and H blocks 22.8 ms in submit(routed), so mlx_async_eval returns only after the queued work runs. Window 2's progress-log KL (0.0897; A vs A 0.080) came from a stale Studio copy of the lp script; the doc's 0.0094 stands. Verdict: the reordering is not a lever (it costs 0.5%); no lossless GPU-only gain found. The E > Z remainder is open (sham arms R/Y/Q built at 0ba5bd8, not run). Write-up: docs/research/ane-shared-gain-attribution-20261031.md.
Prefill pipelining as a live candidate, DeepSeek V4.1 STQ, M5 Ultra, 2026-10-31 (STRML/plugins perf/ds41-prefill-pipeline-live: 7390ec8 = live a72ddff + SUSHI_DS41_PREFILL_PIPELINE default 2 with the review fixes (drain in finishPass, resetState and deinit; synchronize at the end of the drain; a verify can never pipeline; depth capped at 2), 58b7467 = + SUSHI_DS41_EARLY_ENGRAM=1, off by default; dylib sha256 e217704f; Latch measurement window 15:46-15:59, live stopped and restored; bench/ane/ds41-pipe-live-window.sh, results ~/bench/ane/pipelive-20261031). Equivalence against live: text and logprobs identical on all seven probe prompts for the pipeline and for pipeline + early Engram. Cold prefill, palindrome A B E E B A, n = 4, live / pipeline / + early Engram: 6.4k 2,435.6 / 2,613.8 (x1.073, sd 144) / 2,540.9 (x1.043); 25.6k 3,197.7 / 3,270.7 (x1.023) / 3,281.0 (x1.026); 51.3k 3,232.2 / 3,307.4 (x1.023) / 3,307.1 (x1.023); at 25.6k and 51.3k every candidate sample is above every live sample. Short-prompt greedy decode 70.46 / 70.90 / 74.19 tok/s (sd ~2; the pipeline does not touch decode). Concurrency (~39k-token cold prefill beside two 400-token decoding streams): all completed in every arm, no hangs, wall 21.9-22.4 s. Memory: phys_footprint 121 GB, peak 131-132 GB in every arm. Early Engram: no measurable gain, keep it off. Verdict: the pipeline is a byte-exact +2.3% (51k) to +7% (6.4k) prefill candidate for live; the PR branch against CommunityServe main is perf/ds41-prefill-pipeline b48f4a0, not opened. Write-up: docs/research/ds41-wavefront-substrate-20261031.md, "Live candidate".
DS4.1 decode prelude levers (the audit's rank 1), M5 Ultra, 2026-10-31 16:00-16:37 (Latch measurement job via the latch-studio MCP, bench/kld/ds41-engram-job.sh + ds41-engram-window.sh, live stopped and restored by studio-bench-hcrows-wrap.sh: /health OK 16:37:18, runs = 1; excl-watch clean, 710 ticks; mlx-serve db128461; results ~/bench/kld/engram-20261031). Plugin STRML/plugins exp/ds41-decode-engram-prelude 5fd7396 (sha256 3486d579) = a72ddff + 306fbc5SUSHI_DS41_DECODE_DIAG (host clock per decode forward) + 5fd7396 levers: SUSHI_DS41_ENGRAM_FIRST (Engram read started before the embedding read), SUSHI_DS41_ENGRAM_POOL (one long-lived reader thread plus 15 read workers, no spawns), SUSHI_DS41_EMBED_HOST (the SSD embedding held in host memory, 0.37 GB). Diag arm (D, six agent captures plus the 4k prose prompt): Engram take at layer 1 0.218 ms per verify forward (750 forwards, weighted; 0.12-0.31 per 256-forward block, rows not ready on 32-95% of takes), 0.05-0.22 ms per plain forward, layer 14 0.000; prelude (entry to layer 0's submit) 0.29-0.50 ms; embedding read 0.02-0.07 ms (draft 0.03); reader spawns 0.01-0.03 ms; layer-end async_eval 0.6-0.7 ms per forward, the rest of the host's 13.6-60 ms forward inside buildLayer (its inner submits included, so MLX's throttle cannot be split from graph build here). Gate: kill < 0.1, go >= 0.3: 0.218 fell between, so the A/B ran. A/B, order D L X X L L X X L, greedy replay of the six captures: L 146.22 tok/s (sd 0.15, 146.02-146.37, n=4), X 146.32 (sd 0.23, 145.93-146.53, n=4), X/L 1.0007, per capture -0.10% to +0.27%; L drifted up 0.35 over the window. Prose 4k (client clock, 1,000 tokens): L 66.4-68.1, X 65.7-66.6 (-1.6%, client-measured and noisy). Byte identity: all 9 arms' six replay hashes and the prose hash are equal. Verdict: killed as a decode speed lever: the Engram wait is real but ~0.2 ms, under half of one ~0.53 ms trace segment, and removing the spawns, the embedding pread and the read order buys nothing measurable. The ~2.3 unexplained segments a round are not Engram; the next suspect is MLX's 10-buffer throttle inside buildLayer's submits (the prefill trace's mechanism). Write-up: docs/research/ds41-decode-host-sync-audit-20261031.md, "Result: rank 1 measured".
2026-10-31, DS4.1 first cold prefill after idle: the expert cache is unwired and re-wired (Studio, two Latch measurement windows 9E1D797B and 4F42D0A9, live server stopped and restored, /health 200, runs = 1; bench server = db128461 + the live sushi_ds41 a72ddff as a launchd job like live). About 1.3-1.8 s after the last request, "Pages wired down" drops by 119.5-120.4 GiB (the expert cache; [wired] mode=max). The next request re-wires 7.85-7.94 M pages (16 KB) while the GPU sits idle: first GPU-busy mactop sample (about 0.5 s resolution) 1.65-2.10 s into the request against 0.22-0.27 s warm, with the CPU at 7-13 W against 2-3 W idle and the GPU at full clock once it starts. Cold 6.4k: warm 2.216 s (2,902 tok/s); after 15/45/120 s idle 3.429 s mean (n = 8, sd 0.056, 1,871 tok/s, +1.21 s, -35.5%); after 2/5/10 s 3.06-3.16 s (window 2, +0.85 s). It is flat from 2 s to 120 s. The bench flags differ from live (ctx 139264 against 974848, no --prefix-cache-mem 64GB or --max-concurrent 8), and live was not measured, so "every agent turn pays it" is inferred. Killed: DVFS (full clock; a GPU matmul tick from another process still pays +1.13 s), paging and compression (0 pageouts or swap), ProcessType=Interactive (+1.16 s), the sampler (mactop off +1.16 s). The earlier "steady" 2,431-2,451 tok/s was the post-load warm-up (the first 6.4k prompts after load ran 2.42-2.68 s until a 25.6k; separate and not investigated). Fix measured once: a 1-token [1,2,3] request to the server every 2 s during a 45 s idle gave 2.191 s (full speed) at about +5 W while idle. But the CPU shows an 8-10 W burst of ~1-1.5 s after each tick, so each tick most likely re-wires the set itself: a weak fix (a real request can wait up to ~1.5 s behind a tick). Ticks every 5 s (3.067 s) and every 10 s (2.910 s, still wired) did not fix it. When the unwire fires after a tiny request is not settled (measured only after a 6.4k prefill). Proposed, untested (sudo, Sam's call): sudo sysctl iogpu.disable_wired_collector=1 (Studio reads 0), or raise iogpu.wired_lwm_mb, then re-run bench/idle/ds41-idle-knee.sh. Write-up: docs/research/ds41-first-request-after-idle-20261031.md.
2026-11-01, DS4.1 idle unwire: iogpu.disable_wired_collector=1 keeps the expert cache wired on live. Set by Sam by hand. Loopback probe on live: 4.4 GiB wired at idle before, 124.2 GiB after one 4-token request (0.90 s, the re-wire), then 124.2 / 124.1 / 124.4 / 123.9 GiB at 2 / 10 / 45 / 90 s idle; a request after 90 s idle took 0.14 s. Lost on reboot; bench/studio-live/local.iogpu-wired.plist sets it at boot (needs sudo to install). Cold 6.4k after idle not re-measured.
2026-11-01, DS4.1 ANE shared expert on the pipelined live plugin (M5 Ultra; STRML/plugins exp/ds41-ane-shared-pipe 0412ec9 = live 58b7467 + the ANE commits, layer output submitted under the pipeline; one Latch measurement window, job 15649E0D, 20 arms palindromic A E F Z Y, live stopped and restored, health 200, runs = 1; ~/bench/ane/pipe-ane-20261101, bench/ane/ane-pipe-stats.py). Cold prefill vs live A: E (SUSHI_DS41_ANE_SHARED=2) 25.6k 3,393.6 vs 3,271.3 x1.037 (n = 8, sd 21/17, ranges apart), 60k 3,461.5 vs 3,322.8 x1.042 (n = 4), 6.4k x1.006; the pipeline kept the whole unpipelined gain (x1.038/x1.042). F (routed first) x0.983; Z (no shared expert) x1.025/x1.030, so E > Z by 1.2% (cause still open); Y (Z + spinning host threads) = Z, sham lever dead. KL vs A 0.0108 (max 0.018, pos-0 top-1 3/4), E = F logits; peak footprint 133 vs 130 GB. 6.4k after 30 s idle, all arms 2.14-2.25 s (A 2,926 tok/s) against 3.43 s before iogpu.disable_wired_collector=1: the idle penalty is gone. Adopted on Sam's go: live since 2026-11-01 17:52 (swap-sushi-ds41-plugin-env.sh, PLUGIN-SWAP-OK, rollback label 20261101-ane2). Write-up: docs/research/ane-shared-expert-prefill-20261031.md (Update 2026-11-01).
2026-11-01, DS4.1 directional ablation live (Sam's go, before ddalcu/mlx-serve#1045 merges). Host mlx-serve-abl-live1 = db128461 + the PR's commits (review fixes through 94b53659 included), plugin sushi_ds41-abl-live1 = 0412ec9 (ANE on) + the validated ablation commits; built by bench/ablation/build-val.sh live1 (233 MLX imports, 72/72 ablation tests), swapped by bench/studio-live/swap-mlxserve-main-ablation.sh (SWAP-OK, runs = 1). Checks on live: plain 6.5k prefill 200 with the ANE chunk line (fails 0) and no X-Ablation; ablated 200 with X-Ablation: profile=refusal; strength=1.000; no key 401; key bytes in the logs 0; an omp -p through the new studio-ablated provider prefilled 49,740 tokens at 3,100 tok/s ablated. Measured on live afterwards (docs/research/ds41-ablation-live-test-plan.md): held-out refusals 100 -> 8 of 100 at s = 1 (82 at 0.5), harmless first-token KL 0.067 mean, the same numbers as validation window 2; off byte-identical to db128461 + 0412ec9 with the ANE on (EQUIV-OK, Latch window 69F74A46); decode with it on geomean -7.2% (prose -11.7%, code -5.2%, 8k summary -4.7%, n = 4 each). Rollback label 20261101-abl.
2026-11-01 (late), DS4.1 directional ablation: no effect in thinking mode (correction to the row above). On held-out harmful prompts with thinking on, the live layer-32 profile refuses 19/20 (API) and complies 0/12 by model judge under omp's replayed request, the same as stock; thinking off it refused 2/20 by substring. A thinking-on recalibration (Latch windows E89A1114, 3F0AE66E: tap in the thinking-on template, 22 candidates at layers 10-31 plus window 2's best, screened on omp's request) found no direction that unlocks thinking mode: best judged 3/12 complied with 9/12 answers unfinished at 3,072 tokens. Write-up: docs/research/ds41-directional-ablation-20261031.md (Correction 2026-11-01).
2026-11-02, DS4.1 directional ablation: the thinking-mode verdict above was a measurement bug; layer 17 at s = 1 works (thinking on).judge.py scored an empty content as "not complied", so a run that hit max_tokens mid-reasoning or returned a tool call read as a refusal; the ablated arms were the long ones (median 10,609 reasoning chars vs stock 1,446) and only they hit the cap. Re-scoring that same output with the reasoning tail moved layer 17 from 0/12 to 8/12, and a budget the answers fit (eval2-window.sh, max_tokens 8192) moved it to 9/9 answered on held-out harmful prompts under omp's replayed request, thinking on, model judge: stock 0/12, layer 32 (live) 0/12, layer 27 0/12. Strength sweep, same 12: s 0.6 2/11, s 0.8 9/11, s 1.0 9/9. Harmless cost at s = 1: 10/11 still answered held-out harmless prompts (stock 11/12). 16 hand-written nasty agent-style prompts: stock complied 10/16, s 0.8 9/16, s 1.0 10/16, with 3 truncated answers per ablated arm against 1 for stock: the direction does not widen what the model will do for nonsense, it removes the reflexive decline. Scripts bench/ablation/{judge2.py,nasty.py,eval2-window.sh,eval3-window.sh}; profile cand-l17-p2 (tap in the thinking-on template, position -2), which the live server does not yet load.
2026-11-03, DS4.1 decode against depth on live traffic, and what the indexer costs a verify forward (LSA follow-up: https://arxiv.org/abs/2610.42147, https://github.com/Prefrontal-AI/latent-sparse-attention). Live log, requests with a [spec-stats] mode=dspark line only (bench/studio-live/decode-by-depth.py). The log also holds the Flash-Next weeks (mode=mtp), which made deep DS4.1 decode look 4x slower than it is. 1,145 requests with >= 64 tokens out, median decode tok/s / tokens per DSpark round / ms per round: 0-8k 82.0 / 2.06 / 25.1 (n=515), 32-64k 88.7 / 2.94 / 34.3 (205), 64-128k 86.3 / 3.15 / 35.8 (156), 128-192k 87.8 / 2.96 / 34.6 (92), 192-256k 73.4 / 3.15 / 43.3 (41), 256-384k 64.5 / 2.74 / 42.2 (4). Decode holds to 192k, and rounds grow ~8 ms past it; 96% of DS4.1 requests sit at or below 192k. The indexer's depth-dependent part is the full scan of layers 2, 8, 14 (ratio 2, D/2 keys) and 20 (ratio 1, D keys). Layer 20 then pins 2,048 blocks of 8, and layers 24-36 score only those 16k keys (the config's candidate_*), so DS4.1 is already coarse-to-fine on half its index layers. M5 Max microbench (STRML/plugins exp/ds41-index-decode-bench 1d7e516, SUSHI_DS41_INDEX_DECODE_BENCH=1 with the gpu-test step, random fp4 keys, 4 sets cycled, 5 timed rounds): the narrow packed scorer is 88-96% of the full-scan cost and grows with rows x depth (one layer-20 scan at S = 1 / 4 / 6 / 16: 1.18 / 4.51 / 6.74 / 17.86 ms at 1M), because each thread scores one (row, key) pair and re-reads and re-decodes the key for every row. Top-k and candidate blocks stay under 0.6 ms. Full-scan cost per verify forward at S = 4: 2.0 ms at 128k, 3.4 at 256k, 6.4 at 512k, 12.2 at 1M (Ultra not measured). Unpacking once and running the prefill matmul2d scorer (index_nax) wins from S = 2 at every depth from 32k: S=2 0.17 -> 0.12 ms at 32k, 0.62 -> 0.39 at 256k, 2.29 -> 1.35 at 1M; S=6 0.43 -> 0.17, 1.74 -> 0.56, 6.74 -> 1.98; S=1 loses (0.34 -> 0.38 at 256k). Scores agree to 2.9e-7 relative, no -inf mismatch, top-512 overlap 1.00000 at every depth and width (random keys). Built as SUSHI_DS41_DECODE_INDEX_NAX (default 2 rows, 0 off; 4884c53), with packed_scan kept so layer 20 still publishes block ids. Ultra window 2026-11-03 07:34-08:01 (live stopped by studio-bench-hcrows-wrap.sh and restored, runs = 1, /health 200; no Latch, Sam's go; bench/studio-live/idxnax-{build,window}.sh, one dylib from ~/bench/plugin-home-idxnax, arms differ only by SUSHI_DS41_DECODE_INDEX_NAX=0; results ~/bench/idxnax/w1, w2). Microbench on the Ultra, one layer-20 scan narrow -> matmul2d: S=2 x1.07 / x1.19 / x1.40 / x1.55 at 32k / 128k / 256k / 1M, S=4 x1.41 / x1.84 / x2.21 / x2.45, S=6 x1.65 / x2.30 / x2.78 / x3.12; S=1 x0.83-0.99 (stays packed); scores to 3.8e-7 relative, top-512 overlap 1.00000. Equivalence on the real pack (ds41-equiv-window.sh, off first): text and logprobs the same on all 7 prompts, EQUIV-OK. Decode after context, FIXED_PROMPTS, 3 rounds, off / on: short 100.8 / 100.8, 32k 96.8 / 96.6, 64k 98.8 / 98.9, 128k 96.2 / 97.5 (x1.013, every on round above every off round), 200k 142.0 / 146.7 (x1.033, ranges apart); greedy text byte-identical in all 6 deep round pairs. Watcher: 3 busy_process ticks from macOS daemons (searchpartyd 07:45, signpost_reporter 07:58), none on the bench port. Verdict: adopt; exact, +1.3% at 128k, +3.3% at 200k, flat below 64k. LSA itself would add a coarse stage to those four full-scan layers only. With the exact fix taking most of their decode cost and no DS4.1 traffic past 384k, it pays only for cold prefills of 256k+ (indexer share extrapolated to ~11% at 256k and ~30% at 1M from the measured 3.3% at 48-64k) and needs a recall study on real index keys.
2026-11-03, sushi_ds41 slice synced from sushi cc1981df to main ec2f5a29 (282 commits; STRML/plugins sushi-ds41-sync-ec2f5a2 35fa957, upstream as CommunityServe/plugins#29 (moved from 28 to an in-repo branch); replaces closed CommunityServe/plugins#27, since sushi fafc69c8 scores packed index keys on matmul2d with the scalar bits for rows > 1 or nb >= 131072). Ultra windows w1 and w2 (bench/studio-live/sync-window.sh, built per arm by bench/studio-live/plugin-ref-build.sh into its own HOME; live stopped and restored, window-exit=0, runs = 1; no Latch, Sam's go; results ~/bench/sync/w1, ~/bench/sync/w2). w1: byte-identical to plugins main 122b841 on 7 prompts (EQUIV-OK); API KLD 0.1849, top-1 89.10% (unchanged); greedy decode main / sync, ablation off: code 115.8 / 120.0, 24k summary 102.4 / 106.0, prose 72.5 / 74.9; ablation on +1.2% to +4.2%. w2, studio-bench.sh FIXED tiers, 2 rounds (round spread under 0.6%), base = main 122b841 / sync / live (4884c53 with the ANE shared expert; every arm ran SUSHI_DS41_ANE_SHARED=2, which only live reads): prefill 8k 2627.5 / 2689.3 / 2710.8, 32k 3214.8 / 3266.3 / 3385.5, 64k 3260.6 / 3308.3 / 3439.3 tok/s; decode after 64k 90.6 / 94.5 / 98.5, after 128k 82.4 / 86.2 / 97.5; short decode 99.3 / 101.6 / 100.5. Verdict: sync beats main everywhere (prefill +1.5-2.4%, deep decode +4.3-4.6%) and goes upstream. It does not replace live as is: live leads it by 3.7-4.0% at 32-64k prefill (the ANE shared expert's measured x1.037-1.042) and reads 4.2% / 13.1% ahead in decode after 64k / 128k, but that decode lead is an artifact: base and sync write byte-identical text in both rounds, while live's lossy ANE prefill changes the 64k/128k continuation, which then drafts better ([spec-stats] accepted tokens per round, sync / live: 1.65 / 1.88 at 64k, 1.50 / 1.90 at 128k). Per DSpark round the sync is faster: 17.5 / 19.1 ms at 64k, 17.4 / 19.5 ms at 128k (decode tok/s over tokens per round). Live-only commits on the sync: one host wait per verify (26d793d) and the decode index scan (4884c53) are superseded upstream (verify sets defer_head, indexNaxOn takes rows > 1); the ANE shared expert stack needs a port onto upstream's reworked MoE path.
2026-11-03, the ANE shared expert ported onto the ec2f5a29 sync (STRML/plugins live/ds41-on-sync 340d068 = sync 35fa957 + early Engram 6590bc3/337daf3 + SUSHI_DS41_ANE_SHARED cf767b0 + a layer-0 plane wait 340d068; 26d793d and 4884c53 dropped as superseded upstream). Ultra windows w1 and w2 (bench/studio-live/port-window.sh; live stopped and restored, window-exit=0, runs = 1, /health ok; results ~/bench/port/w1, ~/bench/port/w2). ANE off: byte-identical to the sync on 7 prompts (EQUIV-OK). ANE on (=2): byte-identical to live 4884c53 on 7 prompts; self-check cos 0.999889, every covered chunk fails 0. API KLD 0.1849, top-1 89.10%, same as live. w2, studio-bench.sh FIXED tiers, live / port, ANE on in both, 2 rounds, the 64k, 128k and short continuations md5-identical in all four runs: prefill 8k 2695.4 / 2703.1 (+0.3%), 32k 3387.5 / 3356.6 (-0.9%, ranges apart: 3386-3389 vs 3357), 64k 3441.2 / 3408.2 (-1.0%, 3440-3442 vs 3407-3409); decode after 64k 99.2 / 102.1 (+2.9%), after 128k 97.6 / 97.1 (port rounds 94.2 / 100.1); short decode 100.8 / 101.6; agg x1 104.5 / 108.2. Verdict: the port matches live on output and quality, gives up ~1% prefill at 32-64k for ~3% decode after 64k, and puts live on the slice that goes upstream as CommunityServe/plugins#29 (moved from 28 to an in-repo branch). Adopted: live swapped to 340d068 at 14:16 on Sam's go (PLUGIN-SWAP-OK, LIVE-WORK-OK; rollback label 20261103-port). Upstream as CommunityServe/plugins#30, stacked on 29 (GitHub stack 31): the ANE module moved to src/ane_shared.zig and the slice edit to patches/shared-expert-ane.patch (sync-sushi.sh deletes non-slice files in src/sushi/dsv41/); review added an all-layer load self-check and a .none branch in Stream.applyOpaque; head 03d3036 (sha256 5bad3bfd) live since 15:39 on Sam's go: self-check 20 layers, worst cos 0.999767 (layer 11), packed planes max |diff| 0; LIVE-WORK-OK; rollback label 20261103-aneup.
2026-11-04, sushi_ds41 on the host's Neural Engine (Host.ane, ddalcu/mlx-serve#1083) against its own ANE bridge copy, same host. One Latch measurement window (bench/studio-live/hostane-build.sh, hostane-window.sh; live mlx-serve-ladder-pm2 stopped and restored, restore: 13:16:08, health 200; results ~/bench/hostane/w2). Host: live's own source (~/build/ladder-val, MLX b79d7477) plus the Host.ane commit 8f052072. Arms, both merged with CommunityServe/plugins#34 (the pack's tile order): a = plugins a2b63dd (ANE glue outside the slice, its own s41_ bridge, 41 symbols), b = 1bc42917 (on Host.ane, no ANE symbol). SUSHI_DS41_ANE_SHARED=2 in both. Byte-identity on the 7 fixed prompts: text and logprobs identical (EQUIV-OK). Self-check worst cos a 0.999777 / b 0.999768, every chunk fails 0. studio-bench.sh FIXED tiers, 2 rounds, a / b: prefill 8k 2706.9 / 2688.4 (-0.7%; a 2698.6-2715.3, b 2682.5-2694.3, ranges just apart), 32k 3337.2 / 3338.0, 64k 3390.3 / 3389.8; decode after a short prompt 114.3 / 111.9 (b's rounds 109.5 and 114.25: noise), agg x1 109.3 / 109.5. Verdict: the host runtime serves the shared expert with the same bytes and the same prefill at 32-64k; the 8k gap is 0.7%, within what one more round could move. The v2 pack download was running during the window.
2026-10-31, DS4.1 prefill host gap: GPU idle between syncs, measured (M5 Ultra, Metal System Trace; Latch windows 4D933F6D and 6A26A193, live restored both times; STRML/plugins exp/ds41-host-gape2bdcc1 adds SUSHI_DS41_GAP_LOG; scripts bench/hostgap/; results ~/bench/hostgap/win1, win2). Live prefill (db128461 + a72ddff) reads no expert picks on the host (resident route, dsv41_stream.zig:241), so the ANE doc's 7.3 ms "picks read + routing prep" was the host encoding the routed chain. Its syncs are moe's mlx_array_eval(out) (dsv41_model.zig:2320) and the end-of-layer evalAll (:3207). A steady 2,048-row chunk, 613-626 ms: 446-480 ms inside mlx_async_eval (encode plus MLX's 10-buffer in-flight cap), 103-113 ms waiting, 31-38 ms graph build, ~7 ms end-of-layer. Trace, cold prefill: GPU busy 78.9% at 25.6k and 80.0% at 64k (middle 80%: 80.8 / 80.9%), ~170 gaps a chunk (~8 a layer, median 460-470 µs, at fixed positions in the layer, mostly after short kernels), one op per command buffer (7,306 encoders in 7,302 buffers: every wide op binds past the Ultra's 50 MB/buffer). Bound with zero idle (tokens / GPU busy ms): 25.6k ~4,013 tok/s (x1.26 over 3,188), 64k ~4,006 (x1.24 over 3,238). But most of it is GPU-side. Commit times (MLX creates buffer n+1 right after committing n, so n's commit = n+1's creation) split the 2,241 gaps at 25.6k: 667 host-late (477 ms, 5.9% of the span; the layer-boundary drains) and 1,574 pre-committed (1,226 ms, 15.1%; committed a median 7.1 ms ahead, the GPU still waiting a median 548 µs). No buffer starts before the latest GPU end so far in any trace (0 overlaps in T, P, K, PK), so these are real idle, not the concurrent-buffer artifact seen on the Mac. MLX_MAX_MB_PER_BUFFER=1000000 cut the pre-committed idle 15.1 -> 4.0% and halved the traced idle (21 -> 10.9%) yet moved 25.6k only +0.4% (n=4, sd 30; byte-exact, EQUIV-OK), its GPU busy rising by what the gaps lost; two spinning host cores x0.999. Pipelined prefill (SUSHI_DS41_PREFILL_PIPELINE=2, 8d45380) traced: gaps 2,244 -> 1,625, busy 81.4%, untraced +2.5-4.0%; with the MB knob +3.7%. Reading: the host-side lever is the layer-boundary drains, which the pipeline takes; the remaining ~15-17% is a per-dependency GPU cost (cross-buffer MTLFence waits or first-touch residency of fresh buffers), not reachable from the host. Next: the Mac bench/cbgap/ repro to split allocation from fence cost. Write-up: docs/research/ds41-prefill-host-gap-20261031.md. Follow-up window 3 (66AFD8C4, pipelined plugin 58b7467, order P PK K4 PK P P PK K4 PK P, n = 8 a length for P and PK): MLX_MAX_MB_PER_BUFFER=1000000 on top of the pipeline 25.6k 3,311.6 (sd 11.2) vs 3,277.9 (sd 10.8), x1.010, ranges apart; 6.4k x1.000; peak footprint 130 -> 136 GB; a short greedy decode 62.6-62.8 vs 65.7-67.0 tok/s (-6%, the env is process-wide); EQUIV-OK. =400: x1.003 at 25.6k, same +6 GB, decode unchanged. Not adopted.
2026-10-31, mlx pin v0.32.3 -> ml-explore/mlx main 339279525e (161 commits, carries ml-explore/mlx#4568 cached kernel source and hash), DeepSeek V4.1 STQ, M5 Ultra (ddalcu/mlx-serve#1039; A = mlx-serve main 1271abe0 on v0.32.3, B = PR head 8bb43164, sushi_ds41a72ddff built against each arm's kit; scripts bench/mlx-pin-ab/). Prefill flat: 8k 0.0%, 32k +0.2%, 64k +0.1% (rounds 2-4, n=3, ranges overlap). Short decode +0.3%, 1 stream 400 tokens +1.2%. Decode after an 8k-64k prompt moves -6.5% to +13.9%, and the sign follows the prompt: A and B's greedy text diverges within ~260 characters at 32k/64k, so those rows compare different generations (64k reply-length sweep in a second window: +0.2 / +5.2 / -3.8 / +10.4% at 64/128/256/400 tokens). API KLD to the FP8 teacher identical on all four boots (0.1849, top-1 0.8910, prompts <= 607 tokens). Forced-token KL(A || B) 0.004-0.009 from 8k to 60k (argmax agrees 94.5-98.4%), A-again 0; the shift starts between 717 and 1,001 tokens fed. Cause: MLX's new thin NAX GEMM (steel_gemm_thin_nax, split-K 4 ways, matmul.cpp:995 Case 2); B with it off equals A to the bit at 1k/2k/8k, and against float64 on 8 thin shapes its error equals v0.32.3's (thin-nax-accuracy.c). The pin also carried patches/mlx-metal-sdpa-split-off.patch for ml-explore/mlx#4808, which was our repro's bug: sdpa_split returns a strided output (strides 24576/256/6144/1 for [1,24,4,256]) and the mlx-c repro read the raw buffer as row-contiguous. Read through mlx_contiguous, split's max error against float64 is 6.6e-5 to 7.0e-5 (M5 Max on mlx c69303b0 and M5 Ultra on 77cc0e2e with the patch reverted, identical to the last digit, 2026-11-04; issue closed with ml-explore/mlx#4808 (comment)), below v0.32.3's 1.1e-4; the patch was never needed. Same-text follow-up (2026-11-01, no new window: the forced-token windows' server logs, step ms = 2/prefill rate + 1/decode rate): one decode-width forward over a cached prefix costs the same on both builds, B -0.1 to -1.2% time across 12 buckets from 1k to 60k (n=120-600 each) against an A-vs-A-again control of -0.5 / +0.2% (forced-step-times.py). The depth decode rows track DSpark's accepted tokens per verify round (dspark-accept-vs-decode.py, all rounds): 8k/64 tokens +13.4% decode with +13.7% acceptance, 64k/256 -4.1% with -13.7%, 32k/64 +1.5% with 0.0%. Verdict: no speed or quality gain for this pack beyond ~1% per forward; the depth swings are text (acceptance), not kernel cost.
2026-11-04, the prefix-cache checkpoint ladder (ddalcu/mlx-serve#1081, 061cb16d with computed rungs), a regenerate below the tip, DS4.1 Sushi-STQ rev 1.0, M5 Ultra 256 GB. Win, live since 11:18. bench/studio-live/ladder-ab-chain.sh through Latch (measurement, Studio omp paused, excl-watch CLEAN on both arms), one arm each with a restart: A = mlx-serve-abl-live2 (no ladder), B = mlx-serve-ladder-pm2, same sushi_ds41-ladder-pm2 dylib and plist (--prefix-cache-mem 64GB clamped to 43,745 MB, --prefix-cache-entries 512). bench/studio-live/ladder-fork-bench.py, 3 fresh conversations per arm at ~28.6k tokens: R1 [system, u1], R2 extends it, R3 forks at the last user turn. Fork R3: A 0 cached, 8.709-8.736 s to the first token; B 28,570-28,614 cached (all but ~19 tokens), 0.128-0.131 s. R1 (cold, 8.86-9.89 s) and R2 (0.125-0.130 s) match across arms. Cost: resident grew 60.8 MB per conversation on A and 91.2 MB on B, so one rung of 30.4 MB at 28.6k tokens (~1.06 MB per 1k). Cold prefill read 3,290 tok/s at 28.6k. Upstream review thread: ddalcu/mlx-serve#1081 (comment).
2026-11-04, Sushi-STQ pack revision 2.0 (pair-major experts) live, and the ablation directions transferred from revision 1.0. Not a speed lever; logged for the ablation numbers. mlx-serve pins a profile to the pack's config.json sha256, so both were re-pinned (r1 b7028103 -> r2 9860e121), same direction files. refusal (layer 32), bench/ablation/r2-transfer-window.sh, ablate.py evaluate on the 100 + 100 held-out split, thinking off: stock 100/100 refused, s = 1 9/100 (r1 8/100), harmless first-token KL 0.085 mean / 1.105 max (r1 0.067 / 0.58), s = 0.5 83/100 at KL 0.030 (r1 82/100 at 0.028). cand-l17-p2 (layer 17), eval2-window.sh with EVAL_BIN=mlx-serve-ladder-pm2 EVAL_HOME=$HOME, 12 held-out harmful, thinking on, omp's request replayed, judge2: stock complied 0/12, s = 1 complied 10/10 answered (0 refused, 3 unfinished that complied in the tail, 2 tool turns); r1 stock 0/12, s = 1 9/9. Both transfer without re-deriving.
2026-11-05, live host swap checked: old live (mlx-serve-ladder-pm2 eed73f5a + sushi_ds41-ladder-pm.dylib 3568a0a6) against new live (upstream bc6c5f2c mlx-serve-main-bc6c-ane 3ed329dc + PR 30 sushi_ds41-main-bc6c-lean2.dylib 6a76e6ba), SUSHI_DS41_ANE_SHARED=2, live stopped.bench/studio-live/host-swap-window.sh (Latch, 2 rounds ABBA, excl-watch clean). Cold prefill a / b: 8k 2705.3 / 2702.4, 32k 3344.7 / 3347.7, 64k 3397.5 / 3402.8; decode 114.1 / 114.7, agg x1 109.5 / 109.8. Same speed: the swap lost nothing. Live log rates (2,300-3,600 on cold prompts) swing with prompt length, cached share and concurrent agents; read a change in a window, not in the log.
2026-11-05, sushi_ds41 ANE shared expert, lean rewrite (CommunityServe/plugins#30 at 654628c, src/ane_shared.zig 502 -> 263 lines) against the first Host.ane version (3d959968), same host (~/opt/mlx-serve-c693, mlx-serve bc6c5f2c), SUSHI_DS41_ANE_SHARED=2. Two Latch windows (bench/studio-live/lean-window.sh; live stopped and restored, health 200 both times). Window 1 had the int8 weights quantized on the GPU (85d8d3f): 6 of 7 fixed prompts diverged (first token difference at 1 to 27, max |dlogprob| before it 0.50) although its self-check read worst cos 0.999775. Metal's division is not correctly rounded, so the int8 rows differed from the host's; the self-check alone does not catch a weight change at this size. Window 2, host quantization restored (654628c): text and logprobs identical on all 7 (EQUIV-OK), self-check 0.999768 both, 48 ANE chunks each. Cold prefill (window 1, per-chunk code the same as 654628c), 2 rounds, b / c: 32k 3244.7 / 3223.6 (-0.65%, ranges 3238.8-3250.5 / 3212.0-3235.2), 64k 3401.0 / 3389.4 (-0.34%).
2026-11-05, DeepSeek V4.1 STQ r2 served with fewer routed experts than trained (k = 6 -> 5 -> 4, weights renormalized over the survivors), live mlx-serve bc6c5f2c + live sushi_ds41, SUSHI_DS41_ANE_SHARED=2. Idea from the HF MoE handbook (https://huggingface.co/spaces/huggingface/moe-blogpost, section 4.1; notes in docs/research/moe-handbook-20261105/). Variant packs link every file of the live pack and change only num_experts_per_tok. Window w1 (bench/studio-live/topk-window.sh, Latch, live stopped and restored, health 200). API KLD against the FP8 teacher, 16 prompts, 7,495 rows: k = 6 0.1596 (top-1 0.8965), k = 5 0.1686 (+5.6%, 0.8950), k = 4 0.2040 (+28%, 0.8822). Code and math prompts move least (k = 4: 0.02-0.06 -> 0.02-0.11); multilingual and story move most (multi-ja 0.298 -> 0.348 -> 0.454). k = 4 costs about twice what the r1 -> r2 pack gained. Speed arms did not run (port 8010 still held by the last KLD server; fixed with a port wait). KLD is teacher-forced and deterministic, so excl-watch's 2 busy_process and 1 new_agent findings do not touch it. Byte savings per token at batch 1, from the pack headers: routed experts 1.74 of about 5.9 GiB, so k = 4 reads about 10% less.
2026-11-05, served top-k windows w2 and w3 (same setup as the row above; candidate plugin STRML/plugins exp/ds41-route-norm-k c8425f3 = main 1464692 + sushi_route_norm_k + SUSHI_DS41_TOP_K / SUSHI_DS41_ROUTE_NORM_K env overrides, dylib sushi_ds41-normk2.dylib sha256 6571d066; live pack, config.json untouched, digest 9860e121). w2 (bench/studio-live/topk-window2.sh) API KLD: k6 0.1596 (equal to live), k5 renormalized over the 5 0.1686 (equal to w1), k5 divided by the top-6 mass 0.1747, k4 by the top-6 mass 0.1986. The handbook's denominator fix (its results "come from softmax routers") makes our sqrt-softplus router worse at k = 5. w3 speed (Latch, ABBA x2, excl-watch clean, port 8011; studio-bench.sh's bind test fails on 8010 TIME_WAIT left by the KLD client): prefill 32k k6a/k6b 3346.8/3346.8, k5 3540.8 (+5.8%), k4 3746.8 (+12%); 8k 2704.8/2693.7, 2799.4, 2888.6. Decode probe (512 tokens, DSpark on) 114.4/114.1, k5 104.6, k4 116.0; conc-1 probe 109.8/109.8, 118.2, 118.5. Per DSpark round on the 512-token request: k6 151 rounds, 2.39 accepted a round, 29.6 ms a round; k5 188, 1.72, 26.0 ms (-12%); k4 174, 1.94, 25.4 ms (-14%). The verify round gets cheaper close to the 1/6 of routed reads, but the drafter (trained against the k = 6 trunk) accepts fewer tokens, so decode is a wash or worse on these two prompts. Not swapped. Leads: k = 5 for prefill only, DSpark calibration at k = 5, acceptance over the agent replay set.
2026-11-05, served top-k window w4: k = 5 at prefill width only, and DSpark acceptance on agent replays (bench/studio-live/topk-window4.sh, Latch, live stopped and restored, health 200; plugin exp/ds41-route-norm-k 39e81ad adds SUSHI_DS41_PREFILL_TOP_K, used when a forward is wider than narrow_rows = 16, so DSpark verify and decode keep 6; dylib sushi_ds41-normk3.dylib). API KLD of p5 (prefill k = 5, decode k = 6): 0.1589, against k6 0.1596: no measurable cost. Replay of 16 omp captures (76k-305k-token prompts, greedy, 600 max tokens, ds41-replay.py), arms k6a / k5 / p5 / k6b: DSpark accepted a round 3.12 / 3.33 / 3.05 / 3.10, without request 189 (a 12.37-a-round copy echo in k5 and p5) 3.06 / 3.10 for k6 / k5; decode 118.0 / 128.1 / 116.9 / 118.0 tok/s (k5 wrote 3,356 tokens against 4,084, different text); ms a DSpark round 34.8 / 33.7 / 34.5 / 34.7; cold prefill TTFT on the three uncached prompts 78.3 / 81.3 / 28.8 s at k6, 75.0 / 77.5 / 27.4 s at k5 and p5 (-4 to -5%). k6a and k6b gave the same 16 hashes. The w3 probe's acceptance drop (2.39 -> 1.72) was one prompt's text: across 16 agent requests the drafter accepts the same at k = 5. At 76k-305k context the verify round gets only 3% cheaper (KV reads dominate), against 12% on the 45-token probe. excl-watch: XProtect scans and duetexpertd at one core each, 22:08:11-22:09:49, overlapping the first 30 s of k6a (k6b matched it).
2026-11-07, TP2 across studio1 + studio2 with DSpark, window 6g (bench/studio-cluster/tp-window.sh, Latch A53E826D, live stopped and restored, LIVE-WORK-OK; bench binary mlx-serve-tp = live bc6c on a patched JACCL MLX, libjaccl sha256 010963b0; plugin STRML/plugins feat/sushi-ds41-tp2 edd1f2c, dylib sushi_ds41-lf6.dylib sha256 63f81e94; leader/follower, 32 heads and MoE width 1152 a rank, over JACCL on Thunderbolt 5). Arms tp2-ds, tp1-ds, tp2-ds, greedy replay of 4 omp captures, neither arm with the live env (no ANE shared expert, no prefill top-k 5). Decode tok/s TP1 / TP2 warm: capture 70 (88k) 116.8 / 165.6 (cold TP2 arm 74.4, warm-up), 155 (118k) 117.0 / 130.8 (other text), 207 (137k) 144.3 / 174.6 (same hash, 1.21x), 54 (251k) 184.5 / 231.0 (1.25x). TTFT TP1 / TP2: 34.17 / 28.57, 10.73 / 8.66, 7.77 / 6.32, 89.63 / 74.31 s (-16 to -19%). API KLD TP2 0.0460, TP1 0.0473. Ablation check OK, no lost sync, TP2 cold and warm hashes equal. Lead: window 7 with the live env on both arms; open: DSpark greedy text drifts from plain TP2 on 2 of 4 captures. Detail: docs/research/ds41-tp-leader-follower-plan-20261106.md.
2026-11-07, TP2 window 7: window 6g's setup with live's plugin env on every arm (LIVE_ENV=1: SUSHI_DS41_ANE_SHARED=2, SUSHI_DS41_PREFILL_TOP_K=5; Latch A6A26DC4, live stopped and restored, LIVE-WORK-OK; ANE chunk lines on TP1 and both ranks). Decode tok/s TP1 / TP2 warm: capture 70 140.4 / 170.8 (1.22x, same hash), 155 111.3 / 130.3 (1.17x, other text), 207 138.2 / 174.2 (1.26x, same hash), 54 183.4 / 228.3 (1.24x). TTFT TP1 / TP2: 31.99 / 27.59, 10.00 / 8.40, 7.29 / 6.15, 84.24 / 72.83 s (-13.5 to -16%). Cold TP2 arm equal to warm (172.8 on 70; 6g's 74.4 was a one-off). API KLD TP2 0.0500, TP1 0.0533. Ablation OK, no lost sync. Leads from exo (exo-explore/exo#2522, exo-explore/exo#2401): MLX_ENABLE_TF32=0 for the DSpark-vs-plain text drift, MLX_SERVE_WIRED=off on JACCL groups.
2026-11-07, TP2 per-layer all-reduce cost on studio3 + studio4 (plugin lf8 SUSHI_DS41_TP_SUM=off skips the 86 per-forward CPU-stream all-reduces, wrong output, timing only; tp-window.sh with the pair studio3 + studio4 (then R0/R1, now RANKS="studio3 studio4"), KLD=0, tp-speed.py plain decode 256 tokens, arms tp2 / tp2-sumoff / tp2, no live server involved). Decode tok/s sums on (two arms) vs off: 2k 75.4/74.4, 75.4/75.1 vs 82.3/85.8 (~1.4-1.9 ms a token, 10-14%); 8k 75.3/73.9, 75.3/75.2 vs 81.3/81.2 (8%); 32k ~74.3 vs 76.8/75.6 (2-3%); 64k 73.4 vs 71.7 (off slower: garbage hidden states route to other experts). At agent depth the all-reduces are not TP2's gap to an ideal half-time round; repeated per-rank work is the next suspect. A GPU-stream all-reduce is impossible on MLX 0.32.5 (no AllReduce::eval_gpu).
2026-11-07, TP2 window 9: window 7 rerun with the plugin hash-checked on both ranks (tp-window.sh, plugin lf8 sha256 636a712a = lf6 plus SUSHI_DS41_TP_SUM at its default cpu; live stopped and restored, LIVE-WORK-OK). Every output hash equals window 7's, TP2 and TP1, so windows 6g/7's unchecked rank-1 plugin was the same build. Decode TP1 / TP2: 141.5 / 173.3 (70, 1.22x), 111.6 / 132.9 (155, 1.19x), 140.6 / 178.3 (207, 1.27x), 183.0 / 228.9 (54, 1.25x). TTFT 31.29 / 27.32, 10.00 / 8.38, 7.28 / 6.14, 83.98 / 71.92 s. KLD TP2 0.0500, TP1 0.0533. Needed a reboot of studio1 and studio2 first (JACCL EHOSTUNREACH after the mesh addressing; docs/studio-cluster-setup.md traps).
2026-11-07, TP3 across studio2 + studio3 + studio4 (tp-window.sh RANKS, plugin lf8 hash-checked on every rank, packs from the per-rank-grain splitter: 24/24/16 heads, MoE 768 each). Plain decode (tp-speed.py) TP1 / TP2 / TP3: 69.4 / 75.3 / 80.9 tok/s at 2k, 68.0 / 73.4 / 78.8 at 64k (~8% a rank). DSpark replay, window 7's setup: TP1 (studio2) / TP3 on 155 111.9 / 150.4 (1.33x), 207 138.5 / 182.2 (1.32x, same hash), 54 183.6 / 275.7 (1.50x, same hash); TTFT unchanged (TP arms ran PIPE=0). Detail: docs/research/ds41-tp3-tp4-plan-20261107.md.
2026-11-07, TP4 across all four Studios (tp-window.sh RANKS="studio1 studio2 studio3 studio4", plugin lf8 on every rank, 16 heads each, MoE 640/640/512/512; live stopped and restored, LIVE-WORK-OK). DSpark replay, window 7's setup, TP1 / TP4 (two arms): 70 141.0 / 202.6 warm (1.44x, same hash), 155 111.7 / 159.5, 149.7 (1.34-1.43x), 207 138.2 / 201.8, 187.8 (1.36-1.46x), 54 183.5 / 306.3, 303.0 (1.65-1.67x). TTFT -23 to -36%. API KLD 0.0499 / 0.0513 against TP1 0.0533. Detail: docs/research/ds41-tp3-tp4-plan-20261107.md.
2026-11-07, Metal System Trace of one decode token, TP1 against TP2 on studio1 + studio2 (tp-window.sh WORK=trace, plugin lf8, DSpark and MTP off, 2k prompt, 2,048 tokens generated, 4 s of rank 0 recorded 10 s in; bench/studio-cluster/trace-gpu-summary.py, mlx-serve intervals only). TP1 decoded at 67.2 tok/s: 14.9 ms a token, the GPU busy 12.7 ms of it (86%), idle 2.1 ms, 197 command buffers a token. TP2 at 71.1 tok/s: 14.1 ms a token, busy 10.2 ms (72%), idle 3.9 ms, 175 command buffers and 309 encoders a token. Gaps of 0.1-1 ms (host waits) went from 1.8 ms to 3.2 ms a token. Each TP2 rank runs half the attention heads and half the MoE width, yet GPU busy fell only 2.6 ms of 12.7 (20%), and the idle the all-reduces add eats most of that. Most of a decode token's GPU time is either work every rank repeats or per-dispatch latency (about 65 us a command buffer), not weight bandwidth. The stock template records no per-kernel times (shader timeline off, MLX encoders unlabeled), so the split by kernel needs removal arms or the indexer-split plugin branch. Latch note: the job had to drop --gpu; a batch job claiming the GPU needs it at 2% or less, and studio1 idles at 2-6%.
2026-11-07, concurrency on TP2 (studio3 + studio4) against TP1 (studio3), tp-window.sh CONC=4 DEPTHS=2048,32768, plugin lf8, DSpark and MTP off, 4 streams x 256 tokens per rep, ~/bench/tp2-conc4 on studio3.sushi_ds41 serves one request at a time at --max-concurrent 4, on one box and on two: per-stream decode stays at the single-request rate (TP1 69.4 / 68.4 tok/s, TP2 75.1 / 74.3 at 2k / 32k) and the aggregate falls below it (TP1 54.7 / 15.7, TP2 52.1 / 13.4). TP2's aggregate is 5% under TP1 at 2k and 15% under at 32k, because its queued 32k prefills ran slower: the last stream's TTFT was 95.3 s against 78.2 s, about 1,500 prefill tok/s against 1,930. So concurrency is no argument for TP, and live TP would serve omp, hermes and secops one request at a time, as the single box does now. CONC=8 was not run: it would only lengthen the queue.
2026-11-07, TP2 prefill with the index keys split across ranks (STRML/plugins feat/sushi-ds41-tp-indexer f055422, dylib sushi_ds41-li1.dylib sha256 65f31249) against lf8, studio1 + studio2, one Latch job back to back (~/bench/tp-idx-li1, ~/bench/tp-idx-lf8), tp-speed.py, DSpark and MTP off. Prefill fell: 8k 1,336-1,424 against 1,548-1,551 tok/s, 32k 1,487-1,539 against 1,659-1,664, 64k 1,557-1,620 against 1,703-1,729 (6-14% slower). Decode unchanged (74-77 tok/s); li1's API KLD 0.0448, top-1 0.922. Gathering each rank's top-k costs more than the halved index scan saves, so the branch stays unmerged. Prefill on this pair is also under one box's (TP1 on studio2, ~1,860-1,900 at 64k), so TP2's prefill loss is somewhere other than the indexer.
Multi-Mac tensor parallel survey, 2026-11-07
Four Sonnet surveys (exo, MLX + mlx-lm, TensorFold, other runtimes), reports in docs/research/tp-survey-20261107/;
the leads below were checked against the cited source lines. Nobody runs a multi-Mac all-reduce on the GPU: MLX's
AllReduce::eval_gpu still throws (mlx/backend/metal/distributed.cpp, origin/HEAD fc344c9), and every runtime sums
on the CPU stream as we do, two collectives a layer. 86 sums x ~20 us is ~1.7 ms a token, the floor we measured. No
runtime publishes better multi-Mac DS4.1 decode scaling than ours.
Their 16.5 -> 39-40 tok/s TP2 is fusing an unfused mlx-lm model; against one fused Mac it is 1.05-1.12x (34.7-38.2 single). sushi_ds41 already fuses those stages; ours is 1.085x plain, 1.19-1.27x DSpark
exo PR 2538 tables
GPU-stream all-reduce
MLX
Not available, none open; zcbenz: needs driver support (ml-explore/mlx#4438)
distributed.cpp
Collective inside the decode command buffer (GPU post, host RDMA write, GPU waits on a SharedEvent; peer-add fused with residual and norm)
TensorFold 94f17b74b (Flash Next pair 199.4 -> 206.6 tok/s, +3.6%)
Not ported: needs a custom transport outside MLX; removes only the command-buffer split, est. +2-6% for 60-100 h
Closed unmerged upstream; est. +1-3% for us, head cost unmeasured
Index-key split
ours li1; TensorFold GLM
Ungated: -6 to -14% TP2 prefill (ours); TensorFold gates it by key count (+4.9% at 131k, +10.3% at 262k, TP4)
this ledger, 2026-11-07
Lead
Source
Block
Estimate
Status
Overlap prefill sums: apply wo_b and sum each 256-row span on the CPU stream while the GPU runs the next span; sum MoE per row group
mlx-serve deepseek_v41.zig span loop ("A tensor split sums each span's wo_b on the CPU stream while the GPU runs the next span's attention"); their TP2 prefill 1,018 -> 1,608 tok/s on M3 Ultra
TP prefill (ours sums once per layer chunk, dsv41_model.zig:2795, :2821)
+10-18% TP prefill (agent arithmetic); first run a -sumoff prefill arm for the ceiling
open
Long-decode slowdown with wired memory under JACCL TP
exo-explore/exo#2401 (open): 42.4 / 31.6 / 9.8 tok/s by thirds over 2,000 tokens, flat with memory unwired
TP decode on thinking-length turns
0 if it does not reproduce; up to 2x late in long turns if it does. Our windows decode 256 tokens; the 2,048-token trace read 71.1 against 75
test: 3,000-token TP2 decode by thirds
Pipelined layer-stage prefill across ranks (each rank a layer range, segments flow through)
neko-legends TP4 fork of TensorFold (ZIG-PREFILL-PIPE.md): ~2x at 160k, 32k 2,779 -> 4,851 tok/s
TP prefill / TTFT
2-2.8x cold prefill (agent arithmetic); 80-120 h, needs a layer-span entry in the plugin
possible: studio1 reports 6 Thunderbolt receptacles (system_profiler), the mesh uses 3; open
2026-11-07, the survey's two cheap leads measured on studio1 + studio2 (tp-window.sh ARMS="tp tp-sumoff tp1", DEPTHS 2048 and 32768, DECODE=3000, plugin lf8, DSpark and MTP off, tp-speed.py per-third decode; ~/bench/tp-long-1, LIVE-WORK-OK). Long decode: flat on both, TP1 69.6 / 69.6 / 69.6 tok/s by thirds of 3,000 tokens at 2k and 68.6-68.8 at 32k, TP2 76.5-76.8 and 75.4-75.6. exo's wired-memory slowdown (exo-explore/exo#2401) does not reproduce on these boxes; closed. Prefill-sum ceiling: TP2 1,289-1,347 / 1,716-1,750 tok/s at 2k / 32k against 1,688-1,708 / 2,056 with the sums off (SUSHI_DS41_TP_SUM=off, wrong output, timing only) and TP1 1,314-1,380 / 1,878-1,905. The sums cost ~16% of TP2 prefill at 32k, so overlapping them per span (the survey's lead 1) is worth at most +18% on TP2 prefill, which is +8-9% over one box: the rest of TP2's prefill loss is replicated work, not the sums.
2026-11-07, the lossless DeepSeek-V4.1-Flash pack on two Studios (ddalcu/DeepSeek-V4.1-Flash-1017-MLX-Serve-Lossless revision 85002f89: the release's MXFP4 experts and FP8 trunk, nothing re-quantized; 288 GB resident) under mlx-serve's own --dist tensor (ddalcu/mlx-serve#1070, in the bench binary mlx-serve-tp, bc6c5f2c), studio3 rank 0 + studio4 worker over the 3-4 cable (rdma_en4), no plugin. Downloaded once on studio3 with the Engram files (189.1 GiB, sha256-identical to the STQ pack's) hard-linked from STQ, copied to studio4 over Thunderbolt (512,229,676,014 bytes, 89 files, 174 s), Engram hard-linked there too. Rank 0 must start without --model (only --dist-model and --model-dir) and load on the first request after the worker joins: a model named at startup loads before the join, and the preflight then wants the whole 280 GB on one box (240 GB free). The worker holds half of every expert (143,020 MiB). API KLD to the FP8 teacher (api-kld.py --limit 2 --rows 64, the TP windows' setting): 0.0031, top-1 0.992, against STQ 1.75's 0.0533 / 0.945 on the same harness. tp-speed.py (DSpark on, random-token prompts, so decode is acceptance-bound): prefill 946-1,494 tok/s at 2k and 2,103-2,574 at 32k (one STQ box: 1,314-1,380 and 1,878-1,905), decode 84.9-116.7 and 114.0-145.9 tok/s. Greedy agent replays, DSpark on, against one STQ box (TP1 arms of 2026-11-07): capture 70 (88k) 129.5 tok/s, 4.83 accepted a round, TTFT 33.3 s, against 141.0 / 4.22 / 32.5 s (0.92x); 155 (118k) 107.5 / 2.79 against 111.7 (0.96x); 207 (137k) 136.2 / 4.87 against 138.2 (0.99x); 54 (251k) 154.3 / 13.22, TTFT 108.5 s, against 183.5 / 84.4 s (0.84x), where the STQ plugin's copy arm drafted 1,353 tokens and the built-in path ran none (copy=0/0/0; window ~/bench/lossless-dist-2, CTX 262144, through tp-window.sh ARMS=dist-ds). Two boxes serve the native weights at 92-96% of the live box's agent decode for a 17x lower KLD.
2026-11-07, the fused MXFP4 MoE decode kernels on M5 for the lossless pack (studio3 + studio4 --dist tensor, DSpark on, captures at 262k context; ~/bench/fp4nax-{a,b,a2,b2} on studio3). Upstream deepseek_v41 builds moe_fp4 only on GPUs without NAX (Dec.init, origin/main 72e87026: .moe_fp4 = if (nax) null else ...), so on an M5 the lossless pack's experts took the generic gather path (rank 0 logged no "fused mxfp4 MoE decode kernels on"); ddalcu and Ivan Fioravanti flagged the missing kernels. Building it on NAX too (one line; bench binary mlx-serve-fp4nax, sha256 7684d2d0): API KLD 0.0038, top-1 0.992 (0.0031 without). Two A/Bs, the second reversed with capture 207 first: 207 (137k) 146.9-148.0 against 132.8-136.4 tok/s (+8-11%, same text, 15 rounds), 70 (88k) 140.4 against 129.6-130.1 (+8%, same text, 42 rounds; 116.6 when it ran first after the load), 155 (118k) 120.5-122.2 against 107.2 (+12-14%, different text), 54 (251k, a verify-bound copy echo) flat at 154. With it the lossless pair matches or beats one STQ box on three of the four captures (70 140.4 against 141.0, 155 120.5 against 111.7, 207 147 against 138.2); 54 stays at 0.84x for want of the copy arm.
2026-11-07, the lossless DS4.1-Flash pack on all four Studios: N-rank --dist tensor (STRML/mlx-serve feat/dist-tensor-n, 8 commits on upstream 72e87026: --dist-size N, a device per peer, a bell per worker, every control message to every worker, uneven splits refused) plus the fused MXFP4 MoE on NAX; binary mlx-serve-distn-fp4, studio1 rank 0 (live stopped and restored, LIVE-WORK-OK), DSpark on, captures at 262k context; ~/bench/tp4-lossless-{1,2}. Each worker holds a quarter of every expert and head (72,668 MiB). API KLD 0.0064, top-1 0.984 (f32 sums past a pair; the pair reads 0.0031-0.0038). Warm run (207 first): 207 172.6 tok/s, 70 168.8 (TTFT 27.7 s), 155 128.0, 54 185.5 (TTFT 94.1 s), against one STQ box 138.2 / 141.0 (32.5 s) / 111.7 / 183.5 (84.4 s): 1.01-1.25x the live box's agent decode at 1/8 its KLD, and 1.06-1.20x the lossless pair. The first run (70 first after the load) read 70 at 48.3 and 155 at 77.7: DSpark's drafting backoff measured a 12.5 ms plain step on cold kernels, judged drafting a loss against its GLM-derived verify ladder (spec/dflash/policy.zig) and skipped 159 and 231 rounds; warm, it skipped none. The backoff has no switch; a policy that decides on the first cold rounds of a load is an upstream issue.
2026-11-07, where a lossless TP4 decode token goes (plain decode at 2k, mlx-serve-distn-fp4, Metal System Trace on rank 0; ~/bench/tp4-trace-1, ~/bench/tp2-trace-lossless, studio1 rank 0, LIVE-WORK-OK). TP4: 81.8 tok/s, 12.2 ms a token, GPU busy 11.0 ms (90%), idle 1.2 ms (the four-rank sums), 45 command buffers and 206 kernels a token. TP2 (studio1 + studio2): 71.9 tok/s, busy 12.8 ms, 209 kernels. Fitting busy = R + W/N: W = 7.2 ms of work that splits across ranks, R = 9.2 ms that does not, so 84% of a TP4 token's GPU time is replicated or launch-bound, and the kernel count does not move with width (206 x ~45 us = 9.3 ms, close to R). More ranks cannot buy much more; fewer, larger kernels (fusion, NAX for the small-width launches) are the lever. TP4 also measured plain decode 81-85 tok/s at 2k-32k and prefill 3,500-3,600 tok/s at 32k (one STQ box: 1,880); DSpark on random-token prompts 121-241 tok/s. DSPARK_PROFILE prints [dspark-prof] only at unload, which the window's kill skips, so the draft/verify split is still unmeasured.
2026-11-07, NAX and fused-kernel options for the lossless pack on M5 (code map of deepseek_v41 at upstream 72e87026 + one commit; online kernels and papers in docs/research/nax-mxfp4-kernels-20261107.md; TP2/TP4 kernel-duration histograms from ~/bench/tp{2,4}-trace*). Decode at 1-6 rows is already fused (blockFused: in_proj, wq_b, NAX attention, wo_a, ffn_in, moe_fp4 up/down); the lossless pack's compressor wkv and indexer weights_proj are bf16, so nothing declines it. Under tensor parallel ffn_in is skipped (m.tp == null gate) and the hc expand runs as its own launch. The TP4 token's ~70 kernels of 40-200 us hold 60% of GPU time; their median is 134 us at TP2 and 95 us at TP4, so each carries ~56 us that width does not touch (~3.9 ms of a 12.2 ms token). NAX gaps, by width: prefill MXFP4 gate-up runs NAX gather + a separate moe_act because gateUpPaired rejects non-affine (G1, ~0.5 day); 7-16-row verify takes stock gather_qmm for every format (G2); routed experts at verify widths touch 45-85 distinct experts at ~1.1 rows each, so NAX buys them little. macOS 27's matmul2d takes fp4_e2m1 and fp8_e4m3 operands (MPPTensorOpsMatMul2d.h), with Float4E2M1 / Float8UE8M0 tensor types (MTLTensor.h); whether M5 runs them in hardware is unstated, and fp4/fp8 tensors need 128-byte strides (a 576-wide TP4 fp4 row is 288 B). Order of work: the 56 us floor, then G1, then a microbench of native fp4 matmul2d.
Correction to the two rows above (TP4 decode split, NAX options), 2026-11-07. The ~70 kernels a token at 40-200 us were read as a per-launch floor. Under MLX_METAL_FAST_SYNCH (set by --dist) each CPU-stream all_sum puts a spinning fence_wait kernel on the GPU (lib/mlx-src/mlx/backend/metal/fence.cpp), so the trace's "GPU busy" includes the sums, and moe_fp4 itself has no floor (M5 Max ubench, 1 row: up 129 / 66 / 37 us and down 63 / 37 / 22 us at widths 2304 / 1152 / 576; STRML/mlx-serve perf/dsv41-decode-floor 6d761ea6). The sums-off bound below puts their real cost at ~2.7 ms of the 12.0 ms token, not 6.6.
2026-11-07, the tensor-parallel sums at TP4, lossless pack (DSV41_TP_SUM, STRML/mlx-serve perf/dsv41-decode-floor ffc750cf on top of N-rank dist + moe_fp4 on NAX; binary mlx-serve-tpsum; tp-window.sh dist arm, DIST_ENV on every rank, studio1-4, plain decode 512 tokens; ~/bench/tpsum-{normal,off,bf16}, LIVE-WORK-OK). Decode at 2k / 32k: f32 sums (as shipped past a pair) 83.2-84.0 / 82.9-83.0 tok/s; sums off (wrong output, timing only) 107.2-107.4 / 104.8-105.0, so the 80 sums a token cost ~2.7 ms (~34 us each) and comms work is capped at +28%; bf16 sums (the partials are already bf16-valued; JACCL's bf16 sum rounds to bf16 after each rank's add, per SumOp<bfloat16_t> in jaccl/reduction_ops.h; this row first said it accumulated in f32 and rounded once, corrected 2026-11-09) 88.8-88.9 / 87.4 tok/s, +5.4-6.2%, API KLD 0.0039 (f32: 0.0064; the pair, which sums bf16 already: 0.0038). Prefill at 2k / 32k: 2,849-2,958 / 3,129-3,158, sums off 3,270-3,330 / 3,507-3,513 (+12%), bf16 2,738-2,929 / 3,086-3,142 (flat). Kept.
2026-11-07, concurrency on the lossless TP4 group (mlx-serve-tpsum with f32 sums, tp-window.sh dist / dist-ds arms, CONC=4, 4 streams x 256 tokens per rep, studio1-4; ~/bench/tp4-conc4, LIVE-WORK-OK). Unlike sushi_ds41 (one request at a time, row 2026-11-07 above), mlx-serve's built-in --dist tensor batches: per-stream decode 38.7-39.5 tok/s at 2k and 36.4-36.6 at 32k with four streams decoding, ~155-158 and ~146 tok/s across them against 83.6 / 82.9 for one stream (1.75-1.9x). DSpark on: per-stream 53.3-56.4 at 2k, 69.4-75.4 at 32k (~213-302 tok/s across four). tp-speed.py's aggregate (all tokens over the span from the first stream's first token to the last stream's last) reads 120.7-130.1 at 2k and 20.1-22.3 at 32k, because the four 32k prefills queue one after another (last TTFT 54-57 s). So the four-Studio lossless group carries ~1.8x the tokens when several agents share it; prefill does not batch.
2026-11-07, two levers on the lossless TP4 group (mlx-serve-lev2 = STRML/mlx-serve perf/dsv41-decode-floor 7253fce7: bf16 sums as the base for every arm; studio1-4; ~/bench/lev2-*, LIVE-WORK-OK). (1) DSV41_IDX_TILED_ROWS=6: verify rounds of 7-16 rows (copy rounds) score the indexer on the tiled matrix kernel instead of indexScoresScalar (rows x depth). DSpark replay against the default (16): capture 54 (251k, copy echo, 103 rounds, same text) 230.1 against 191.1 tok/s, +20%; 207 185.8 against 178.8 (+4%, 15 vs 14 rounds); 155 140.2 against 144.5 on different text. Kept. (2) The MXFP4 paired NAX gate-up with SwiGLU at prefill (gateUpPaired with mx; engaged, one "paired SwiGLU engaged" line): prefill 8k 2,881 / 3,586 and 32k 3,280 / 3,393 tok/s against 3,440 / 3,525 and 3,369 / 3,309 with DSV41_FP4_PAIRED=0. Flat: dropped (the switch stays off by default if merged). Stacked so far on the TP4 group with DSpark: 207 at 186 tok/s and 54 at 230, against the live STQ box's 138 and 184.
2026-11-07, lev3 validation of the stacked defaults on the lossless TP4 group (mlx-serve-lev3 = STRML/mlx-serve perf/dsv41-decode-floor 38be6b7d: N-rank dist, moe_fp4 on NAX, bf16 sums past a pair and the tiled indexer from 7 rows by default; studio1-4; ~/bench/lev3-{replay,speed,conc4}, LEV3-OK, LIVE-WORK-OK). API KLD 0.0046, top-1 0.9844 (128 rows). DSpark replay at 262k context, 207 first: 207 186.8 tok/s (5.21 accepted a round, TTFT 43.9 s), 70 180.1 (4.83), 155 136.4 (2.25), 54 231.4 (13.09, TTFT 94.5 s), against the first TP4 run's 172.6 / 168.8 / 128.0 / 185.5 and the live STQ box's 138.2 / 141.0 / 111.7 / 183.5. Plain decode 2k / 32k 89.0-89.5 / 87.1-87.4 tok/s, prefill 2,893-3,073 / 3,366-3,466. CONC=4 with DSpark at 2k: 63.3-70.6 tok/s a stream, 132.2-132.7 aggregate. Every request logged dspark policy: ... skipped=0 plain_ms=17.70: the backoff runs on the GLM prior at TP4 (H1, branch perf/dsv41-plain-seed).
2026-11-07, the vocabulary-split LM head on the lossless TP4 group (mlx-serve-lev4 = STRML/mlx-serve perf/dsv41-lev4 a0ac176e: lev3 + each rank projects a quarter of the 8-bit head's rows and the group gathers the logits; arms the same binary with DSV41_VOCAB_HEAD=0, studio1-4; ~/bench/lev4-{speed,replay}-{on,off}, LEV4-OK, LIVE-WORK-OK). Plain decode 2k / 32k: on 92.8-93.2 / 90.9-91.4 tok/s, off 87.9-89.0 / 87.4, +4.3-4.6%; prefill unchanged. DSpark replay on / off: 207 160.1 / 187.7 (same text and 15 rounds; first request after the load, 87 tokens, so a one-time cost in the head's path weighs -15%), 70 181.3 / 180.0, 155 137.9 / 144.1 (different text in each arm, and off differs from lev3's too), 54 232.2 / 231.7. API KLD on 0.0056 (top-1 0.9766), off 0.0052 (0.9844), where lev3 read 0.0046 on the same code as off: run-to-run spread ~0.0006, one top-1 row of 128. Kept: perf/dsv41-decode-floor fast-forwarded to a0ac176e. Open: whether 207's cold cost repeats after every load.
2026-11-07, a TP rank's decode attention split across the GPU's cores (mlx-serve-attn = STRML/mlx-serve perf/dsv41-attn-splits 304b9df8: lev3 + the split cap at 2 x cores / (row, 16-head group) pairs, clamped 8..32, from the roofline branch perf/dsv41-decode-roofline 1bb5afa2; arms the same binary with DSV41_ATTN_SPLITS=0, studio1-4; ~/bench/attn-{speed,replay}-{on,off}, ATTN-OK, LIVE-WORK-OK). At four ranks a rank holds 16 heads, one group a row, so the decode attention ran as 8 threadgroups; the M5 Max fixture at TP4 shapes read the 1-row step 18.3 -> 16.5 ms and 6-row attention at 32k 4.98 -> 3.16 ms. On the Studios: plain decode 2k / 32k on 87.6-88.2 / 86.8-86.9 tok/s, off 88.9-89.5 / 87.4-87.6 (-1%). DSpark replay on / off: 207 88.8 / 187.0 (same text; 10 rounds against 15), 70 145.9 / 180.0 (same text, 42 rounds each), 155 140.2 / 145.0 (different text), 54 232.4 / 231.5. The losses sit on the first two requests after the load and are gone by the third: the split count changes the launch shape as the context grows, so each new shape pays its first use. Dropped; the roofline ubench (decode/roofline.zig, DSV41_DEC_UBENCH=1 DSV41_ROOFLINE_N=4) stays on its branch.
2026-11-07, H1+H3: DSpark's backoff learns the plain step from one-row verifies and skips the cold rounds after a load (mlx-serve-seed = STRML/mlx-serve perf/dsv41-plain-seed 6a3fb2c7 on lev3 38be6b7d; arms seed / lev3 / seed, capture 70 first after each load, studio1-4; ~/bench/seed-{seed,base,seed2}, SEED-OK, LIVE-WORK-OK).plain_ms now reads 11.8-13.7 ms (learned) against 17.70 (the GLM-5.3 prior) on every lev3 request. Decode seed / lev3 / seed: 70 175.8 / 181.7 / 182.1, 155 142.3 / 136.9 / 140.8 (different text in each arm), 207 189.6 / 189.3 / 189.2, 54 232.0 / 232.8 / 231.9: neutral on these four, as expected at 2.4-13.5 accepted a round, far above the 1.56 tok/round break-even. The backoff now engages on 155's low-acceptance stretch (3 and 1 skipped rounds against 0). The cold 48 tok/s first run of row "lossless DS4.1-Flash pack on all four Studios" did not recur on lev3 either, so H3 is untested. Kept as the base for H2. The new verify_ms field gives the TP4 verify ladder from live rounds (capture 155, both seed arms): 1 row 11.9, 2 14.1-14.3, 3 16.7, 4 19.1-19.4, 5 22.2-22.4, 6 24.1-24.2 ms, linear at ~2.45 ms a row, where the GLM ladder scaled to a 12 ms step charges 17.3 / 20.1 / 22.8 / 24.9 / 28.7 (~3.3 ms a row).
2026-11-07, the TP4 DSpark verify ladder, forced (mlx-serve-seed with DSV41_DSPARK_ROWS=k, capture 207 twice per load, k = 1, 2, 4, 5, 7, 11, 15; studio1-4; ~/bench/ladder-k*, LADDER-OK). Greedy verify is exact: all 14 requests hash 0943d63ca9. Mean verify ms (first / second request): 1 row 12.1 / 13.2, 2 14.2 / 15.6, 4 19.4 / 20.7, 5 23.1 / 24.7, 6 24.5 / 25.6, linear at ~2.45 ms a row as the live rounds of row "H1+H3" read. The stage drafter proposes at most 5 tokens, so k = 7, 11 and 15 all verify 6 rows: only copy rounds reach 7-16, and this sweep does not price them. Decode on 207: k = 2 115.3 tok/s (35 rounds, 21.5 ms a round), 4 173.2 (19, 26.4), 5 184.9 (16, 29.4), 6 174.6 (15, 33.2), against 189.6 with the policy choosing (row "H1+H3"): the policy beats every fixed width, so a better ladder (H2) has at most a few percent here. A round's time outside its verify is 5.5-7.5 ms (round ms minus verify ms), ~20-25% of the round: the draft, the Markov loop and the host, H6's target, larger than the ~4 ms the spec estimate assumed.
2026-11-07, H6: the DSpark draft as compiled MLX regions (STRML/mlx-serve perf/dsv41-draft-compile 0aea61a6, DSV41_DRAFT_COMPILE; M5 Max, a fixture at release shapes with random weights: 3 stages, top-3 of 128 experts, 5 drafts, vocab 129,280, 8-bit head, 1,024 positions; draft_test.zig, medians of 40). ms per dsparkDraft: eager 6.05-6.58, compiled 5.77-6.27, ~1.05x. Kernel-launching graph nodes 230 -> 153; a dependent tiny add costs 2.58 us here, so the 77 removed launches are worth ~0.2 ms, which is the gain. One stage alone: 3.8-3.9 eager, 3.6 compiled, so a stage costs ~1.1 ms and the shared part (embedding, 8-bit head, 5 Markov-head reads) ~2.2 ms: bytes, not dispatch. Drafts bit-identical to eager (ids, confidences and logits; tests dsv41 draft: ...), dsv41 tests 162 pass / 43 skip. Not adopted: the spec's premise (~250-300 eager ops at 12-15 us = 3.5-4 ms) is false. Since the draft is byte-bound and at TP runs unsharded on rank 0 while ranks 1-3 idle, the lever is H7: shard the stage experts, the head and the Markov reads across the ranks.
2026-11-07, H2: DSpark verify sizing on a cost line learned from its own verifies, and the TP4 round split (mlx-serve-h2 = STRML/mlx-serve perf/dsv41-verify-cost c78650cc on H1 6a3fb2c7; arms H2 / H1 / H2, capture 70 first after each load, then an H2 arm with MLX_SERVE_DIAG=dspark-profile; studio1-4; ~/bench/h2-{h2,h1,h2b,prof}, H2-OK, LIVE-WORK-OK). Decode H2 / H1 / H2: 70 181.5 / 181.6 / 182.0, 155 144.7 / 142.1 / 142.1 (different text each arm), 207 174.0 / 189.3 / 174.3 (same text, 15 rounds each), 54 231.0 / 232.8 / 230.6. No win anywhere, 207 -8% in both H2 arms. With rows priced near the measured 2.45 ms, H2 never verifies t1 alone (no 1-row rounds, against 10 on 155 under H1), so the plain-step samples H1 takes from those rounds stop. Dropped; the branch stays. The profile arm (cumulative over 128-160 rounds): a round 28.4-29.1 ms = draft 4.2-4.3 ms + verify 24.1-24.8 ms (4.6-4.8 drafts submitted, 3.2-3.4 accepted), host and rollback ~0. The draft is ~15% of the round, runs on rank 0 alone and is byte-bound (row H6), so sharding it across the four ranks (H7: stage experts, the draft's 8-bit head and the Markov reads; lev4 split only the verify head, and the draft still projects through the whole head on rank 0) is worth up to ~2.5-3 ms a round, +9-10%.
2026-11-07, the candidate stack on the lossless TP4 group (mlx-serve-stack = STRML/mlx-serve perf/dsv41-stack 22e3e828: perf/dsv41-decode-floor a0ac176e (N-rank dist, moe_fp4 on NAX, bf16 sums, tiled indexer, vocab-split head) merged with H1 perf/dsv41-plain-seed 6a3fb2c7; studio1-4; ~/bench/stack-{replay,speed,conc4}, STACK-OK, LIVE-WORK-OK). API KLD 0.0048, top-1 0.9766. DSpark replay, 207 first after the load: 207 190.4 tok/s (TTFT 44.7 s), 70 182.0, 155 150.8 (3.09 accepted a round, different text), 54 233.8, against lev3's 186.8 / 180.1 / 136.4 / 231.4 and the live STQ box's 138.2 / 141.0 / 111.7 / 183.5 (1.29-1.38x on the first three, 1.27x on the copy echo). Plain decode 2k / 32k 93.2-93.3 / 90.2-91.2 tok/s (lev3 89.0-89.5 / 87.1-87.4), prefill 2,845-2,947 / 3,146-3,332. CONC=4 with DSpark at 2k: 60.4-62.5 a stream, 129.6-133.0 aggregate (lev3 63.3-70.6 / 132.2-132.7). 207 first after the load read 190.4, so the lev4 on-arm's 160.1 there was a one-off.
2026-11-07, the candidate TP4 stack over the 16-capture agent set (mlx-serve-stack, perf/dsv41-stack 22e3e828; picks 7, 21, ..., 217 at 76k-305k context, DSpark greedy, context 393,216; studio1-4; ~/bench/stack-wide, WIDE-OK). Token-weighted decode 160.8 tok/s over 3,991 tokens (median 155.4, 116.2 at pick 161 to 273.1 at pick 189, the copy echo at 12.42 accepted a round), against the live STQ box's 116.3 / 116.7 on the same 16 (row 2026-11-06, EXL3 against STQ, w1): 1.38x the live box at 1/33 of its KLD (0.0048 against 0.1589). The slowest picks are the deepest with the fewest accepts (105 at 275k: 119.1, 2.06 a round; 161 at 294k: 116.2, 3.14). H7's baseline.
2026-11-07, serving capacity of the candidate TP4 stack: 2 and 8 concurrent streams (mlx-serve-stack; tp-window.sh dist and dist-ds arms, CONC = 2 and 8, 256 tokens a stream, 2 reps; studio1-4; ~/bench/stack-conc{2,8}, CONC-OK, LIVE-WORK-OK; CONC=4 is in the stack row). Per-stream decode at 2k / 32k, plain: 2 streams 63.7-65.7 / 56.8-57.3 tok/s, 8 streams 23.6-24.0 / 31.6-31.7; DSpark: 2 streams 87.6-100.5 / 103.4-110.9, 8 streams 30.2-31.9 / 47.4-54.7. So the group decodes ~130 tok/s across 2 plain streams and ~190 across 8 at 2k, ~190 and ~245 with DSpark, against 93 for one plain stream: batching gives 2-2.6x at 8 streams. The window's aggregate (all tokens over first token to last) reads 111-115 / 139-141 at 2k and 18-31 at 32k because prefill does not batch: the last of 8 32k prefills waits 108-120 s. For agents that share the group, decode capacity scales; a burst of long cold prompts queues on prefill.
2026-11-07, the bytes a TP4 decode token reads, and the target (Sam: 3x the STQ pack's ~80-90 tok/s decode, so ~250-270 tok/s). The lossless pack's safetensors headers (studio1 ~/models-big/DeepSeek-V4.1-Flash-1017-MLX-Serve-Lossless, 80 shards) hold 287.9 GiB: routed experts 275.7, attention 6.3, other 2.1, shared expert 1.5, embedding + head 1.2, DSpark stages 0.7, compressor 0.44, indexer 0.04. A rank holds 72.7 GiB, so nearly everything already shards. A plain token reads per rank ~6/256 x 275.7 / 4 = 1.6 GiB of routed experts plus ~6.3 / 4 = 1.6 GiB of dense weights, ~3.3 GiB: at ~0.75-0.8 TB/s that is ~4.3 ms, a bandwidth bound near 230 tok/s plain, against the stack's 10.7 ms (93 tok/s). The ~6.4 ms over the bound is latency, not bytes: the 80 sums (~2.7 ms, ~34 us each) and ~200 dependent kernels a token (row "where a lossless TP4 decode token goes"). Agent decode today: 160.8 tok/s token-weighted on the 16 captures (6.2 ms a token); the target needs ~3.9 ms. Work in flight: H7 (sharded draft), comms H2 (one-chunk JACCL buffers), a per-sum timeline (where the 34 us goes) and fusion at the sum boundary (comms H4).
2026-11-07, H7: the DSpark draft sharded across the four ranks (mlx-serve-shard = STRML/mlx-serve perf/dsv41-draft-shard 86fffd7d on the stack: every rank holds its slice of the stage layers, the draft's 8-bit head and Markov head project each rank's vocab rows and gather [value, id] argmaxes, rank 0 sends the draft op in its plan; arms the same binary with DSV41_DRAFT_SHARD=0; studio1-4; ~/bench/shard-{on,off,on2,prof-on,prof-off}, SHARD-OK, LIVE-WORK-OK). Decode on / off / on: 207 192.0 / 186.9 / 192.7 and 70 188.4 / 181.3 / 187.9 (same hashes in every arm, so the sharded draft is exact), 155 164.2 / 150.4 / 150.0 (text differs each arm), 54 233.8 / 234.3 / 233.7 (copy rounds draft nothing). API KLD 0.0049 / 0.0040 / 0.0055. Profile on / off: round 26.1 / 27.5 ms, draft 3.1 / 4.3 ms, verify 23.0 / 23.2, 6.1 / 6.5 ms a token. +3-5% on drafted captures; kept, the new stack. The draft shrank 1.2 ms, not the ~3 ms its bytes promised (the M5 Max fixture put one rank's share at 2.4 ms of 5.7): the rest is launches and its 11 collectives a draft, the same latency the 80 trunk sums pay.
2026-11-07, the RAM prefix cache at TP4 works (mlx-serve-stack with the cache on: PREFIX=1 drops the windows' --no-prefix-cache-ram; the 16-capture set, two omp conversations taking turns, DSpark greedy, context 393,216; studio1-4; ~/bench/prefix-tp, PREFIXTP-OK, LIVE-WORK-OK). Every one of the 13 follow-on prompts restores from RAM on rank 0 ([hot-cache] module restored source=ram, e.g. pick 49 76,277 of 80,294 cached, pick 105 260,721 of 274,897, pick 161 282,026 of 294,431) and the workers mirror it through OP_DSV41_TP_SNAP with no error or divergence line in ranks 1-3's logs. TTFT summed over the 16 picks: 255.3 s against 1,016.8 s with the cache off (row "stack over the 16-capture agent set"); per follow-on 1.5-7.8 s, 15.8 s for pick 77, which adds 31k new tokens. Decode token-weighted 160.7 tok/s over 4,012 tokens (cache off: 160.8). The engine's own hot cache logs requested capacity=32 but disabled by scheduler; the plugin's module cache does the work, as on one box. Every window so far ran with the cache off, so this is its first TP test; it needs no fix.
2026-11-08, the stack + H7 over the 16 captures with the prefix cache on (mlx-serve-shard, perf/dsv41-draft-shard 86fffd7d; PREFIX=1, same set and settings as row "the RAM prefix cache works at TP4"; ~/bench/prefix-tp-shard, PREFIXSH-OK). 13 of 13 follow-on prompts restore from RAM; no error, divergence or panic line in ranks 1-3's logs, so the sharded draft's stage windows ride the snapshots. Token-weighted decode 170.0 tok/s over 3,947 tokens (the stack without H7: 160.7), TTFT summed 256.3 s (255.3). Against the STQ pack's ~80-90 tok/s that is ~2.0x; the target is 3x (~255).
2026-11-08, comms H2: one-chunk JACCL buffers and the reduce-scatter cutoff at TP4 (bench/studio-cluster/jaccl-fit-patch.py on the bench MLX: JACCL_FIT_BUFFER=1 sizes a message's buffer to hold it whole, so a 10,240 B bf16 decode sum goes as one 16 KB chunk instead of two 8 KB ones; JACCL_RSAG_MIN moves the 32 KB cutoff past which a 4-rank all_reduce takes reduce-scatter + all-gather; both off unless set; mlx-serve-shard, the stack + H7; studio1-4; ~/bench/jab-{speed,replay}-{base,fit,fitrs}, JAB-OK, LIVE-WORK-OK). Plain decode 2k / 32k: as built 92.5-92.6 / 90.5-91.3 tok/s, fit 94.6-95.1 / 92.7-93.1 (+2-2.5%), fit + cutoff 131,072 94.4-94.7 / 91.9-92.9. DSpark replay as built / fit / fit + cutoff: 207 192.4 / 198.5 / 173.5 (same hash; 16 rounds in the last), 70 188.3 / 190.7 / 189.8, 155 146.9 / 155.1 / 162.6 (different text each arm), 54 233.8 / 233.6 / 232.2. Kept: one-chunk buffers (+2-3% plain, +1-3% on drafted captures). Dropped: the cutoff (no gain on the 6-row verify sums).
2026-11-08, Step 0: where a TP4 tensor sum goes (mlx-serve-sumtl = STRML/mlx-serve perf/dsv41-sum-timeline 18d2f5c0, diag MLX_SERVE_DIAG=tp-sum-timeline on every rank, MLX patched with its patches/mlx-tp-sum-timeline.patch (fence.cpp, the JACCL wrapper; inert when the diag is off, libmlx backed up as libmlx.dylib.pre-tl); plain decode at 2k and 32k, then capture 70; studio1-4; ~/bench/sumtl-{speed,ds}, SUMTL-OK). Plain decode with the diag on 92.4 tok/s at 2k, unchanged. A decode sum (10,240 B bf16, 20,480 samples a rank), p50 / p90 us, the same on all four ranks: GPU work since the last sum ("spin", wait start to fence seen) 92.8 / 146.3, fence seen to all_sum entry 0.1 / 0.7, the all_sum 16.4-17.0 / 19.5-20.3, return to the GPU's release 0.2 / 1.0. So of the ~34 us a sum costs (row "tensor-parallel sums at TP4"), ~17 us is JACCL's one-hop collective and ~17 us the GPU side of the hand-off (fence signal, release wake), which the host cannot stamp. The larger share of a token is compute: 80 x ~93 us = ~7.4 ms between sums against ~4.3 ms of bytes (row "the bytes a TP4 decode token reads"), so kernel efficiency, the routed MoE first, is the bigger lever than comms. DSpark verify sums: 81,920 B (6-row, bf16) 34.0 / 43.8 us, 327,680 B 61.6 / 79.5 us. Prefill sums (1.3 MB, 84 MB) are bandwidth-bound and irrelevant to decode.
2026-11-08, stack2: the stack + H7 + one-chunk JACCL buffers, validated (mlx-serve-shard with JACCL_FIT_BUFFER=1, now the windows' default; studio1-4; ~/bench/stack2-{replay,speed,conc4,wide}, STACK2-OK, LIVE-WORK-OK). API KLD 0.0038, top-1 0.9844. Captures: 207 199.3 tok/s, 70 190.6 (same hashes as before), 155 160.2, 54 233.3. Plain decode 2k / 32k 94.5-94.9 / 92.6 tok/s. CONC=4 with DSpark at 2k: 52.7-63.2 a stream, 129.9-136.1 aggregate. The 16 captures with the prefix cache: 176.4 tok/s token-weighted over 4,207 tokens (stack 160.8, + H7 170.0), TTFT summed 255.2 s: ~2.1x the STQ pack's ~85 tok/s, ~1.51x the live box's 116.5 on the same set.
2026-11-08, comms H4: fusion at the TP sum boundary (STRML/mlx-serve perf/dsv41-tp-fuse 04d5c1c2 on the stack, DSV41_TP_FUSE; M5 Max fixture at TP4 shapes, sums stubbed). Only the hc-expand fold is exact: tpFfn leaves the expand to the next layer's in_proj stage kernel, bitwise identical on one rank (layers 0-4 and 20-25, six steps of 1-6 rows) and at four ranks. The TP ffn_in without wo_b is not exact (its own tests accept a different route pick in up to one row), and hc_split already overlaps the gate (MLX puts no barrier between them). Launches per 5-layer step 57 / 57 at 1-2 rows, 61 -> 58 at 3-6 rows; fixture ms per 40-layer step, off / on: 1 row 13.32 / 13.33, 2 rows 19.17 / 18.22, 6 rows 40.33 / 40.57. Parked without a Studio A/B: nothing at 1 or 6 rows, and it conflicts with the sharded draft's fixture code.
2026-11-08, the tiled index scorer on short verifies (DSV41_IDX_TILED_ROWS = 6, the default, so 7+ rows tiled / 2 / 1; stack2; 9 captures: 207, 70, 155, 54 and the deep 7, 77, 105, 161, 217 at 223k-305k; studio1-4; ~/bench/idx-t{6,2,1}, IDX-OK). 207 / 70 / 54: 199.8 / 190.8 / 233.8, 198.6 / 191.3 / 233.7, 199.5 / 192.1 / 232.8, flat. Deep picks 105 / 161 / 217: 130.9 / 124.9 / 159.3, 133.3 / 119.0 / 158.5, 137.3 / 116.1 / 155.6, mixed; pick 7 read 96.8 / 88.0 / 123.8, text variance rather than the scorer. No change: the default stays 6. A repeat of stack2's 16-capture run (stack2-wide2) sizes the run-to-run band before smaller levers are judged.
2026-11-08, the 16-capture meter's noise band (stack2 again, same binary and settings as row "stack2"; ~/bench/stack2-wide2, WIDE2-OK). Token-weighted 168.3 tok/s over 4,103 tokens against the first run's 176.4, TTFT summed 255.8 s against 255.2: run to run the 16-capture number moves ~±2.4% (greedy DSpark text differs between runs on most deep picks). So it cannot resolve a lever under ~5%; plain decode (±0.5%) and the fixed-text captures 207, 70 and 54 (same hash every run) are the meters for small levers. The H7 + fit-buffer gains stand on those: 207 192.0 -> 199.3, 70 188.4 -> 190.6, plain 2k 92.5 -> 94.5-95.1.
2026-11-08, MLX's command-buffer op cap at TP4 decode (MLX_MAX_OPS_PER_BUFFER default / 500 / 16; stack2; plain decode 2k, 32k and captures 207, 70; studio1-4; ~/bench/ops-{speed,replay}-{def,o500,o16}, OPS-OK). Plain 2k / 32k: 94.5-94.9 / 92.9-93.1, 94.4 / 92.6-93.2, 94.3-94.4 / 92.6-92.8 tok/s; 207 199.6 / 198.3 / 175.4 (16 rounds in the last, the outlier seen in two earlier windows) and 70 190.3 / 190.8 / 195.6, same hashes. Flat: the sums already end the command buffers, so the cap never binds. Dropped.
2026-11-08, the fused MXFP4 MoE decode kernels laid out for bandwidth (STRML/mlx-serve perf/dsv41-moe-bw bfbd2263 on stack2, DSV41_MOE_BW: gate/up decode each unit's gate and up codes against one decode of the activations; down covers two column halves a threadgroup, splits the shared expert over two simdgroups and keeps a column group's rows adjacent; byte-identical to the old kernels on random and NaN/Inf inputs at widths 576, 1152 and 2304, rows 1-6, hc 1 and 4; arms the same binary with DSV41_MOE_BW=0; studio1-4; ~/bench/moebw-{speed,replay,prof}-*, MOEBW-OK, LIVE-WORK-OK). M5 Max microbench at a TP4 rank's width 576: up 50.5 -> 49.6 us at 1 row (already 86% of a 581 GB/s streaming read) and 253.2 -> 228.3 at 6; down 33.0 -> 30.3 and 161.1 -> 139.1. On the Studios, on / off / on: plain 2k 97.2 / 94.7-95.2 / 97.3-97.7 tok/s and 32k 95.4 / 93.0 / 95.6 (+2.5%); 207 106.7 / 198.8 / 207.0 and 70 180.2 / 191.3 / 197.8 (same hashes: exact on the real weights; the first arm's first requests pay the new kernels' first compile, the identical later arm reads 207 207.0, 70 197.8, +4% / +3%); 54 flat (233.4 / 234.0 / 233.5). API KLD 0.0047 / 0.0040. Profile on / off: verify 20.9 / 22.7 ms (-8%), round 23.9 / 25.8 ms. Kept: stack3.
2026-11-08, TP4 decode against context depth (stack2, plain decode 256 tokens at 2k / 64k / 128k / 256k / 320k, then the three deepest captures with the DSpark profile; studio1-4; ~/bench/depth-{speed,prof}, DEPTH-OK). Plain decode 94.0-94.5 / 91.6-91.7 / 89.9-91.4 / 90.6-90.7 / 90.2-90.3 tok/s: -4% from 2k to 320k, so the compressed attention and the indexer cost little at depth. Prefill 2,814-2,983 / 3,550 / 3,151-3,178 / 2,540-2,555 / 2,303-2,322 tok/s (TTFT 141-142 s at 320k). The deep captures are slow because they accept less: 161 (294k) 127.4 tok/s at 2.66 accepted a round, 105 (275k) 139.1 at 2.25, 217 (305k) 146.0 at 2.15, against 3.3-4.9 on 70 and 207; profile there round 22.4-22.6 ms = draft 3.1 + verify 19.3-19.5, 3.04-3.11 drafts submitted, 2.04-2.13 accepted, 7.2-7.4 ms a token. The lever for deep agent turns is per-round fixed cost (draft, the plain-step base of the verify), not depth.
2026-11-08, stack3 validated (mlx-serve-moebw = perf/dsv41-moe-bw bfbd2263: N-rank dist, moe_fp4 on NAX, bf16 sums, tiled indexer, vocab-split head, H1, the sharded draft, one-chunk JACCL, the MoE bandwidth kernels; studio1-4; ~/bench/stack3-{replay,speed,conc4,wide}, STACK3-OK, LIVE-WORK-OK). API KLD 0.0042, top-1 0.9844. Captures 207 205.5, 70 197.2 (same hashes), 155 168.6, 54 233.8. Plain decode 2k / 32k 97.0-97.1 / 94.9-95.4 tok/s; prefill 3,020-3,085 / 3,623-3,697 (stack2: 2,844-2,962 / 3,216). CONC=4 with DSpark at 2k: 59.4-63.5 a stream, ~240-254 decoded across the four; the window's aggregate (first token to last, prefill queue included) reads 130.9-159.0. 16 captures with the prefix cache: 180.6 tok/s token-weighted over 3,988 tokens (stack2 176.4 and 168.3), TTFT summed 252.7 s: ~2.1x the STQ pack's ~85, ~1.55x the live box's 116.5 on the same set.
2026-11-08, stack3 at TP2 against TP4 (studio1 + studio2, same binary; ~/bench/tp2ref-{speed,replay}, TP2REF-OK). Plain decode 2k / 32k: TP2 78.0-78.5 / 77.1 tok/s, TP4 97.0-97.1 / 94.9-95.4 (stack3 row): 1.24x for twice the Studios, so most of a token does not shrink with width (row "where a lossless TP4 decode token goes": R + W/N). TP2 prefill 1,821-2,117 / 2,832-2,930 against TP4's 3,020-3,085 / 3,623-3,697. The TP2 DSpark captures read 207 34.8 and 70 109.2 tok/s on their first requests after the load: the MoE bandwidth kernels compile per width on first use, and TP2's width 1152 had never run, so these are compile costs, not speed.
2026-11-08, stack3 serving capacity: 2, 4 and 8 streams (mlx-serve-moebw; dist and dist-ds arms, CONC = 2 / 4 / 8, 256 tokens a stream, 2 reps, 2k and 32k; studio1-4; ~/bench/stack3-conc{2,4,8}, CONC3-OK). Per-stream decode at 2k, plain: 66.2-67.8 / 43.4-45.1 / 23.9 tok/s, so ~134 / ~176 / ~191 across the streams; DSpark: 76.1-113.0 / 63.3-63.8 / 33.6-35.9, so ~189-226 / ~254 / ~277 summed across the streams. Correction (row "stack4 serving capacity"): with 256 tokens a stream the decode windows only partly overlap, so the sum counts stretches where fewer streams ran and overstates capacity; measured with 2,048 tokens a stream, stack4's 8-stream DSpark window reads 248-251 tok/s, ~2.9x. At 32k the per-stream rates hold (plain 59.5-59.7 / 42.0 / 32.9; DSpark 102-116 / 81-95 / 65-69) but the cold prefills queue one after another (the last of 8 waits 106-119 s), so the window's aggregate reads 18-31. For agents that share the group with warm prefixes, decode capacity is ~2.9x the STQ pack (stack4 row); one agent alone is ~2.1x (row "stack3 validated").
2026-11-08, stack3 over the 16 captures sampled at temperature 0.6 (DSpark's stochastic verify; TEMPS=0.6 now passes through tp-window.sh's replay; prefix cache on; ~/bench/stack3-sampled, SAMPLED-OK). Token-weighted 175.4 tok/s over 3,990 tokens against greedy's 180.6 (row "stack3 validated"), inside the ~±2.4% run-to-run band, TTFT summed 253.2 s. Accepted a round ranged 1.81 (pick 7) to 9.87 (pick 189). Agents that sample get the greedy speed. Copy rounds over the greedy 16-capture run: 104 rounds against 704 stage rounds, every one verifying 15 drafts, 972 of 1,560 drafts kept (62%), so a failed copy round pays a 16-row verify for little: the case for sizing copy rounds (perf/dsv41-copy-size).
2026-11-08, H10: single-stream copy rounds sized by measured survival (STRML/mlx-serve perf/dsv41-copy-size da8430bf on stack3, DSV41_COPY_SIZE: each copy round prices its drafts at pol.copy's survival for its suffix class against the verify ladder and teaches pol.copy what it kept; before, every copy round verified min(15, remaining); arms warm / on / off / on, same binary, captures 207, 70, 54, 189, 133, 63; studio1-4; ~/bench/copysz-{warm,on,off,on2}, COPYSZ-OK). Decode on / off / on: 207 215.5 / 207.4 / 216.1 and 70 213.4 / 197.0 / 213.0 (same hashes in every arm, so exact: both hold a few copy rounds, 3 rounds drafting 18 against 2 drafting 30), 54 239.6 / 233.6 / 237.3, 189 264.5 / 277.7 / 250.1, 133 222.5 / 214.1 / 228.0, 63 175.7 / 153.1 / 172.8. Token-weighted over the six ~231.9 against ~223.9, +3.6%. The one loss is the near-perfect echo 189 (12.42 accepted a round off, 9.87-10.90 on): CopyStats starts the strong class at 0.9 survival, so it trims that request's first copies before it learns. Copy totals on / off: 54 98 rounds, 1,356 drafted, 1,332 kept / 93, 1,395, 1,321; 63 11, 68, 46 / 7, 105, 48. Kept, in stack4.
2026-11-08, stack4 = stack3 + H10 + the attention-projection bandwidth kernels (mlx-serve-stack4 = STRML/mlx-serve perf/dsv41-stack4 8c07ebbd; perf/dsv41-attn-bw f4797673: wo_a for 1-3 rows computes each row's split weights once into threadgroup memory and issues its 8 split loads before use, wq_b runs four threadgroups a core, in_proj takes its stage launch from 2 rows; bit-equal on 19,299,456 output elements; M5 Max fixture at a TP4 rank's shapes 7.2 us a layer recovered at 1 row, wo_a 27.4 -> 22.2 us; arms the same binary with DSV41_ATTN_BW=0, after a warm arm; studio1-4; ~/bench/stack4-{speed,replay}-*, stack4-{kld,wide}, STACK4-OK, LIVE-WORK-OK). On / off / on: plain 2k 97.5-98.5 / 97.2-97.3 / 98.6-99.0 tok/s, 32k 96.1-97.1 / 95.4-95.5 / 96.1-96.7 (+1%); 207 44.0 (the new kernels' first compile) / 215.5 / 219.8 and 70 147.4 / 209.3 / 209.9 (same hashes); 54 240.3 / 237.3 / 240.4. Kept. stack4 validation: API KLD 0.0044, top-1 0.9766; 207 220.8, 70 214.0; 16 captures with the prefix cache 183.4 tok/s token-weighted over 4,116 tokens (stack3 180.6), TTFT summed 258.5 s: ~2.16x the STQ pack's ~85.
2026-11-08, Metal System Trace of a stack4 DSpark decode (mlx-serve-stack4, rank 0 on studio1, 2k prompt, 8,192 tokens so the 4 s trace sits inside decode, TRACE_DELAY=12; the first try traced an idle GPU because 2,048 tokens ended before the trace started; ~/bench/stack4-trace-ds, S4TRACEDS-OK, LIVE-WORK-OK; bench/studio-cluster/trace-gap-seq.py lists the busy and idle segments in order). 282.8 tok/s on this prompt (a long synthetic generation, so copy rounds dominate; not the agent mix). Over 4,469.0 ms of wall the GPU is busy 4,138.5 ms (92.6%), against ~89.5% on the plain token trace. Idle: 24,482 gaps under 10 us (16.9 ms), 17 at 10-100 us (0.6 ms), 328 at 0.1-1 ms (124.7 ms), 98 over 1 ms (188.4 ms). Busy runs between gaps (merged GPU time) come in ~5 ms steps (4.9-5.2, 9.1, 10.2-10.3, 29.8 ms) split by gaps of a median 0.356 ms, the same size as the ~330 us that follows the tiny kernel at a plain token boundary, so each is one host eval and graph build. Per decoded token that is ~0.25 ms of idle against a plain token's ~1.19 ms, so pipelining the host step is worth up to ~7% of a DSpark round and ~11% of a plain token.
2026-11-08, stack4 serving capacity (mlx-serve-stack4; dist and dist-ds arms at 2k; ~/bench/stack4-conc{2,4,8}: 256 tokens a stream, 2k and 32k, CONC4-OK; ~/bench/stack4-cap{4,8}: 2,048 tokens a stream, CAP4-OK; LIVE-WORK-OK after each). With 256 tokens a stream the streams' first tokens spread up to ~7 s (each waits on the prefills ahead of it) against ~8 s of decode, so neither the sum of per-stream rates nor the first-to-last window measures capacity: 8 DSpark streams sum to 275 / 248 while the window reads 148 / 145 (stack3: 287 / 269 and 152 / 146; plain 191 / 191 and 141 / 141 on both stacks). With 2,048 tokens a stream the decode window is 38-69 s plain and the two measures agree on plain:
2k, 2,048 tokens a stream
per stream
sum of streams
first-to-last window
4 plain
50-53
203 / 206
196 / 199
8 plain
27-29
224 / 224
212 / 213
4 DSpark
51-137
367 / 348
195 / 234
8 DSpark
33-107
383 / 393
251 / 248
DSpark streams accept at different rates (each seed writes different text), so the fast ones finish early and the sum counts them at a rate they held only with fewer peers; the window is the capacity figure: ~250 tok/s at 8 streams, ~2.9x the STQ pack's ~85, and ~212 plain. At 32k every run is cold prefills queued one after another (the last of 8 waits 107-118 s), so those rows read 18-31 and measure prefill, not decode. stack4 matches stack3 at every count within the run-to-run band.
2026-11-08, the strong-match copy prior (STRML/mlx-serve perf/dsv41-copy-prior 8028b13f on stack4: DSV41_COPY_PRIOR seeds CopyStats' survival prior for copies agreeing on 16+ tokens, stack4's being 0.9; arms the same binary warm / 0.9 / 0.95 / 0.97 / 0.9, captures 207, 70, 54, 189, 133, 63; studio1-4; ~/bench/cprior-*, CPRIOR-OK). Decode 0.9 / 0.95 / 0.97 / 0.9: 207 217.6 / 178.7 / 195.5 / 219.7, 70 214.9 / 208.9 / 209.9 / 209.9, 54 240.5 / 235.5 / 233.0 / 240.1, 189 275.9 / 278.6 / 279.0 / 252.3, 133 223.6 / 218.9 / 214.4 / 217.6, 63 232.7 (83 tokens) / 173.2 / 165.7 (125 tokens) / 234.4 (83 tokens). Token-weighted 237.8 / 227.7 / 226.1 / 234.3. The 189 loss H10 was blamed for (row "H10") is text, not the prior: the two 0.9 arms read 275.9 at 12.42 accepted a round and 252.3 at 9.87 with a different hash, so greedy text after these prompts moves between loads of one binary (54 and 63 also wrote two texts each across the five arms). Dropped; stack4 keeps 0.9.
2026-11-08, the piped tensor decode step (STRML/mlx-serve perf/dsv41-tp-greedy-pipe d7c69c38 on stack4, DSV41_TP_PIPE, distributed protocol 8: a plain decode step whose token is still on the GPU sends no id header; rank 0 rings each worker's bell with one byte and every rank's graph all-gathers rank 0's [1] int32 token for the embedding, so it is exact for any sampler; a four-rank fixture checks header against pipe at max tokens, at an EOS and with a snapshot mid-stream: same tokens, same collectives in the same order, equal caches; ~/bench/pipe-{warm,speed-*,replay-*,trace}, PIPE-OK). Plain decode on / off / on: 2k 100.8, 100.8 / 98.4, 97.5 / 101.1, 100.7 tok/s (+3.0%), 32k 97.9, 98.9 / 96.8, 96.6 / 98.7, 98.9 (+2.1%). DSpark captures (the pipe covers only plain steps) 207 217.0 / 222.0 / 220.8, 70 210.2 / 215.8 / 215.2, 54 235.3 / 238.0 / 240.2, same hashes except 54's text in the last arm (it moves between loads, row "strong-match copy prior"). Metal trace of a piped plain token (rank 0, 4.4 s): busy 92.6% against ~89.5% with headers; 475 gaps of 0.1-1 ms (266.2 ms, median 0.548 ms), about one a token, against ~1.19 ms of idle a token before. The bound was ~1.1 ms; the pipe recovered about half. Lead for the rest: each rank still reads the token on its host partway through building the graph, for the Engram lookup. Kept.
2026-11-08, per-kernel map of one TP4 rank's decode step (STRML/mlx-serve diag/dsv41-kernel-map 147436922c: the test decode/kernel_map.zig loops workerStep as TP4 rank 0, 384 mxfp4 experts, ctx 2048, sums stubbed; Metal System Trace with a labelled MLX build run one primitive a command buffer (docs/dsv41-kernel-map.mlx-labels.patch, never applied to lib/); M5 Max, layers 0-20 and 20-40 run separately and added, two repeats each; labelled totals 108-121% of stock busy, so shares hold and absolute us are ±15%; no head or Engram in the fixture). 1 row: span 13.5 ms, busy 12.4 ms, 544 dispatches, 1.1 ms idle between layer encoders. Per launch: moe_fp4_up 59 us (16.6%), wq_b 40 (11.2%), in_proj 38 (10.8%), moe_fp4_down 38 (10.6%), wo_a 36 (10.1%), wo_b 35 (9.9%), dec_attn 22 (6.3%), hc_split 21 (6.0%), hc_stage_x 20 (5.7%), route 15 (4.1%), gate 14 (4.0%), hc_expand 5 (1.4%), 45 stray copies 175 us a step. Groups: attention projections 42%, MoE 27%, hc stages 13%, router 8%, attention core 6%, indexer 1.3%. 6 rows: span 26.1 ms; MoE 52% (up 231 us a launch, down 132), hc_split 62 us (8.8%), projections 25%. In the step the projections run 30-40% over their ubench (wo_a 36 against 22.2 us, wo_b 35 / 23.9, in_proj 38 / 24.9, wq_b 40 / 25.8), more than the scaling to stock busy explains; the MoE matches its ubench once scaled; wq_b on the 8 index-owner layers (2, 8, 14, 20, 24, 28, 32, 36) runs 46-55 us against 30-36. Standalone, not in the table: head 0.30-0.37 ms, Engram wkv 2 x 0.30-0.34 ms at 1 row. hc_split is a 4x4 Sinkhorn in one simdgroup, so its 21 us is launch and dependency latency; fusing it and gate+route went to an agent (perf/dsv41-hc-fuse).
2026-11-08, stack5 = stack4 + the piped tensor decode step (mlx-serve-pipe, d7c69c38; ~/bench/stack5-{kld,wide}, STACK5-OK; ~/bench/pipekld-*, PIPEKLD-OK). 16 captures with the prefix cache: 186.9 tok/s token-weighted over 4,122 tokens against stack4's 183.4 (+1.9%, inside the ~2.4% band; the pipe covers plain steps only), TTFT summed 259.4 s against 258.5, ~2.2x the STQ pack's ~85. API KLD read 0.0066 (code-sql 0.0077) against stack4's 0.0044, so the same binary ran KLD alone four times, pipe on / off / on / off: 0.0043 / 0.0046 / 0.0035 / 0.0044 (code-sql 0.0048 / 0.0043 / 0.0033 / 0.0054), top-1 0.9766-0.9844. The 2-prompt API KLD moves 0.0035-0.0066 run to run on one binary, so it separates nothing finer than ~0.003; the pipe is exact by its fixture and changes nothing measurable here. Kept as the base for the next levers.
2026-11-08, the full API KLD of the lossless TP4 stack (stack5, mlx-serve-pipe, studio1-4; all 16 teacher prompts to their end, KLD_LIMIT=0 KLD_ROWS=0 KLD_SECS=5400 (the 16 prompts took ~27 min), the fixture of the STQ and EXL3 rows; ~/bench/stack5-fullkld).0.0172 over 7,495 rows, top-1 0.9701, against STQ 1.75 0.1589 / 0.899, EXL3 2.25 0.1430 / 0.911 and EXL3 2.81 0.0688 / 0.939 (row 2026-11-06): 9x below the live pack. Per prompt: code-lru 0.0013, code-sql 0.0055, math-series 0.0010, math-probability 0.0052, reasoning-schedule 0.0050, reasoning-bridge 0.0070, design-ratelimit 0.0085, design-offline 0.0204, prose-lighthouse 0.0492, prose-sourdough 0.0520, multi-es 0.0429 (173 rows: the server ends it with an empty stop at row 173, the run's 3 null rows), multi-ja 0.0158, story-ferry 0.0522, story-robot 0.0211, agent-debug 0.0058, agent-plan 0.0156. Code, math and agent prompts sit at 0.001-0.016, prose and stories at 0.02-0.05: what remains is the FP8 attention carried as mxfp8 and the bf16 sums, on the open-ended text where the teacher's own distribution is flat. The window's follow-on replay of 207 failed on my CTX=131072 (207 is 137,266 tokens: HTTP 400 "Prompt exceeds maximum context"), not on the binary; the KLD finished before it.
2026-11-08, hc_split folded into the gate launch (STRML/mlx-serve perf/dsv41-hc-fuse 490c661d on stack5, DSV41_HC_FUSE: one more threadgroup a row on the gate GEMV runs hc_split.metal unchanged; bit-equal on x1, h, z, pre, post, comb, idx, wts at 1, 2, 6 and 16 rows, 96 of 96; M5 Max kernel-map fixture, one TP4 rank, layers 0-20, ctx 2048). Cross-process runs of the fixture are too noisy to bound anything (the same stock arm 5,360-5,786 us at 1 row), so the bound moved in-process: 128 interleaved pairs a process, paired-difference median, second arm minus first. A/A null +31..+80 us (6 processes, mean +58: the second arm reads slower even when identical); fused +39..+90 (mean +59), so +1 us against the null; hc_split removed outright -34..-5 us (mean -16), so 74 us, 1.4% of the 5.25 ms step, is all a zero-cost Sinkhorn could recover. 6 rows: every arm inside the null's ~±150 us. hc_split's grid is one 32-thread group a row, and DSV41_BENCH_HC saves 2-4 us a call by removing the launch at 1 and 6 rows: the labelled trace's 21 -> 62 us growth is how that trace attributes time, not kernel work. Gate+route dropped without building: a fused kernel still pays route's top-k latency, the fused split shows a launch at that point is worth ~0, and the plugin's AGENTS.md records a merged two-stage launch measuring slower. Dropped; the open lever there is a faster bit-equal route kernel.
2026-11-08, the kernel-map fixture on the M5 Ultra (diag/dsv41-kernel-map 147436922c built in ~/build/dsv41-kmap on studio1: one TP4 rank's decode step, sums stubbed, 384 experts, ctx 2048, stock MLX; layers 0-20 and 20-40 separately, since all 40 failed with Metal "Insufficient memory" beside the live server; two repeats; ~/bench/kmap-ultra, KMAP-OK). Median host step, 0-20 + 20-40: 1 row 3.86-3.95 + 3.97-3.99 = ~7.9 ms, 6 rows 8.52 + 8.55-8.58 = ~17.1 ms, against the M5 Max's 13.5 and 26.1 ms (Ultra ≈ 0.59x and 0.65x). The traces hold the 64 timed steps at ~430 ms of GPU busy, matching the host times, so the step is GPU-bound. Without head and Engram (~0.5 ms on the Ultra, scaled from the Max's ~0.9-1.0 ms), a rank computes ~8.4 ms of a piped plain token's ~9.9 ms (stack5, ~101 tok/s), leaving ~1.5 ms for the 80 sums, the remaining Engram gap and the host. kernel_map_trace.sh's empty extra array needs ${extra[@]+"${extra[@]}"} under the Studio's bash 3.2 with set -u, and trace-gpu-summary.py needs --process test for the fixture's traces.
2026-11-08, TP windows broke when the Studios got a console login, and hold_rank fixes them (bench/studio-cluster/tp-window.sh). After Sam logged in on all four (to stop audiomxd's no-user loop), every TP4 window failed at the join with [dist] rank N: no bell connection to rank 0 at ... (port + 1) on all three workers, for the stack5 binary that had joined all day and for the engram-early binary alike (~/bench/join-ab.sh, twice). Rank 0 was listening on both ports (lsof: *:port and *:port+1), Apple's python reached both from studio2, and a hand-started worker joined, from the Mac or from studio1 over the cable, Latch-launched rank 0 or not. The one difference: the window starts each worker as nohup ... & and the ssh session ends; a worker started that way by hand failed the same way, and one whose session stayed open joined. Likely macOS Local Network privacy, which applies once a console user exists and leaves a detached third-party process without an exempt parent; not proven. hold_rank keeps each rank's ssh session open for the server's life (the remote shell writes $$ to tp-window-r.pid and execs the server; restore closes the sessions), for both the tp and dist launch sites; the window also waits for rank 0's bell port. Third join run: TP-WINDOW-OK for both binaries, every worker ready (72836 MiB resident).
2026-11-08, Engram rows read at once and the Engram stage handed to the GPU early (STRML/mlx-serve perf/dsv41-engram-early bd33339d on stack5, DSV41_ENGRAM_EARLY: after the hash, one decode-width chunk reads both Engram layers' rows on GCD workers instead of a prefetch thread, and each Engram stage is submitted as soon as it is built, before the rest of its layer; it holds no collective, so every rank still enqueues collectives in the same order; outside the switch, a GCD item reading one row no longer advises the kernel about that row first; exact by two fixtures (one model, logits bit-equal on and off; four tensor ranks with Engram, same tokens, collectives, positions and caches); MLX_SERVE_DIAG=engram-laps on every rank; ~/bench/eearly-{warm,speed-*,replay-*,trace}, EEARLY-OK, after the hold_rank window fix). Plain decode on / off / on: 2k 104.6, 106.2 / 102.4, 102.1 / 105.4, 105.6 tok/s (+3.1%), 32k 103.7, 103.6 / 100.6, 100.7 / 103.4, 101.9 (+2.5%). DSpark captures, which the change does not reach: 207 225.7 / 231.8 / 231.4, 70 222.5 / 221.3 / 228.0, 54 255.8 / 258.7 / 258.0, the same hashes except 54's text in two arms. Laps, rank 0, us a step, on / off: readback to the GPU's next work 147 / 465 (L1 read 73 / 179, L1 wait 0 / 193; the first Engram layer's own build 40 / 451), host graph build of the rest 4,417 / 3,987 (it now runs while the GPU works), total 9,593 / 9,854; rank 1 the same shape (162 / 483). On the Studios' page-cached tables the row read is 73-227 us, not the SSD-bound worst case. Trace of a plain token with it on: busy 95.8% (stack5 92.6%), idle 104.5 ms over 4,349 ms against 267.4 over 4,400, gap median 0.410 ms. Kept: stack6 = stack5 + this. Every arm's captures read 4-9% above this morning's stack5 (54: 235-240 then, 256-259 now); the console logins (no audiomxd/configd core per box) and the unconditional advise drop are both new since, so a stack5 control on the same captures runs next.
2026-11-08, stack6 = stack5 + Engram rows early (mlx-serve-eearly, bd33339d), with a stack5 control after the console logins (~/bench/s5ctl-{speed,replay}, ~/bench/stack6-wide, STACK6-OK). Control, the stack5 binary now: plain 100.0 / 100.4 tok/s at 2k, 98.4 / 98.5 at 32k (row "piped tensor decode step": 100.8 and 97.9-98.9), captures 207 218.9, 70 214.3, 54 239.6 (this morning 217-222, 210-216, 235-240). The logins changed nothing measurable, so the 4-9% higher captures in every arm of the Engram-early A/B, DSV41_ENGRAM_EARLY=0 included, come from that binary: the part outside the switch is a GCD row read no longer advising the kernel about its own row, and DSpark verify rounds read Engram rows for every position they verify. stack6 over the 16 captures with the prefix cache: 192.1 tok/s token-weighted over 4,356 tokens (stack5 186.9), TTFT summed 262.2 s (259.4). Same-meter comparison: the live STQ box read 116.3 / 116.7 on these 16 captures (row 2026-11-06, EXL3 against STQ, w1), so stack6 is 1.65x the live box for one agent; the "~2.1-2.2x the STQ pack's ~85" in rows stack3, stack4 and stack5 divides by Sam's ~85 figure, a different measurement, not by the same captures.
2026-11-08, the live STQ pack on one Studio after the console logins (exl3-window-run.sh with REPLAY_ARMS="stq-a stq-b", no KLD; the window's own bc6c5f2c binary with the live sushi_ds41, live stopped and restored, health 200; excl-watch clean, 212 ticks; ~/bench/stq-today). 16 captures token-weighted 117.0 / 116.9 tok/s over 4,057 tokens, 0 errors, against 116.3 / 116.7 on 2026-11-06 (row "EXL3 2.25bpw on turboexl3_ds41 against the live STQ"): the logins (no audiomxd/configd core) moved the single-box path by under 1%. This is a different pack (1.75-bit) on a different machine count from the TP rows, so it is context, not a before/after for them.
2026-11-08, like-for-like before and after, TP2 and TP4, same day (~/bench/like-for-like.sh, LFL-OK; ~/bench/lfl-{tp4,tp2}-{before,after}-{speed,wide}; order TP4 after, TP4 before, TP2 before, TP2 after, each after a warm load). Before = mlx-serve-distn: upstream main 72e87026 plus only the commits that let --dist tensor run past two Macs, no speed lever, JACCL one-chunk buffers off. After = stack6 (mlx-serve-eearly) with them on. Same lossless pack, same Studios (TP2: studio1 + studio2).
TP2 before
TP2 after
TP4 before
TP4 after
plain decode, 2k (tok/s)
62.8 / 62.8
85.2 / 85.1
+36%
71.1 / 71.2
104.6 / 105.9
+48%
plain decode, 32k
61.9 / 61.8
83.4 / 83.5
+35%
70.1 / 70.1
104.0 / 104.1
+48%
16 agent captures, token-weighted
119.4
134.9
+13%
136.9
194.7
+42%
TTFT summed over the 16
292.0 s
292.5 s
257.7 s
257.3 s
No errors in any arm. TP2's agent number moves least: several levers pay only past a pair (the sharded draft, buffers sized for four ranks' sums), and the captures are acceptance-limited. "Before" at TP4 plain is 71.1 here, not the 81.8 of row "where a lossless TP4 decode token goes": that run's binary (mlx-serve-distn-fp4) already had the mxfp4 MoE on NAX, a lever. Chart: docs/img/tp4-lossless-20261108.png, from bench/studio-cluster/tp4-chart.py and docs/img/tp4-lossless-20261108.json.
2026-11-08, like-for-like serving capacity at TP4 (~/bench/lfl-cap.sh, LFLCAP-OK; ~/bench/lflcap-{after,before}; eight streams of 2,048 tokens at 2k, first-to-last window; same binaries as row "like-for-like before and after"). Plain: before 201.8 / 202.2 tok/s, after 219.9 / 218.6 (+8%). DSpark: before 233.0 / 222.9, after 239.6 / 240.4 (+3-8%). Per stream, plain 26.6-26.7 against 28.7-28.9. The levers cut single-stream overhead (host gaps, launches, the sums' hand-off), which eight batched streams already hide, so capacity moves little; the single-agent gain (+42%) is the story. The ~250 of row "stack4 serving capacity" and this ~240 are the same build family within the run-to-run band of DSpark text.
2026-11-06, EXL3 2.25bpw on turboexl3_ds41 against the live STQ 1.75bpw (bench/studio-live/exl3-window.sh, Latch, live stopped and restored each time, health 200). Pack: OpensourceWTF/DeepSeek-V4.1-Flash-1017-streaming-repack-exl3 branch 2.25bpw (8223e8b5, the a4k repack of turboderp's 2.25bpw branch, 74 files at the Hub's sizes, 336.6 GiB: experts.bin 136.0, Engram 188.8, trunk 11.8) in ~/models-exl3/. Plugin: CommunityServe/plugins main 203ed903 (PR 35), built against the bc6c5f2c kit by build-plugin-turboexl3-ds41.sh (tests exit 0; dylib turboexl3_ds41-t3a.dylib, sha256 bc1849cbf4d7ae8d4c3de7197adb7d5e833e70289a68ab91fdbb622ebf826649), same binary as live, both plugins in a throwaway HOME. On this box every expert stays resident (384/384 slot rows a layer, misses=0), RSS 134.7 GiB against STQ's 121.9; the calibrated bill is off (fitted to an M5 Max 128 GB); MLX_SERVE_DSV41_FRAC=on for the 2.5-bit layers 0-5 and 35-39.
STQ 1.75 (live: ANE shared, prefill k 5)
EXL3 2.25
API KLD to the FP8 teacher (16 prompts, 7,495 rows)
0.1589, top-1 0.899
0.1430 (-10%), top-1 0.911
Decode, 16 omp replays, token-weighted, w1 (arms a / b)
116.3 / 116.7 tok/s
88.4 / 94.2 (a's first request read 21.6)
DSpark accepted per round, w1
3.03 / 3.08
3.65 / 3.65
Cold prefill, the 3 uncached prompts, w1 b arms (223k / 230k / 76k)
2905 / 2971 / 3076 tok/s
2722 / 2688 / 2978 (-6% / -10% / -3%)
The prefix cache, over the same 16 replays (two omp conversations taking turns, 13 follow-on prompts):
Run
Follow-on prompts cached
Replay wall
STQ, w1
13 of 13
272-276 s
EXL3 plugin as merged, w1 (the harness's 3-token request after each pick)
0 of 13
1079-1106 s
EXL3 plugin as merged, w2, ds41-replay.py --no-flush
6 of 13 (picks 49, 63, 119, 147, 189, 203): every miss follows a switch of conversation
808 s
EXL3 with the fix (t3pc1), w3, flush on
13 of 13
314 s (not a clean speed number: the 2.81 download ran beside it)
Why: mlx-serve's deepseek_v41, which turboexl3_ds41 serves from, returns auxEnabled false for any streamed bank (!m.cfg.dsv41_streamed and m.bank == null and ..., from ddalcu/mlx-serve#996), so the engine's prefix cache is off (Hot prefix cache: requested capacity=32 but disabled by scheduler) and the model keeps one snapshot of its own, at the last prompt's end. Any other request replaces it: the replay's 3-token request after each pick (w1), or the other conversation (w2). PR 35's latency tables measured only "same prompt again", which that one slot serves. The fix (STRML/plugins fix/t3ds41-prefix-cache): the gate keeps out only a Thunderbolt pair, and the plugin wraps aux.begin_prompt so its drafter and request counters start at the restored boundary (the engine's module path never calls resume_prompt). w3 logs Hot prefix cache: ENABLED, 10 snapshots held 6.06 GB at the end. w4 (exl3-w4, 11:04-11:48, PREFIX_MEM 20GB, dylib turboexl3_ds41-t3pc1.dylib sha256 082130443c5f04f0adf2449e7e82cf00c1e7135448b3eff909dccccbca790b97): two flushed arms and one --no-flush arm of the fixed plugin hash identically on all 16 picks, and identically to w3, so the restore is deterministic and does not depend on what ran between turns. Against the cold w1 arms (0/13 hits, identical to each other) the fixed path matches at 10 of 16 picks; it differs at 77, 105, 147, 161, 189, 217, all restored picks. Legacy (w2 --no-flush) restored 6 picks and differs from cold at 189 and 203. Both paths restored at the same position at six picks (49, 63, 119, 147, 189, 203); their text matches at 49, 63 and 119 and differs at the other three. The snapshot behind each of those three was itself taken during a prefill the two paths ran differently (pick 147 restores at 106268, a boundary pick 133 wrote: legacy prefilled 133 cold from 0, the fix restored 133 at 95366 and prefilled the rest), so the state at that position was rounded through a different chunk grid. Copy rounds drafted the same counts on both paths at all six (e.g. 147: 4 rounds, 28 drafted), so the drafter history is not the difference. Read: the fix restores what it captured; restored text drifts from cold through prefill chunking, as legacy's does, which is the near-tie class of row 2026-10-30 (width A/B). Not shown: a logit-level comparison (KLD of restored against cold), which would put a number on it. Memory: the post-load clamp (hot_cache_plan.prefixCacheMemForLoad) counts MLX active memory, bank included, but on this box it never bit (w3 asked 64 GB and logged mem-cap=65536.0 MB), so a 128 GB machine with a streamed bank is untested. Speed in w4 is not clean (watch CONTAMINATED: another session's rsync of the STQ pack to studio2 ran from 11:17). As a cross-check only: decode mean 91.6-93.3 tok/s, w3's was 92.7; DSpark accepts per round over all 16 picks 3.63 (2.25) against w1 STQ's 3.03. EXL3 2.81bpw (branch 2.81bpw 7389b60e, same plugin): API KLD 0.0688 (top-1 0.9386, 7,495 rows) against 2.25's 0.1430 and STQ's 0.1589; all experts resident, RSS 173.4 GiB; 13/13 hits on both replay arms, which hash identically; 3.76 accepts per round; decode mean 93.4 and 95.8 tok/s (contaminated) against STQ's 121.7-122.4 in w1. Open: a clean speed window for 2.81 against STQ. Verdict so far: EXL3 2.25 is the better quant on our fixture (KLD -10%, a smaller gap than the cards' 0.0803 against 0.1576, which are on different prompt sets) and slower at decode (-20%) and cold prefill (-3 to -10%); with the fix the agent loop caches like STQ.
2026-11-08, the projections' in-step premium is not real (STRML/mlx-serve perf/dsv41-proj-premium, local, on bd33339d: a test-only probe before in_proj, wq_b, wo_a, wo_b in blockFused, and kernel-map arms run interleaved in rotated blocks; M5 Max, 1 row, TP4 widths, 994-1000 steps a phase; the GPU was shared with other sessions' tests and swap reached 56 GB, so figures hold to about 15%; A/A null 6-40 us a step). Method: launch each projection once more on a copy of its weights just before the real one; twin minus a copy-only control is what one cold projection costs inside the pipelined step. Against the 450 GB/s streaming floor for its own bytes: in_proj 11.4 MB, floor 25.4 us, in step 23.4-27.1; wq_b 10.8 MB, floor 24.0, in step 25-30 (96 experts) and 21-24 (384, 10th percentile); wq_b on the 8 index-owner layers 16.2 MB, floor 36.0, in step 31-48; wo_a 8.65 MB, floor 19.2, in step 18-26; wo_b 10.8 MB, floor 24.0, in step 22-28. Every projection runs at 75-100% of its read floor in the stock step; the 36-40 us of row "per-kernel map" come from the labelled build (inferred: its busy-time spread was not measured). The index-owner layers' slower wq_b is their 1.5x bytes. One extra dependent launch costs 0-6 us, matching row "hc_split folded into the gate launch". Warm weights help: a twin on the layer's own wq_b left the real launch 10-11 us faster. The one lever from that, reading wo_a's weights alongside attention: after fixing its dispatch order the read overlaps attention by about half, and pre:wo_a minus ctl:wo_a read +0 to +7 us a layer over 6 phases, never negative; full overlap would cap it at 8-10 us a layer and needs kernel-level work. Nothing built. Read: no single projection kernel is slow; each streams its weights near what one read of its size reaches. That is per kernel, not per token: a TP4 token reads ~3.3 GiB a rank, ~4.3 ms at 0.75-0.8 TB/s (row "the bytes a TP4 decode token reads"), against ~9.5 ms (stack6), so the token runs at ~45% of bandwidth. The other ~5 ms is latency spread over ~200 dependent kernels and the 80 sums; recovering it needs fewer kernels per layer and overlap across the sums, not a faster projection.
2026-11-08, where a TP4 rank's 1-row decode step spends its time beyond the bytes (STRML/mlx-serve diag/dsv41-latency-map d4e6bfde, kernel-map fixture with stand-in arms: each arm replaces one stage group with captured real outputs inside the stock pipelined step, rotated blocks against an A/A null; M5 Ultra studio1 beside the live server, 384 experts, 1 row, 720 steps a half; ~/build/latmap-20261108-172633, ~/bench/latmap-ultra.out). Step 3.80 + 3.85 = 7.65 ms for 40 layers against 3,480 MB = 4.35 ms at 0.8 TB/s (4.64 at 0.75): 3.3 ms beyond the bytes. Stand-in deltas over 40 layers, and beyond their bytes at 0.8 TB/s: projections 2.64 ms (bytes 2.19, beyond 0.46), MoE 2.55 (1.87, 0.69), router 0.82 (0.20, 0.62), hc stages 0.57 (0.10, 0.47), attention core + indexer 0.71 (KV only, 0.71), norms 0.06 (they live inside other launches), all small stages together 1.38 (parts 1.39). A/A null within ±60 us. One stand-in launch costs ~2.5 us a layer, so hc, proj and attention read short by that much. Two independent fixtures stepped together on two GPU streams (layers 20-40, 96 experts for memory): x2.02 of one, and x1.92 as whole graphs; 512 dependent tiny launches overlap on two streams (x1.01), so the GPU runs queues together, but MLX's encoder puts a buffer-wide barrier before every dependent dispatch and the decode chain never overlaps. M5 Max for comparison (agent run, ±15%): 13.1 ms against 7.7 ms of bytes at 450 GB/s. The FFN-segment spike (spike/dsv41-fused-ffn-segment 58f47749, M5 Max, layers 0-20): overlap through MLX's encoder (shared expert split or co-launched with top-k) saves 0-3 us a layer; one launch for hc mixes + Sinkhorn split + norm + gate + top-k (fin, error vs stock rel rms 0.8-2.6e-5, routes identical) 7 us; the MoE not waiting on the small stages (oracle, timing only) 20 us; the small stages removed (nopre, ceiling) 38 us. Read: the 3.3 ms is ~1.8 ms of small serial stages (attention core, router, hc) and ~1.15 ms of the big kernels short of bandwidth; removing all of it gives ~6.2 ms a token (+53%); only kernels that synchronize inside themselves, not MLX's encoder, can overlap across the chain's dependencies. The labelled per-kernel map did not run: the TP install's MLX is the patched 6c2b99e, not c69303b.
2026-11-08, Engram rows read at once (DSV41_ENGRAM_AT_ONCE, PR 11 candidate pr/dsv41-engram-early 0ca5dc05) on one Studio with EXL3 2.25bpw, on upstream main 07936b99 (ddalcu/mlx-serve#1131 merged) + CommunityServe/plugins#46 at 34f9573 (turboexl3_ds41 as a quant plugin; binary ~/opt/mlx-serve-c693/zig-out/bin/mlx-serve-main-pr11, dylib turboexl3_ds41-pr46.dylib; Latch pr11-exl3, live stopped and restored, health 200; ~/bench/pr11-exl3, PR11-DONE). KLD check 0.1430 over 7,495 rows, top-1 0.9110, the old plugin's number exactly, so plugins#46 loads the pack right. 16 captures with the prefix cache, arms interleaved on/off/on/off: token-weighted decode 90.3 / 90.4 tok/s on, 92.2 / 92.2 off (3,733 tokens each, same text in every arm, 0 errors): the switch is 2.0% slower on single-box EXL3, where DSpark verify chunks now read their Engram rows inline before layer 0 instead of on the prefetch thread. TTFT summed 1,031-1,034 s in every arm, against 314 s for the old plugin with our prefix fix (row "EXL3 with the fix (t3pc1)"): the serve log says Hot prefix cache: requested capacity=32 but disabled by scheduler. Cause: main's deepseek_v41auxEnabled still excludes every streamed bank (!dsv41_streamed and bank == null and ...), and since #1131 the EXL3 bank is deepseek_v41's own .outside bank, so the plugin-side fix no longer applies. Fix: ddalcu/mlx-serve#1117 rebased onto main (gate = no Thunderbolt pair and a bank that holds every expert in both phases). Read: PR 11 opens only with the switch restricted to plain 1-row steps.
2026-11-08, EXL3 2.25bpw with the prefix cache back, and Engram-at-once limited to 1-row steps (binary mlx-serve-main-combo sha256 5434023b = main 07936b99 + ddalcu/mlx-serve#1117 merged with main (3c9222a5, tree identical to a rebase that passed 255/0 deepseek_v41 tests) + ddalcu/mlx-serve#1149 at 54a1ac82; same dylib turboexl3_ds41-pr46.dylib as the row above; Latch combo-exl3, live stopped and restored, health 200, COMBO-DONE; ~/bench/combo-exl3). Every arm logs streamed experts, 384 prompt / 384 decode slot rows per layer and Hot prefix cache: ENABLED. 16 captures, arms on / off / on / off: TTFT summed 261.9 / 261.2 / 261.1 / 261.1 s, against 1,031-1,034 s without #1117 (and 314 s for the old plugin-side fix t3pc1); token-weighted decode 94.6 / 94.5 / 94.5 / 94.6 tok/s, 3,484 tokens in each, the same 16 hashes in all four arms, 0 errors. The restriction to 1-row steps takes the switch from -2.0% to neutral on DSpark agent decode. Decode is not comparable to the row above: the restored picks write different text (3,484 tokens against 3,733), as in row 2026-11-06. Not measured: plain single-Studio decode on this base, where the switch's 1-row path applies.
2026-11-08, fused decode segments step 0: the cost of a phase boundary inside one kernel on the M5 Ultra (STRML/mlx-serve perf/dsv41-fused-seg e9e3fa95, decode/seg_proto.zig probe kernels: 6-phase chains, each phase reading a rotated group's previous-phase word; MLX_SERVE_DIAG=dsv41-seg-probe, studio1 beside the live server, secops paused, Latch segp-ultra, ~/bench/segp-20261108-210622). Residency at 256 threads and 16 KB threadgroup memory a group: 384 groups in all four probes (the M5 Max moved 228-480 between runs on a shared GPU). Protocol tests 65 passed, 0 failed: 1,000 launches each of last-arriver, ordered tickets and spin (at 75% of 384) gave every phase all of the previous phase's writes, a dirty counter could not satisfy a wait, and a grid twice the residency ended with spin_timeout within 9-14 ms with or without 2 GB background reads (40,000 polls = 8.5-11 ms). Marginal us a boundary, median of 3 runs: groups 1: dispatch 3.1, last 1.7, ticket 1.2, spin 1.7; 96: 2.8 / 2.2 / 2.4 / 2.2; 192: 2.9 / 2.3 / 2.6 / 2.5; 384: 3.3 / 2.8 / 3.2 / 3.1; 480: 3.6 / 3.2 / 4.2 / all timed out; 768: 3.9 / 3.5 / 5.1 / all timed out. Spin held at the full probed grid on the Ultra (0 of 21 launches timed out at 384) but beats tickets by 0.1-0.2 us, under the plan's 1 us bar, so the default is ticket (last-arriver for serial stages, ordered tickets for wide phases). Precision: at 384 groups two runs agree within 0.1 us (dispatch 3.31 / 3.33, last 2.69 / 2.83, ticket 3.12 / 3.20, spin 3.04 / 3.09) and the third reads 1-2.5 us higher on every arm (5.65 / 5.34 / 4.98 / 4.07: the GPU was shared for a stretch, the live server ran beside it); ticket at 1 group read -0.14, so a single figure carries a few tenths of a us of error. The spin-ticket decision holds at that precision; last-arriver being ~0.5 us under a dispatch is near it. The phases are trivial, so a boundary between phases that carry real work may cost more. Read: a boundary inside a kernel costs about what a dispatch costs, within ~0.5 us; even 0.5 us over ~540 dispatches a token is ~0.27 ms (<3% of 9.5 ms), matching the earlier ~2.5 us a removed launch and fin's 7 us a layer, so fusing launches saves little by itself; a segment kernel pays only by letting the small stages run while weights stream. Multi-die visibility (e9e3fa95 -> 64c12adf, Latch segp-ultra2 and segp-ultra3, ~/bench/segp-20261108-213727 and the run after it). With the phase data in ordinary device loads and stores, the protocol's fences are not enough on the Ultra: in 8 of 8 runs a plain read after the boundary returned stale data, last-arriver and spin at launch 0 (1,360-8,320 of 589,824 and 64,912-80,912 of 442,368 words), tickets at launches 1-68 (96-2,656 words), with status ok and every arrival counted; every thread of a group read one constant value, as from a line cached in that group's L1. The M5 Max (one die) passed every arm. Reading the peer's output through a coherent(device) load (seg_read_peer_output), or an atomic load, passed 1,000 launches on all three protocols in all 8 runs. Cost, median of 7 runs at 384 groups, us a boundary: ticket plain 3.27, coherent 3.35, through the helper 3.34; spin 3.02 / 3.03 / 3.06; last-arriver 4.19 / 4.17 / 4.17; dispatch 3.27. Coherent reads cost nothing measurable at one word a thread (wide reads not measured). Read: every read of another threadgroup's phase output in a segment kernel goes through the coherent helper, or the kernel computes on stale data without any error; tickets stay the default (spin -0.2 us). Corrected 2026-11-09 (row "a plain cross-group store is read stale on the Ultra"): the writes must be coherent too; this probe's layout, 32 consecutive words a simdgroup, hid it.
2026-11-09, fused decode segments: a plain cross-group store is read stale on the Ultra even through a coherent load (STRML/mlx-serve fix/dsv41-seg-ffn-in-ultra 749a6703..e52c1c9e, squashed as c207a73b, on perf/dsv41-fused-seg as 9a41c186; studio1 beside the live server, Latch jobs, ~/bench/g12-20261108-233000, ~/bench/segdbg-20261109-000549, ~/bench/segfix-20261109-002140). Level 1 (DSV41_FUSED_SEG=1, one launch for the FFN's mixes, Sinkhorn split, norm, gate and top K) passed on the M5 Max and failed on the Ultra: 6 of 81 fused-seg tests (non-finite numerics, four ranks routing differently at index 2), kernel-map SEG-CHECK-FAIL with 20 of 20 route rows wrong and whole-step error 0.72 / 0.64 against stock's 0.033 / 0.052. Each group's own output was right; both last arrivers reduced stale data. Cause: the groups wrote their partials and router scores with plain device stores from lane 0 of each simdgroup; after seg_release (device fence + barrier) a peer's coherent(device) or atomic load still read the recycled buffer's previous bytes in 100 of 100 launches (all 50,000 parts words; logits[32] read 00000020 final 3f5efd34), while the final buffer matched the reference, so the stores were late, not lost. Coherent or atomic stores: 0 stale words. Padding a group's row to 32 words did not help. Ruled out: grid against arrival count (136 = 40 + 96), more than one last arriver, launch overlap (fails on a fresh state's first launch), the read path (SEG_COHERENT 1 on both machines), and MLX (the Mac is c69303b, both studio1 installs 6c2b99e; the failure follows the store mode within one build). The step-0 probe missed it because each simdgroup stored 32 consecutive aligned words; with a phase's words interleaved across groups its plain-store arms fail on the Ultra at launch 0 and pass on the M5 Max. Fix: seg_write_peer_output / seg_write_peer_f32 (coherent stores, atomic below MSL 3.2) for every word another group reads in the same launch, lint pins that forbid plain indexing of those buffers, probe arms in both layouts. After it, on the Ultra: fused-seg 80 passed, 0 failed; kernel-map halves SEG-CHECK-OK seg:1 three times each, 0 route rows differing. Read: on a multi-die Apple GPU both sides of a cross-threadgroup hand-off inside a kernel need coherent access, and a probe of such a pattern must interleave its writers within cache lines; a one-die Mac passes either way.
2026-11-09, fused decode segments level 2 loses on the M5 Max and the Ultra: the whole FFN of a one-row TP4 step as one persistent ticketed launch (STRML/mlx-serve perf/dsv41-fused-seg 51d8249f, DSV41_FUSED_SEG=2, decode/seg_ffn.zig + kernels/dec_seg_ffn.metal; 960 threadgroups of 256 at E 384: 136 entry + 72 shared up + 432 routed up + 320 down; M5 Max, shared GPU, DSV41_KMAP_AB="base/base/seg:1/seg:2/ffn:oracle/ffn:nopre" x3 a half, 288 steps, 1 row, 384 experts, TP 4, ctx 2048, 48 blocks a phase). Block-median us a step over 20 layers: seg:2 - seg:1 +477.5 / +467.5 / +524.5 (layers 0-20) and +518.0 / +538.5 / +552.0 (20-40); seg:2 - base +311..+402; A/A null +-37; ceiling (ffn:nopre - base) -730..-808; ffn:oracle -353..-403; seg:1 - base -136..-194 (level 1 recovers 18-27% of the ceiling). Level 2 loses to level 1 and to stock in all six phases. Phase attribution (stop:N arms): the MoE as one kernel costs ~87 us a layer (shared up 18, routed up 39, down 30) against ~62 us for the stock up_bw + down_bw, ~430-460 GB/s against ~590. More items a group was worse (4 and 8 column blocks an up item: +993 and +1747 us a step); removing the fences and weight-touch prefetch (timing only) saved 2-5 us a layer; coherent cross-group reads cost nothing measurable (staged = plain loads, direct coherent +2 us a layer at most). Suspected cause, not proven: one kernel holds its heaviest item's registers and threadgroup memory for every group, so the MoE items run fewer simdgroups than the 64-thread stock up kernel. Numerics: part rows bit-equal to moeFused on the same h2 and routes, entry phases bit-equal to level 1, 0 of 20 route rows differing, layers 20..23 decode median 1.002 of the chain's distance to the f32 model. Ultra (G(2).2, studio1 beside the live server, Latch g22-ultra, ~/bench/g22-20261109-023341, same binary, base/base/seg:1/seg:2 x3 a half, 192 steps, 48 blocks): SEG-CHECK-OK seg:2 in all six phases with the same differing-value counts and rel rms as seg:1 in every phase; seg:2 - base +1101 / +1085 / +1087 (layers 0-20) and +1039 / +1046 / +1019 (20-40) us a step, A/A null -11..+7: +52 us a layer, ~2.1 ms a 40-layer token, 2.5-3x the M5 Max's loss. Pending: a MoE-only persistent arm to split footprint from pattern, G(2).3.
2026-11-09, fused decode segments level 1 wins on the M5 Max and the Ultra: the FFN's small stages in one launch (STRML/mlx-serve perf/dsv41-fused-seg 7447034c + the coherent-store fix c207a73b, DSV41_FUSED_SEG=1, decode/seg_ffn_in.zig + kernels/dec_seg_ffn_in.metal: stream mixes, Sinkhorn split, rms norm, gate and top K as one last-arriver kernel of 40 mix + 96 router groups; 1 row, 384 experts, TP 4). M5 Max (G(1).1, shared GPU, base/base/seg:0/seg:1 x3 a half, 192 steps): seg:1 - seg:0 -62.5 / -123.5 / -141.5 (layers 0-20) and -144.5 / -138.0 / -117.5 (20-40) us a step, A/A null -45.5..+8.5. Ultra (G(1).2 rerun with the fix, studio1 beside the live server, Latch g22-ultra, ~/bench/g22-20261109-023341, base/base/seg:1/seg:2 x3 a half, 192 steps, 48 blocks): fused-seg tests 85 passed, 1 skipped, 0 failed (four ranks route bit for bit over 1,000 launches; the probe's 9 plain interleaved arms all fail there, so it still catches a stale cross-group read); seg:1 - base -223 / -221 / -216 (layers 0-20) and -219 / -213 / -207 (20-40) us a step, A/A null -11..+7: -10.8 us a layer, ~0.43 ms a 40-layer token (stock step 3.78 / 3.83 ms a half). Numerics: 0 of 20 route rows differing in every phase, largest weight difference 2.3-3.2e-7, rel rms 1.4-4.9e-5, whole step from the f32 model 3.209e-2 against stock 3.254e-2 (layers 0-20) and 5.205e-2 against 5.187e-2 (20-40). The spike's fin read 7 us a layer on the M5 Max; the Ultra gains more. Pending: G(1).3 on four Studios (plain decode 2k/32k, 16 agent requests, full API KLD).
2026-11-09, fused decode segments on the Ultra: the g2d seg:1 failure is rounding, and a MoE-only persistent kernel still loses on two dies (Latch g2e-ultra, ~/bench/g2e-20261109-081910, STRML/mlx-serve diag/dsv41-seg-l2-moeonly 4bde20a6: route flips print the h2 bf16 ulp gap, each path re-runs on its captured inputs, DSV41_KMAP_CHECK_GO keeps later arms going; kmap layers 0-20, base/base/seg:1/seg:2/seg:2m/seg:2c x3, 192 steps, two runs). g2d (~/bench/g2d-20261109-034044) failed SEG-CHECK-FAIL seg:1: route rows differ on layer 11 row 0. The kmap check replays the inputs of the last timed step, which ran under a different arm in g2d (seg:2c) than in g22 (seg:2), so the two runs checked different inputs. g2e: both runs byte-identical; every path repeats on its own inputs with 0 of 409,600 values differing (stock, seg:1, seg:2, seg:2m, seg:2c). On the flipping input fused h2 differs from stock in 30 of 5,120 elements (18 by one bf16 ulp, worst 2), the six picks are the same, weights move up to 1.79e-4 relative, rank 6-7 gap 5.2e-2 on both paths, whole step from the f32 model 3.209e-2 against stock 3.254e-2. The other two phases: 28 and 12 values differ, 0 route rows. Fix: the kmap route check takes 1e-3 relative weight drift with identical picks (perf/dsv41-fused-seg 8c25136b); kernel parity on the same h2 keeps 1e-6. Speed, us a step over 20 layers against base (three blocks): seg:1 -210 / -210 / -215; seg:2m (MoE-only persistent, 256 threads, staged) +485 / +531 / +453; seg:2 +1093 / +1078 / +1110; seg:2c (direct coherent reads across dies) +1531 / +1534 / +1559. Read: on two dies even a MoE-only persistent kernel loses ~24 us a layer, and reading peers directly costs the most, so Task 3 goes to 3a (attention small stages in level 1's shape); 3b's persistent attention segment has no measured path to a win.
2026-11-09, fused decode segments G(1).3 + G(2).3 on four Studios (Latch fseg-window B9CC1256-F7ED-401C-9B41-2EF75043C250, ~/bench/fseg-20261109-0837, STRML/mlx-serve perf/dsv41-fused-seg d8b237ca serving code, binary sha256 1929c368, --dist tensor --dist-size 4, lossless pack, FSEG-OK, live restored: health 200, runs 1). Plain decode, DECODE 512, arms in order 1 0 2 0 1, two requests each: level 1 at 2k 107.1 / 109.8 / 109.2 / 110.0 and at 32k 107.0 / 107.2 / 107.7 / 108.1 tok/s; level 0 at 2k 105.4 / 105.4 / 104.4 / 105.8 and at 32k 102.9 / 103.8 / 103.7 / 104.3; level 2 at 2k 82.2 / 82.2 and at 32k 80.7 / 81.0. Level 1 +3.6% at 2k (109.0 vs 105.3) and +3.7% at 32k (107.5 vs 103.7), matching the Ultra's -0.43 ms a token; level 2 -22%. Full API KLD (16 prompts, 7,495 rows, prefix cache on, 22,001 one-row forwards on rank 0 at level 1): level 1 0.0149, top-1 0.9706; level 0 0.0148, top-1 0.9717 (smoke at level 1, 2,400 rows: 0.0163). Every level-1 arm: load line on all four ranks, 0 declines, no rank latched stock. The 16 agent captures (DSpark on, prefix on): level 1 engages on 1 one-row forward a request (40 segment launches), because DSpark verify rounds are multi-row forwards, outside the 1-row scope. Decode on the six captures whose text matched across arms, level 1 / level 0: 35 186.2 / 192.5, 105 172.0 / 163.2, 133 240.1 / 240.2, 147 229.7 / 230.8, 189 298.2 / 298.9, 21 106.4 / 166.8 (second request after load, 13 vs 25 rounds; 7 and 21 at level 1 read cold). Read: level 1 buys ~4% of plain decode and nothing on the agent path; the agent number moves only through the multi-row verify forward. The window's speed summary printed empty (it greps *.txt; the arms wrote JSON); the numbers above are from each arm's request lines.
2026-11-09, time-map hypothesis 2, the verify's fixed premium: Metal System Trace of a DSpark round against a plain step on the same agent capture (four Studios, stack6 = mlx-serve-fseg with DSV41_FUSED_SEG=0, capture 91: 95,367-token prompt, greedy; TRACE_PICK=91, 20 s traces from 20 s, rank 0 on studio1; Latch verify-trace BA5FE59C-F727-480B-BDBD-1145A3A09648, ~/bench/verify-trace, VTRACE-OK, LIVE-WORK-OK; analysis vtrace-analyze 52F244A6, trace-gap-seq.py). DSpark: ttft 28.67 s, 1,128 tokens at 194.1 tok/s, 247 rounds, 3.57 accepted a round (234 stage, 13 copy rounds keeping 95 of 168 copy drafts). Plain: ttft 28.71 s, 1,254 tokens at 96.8 tok/s (different text: the multi-row verify and the 1-row step round differently, the known near-tie class). Whole window busy: DSpark 77.7% of 13.3 s, plain 89.1% of 20.1 s. Split at gaps over 1 ms, the DSpark decode is a repeating round: verify ~20.6 ms busy, idle ~1.6 ms, draft ~2.3 ms busy, idle ~1.6 ms (553 gaps over 1 ms against ~247 rounds, 2.2 a round, gap median 1.652 ms), so ~3.3 ms of each ~26 ms round (~13%) is the GPU waiting on the host. The plain path shows no such gaps (segments of 100-870 ms between the few over 1 ms; the piped step DSV41_TP_PIPE hides its host work). Read: the verify premium of the time map (1.8-2.9 ms a round, estimated) is two host round trips a round, after the verify (accepted count read back, draft graph built) and after the draft (draft tokens read back, verify graph built). Pipelining them the way the plain step is (draft tokens kept on the GPU as the verify's input, the next graph built while the GPU runs) is worth up to ~3 ms a round, about +10-13% agent decode. bench/studio-cluster/tp-window.sh gains TRACE_PICK for this.
2026-11-09, the DSpark pipe: draft and verify rung on the bells (STRML/mlx-serve perf/dsv41-dspark-pipe 93dc74c5 + cc058ae3, DSV41_DSPARK_PIPE, protocol 9; gate on studio3 175/48/0, the red check fails as designed; four Studios, Latch dspipe-window C0C451E8-2221-4817-BE4E-327C0E008451, ~/bench/dspipe-20261109-1326, DSPIPE-OK, LIVE-WORK-OK; 16 agent captures off / on / off, then a TRACE_PICK=91 trace with the pipe on). The replay is not repeatable on this stack: the two pipe-off arms of one binary hash differently at 9 of 16 picks (49, 77, 91, 105, 119, 161, 175, 203, 217), so the on arm's 8 differing hashes say nothing about exactness (the studio3 gate does). Decode on the 7 picks that hash identically in all three arms: off 212.0, on 214.1, off2 215.9 tok/s mean. Neutral. Trace against the verify-trace baseline (stack6, DSV41_FUSED_SEG=0): gaps over 1 ms 516 in 297 rounds (1.74 a round) against 553 in 247 (2.2), gap median 1.511 against 1.652 ms, busy 79.5% against 77.7% of the window. Some draft and verify segments now merge into 45-119 ms busy runs, but a 1.0-1.9 ms host wait a round survives, so the ~3 ms a round the time map priced is not realized. Not kept yet; the remaining sync is being traced (dist-ds-seq1ms.txt, dist-ds-seq01ms.txt in the window's trace/).
2026-11-09, round laps: where a DSpark round's host time goes at TP4 (STRML/mlx-serve diag/dsv41-round-laps 86745cc1 = the DSpark pipe cc058ae3 + MLX_SERVE_DIAG=dsv41-round-laps, rank 0 host microseconds per round stretch, one line per 32 rounds; studio3 test-box 65 passed, 1 skipped, 0 failed; four Studios, Latch laps-window 101F6130-B54E-467B-A471-3C0A8B31AFCB, ~/bench/laps-20261109-1421, LAPS-OK, LIVE-WORK-OK; 16 agent captures, pipe on then off). Medians over the lines after the first, us per drafted round, pipe on / off: draft build 202 / 463, draft wait 2,696 / 2,636, read+policy 61 / 60, verify lead 20 / 285, engram+layer0 1,061 / 1,064, build rest 12,964 / 13,221 (overlapped with the GPU), wait+read 3,678 / 3,788, finish 20 / 19. Copied rounds: 4 of every 32, verify 40,024 / 33,900 us each. The pipe's whole effect is ~0.5 ms a round (verify lead and draft build), which is why its window read neutral. What stays in the GPU's idle time between draft and verify is engram+layer0: 1.06 ms a round of Engram id hashing, prefetch and layer 0's build before anything reaches the GPU, ~4x the review's ~0.25 ms estimate of one layer's build (an estimate, not measured). Read (with the Fable 5.2 review, docs/2026-11-09-fable-52-review.md): handing layer 0 to the GPU before the Engram hash and prefetch is the next lever (~0.8 ms of a ~26 ms round, ~+3%); the verify-to-draft side is 0.38 ms without the GPU wake, so chaining the draft behind the verify waits until worker-rank marks price the wake. The fused-seg verify-width window (perf/dsv41-fused-seg-verify 39ee656c, fixed engagement report, fused-seg tests 98 passed, 1 skipped, 0 failed on studio4) was cancelled on the Fable 5.2 review's estimate that 157 of 708 verify forwards are 2-3 rows, worth about 0.2% on the agent set. That count is Fable's, from reading code only (the review ran nothing); it is not measured. What was measured fits it without confirming it: the laps run's [dspark-prof] lines read 4.69-5.44 drafts submitted a round over its first 48 rounds, so most verifies are 5-6 rows. The width histogram comes from dsv41-dspark-round-log (STRML/mlx-serve perf/dsv41-dspark-next d73db5cc) on the next window; the window reopens if that shows 2-3 row verifies are common, or if the R >= 4 route flip is fixed.
2026-11-09, correction to row "the bytes a TP4 decode token reads" (2026-11-07): 384 routed experts, not 256. The lossless pack's config.json on studio1 reads n_routed_experts 384, num_experts_per_tok 6, n_shared_experts 1; that row computed the routed read as 6/256. With 384, a row reads ~1.13 GB of routed experts a rank, ~1.4 ms at 0.8 TB/s, so expert bytes are ~58% of the verify's 2.45 ms a row slope, not ~86% as the Fable 5.2 review first said (docs/2026-11-09-fable-52-review.md, item 7, corrected). The per-token total of ~3.3-3.5 GB a rank still holds because the shared expert makes up the difference, but the ~230 tok/s plain bound leaves out the head and Engram; with both it is nearer 205-215 (Fable's estimate from code, not measured). About 1 ms of each verify row is therefore not bytes: per the review, ~0.4 ms of it shows in the single-rank Ultra kernel map and ~0.6 ms only at TP4; splitting that by kernel and by sum is the next measurement before building anything there.
2026-11-09, does forcing the verify width make TP4 replay repeatable? No (Fable 5.2 review item 5, first check; mlx-serve-laps = the DSpark pipe cc058ae3 + round-laps, pipe off, DSV41_DSPARK_ROWS=6; three identical arms on the 16 captures; four Studios, Latch det-window 1B370F97-5146-4C44-AA79-A7A1F45EE378, ~/bench/det-20261109-1442, DET-OK, LIVE-WORK-OK). Distinct output hashes per pick over the three arms: 7:3, 21:1, 35:1, 49:3, 63:2, 77:3, 91:3, 105:3, 119:3, 133:1, 147:2, 161:3, 175:3, 189:3, 203:3, 217:3. Only 3 of 16 picks repeat, against 7 of 16 in the unforced pipe-off arms of row "the DSpark pipe" today, and pick 7, the first request after each load (no clock state from an earlier request), differs in all three arms. So the policy's wall-clock inputs to the verify width are not the main source: the review's own caveat (kept counts parting through non-deterministic logits, the TP sums near ties, or the copy arm) is the live hypothesis. Forcing 6 rows makes it worse, which fits a numeric source exposed by more rows per verify. Next: the per-round log dsv41-dspark-round-log (STRML/mlx-serve perf/dsv41-dspark-next d73db5cc) on two off arms, to see whether rows, kept count or copy length part first, before trusting the fixed-clock switch to give repeatable A/Bs.
2026-11-09, Fable 5.2 review items 9, 4, 5 and 7 on four Studios (STRML/mlx-serve perf/dsv41-dspark-next 415ff1dc: 54a1ac82's verify Engram reads on the prefetch thread ported as c28f6861, DSV41_ENGRAM_LEAD ad4c5554, DSV41_DSPARK_FIXED_COST d73db5cc, worker laps 44fafa26, verify picks 66365fda; gates on studio3: dsv41 179 passed, 48 skipped, 0 failed, dsv41 engram early 62/1/0, bell 69/1/0; binary mlx-serve-next sha256 70391305b9d85827d0eb8251aeecc8f362354ead786900f8579118392e96088e; pipe off in every arm; Latch next-window 9496594C-4D2F-4972-959D-7ABABB4582B2 ~/bench/next-20261109-1541 and fixed-window 541A1591-3FD1-4B14-B3FE-5072B201D05A ~/bench/fixed-20261109-1624, both LIVE-WORK-OK; arms A default, B DSV41_ENGRAM_LEAD=0, A2 default).Engram off the verify's critical path: rank 0's engram+layer0 median falls from 1,064 us (row "round laps", pipe off) to 530-578 us with item 9 alone (B) and 144-147 us with item 9 + item 4 (A, A2): ~0.9 ms of host time a round the GPU no longer waits through. Decode, token-weighted over the 16 captures: clock free A 191.5 / B 192.4 / A2 189.3 tok/s; clock pinned (DSV41_DSPARK_FIXED_COST=12.2) A 196.5 / B 189.6 / A2 195.1; on the 4 picks that hash equal in all three pinned arms (21, 35, 119, 133) A 196.7 / B 194.9 / A2 195.6. The lead reads +0.5-3% over item 9 alone in the pinned window and nothing in the free one, so the gain is real in host time and within the arms' own spread in decode. Determinism (item 5): pinning the clock does not make replay repeat: A and A2 hash equal on 6 of 16 picks (7, 21, 35, 119, 133, 189). The per-round log (dsv41-dspark-round-log) shows where they part: free clock, request 1 round 6, same state and 5 drafts, A verifies 1 row and A2 2; pinned clock, round 3, same state, 4 rows against 3. With the clock out of the policy, what is left to pick the width is the draft's confidence values, so the draft logits themselves differ between runs at TP4 (a numeric source, the sums or a kernel's reduction order); that is the next thing to pin before replay A/Bs can be exact. Verify expert sharing (item 7): 27.2-31.7% of a verify's (row, expert) picks repeat an expert already read for another row of the same verify, rising with width: 2 rows 13%, 3 rows 21-29%, 4 rows 27-28%, 5 rows 30-32%, 6 rows 33-39%. Over the review's ~10% bar: a MoE kernel that reads a shared expert once per verify is worth a spec; at ~1.4 ms of expert bytes per verify row (row "384 routed experts"), dropping ~30% of them is ~0.4 ms per extra row, ~1.5 ms of a ~25 ms round (an estimate, not measured). Worker ranks ([worker-laps], rank 1): a verify's first hand-off to the GPU comes 157-350 us after its bell, the rest of its build 16-21 ms overlapped with the GPU; a draft runs 2.8 ms.
2026-11-09, why TP4 replay does not repeat: JACCL's reduce-scatter adds peers in arrival order (code read on STRML/mlx-serve perf/dsv41-dspark-next, confirmed at TP2; Latch tp2det-window C4FE6A41-E160-4189-B50C-D74E4139C03D on studio1+studio2, ~/bench/tp2det-*, mlx-serve-next, pipe off, DSV41_DSPARK_FIXED_COST=12.2, LIVE-WORK-OK). MLX's JACCL MeshGroup::all_reduce (lib/mlx-src/mlx/distributed/jaccl/lib/jaccl/mesh.cpp) reduces a message of up to 32 KiB, or on two ranks, on its fully connected path in rank order; a larger message on more than two ranks goes through all_reduce_scatter_gather, whose reduce-scatter adds each peer's chunk as its receive completes, and SumOp<bfloat16_t> rounds after each add, so the bits depend on arrival order (the ranks still agree with each other; two runs do not). A bf16 row at hidden 5120 is 10,240 B, so the plain step (1 row) and verifies of 2-3 rows stay on the ordered path, while the DSpark draft's 5-row stage sums, every verify of 4+ rows and every prefill take the arrival-order path. Two identical pinned-clock arms at TP2: 16 of 16 picks hash equal (against 6 of 16 at TP4 with the same binary and clock, row "Fable 5.2 review items 9, 4, 5 and 7"). Fix in the plugin, unbuilt in a window yet: DSV41_TP_SUM=gather (b5cb6504 + 217afa05) gathers the four parts and adds them as ((p0+p1)+p2)+p3 in f32 with one rounding, same link bytes as the ordered path at decode, ~2x the reduce-scatter's at prefill; its fixture test shows today's path giving 0 or 2^-7 by arrival order and gather 2^-7 every time. The upstream fix is a rank-ordered reduce-scatter in MLX. Next: a TP4 window with gather on two pinned arms (expect 16/16) plus dsv41-tp-sum-crc to show the non-gather pair first parting at a reduce-scatter sum, and gather's cost against today.
2026-11-09, verify MoE reads one expert once per row, not once per verify: the bound (STRML/mlx-serve perf/dsv41-dspark-next 217afa05, DSV41_DEC_UBENCH=1dsv41 dec moe_fp4: verify picks ubench, one Ultra, studio3, TP4 rank width 576, 80 cycled weight sets, peak streaming read 1,108 GB/s; spec docs/dsv41-verify-row-grouped-moe.md b9e99ab9). Up + down (hc 4) per MoE layer, BW kernels (live), with the duplicate share measured on the four Studios: R=2 74.5 us, R=3 96.2, R=4 116.4, R=5 151.0, R=6 165.6. Reading each distinct expert once could save at most 23.8 / 28.5 / 36.1 / 53.7 / 59.8 us (32 / 30 / 31 / 36 / 36%); the cache already absorbs 7.0 / 13.5 / 22.8 / 28.6 / 38.1 us of the duplicates (measured against all-distinct picks). Over 40 layers the bound at R=5-6 is ~2.1-2.4 ms a verify, ~8-10% of a ~25 ms round (an upper bound: distinct bytes at peak). Over the spec's 5% gate, so the row-grouped kernel is being built behind a kill switch, bitwise equal per row.
2026-11-09, DSV41_TP_SUM=gather makes TP4 replay repeat 16 of 16; the shared-expert verify kernel is dropped (STRML/mlx-serve perf/dsv41-dspark-next 217afa05, mlx-serve-gather on all four Studios, pipe off, DSV41_DSPARK_FIXED_COST=12.2, MLX_SERVE_DIAG=dsv41-tp-sum-crc,dsv41-dspark-round-log,dsv41-round-laps in every arm; Latch gather-window A3992001-DE67-46C7-AB0B-536CA9147396, ~/bench/gather-*, LIVE-WORK-OK). Arms G1, N1, G2, N2 (G = gather, N = today's sum): G1 and G2 hash equal on 16 of 16 picks, N1 and N2 on 5 of 16. So the fixed-order f32 sum removes the run-to-run difference completely, which closes the cause found at TP2 (row "why TP4 replay does not repeat"). Speed in this window is not usable: every arm decoded at 113-126 tok/s token-weighted (G 113.5 / 114.6, N 122.8 / 125.6) against ~190-196 in the windows before, because dsv41-tp-sum-crc keeps every sum's output and checksums it on the host; and its lines differ between G1 and G2 although all 16 outputs match (the N pair's first differing line is an r sum, as expected). The diag is sound: compared as multisets, 952 of G1's 960 lines also appear in G2. The other 8 are rounds the two arms ran differently, so they summed different rows: 7 where DSpark picked a different draft or verify width (e.g. at 6: … 5g×6 3g×80 in G1 against at 4: … 5g×6 1g×80 in G2), and the window's readiness probe ("Hi", max_tokens=1, temp 1), whose sampled drafts differ (4268 3 1 10257 36315 against 539 361 565 69 38577). Every greedy round of the same shape in both arms has identical sums. An index-by-index diff misaligns once one round differs, which is how the earlier "broken" read came about; to compare two runs, pin the clock, drop the probe's round and match lines by round shape. Gather's cost goes to a window without diags. Separately, the row-grouped verify MoE (b9e99ab9 spec, 81692d6b kernel, reverted in b49dc2ac): bitwise equal to the BW kernels (moe_fp4 68 passed, 2 skipped, 0 failed on studio3) but slower at every width, us per layer bw / rowgroup at the measured share: R=2 74.4 / 85.7, R=3 96.7 / 116.0, R=4 115.8 / 146.4, R=5 150.4 / 185.8, R=6 166.1 / 216.5 (shared picks 9-38% slower too). An owner simdgroup running every row serializes what BW spreads out, and BW is ~1.5x its byte floor even on disjoint picks, so the earlier "up to 36%" bound (against peak bandwidth) overstated the headroom: matching BW's own per-expert cost (179.9 us / 30 experts at R=5) at the measured 21 distinct experts gives at most ~24 us a layer, ~1 ms of a ~26 ms round, under 2% realistically. Dropped.
2026-11-09, what the gather sum costs at TP4 (STRML/mlx-serve perf/dsv41-dspark-next 217afa05, mlx-serve-gather on all four Studios, pipe off, no diags; Latch gspeed-window 4DC524E0-0B0F-4FDA-8FA3-4093E25995D0, ~/bench/gspeed-20261109-1805, GSPEED-OK). The 16 agent captures, token-weighted decode (total output tokens over total decode seconds):
Arm
Sum
Clock
Decode tok/s
ms a round
Tokens a round
Repeats
Nfree
auto (JACCL)
measured
194.1
24.11
4.68
Nfree = Npin on 7 of 16
Npin
auto (JACCL)
fixed 12.2
191.5
24.02
4.60
Gfree
gather
measured
175.6
26.04
4.57
Gfree = Gpin on 13 of 16
Gpin
gather
fixed 12.2
175.6
25.30
4.44
Gpin = Gpin2 on 16 of 16
Gpin2
gather
fixed 12.2
175.7
25.29
4.44
Gather costs 8.3% (pinned) to 9.5% (free) of decode, about 1.3-1.9 ms a round, with acceptance nearly unchanged, so the cost is the gather itself (every rank's part over the wire, then four adds in rank order). With the clock pinned it repeats 16 of 16 without the CRC diag and at the same speed both times; with the measured clock the DSpark policy still reshapes rounds (13 of 16). Verdict: not a default (the bar was < 2%); it stays the switch for exact A/Bs, read as relative numbers. Today's sum still repeats only 7 of 16 at TP4. A cheaper exact sum would need a fixed peer order inside JACCL's reduce-scatter.
2026-11-09, survey: an exact TP sum cheaper than gather (inference-perf-survey, scoped to collectives; report ~/.claude/tmp/perf-survey-det-allreduce.md). JACCL already has a rank-ordered all-reduce: MeshImpl::all_reduce in mlx/distributed/jaccl/lib/jaccl/mesh_impl.h (our pin c69303b and upstream main alike) copies rank 0's part and folds ranks 1..N-1 in order ("Fully connected all reduce with deterministic reduction order"). MeshGroup::all_reduce in mesh.cpp sends a wire chunk over 32 * 1024 bytes at 3+ ranks to all_reduce_scatter_gather instead, whose reduce-scatter folds peers in arrival order; decode messages stay under MESH_MULTI_WIRE_MIN_BYTES (512 KiB), so the cutoff applies to the whole message. Decode sums of 1-3 rows (≤30 KiB bf16) already take the ordered path; the 5-row draft (51 KiB) and 4-8 row verifies (≤80 KiB) do not. Leads, ranked:
Lead
Mechanism
Cost
Status
Raise the cutoff (JACCL_RS_MIN_BYTES, env, default 32 KiB)
decode sums all take the ordered fully connected path
one phase, full message on each link (~2x reduce-scatter+gather bytes at 4 ranks, the same wire bytes as gather); unknown whether that or the GPU add is gather's 1.3-1.9 ms
patched in a copy of the pinned JACCL; ~/bench/jaccl-cutoff.sh queued on studio1 (bf16/f32, 4 KiB-512 KiB, two arms twice)
Rank-ordered sum_scatter
receive completion only records arrival; fold peers 0..N-1 (own part at its rank, not as the seed) once all tiles land; optionally f32 accumulate, one downcast
reduce-scatter bytes kept; waits for the slowest peer's tile, no new memory (per-peer receive slots exist)
4-rank bitwise test across sizes straddling the cutoff, adversarial +B, -B, small inputs (vLLM's pattern)
test only
do with whichever lead ships
Not for us: ring or tree all-reduce (fixed order, but 2(N-1) serial hops at decode; MLX's ring backend is TCP); NCCL knobs (repeatable only for a fixed size and topology, NVIDIA/nccl#1975; SGLang found RCCL NCCL_ALGO=Ring NCCL_PROTO=Simple still not batch-invariant at TP4); exo and MLX have no determinism work; llama.cpp's tensor split is 2 ranks. vLLM's open vllm-project/vllm#56358 is our gather. The cutoff knob is a natural upstream PR to ml-explore/mlx once measured.
2026-11-09, the chained DSpark draft (DSV41_DSPARK_CHAIN) at TP4: exact, +0.7-1.7%, under the bar (STRML/mlx-serve perf/dsv41-dspark-next c3b63934, mlx-serve-chain sha256 0a67d42d on all four Studios, DSV41_TP_SUM=gather in every arm; Latch chain-window CBDCDAB1-31F7-4CAE-ABB3-B921A5B44098, ~/bench/chain-20261109-1907, CHAIN-OK; gate first: chain 62, commit-all 61, pipe 65, dist N-rank 76, draft shard 65, dsv41 184 passed, 0 failed, on studio4). The 16 captures, token-weighted:
Arm
Setting
Clock
Decode tok/s
ms a round
Tokens a round
Kpin
DSV41_DSPARK_COMMIT_ALL=1
fixed 12.2
174.0
25.40
4.42
Cpin
DSV41_DSPARK_CHAIN=1
fixed 12.2
176.2
25.08
4.42
Cpin2
DSV41_DSPARK_CHAIN=1
fixed 12.2
176.9
24.99
4.42
Kfree
DSV41_DSPARK_COMMIT_ALL=1
measured
176.9
26.00
4.60
Cfree
DSV41_DSPARK_CHAIN=1
measured
178.2
25.81
4.60
Hashes: Kpin = Cpin 16 of 16 (chain is bit-equal to commit-all, as built), Cpin = Cpin2 16 of 16, Kfree = Cfree 14 of 16 (the measured clock reshapes rounds). Gain: 0.32-0.41 ms a round pinned (+1.3-1.7%), +0.7% free. The ceiling explains it: a drafted round's engine plus draft build is ~0.5 ms (rank 0 laps, last request: engine 44-48 us, draft build 446-501 us), ~2% of a 25 ms round, and chaining recovered most of it. The laps file chained rounds under "copied" (Cpin: 31 of 32 rounds), so they cannot split a chained round by phase; fix that label before using laps on chain again. Verdict: below the 2% bar and it needs commit-all's numerics change, so it stays off by default. The verify (15-16 ms build rest plus 3-7 ms wait) is where the round's time goes.
2026-11-09, JACCL's ordered path against its reduce-scatter at decode sizes (MLX c69303b jaccl/lib with JACCL_RS_MIN_BYTES, default 32 KiB; jaccl_allreduce_bench sha256 d8f9b75f built on studio1 and run on all four Studios over the TB5 mesh, -w 50 -n 400 -c, every size check OK; Latch jaccl-cutoff, ~/bench/jaccl-cutoff-20261109-1948, JACCL-CUTOFF-OK).all_sum us, two runs each, rs32k = today, fc1m = JACCL_RS_MIN_BYTES=1048576 (the rank-ordered fully connected path up to 1 MiB):
Size
bf16 rs32k
bf16 fc1m
f32 rs32k
f32 fc1m
32 KiB
18.9 / 17.3
18.5 / 18.0
16.4 / 15.0
16.0 / 16.7
64 KiB
22.1 / 19.9
27.4 / 27.0
19.8 / 19.8
23.5 / 23.2
128 KiB
28.9 / 25.5
41.8 / 42.0
25.6 / 24.5
38.3 / 38.5
256 KiB
47.3 / 44.0
69.8 / 70.8
42.4 / 42.7
61.9 / 64.3
Below 32 KiB the two paths tie (they are the same path). At 51-80 KiB, the sizes the 5-row draft and 4-8 row verify sums send, the ordered path costs ~5-8 us more a sum; at ~86 such sums a round that is ~0.5-0.7 ms (~2%), against gather's measured 1.3-1.9 ms (row "what the gather sum costs"). So the cutoff knob is a cheaper exact sum than gather, but not free: the fully connected path puts the whole message on every link. The rank-ordered reduce-scatter lead (row "survey: an exact TP sum cheaper than gather") keeps reduce-scatter's latency and should cost ~0; both need a rebuilt libjaccl.dylib on the Studios (JACCL is its own library under lib/mlx/lib, and bench/studio-cluster/build-jaccl-ordered.sh installs only that one file). The patched source and bench script: ~/build/jaccl-src, ~/bench/jaccl-cutoff.sh on studio1. The knob duplicates JACCL_RSAG_MIN from bench/studio-cluster/jaccl-fit-patch.py, already in the bench MLX, whose end-to-end trial at 131,072 (row "comms H2", 2026-11-08) was dropped for no gain on 6-row verify sums; this microbench is consistent with that and adds the determinism reading.
2026-11-09, a rank-ordered reduce-scatter in JACCL (bench/studio-cluster/jaccl-ordered-patch.py, JACCL_ORDERED_RS=1, off unless set; tested as a standalone jaccl build on all four Studios: examples/order_test.cpp, ~/bench/jaccl-order-20261109-1954, JACCL-ORDER-OK).MeshImpl::sum_scatter now records each peer's tile as it lands and folds the tiles as ((r0 + r1) + r2) + r3, our own part staged per tile because callers may pass in aliasing out (the vLLM fix, vllm-project/vllm#57042, in JACCL's shape). The test fills adversarial bf16 parts (±256 plus small values), computes the ordered fold on every rank with JACCL's own SumOp, and compares bits on 200 calls a size, in place and out of place: stock differs on 200 of 200 at every size past 32 KiB (32,770 B to 1 MiB + 6) and on 0 at or under it; patched on 0 of 400 at every size. Cost, all_sum us stock / patched (two runs): bf16 64 KiB 20.3, 18.7 / 21.3, 19.4; 128 KiB 27.3, 24.8 / 28.9, 28.7; f32 64 KiB 19.1, 17.9 / 18.3, 18.9. About +1 us a sum at decode widths, ~0.1 ms a round, against gather's 1.3-1.9 ms. Next: ordered-window.sh (libjaccl rebuilt by build-jaccl-ordered.sh, backups libjaccl.dylib.bak-20261109-ordered on every rank) for 16/16 replays and the end-to-end cost.
2026-11-09, strategy review by Fable 5.2 (read-only, ~/.claude/tmp/fable-tp4-strategy-20261109.md) and the DSpark round log of the chain window's Kpin arm (commit-all, pinned clock, 16 captures, ~/bench/chain-20261109-1907/cap-Kpin/dist-ds-r0.log, 972 rounds). Round log: 822 stage rounds and 150 copy rounds; 4.34 tokens a round, 5.18 verify rows a round (0.84 tokens a verified row). Stage verify widths: 1 row 49, 2 rows 72, 3 rows 146, 4 rows 119, 5 rows 201, 6 rows 235. Full accept by width: 1 100%, 2 71%, 3 53%, 4 65%, 5 65%, 6 94%; every round under 6 rows is the policy cutting the 5-draft offer short, on low-confidence drafts, which the lower full-accept rates bear out. Verified but not kept: 0.50 rows a stage round, ~1.2 ms of a round at the 2.45 ms/row ladder. Copy rounds verify 10.1 rows and keep 6.4. Fable's read, with its numbers marked as estimates in the file: a round is ~16 ms fixed (1-row verify ~12, draft ~2.7, host ~1) and ~8.5 ms that grows with rows, so the ~250 tok/s target needs ~-6 ms a round and the levers on the board sum to ~205-225 tok/s; the 2026-11-09 "~58% of the per-row slope is expert bytes" is too high (the studio3 MoE ubench gives ~0.91 ms a row of MoE up+down over 40 layers, so non-MoE work is ~0.9 ms a row single-rank), and the "~0.6 ms only at TP4" is not shown to be TP (the kmap ran at 2k with no head, Engram or sums; plain decode itself loses ~4% from 2k to 320k). Its ranking: (1) a per-row map before any build (stand-in arms at R = 1, 4, 6 at two depths on one Ultra, and a four-Studio forced-width ladder DSV41_DSPARK_ROWS = 1, 2, 4, 6 at 2k and on a deep capture, pinned); (2) NAX multi-row projections only if R=5 minus R=1 of the projections is ≥ 1.0 ms a verify on the Ultra; (3) fused-seg level 1 on verifies ≥ 4 rows (~1.8%); (4) the policy's cost table from the measured ladder instead of GLM's scaled one, plus the round's fixed cost, priced offline (0-3%); (5) the draft's ~2.3 ms busy against ~1.1 ms of bytes. Structural 10%+: none survives the arithmetic (draft length is the pack's trained block; draft beside verify is byte-bound x2.02); the one place 10% could hide is verify-to-plain parity in the fixed cost (the ~2 ms verify premium plus time map item 3, the GPU-side hand-off). Also found: perf/dsv41-dspark-next lacks decode/seg_ffn_in.zig, so the agent binary has no fused-seg level 1 for its plain rounds; the backoff prices a plain step at the 1-row verify (12.2 ms) where the piped plain step is ~9.9 ms; and the tpSum comments said JACCL accumulates bf16 in f32 with one rounding, which is wrong (SumOp<bfloat16_t> rounds after each add; fixed in mlx-serve 5d9769ed and in row 2026-11-07 "the tensor-parallel sums").
2026-11-09, time-map hypothesis 4 (NAX for multi-row verify projections) killed at the napkin, on the projection ubenches (DSV41_DEC_UBENCH=1, dsv41 dec {wq_b,in_proj,wo_a}: ubench on perf/dsv41-dspark-next c3b63934, one Ultra, studio2, Latch proj-ubench, ~/bench/proj-ubench.out, each 61 passed, 0 failed). The ubenches run at full width (wq_b moves 43,253,760 B a call; the TP4 rank share is ~10.8 MB, time map section 3). us a layer at R = 1 / 2 / 4 / 6: wq_b 53.3 / 58.2 / 66.1 / 77.8 (76% / 70% / 61% / 52% of its byte floor), wq_b + index 61.9 / 66.4 / 78.8 / 98.5, in_proj 17.4-29.0 / 21.4-36.2 / 26.8-37.8 / 30.7-43.1 across its four layer kinds (62-72% of floor at R=1, 35-48% at R=6), wo_a 42.0 / 46.7 / 60.0 / 64.1 (77% to 51%). Per added row ~4.9 (wq_b), ~2.8 (in_proj), ~4.4 (wo_a) us a layer, so R=5 minus R=1 is ~48 us a layer, ~1.9 ms a verify over 40 layers at full width and ~0.5 ms at the TP4 rank share (est., ¼ the bytes; smaller widths may run less efficiently). Fable 5.2's bar was ≥ 1.0 ms a verify before building (row "strategy review"), and NAX would recover only part of the slope: not built. The forced-width ladder window (ladder2-window.sh) prices the whole per-row cost at TP4 directly.
2026-11-09, rank-ordered reduce-scatter end to end at TP4: exact and free (JACCL_ORDERED_RS=1, jaccl-ordered-patch.py v2, libjaccl sha256 a82a9722 on all four Studios via build-jaccl-ordered.sh, backups libjaccl.dylib.bak-20261109-ordered; mlx-serve-chain c3b63934, default sum, chain off; Latch ordered-v2, order test first (JACCL-ORDER-OK to 32 MiB) then ordered-window.sh, ~/bench/ordered-20261109-2003, ORDERED-OK, LIVE-WORK-OK). v1 hung the first prefill (JACCL work completion status 1 on an 8,192-row sum): its loop ended once every received tile was reduced, before its own sends past the pipeline depth went out; v2 keeps the loop running until every send is posted, and the order test now covers 4, 8 and 32 MiB (stock 200/200 differ, v2 0). The 16 captures, token-weighted:
Arm
Setting
Clock
Decode tok/s
ms a round
Tokens a round
Opin
ordered
fixed 12.2
195.8
23.67
4.64
Opin2
ordered
fixed 12.2
196.8
23.55
4.64
Npin
stock
fixed 12.2
188.9
23.82
4.50
Ofree
ordered
measured
195.7
24.26
4.75
Opin = Opin2 on 16 of 16 picks (stock pinned repeated 7 of 16 in row "what the gather sum costs"), Opin = Ofree on 15 of 16 (arrival order was most of the measured clock's drift too), Opin = Npin on 4 of 16 (different sum order, different text). Cost: none visible, 23.6 against 23.8 ms a round. Replaces DSV41_TP_SUM=gather (-8-9.5%) for exact A/Bs; bench/studio-cluster/tp-window.sh and the Studio's tp-window-sum.sh now set JACCL_ORDERED_RS=1 on every rank by default (JACCL_ORDERED=0 turns it off). Upstream candidate for ml-explore/mlx.
2026-11-09, stack7 validation and the serving layout (mlx-serve-stack7 sha256 15339cb0 = STRML/mlx-serve perf/dsv41-stack7 8abe83c0, the agent branch + fused-seg level 1, DSV41_FUSED_SEG=1, ordered sums by the harness default; gate on studio4: dsv41 214 passed / 52 skipped / 0 failed, dist N-rank 76, fused-seg 60; Latch stack7-window 166B47AE-B701-4F5F-89B3-054EA47EEA66, ~/bench/stack7-20261109-2059, STACK7-OK, every arm's output checked by hand). A, TP4: API KLD over all 7,495 rows 0.0147, top-1 0.9697 (fused-seg row's 0.0149; plan gate 0.0148 ± 0.002 met); the 16 captures, all present, 183.9 tok/s token-weighted, 26.47 ms a round, against 195.8 / 23.67 for the agent stack with ordered sums (row "rank-ordered reduce-scatter end to end"). On the picks with identical text it is 3-29% slower a round (21, 35, 63, 133), equal on the copy-heavy 189, and pick 105 read 55 ms a round; arm A ran its 7,495-row KLD right before the replay and Opin ran none, so fseg-ab-window.sh (fused-seg 1 / 0 / 1, no KLD) is separating the two. C, TP2 (studio1 + studio2), the 16 captures: 147.0 tok/s, 31.63 ms a round, TTFT summed 291 s. So TP4 is 1.25-1.33x a TP2 for one agent session, and two TP2 groups (disjoint boxes and cables) would carry ~294 tok/s across two. B and D (synthetic 2k / 32k prompts, DSpark on): TP2 solo decodes 186-199 tok/s on them, as fast as TP4, because those prompts accept like copy echoes; they do not separate layouts. Decision (Sam, 2026-11-09): serve TP4 now, add the router and 2x TP2 later if sessions waiting on each other's prefills hurts in practice.
2026-11-09, TP4 beta under Sam's 4-subagent omp load (stack7, ds41-beta.sh, :11234, --max-concurrent 4, temp 1.0, thinking high, DSpark on; recorder ~/bench/load-tp4-20261109.csv every 5 s from 21:57 to 22:41 when Sam stopped the run; bench/studio-cluster/load-summary.py). 37 min, 160 requests ok, 0 failed. Prompts median 87k tokens, 91% of prompt tokens from the prefix cache (15.0M prompt, 1.41M prefilled). 142 tok/s generated over the span. The batch splits on whether any request is prefilling:
Window
Aggregate decode tok/s
Per stream
Share of busy time
decode only, 4 running
209.3
52.3
10.3 min
decode only, 5 running
200.6
40.1
9.0 min
any prefill in flight
81.2
17.0 min (46%)
Per request (rank-0 log, 170 with 64+ generated tokens): decode median 60.2 tok/s, mean 74.7; uncached prefill median 2,143 tok/s (38 requests with 2k+ uncached). Prefill does not batch with decode, so a 2-10k-token cache-miss tail stalls every stream for its whole length: that is the lever (chunked prefill interleaved with decode) ahead of the router. Per-stream decode is also capped by batched DSpark's per-slot backoff (spec-stats: plain_ticks ~93% of rounds at acc_pos 0.94-0.97), fix on perf/dsv41-group-dspark-backoff 0f8d039f, gate queued on studio4. Caveat (found 04:10): every server tonight ran mlx-serve's default 2,048 MB hot prefix cache (the launchers passed no --prefix-cache-mem; STQ live runs 64 GB), so long agent conversations evicted each other; see row "the DS4.1 launchers' 2 GB hot cache".
2026-11-09/10, GoldenEye replay on the TP4 beta (Sam's 4 lanes replayed as 4 parallel omp -p --thinking high runs, replay.sh tp4, 23:00-00:21; recorder ~/bench/load-replay-tp4.csv, rank-0 log from line 78285; studio4 ran the single-core backoff test gate for the first ~5 min). 81 min, 279 requests ok, 2 cancelled, 0 failed; all 4 lanes rc=0 and wrote a game. Prompts grew to a median 165k tokens; 97% of prompt tokens came from the prefix cache (46.5M prompt, 1.47M prefilled). 152 tok/s generated over the span.
Window
Aggregate decode tok/s
Per stream
Time
decode only, 4 running
194.9
48.7
33.3 min
decode only, 3 running
184.0
61.3
16.0 min
decode only, 2 running
156.8
78.4
5.5 min
decode only, 1 running
125.1
125.1
2.9 min
any prefill in flight
93.6
20.6 min (26% of busy)
Per request (280 with 64+ generated tokens): decode median 92.8 tok/s, mean 101.3; uncached prefill median 1,979 tok/s (97 requests with 2k+ uncached). The cold start (4 x 38.6k uncached prompts at 2,394 tok/s, serial) stalled every stream for ~65 s. Lane wall times (mostly what each lane chose to write, one run at temp 1.0): Dam 60.0 min, Aztec 69.2, Archives 77.5, Facility 81.1. TTFT not separable for this window (histogram not snapshotted at the start); the 2x TP2 run snapshots it. Caveat (found 04:10): every server tonight ran mlx-serve's default 2,048 MB hot prefix cache (the launchers passed no --prefix-cache-mem; STQ live runs 64 GB), so long agent conversations evicted each other; see row "the DS4.1 launchers' 2 GB hot cache".
2026-11-10, the same GoldenEye replay on 2x TP2 behind the sticky router (ds41-tp2x2.sh up: group A studio1+2 on 127.0.0.1:11301, group B studio3+4 on 10.254.13.3:11302, stack7, same flags as the TP4 beta; router ds41-router.py, least-loaded for a new conversation then sticky; replay.sh tp2x2, 00:25-01:58; tp2x2-measure.sh, ~/bench/tp2x2-replay; the backoff binary's build ran on studio1 until 00:24, before the start). The router put 2 lanes on each group (2 in flight on A and on B after the first requests). 575 requests ok (A 310, B 265), 1 cancelled, 0 failed; all 4 lanes rc=0 and wrote a game. 96-99% of prompt tokens from cache; prompts a median 195k (A) and 219k (B) tokens.
TP4 (row above)
2x TP2, both groups
generated, tok/s over the span
152 (741k in 81.3 min)
176 (979k in 92.7 min)
aggregate while busy
160.7
183.2
decode only, all lanes running
194.9 (4 running, 48.7 a stream)
211.9 (2 a group, A 62.8 / B 60.4 a stream)
while a prefill runs
93.6 (26% of busy, everyone stalls)
140.2 (the other group keeps decoding)
per request decode, median
92.8
A 111.1, B 98.6
uncached prefill, median
1,979 tok/s
A 1,655, B 1,640
TTFT mean
not snapshotted
A 1.78 s (310), B 5.52 s (265; B prefilled 2.20M tokens against A's 0.80M)
Lane wall times, one run each at temp 1.0 (what each lane wrote moves them more than the layout): Facility 55.6 min (TP4 81.1), Dam 78.7 (60.0), Archives 78.9 (77.5), Aztec 92.4 (69.2). The lanes wrote 32% more tokens on this run. Reading: 2x TP2 carries +16% generated tokens a second over the span for these 4 agents (+14% while busy, +9% decode-only, +50% while a prefill runs), because a cache-miss prefill stalls only its own group; per stream it is faster too (60-63 against 48.7 tok/s at full load), while a single stream alone is slower (93-98 against TP4's 125 tok/s, 1 running). TP2 prefill is 16% slower per request, so a lone session's TTFT on a cold prompt is worse on TP2. Confounded (found 04:10): each TP2 group had its own 2 GB hot cache for 2 lanes, so the 4 lanes had twice the cache TP4 gave them (row "the DS4.1 launchers' 2 GB hot cache"); 2x TP2 also prefilled more in total (3.0M against 1.47M uncached tokens) on longer prompts, so the cache's net direction on the +16% is unclear. What stands without the cache: decode-only +9%, and the other group decoding through a prefill (+50%). Rerun both layouts at equal, adequate cache before choosing a layout on this row.
2026-11-10, quality at TP2: full API KLD on studio1 + studio2 (kld-tp2-window.sh through Latch on studio1, group A stopped and B serving through the router meanwhile; tp-window-sum.sh dist-ds arm with stack7's A-tp4 flags: fused-seg, prefix cache, ctx 393216, KLD only; ~/bench/kld-tp2-kyNagI, KLD-TP2-OK, 7 min). ALL rows 7,495, mean KLD to EOS 0.0138, top-1 0.9732, unmatched 0, null rows 3, against TP4's 0.0147 / 0.9697 (row "stack7 validation"). The two differ only in reduction order (2 partial sums against 4) and sit inside the plan gate's 0.0148 ± 0.002: TP2 loses nothing. The 8 games from the two replays (self-check screenshots in /private/tmp/claude/goldeneye64-{tp4,tp2x2}/*/shot.png) all render a complete title screen with HUD, weapon, objective and controls; the differences (layout, palette, panel overlap on both sides) are what temp-1.0 sampling varies, not the layout.
2026-11-10, the DS4.1 launchers' 2 GB hot cache: long agent sessions evict each other (found in the backoff replay below; ds41-beta.sh, ds41-group.sh passed no --prefix-cache-mem, so mlx-serve's default 2,048 MB applied; rank-0 log [hot-cache] resident=2001.98 / 2048.00 MB (3/32 entries)). One conversation's entry on a TP4 rank 0 is 0.67-0.83 GB at 195-228k tokens (TP2 rank: 1.04 GB at ~200k), so 4 agents past ~180k tokens no longer fit, and LRU evicts the conversation that is next to come back. In the backoff replay's last 30 min (lanes at 200-276k tokens) two lanes re-prefilled their whole prompt every turn (210,336, 212,653, 226,535, 227,806, 275,783 tokens, uncached, ~2,000 tok/s, so ~2 min a turn with every stream stalled): 3.4M tokens prefilled and 24k generated in those 30 min. Fix, this commit: --prefix-cache-mem ${PREFIX_MEM:-32GB} in ds41-beta.sh and ds41-group.sh (393k ctx: 4 conversations x tip + 3 ladder checkpoints x ~1.4 GB), install-ds41-group.sh 32 -> 64 GB (974,848 ctx, ~3.6 GB an entry); TP4 rank 0 holds ~85 GB, a TP2 rank 0 ~156 GB, so both fit in 256. The morning TP4 beta (stack7) runs with 32 GB.
2026-11-10, per-group DSpark backoff on the TP4 beta, the same GoldenEye replay (mlx-serve-backoff sha256 51abf4c0 = STRML/mlx-serve perf/dsv41-group-dspark-backoff 0f8d039f, built by build-backoff.sh; gate on studio4 BACKOFF-GATE-OK: dspark group backoff 65, group tokens 61, dspark 88 / 2 skipped, dsv41 214 / 52 skipped, 0 failed; replay 02:09, stopped at 03:40 once the 2 GB cache thrash above dominated; only the first 72 min used: CSV --to 1794298835, log cut before the first uncached 150k+ prompt).Inconclusive: one run an arm, temp 1.0, different content per phase, a different binary per arm.
TP4, same 4 lanes
stack7 (per-slot backoff, row "GoldenEye replay on the TP4 beta")
backoff (per group), first 72 min
decode only, 4 running
194.9 tok/s, 48.7 a stream (33.3 min)
198.1 tok/s, 49.5 a stream (52.4 min), +1.6%
accepted draft tokens / generated
28.4%
35.6%
plain ticks
84% of group rounds
55% of group rounds (279,626 / 504,626)
requests
279 ok, 0 failed
334 ok, 0 failed
The group backoff drafts and accepts about a quarter more, but at 4 streams the extra verify rows cost nearly what the accepted tokens save, so the aggregate moves +1.6%. The fair A/B is one binary with DSV41_DSPARK_GROUP_BACKOFF=slot against the default, arms interleaved, at an adequate cache. Not deployed: the morning beta is stack7.
2026-11-10, the TP4 beta (stack7) at a 32 GB hot cache, the same GoldenEye replay (ds41-beta.sh with --prefix-cache-mem 32GB, replay.sh tp4-cache32, 04:16-06:06; recorder ~/bench/load-replay-tp4-cache32.csv, rank-0 log from line 404156, TTFT from /metrics.json snapshots). 113.5 min, 550 requests ok, 2 cancelled, 0 failed; all 4 lanes rc=0 and wrote a game (Archives 80.4 min, Facility 93.1, Aztec 96.3, Dam 113.3). The lanes wrote 1.016M tokens (37% more than the 2 GB TP4 run) on prompts a median 192k tokens (165k there).
TP4 stack7
2 GB hot cache (row "GoldenEye replay on the TP4 beta")
32 GB hot cache
uncached share of prompt tokens
3.2% (1.47M of 46.5M)
1.6% (1.63M of 103.2M)
prefill in flight, share of busy
26%
23%
decode only, 4 running
194.9, 48.7 a stream
189.7, 47.4 a stream (longer contexts)
generated over the span
152 tok/s
149 tok/s (12.9 min of 1-stream tail)
TTFT mean
not snapshotted
2.30 s over 550
accepted draft tokens / generated
28.4%
29.2%
The cache works as sized: half the uncached share on prompts 16% longer, and no eviction forced by bytes (over the whole run: 520 "module ladder thinned", 1 "count cap", 0 "byte budget"). Two new findings. The 32-entry default cap became the limit by the end (resident=17878.40 / 32768.00 MB (32/32 entries), and that 1 count-cap eviction): the beta and group launchers now also pass --prefix-cache-entries ${PREFIX_ENTRIES:-128}; the root helper studio-daemon does not allow that flag yet (line 145 lists only --prefix-cache-mem), so the daemons need it added before install. Worker memory grew too (studio2 89 -> 103 GB by top, 04:43 to 06:06, while rank 0's gauge went 76.5 -> 99.6 GB), but contexts grew from ~40k to ~200k tokens over the same time and workers print no hot-cache lines, so a worker's cached-prefix share is not separated from its active KV; size the daemons as if every rank holds the budget. The stack7 accepted-draft share held at 28.4% / 29.2% across two runs, which makes the backoff run's 35.6% (row above) a real change in drafting, if not in throughput.
2026-11-10, what the TP4 beta still prefills at a 32 GB hot cache (same run as row "the TP4 beta (stack7) at a 32 GB hot cache", 552 request lines from rank-0 log line 404156). Full misses (0 cached): 5 requests (the 4 cold starts and 1 more), 0.22M tokens, 1.3 min of prefill. New tails after a cached prefix: 547 requests, 1.42M tokens, 13.6 min (median 866 tokens, p90 4,064), at about 1,740 tok/s against 190k-token contexts. A bigger cache cannot shorten the slow-decode stretches any further: 91% of the remaining prefill time is new tokens each agent turn appends. What is left: the decode share (the launchers now pass --prefill-decode-share ${PREFILL_SHARE:-0.5}, the value the Studio served from 2026-09-26, docs/studio-bench.md "That policy is now a flag": zero-sum, it moves wait from the streaming agents to the one prefilling; mlx-serve's default is 0.25), 2x TP2 (a tail stalls only its group, https://github.com/STRML/local-llm/issues/57), and faster tail prefill at long context (https://github.com/STRML/local-llm/issues/22).
2026-11-10, does the KLD gap matter for agent work? One fresh omp task (a single-file WebGL voxel pagoda), lossless TP2 (group B, stack7, DSpark on) against EXL3 2.81bpw (turboexl3_ds41-t3pc1, studio1) and Sushi-STQ 1.75bpw (sushi_ds41-q, studio2), 4 lanes an arm a round, graded by bench/quality/pagoda-grade.py (headless render, blank-frame check). Rounds r1-r6 ran omp's DS4.1 provider with reasoningEffortMap high: xhigh, which mlx-serve maps to the template's budget 100 (max).
round
setup
lossless clean
exl3 clean
stq clean
r1, r2
max_tokens 32,768, 2 h, spec decode on
8/8
0/8 (1 black frame)
0/8 (1 black frame)
r4 (stopped 13:15)
quants spec decode off, 32,768
0/4
0/4
r5 (stopped 13:15)
lossless, 32,768
0/4 (stopped at ~25 min)
r6 (stopped 14:20; exl3 13:59)
max_tokens 131,072, quants spec off
2/4
0/4
0/4
r7
effort 75 (production since 2026-11-10), max_tokens 262,144, stq --top-p 0.95 on studio1+2 behind a router (2 lanes a box), spec decode on
4/4 (1 finished, 3 polishing at the 2 h limit)
4/4 (all finished, 81-120 min)
What separates the arms at 32k: every arm hits the reply cap while planning; omp resends the same context, so each long reply is a fresh draw. Long replies (>= 8k tokens) that closed thinking and acted: lossless 22/43, exl3 1/22, stq 3/31. Cut-off quant thinking is coherent (zlib ~0.40, repeated 8-grams 0.000, hedge words per 1k words equal across arms), so the quants plan, they do not loop. Spec decode off did not change it (r4: 4/4 long replies cut). Uncapped (r6) both packs plan 55-72k tokens before acting; one stq lane spent all 131,072 tokens writing the program inside its thinking (53 js blocks). Caveats: effort 100 throughout r1-r6; quant lanes share one serially interleaving decoder (4 lanes a box), lossless decodes batched; the exl3 plugin predates upstream's patch-free turboexl3_ds41 (CommunityServe/plugins PR 46). r7 settles it: at production settings both packs build good pagodas (contact sheet /private/tmp/claude/pagoda/r7; one stq lane first drew a wire-frame pagoda and fixed it). What the KLD gap costs is time and richness, not success: first plans ran lossless 45-59k tokens, stq 100-162k; lossless scenes are fuller (108k-427k voxels, cherry trees, walls, banners) than stq's (51k-94k visible). r1-r6's 0/32 for the quants was the 32k reply cap plus effort 100 (omp's reasoningEffortMap high: xhigh, now removed), not inability.
2026-11-10, stack8 (stack7's 71 commits rebased on upstream ddalcu/mlx-serve main 9191fbdf) validated and live (mlx-serve-stack8 sha256 9d2d85e7 = STRML/mlx-serve perf/dsv41-stack8 71b08058 + 3 merge fixes, uncommitted at the time: ENGRAM_EARLY reader renamed engramEarlyOn, stashChain's readDrafts call, an engram test on the new Prefetch.take, and plugin.zig skipping the fused Markov warm under draft_shard; bench/studio-cluster/stack-window.sh through Latch on studio1, ~/bench/stack8-x20UNL, STACK8-OK; bench/quality/stack-cutover.sh, CUTOVER-OK). Gates on studio1: dsv41 274 passed / 55 skipped / 0 failed, dist 117 / 3 / 0, fused-seg 60. The first build passed every gate and still failed to load the real pack (error: deepseek_v41: load failed: MarkovShape): upstream's plugin load (PR 1131) warms the fused Markov chain, whose shape check cannot hold on a rank that keeps only its vocab slice of the Markov head; the gates' fixtures never load a real Markov head, so a real-pack load belongs on the gate list. A, TP4, same arm as stack7's row: API KLD over all 7,495 rows 0.0147, top-1 0.9697 (stack7 0.0147 / 0.9697: identical); the 16 captures, all present, 198.3 tok/s token-weighted, 24.61 ms a round (stack7 183.9 / 26.47: +7.8%). Same harness and order as stack7 (KLD right before the replay), one run. The beta came up on stack8 at 17:06 with --ctx-size 1048576; a 558,045-token prompt prefilled in 273 s (stack7: 297 s).
2026-11-10, ARC + SSD feed live on the lossless pack (mlx-serve-arc sha256 fb1fb996 = STRML/mlx-serve feat/prefix-cache-arc off upstream main 9191fbdf, uncommitted at the time; TP2 group C on studio3+4, --prefix-cache-mem 8GB --prefix-cache-disk 64GB --prefix-cache-disk-write-max 500 --shutdown-persist-secs 60; bench/studio-cluster/cache-feed-live-test.sh + cache-feed-turn.py, LIVE-TEST-DONE; the TP4 beta stopped 17:47-17:53). A 3-turn conversation (41k tokens): turn 1 cold 41,231 tokens in 12.4 s, SSD tier +4 KB (nothing written while serving); turn 2 41,230 / 41,253 cached from RAM, SSD +4 KB; after 75 s idle the feed wrote turn 2's tip (+132 MB, one record); SIGTERM persisted 0 (already on disk); restart, turn 3 41,252 / 41,275 cached from the SSD record ([hot-cache] module restored source=disk), 1.2 s against 12.4 s cold. So: no SSD writes per turn, the cold MFU tip written once by the feed, and it survives a restart. Module snapshots and the SSD tier work under --dist tensor (TP2) on upstream main.
2026-11-10, EXL3 2.81 expert-placement split priced with a stand-in: not worth building (CommunityServe plugins diag/exl3-expert-split-probe from origin/main cfc3704, a38ce14: TURBOEXL3_DS41_DIAG_OWN=r/N makes the decode lane route, read, read ahead and multiply only the picks with expert % N == r, the rest dropped; dylib sha256 e14b442e, own tests 4/4 and the plugin suite 22/22 on studio1; mlx-serve-stack8, one box (studio1), Latch own-probe F9D651F6, ~/bench/own-probe-20261110-1908, TP4 beta stopped 19:08 and restored by the window's trap). Plain 1-row decode, --no-mtp, 2k prompt, 256 tokens, 3 reps: 0/1 33.6 / 32.8 / - tok/s, 0/2 36.4 / 36.5, 0/4 38.3 / 38.3. Dropping half the routed experts buys 1.11x and three quarters 1.17x, before any cross-box sum; the step is ~30 ms and dropping three quarters of the routed experts saved ~4 ms (all of them would be ~5 ms), so the trunk (attention, shared expert, head) is what a TP1 EXL3 step spends its time on, and expert placement replicates exactly that part. Ceiling at TP4 ~1.15x after ~40 sums of ~18 us, against the plan's gate of ~2x: not built. The DSpark arms (0/2 and 0/4 ~158-160 tok/s against 0/1's 49 then 94) are not comparable: with experts dropped the output is wrong and accepts differently. Read: for EXL3 the lever is the trunk, which only a split of attention and the shared expert (blocked upstream by Dsv41TpOutsideQuant) or faster EXL3 trunk kernels reach; TP1 EXL3 at ~33 tok/s plain is under STQ's 69, so the speed gap to check next is the trunk kernels, not the network.
2026-11-10, EXL3 2.81 plain 1-row decode is ~33 tok/s on every build (bench/studio-cluster/exl3-plain-control.sh, studio1, ~/bench/exl3ctl-20261110-1923, EXL3CTL-OK, TP4 beta stopped 19:23 and back 19:27:54; --no-drafter --no-pld --no-mtp, 2k x 256 x 3). probe dylib at 0/1 33.46 / 32.87 / 33.03; probe dylib, switch unset 33.44 / 32.87 / 33.01; upstream PR 46 dylib (ddd6ec67) on stack8 33.42 / 32.73 / 32.97; PR 46 on mlx-serve-main-combo (5434023b, main 07936b99 + PR 1117) 33.28 / 32.90 / 33.00. Neither the probe's filter path nor stack8 costs anything; the expert-split row above stands. Every arm: 384 / 384 decode slot rows, 330-383 resident rows seeded. The agent figure (94.6 tok/s, row "EXL3 2.25bpw with the prefix cache back") is DSpark decode on 2.25bpw, not plain.
2026-11-10, many omp sessions at once on the lossless TP4 beta (bench/studio-cluster/agent-load.py via agent-load-sweep.sh, stack8, --max-concurrent 4, live :11234, ~/bench/al-tp4-mc4; each worker a separate subagent: the longest transcript of capture session e34362 played as a growing conversation from turn (3w mod 12), worker tag in the system prompt, max_completion_tokens 1000, 300 s per point). Workers 1 / 4 / 8 / 16: output 124.8 / 116.6 / 132.9 / 99.5 tok/s in aggregate; uncached prompt 421 / 935 / 869 / 1,250 tok/s; cache share 0.977 / 0.929 / 0.927 / 0.800; TTFT p50 0.54 / 0.54 / 0.50 / 24.9 s, p90 1.5 / 9.8 / 24.5 / 111.6 s; decode a request p50 158 / 46 / 26 / 28 tok/s; 0 errors. Read: on TP4 a second session buys no throughput: per-request decode falls as fast as concurrency rises (DSpark's single-stream gain does not carry into batched rounds), and past 4 in flight the queue sets TTFT. Next: the same sweep on 4x EXL3 TP1 and 2x lossless TP2 behind the sticky router.
2026-11-10, which layout serves many omp sessions best: TP4 lossless vs 2x TP2 lossless vs 4x EXL3 2.81 TP1, through the sticky router (agent-load-sweep.sh, layout-load.sh; same workload as the TP4 row above: each worker a growing subagent conversation, 1000-token replies, 300 s a point, --max-concurrent 4 everywhere; TP2 groups A = studio1+2, B = studio3+4 on mlx-serve-stack8; EXL3 on every box with mlx-serve-stack8 + turboexl3_ds41-resdec (perf/exl3-resident-decode e62318a), ctx 262,144; router ds41-router.py on studio1 :11331; ~/bench/al-tp2x2, ~/bench/al-exl3x4-r2). Aggregate output tok/s at 4 / 8 / 16 sessions: TP4 116.6 / 132.9 / 99.5; 2x TP2 175.8 / 207.7 / 179.5; 4x EXL3 214.2 / 211.6 / 206.1. TTFT p90: TP4 9.8 / 24.5 / 111.6 s; 2x TP2 5.9 / 12.5 / 49.8 s; 4x EXL3 2.9 / 14.4 / 30.5 s. Per-request decode p50: TP2 65.7 / 38.3 / 26.9; EXL3 72.8 / 73.0 / 71.7. Cache share 0.91-0.94 in every layout; 0-1 errors; the router spread EXL3 requests 131-142 a box. Read: independent servers beat one big group for many sessions, and 2x TP2 lossless reaches 4x EXL3's throughput at 8 sessions (208 vs 212) without the quant's quality cost. No layout batches speculative rounds across sessions: EXL3's per-request decode stays at ~72 while its aggregate stays flat (one session at a time per box), and the EXL3 serve log prices a DSpark verify at 26.4 ms for 1 row and 44.2 ms for 6, so packing two sessions' drafts into one forward is the next throughput lever for every layout. Decision for agent work: 2x TP2 lossless behind the router.
2026-11-10/11, EXL3 2.81 resident-decode skip (CommunityServe plugins perf/exl3-resident-decode e62318a: a wholly resident layer's decode call returns the device wave without the per-layer host route barrier; exl3-plain-control.sh, studio1, ~/bench/exl3ctl-20261110-1934). Plain 1-row decode, 2k x 256 x 3: PR 46 dylib 33.48 / 32.80 / 32.94, resdec 34.43 / 34.36 / 35.35 tok/s (+5%). The skip engages only on layers holding all 384 experts. The greedy-text identity check in that window compared empty strings (reasoning only); not yet re-run. Read (Gemini 4 Carbon review, 2026-11-11, verified in code): the larger EXL3 limit is that deepseek_v4/config.zig treats any pack with experts.bin as streamed, which turns off slot_state and batches_decode, so a fully resident EXL3 box serves one request at a time.
2026-11-11, ARC prefix cache A/B with memory pressure and a restart phase (bench/studio-cluster/cache-ab.sh, lossless TP2 group on studio3+4, 8 session workers + one-shot streams, 10 min + 120 s idle + shutdown + restart; base = upstream main 9191fbdf mlx-serve-arcbase, arc = feat/prefix-cache-arc 96410740 mlx-serve-archead; SSD bytes from ioreg; ~/bench/cache-ab2-2243, ~/bench/cache-ab3-0724). 4 GB tier, 4 one-shot streams of 30k words: in-run cache share base 0.851 / 0.805, ARC 0.840 / 0.772; restart share base 0.973 / 0.980, ARC 0.977 / 0.981; SSD MB serving/idle/shutdown base 1619/2441/21 and 1704/2328/6, ARC 652/1309/2099 and 627/1267/2101 (serving -61%, total equal). 1 GB tier, 6 streams of 10k words: in-run base 0.603 / 0.596, ARC 0.556 / 0.524; restart base 0.629 / 0.631, ARC 0.655 / 0.783. Root cause (Fable 5.2 from per-request data and eviction logs): forked turns put the live tip in T1 while the dead tip stayed in T2 (five ARC-only misses = the whole gap); every one-shot shared cache key 0, which key-fair eviction already evicts first. Fixes through fd85fece; rerun on mlx-serve-archead2 with distinct-key one-shots in progress.
2026-11-11, idle board power and a dev-VM stand-in. SMC PD0R (board power, before PSU losses), five 12 s samples each: studio1 14.87 W loaded idle, 14.86 unloaded, 12.44 unloaded + low power mode, 14.81 reloaded, 12.46 reloaded + LPM; studio2 10.73 / 10.73 / 10.65 / 10.73 / 10.64. Wi-Fi off changed nothing (10.67 W). Unloading the model saves nothing; LPM trims only studio1's background services (hermes osascript wrapper, OrbStack, CI runners). CPU contention (cpu-contention.sh, group A, 4 sessions, 4 min a phase, a 20-core-capped mlx-serve test build on studio1 as the VM stand-in): output 125.7 tok/s under the build vs 129.0 idle (-2.6%), decode a request 37.2 vs 37.8. RAM pressure of a real 32 GB guest is not measured.
2026-11-11, borrow layer deployed and accepted live (deploy-borrow.sh install; ds41-tp2x2.sh borrow/return/status/reconcile, drain-aware router).borrow B -- sleep 600 with the holder SIGKILLed: reconcile returned B in 97 s; the same for A (rank 0 through reconcile's ssh hop) in 87 s; a request loop through :11234 saw 0 errors in 219 requests; a borrow of A while B was mid-return refused.
2026-11-11, ARC prefix cache rerun on mlx-serve-archead2 (fd85fece) vs mlx-serve-arcbase, base arc base arc per tier (cache-ab.sh via cache-ab-rerun.sh, lossless TP2 group C on studio3+4 inside borrow B, 8 agent sessions + closed-loop one-shot workers of distinct-key prompts, 600 s; arc adds --prefix-cache-disk-write-max 500; ~/bench/cache-ab4-{1g,4g}-1110). Verdict: ARC wins hits on a starved tier and is neutral with room; every speed number here is confounded. Matched (worker, turn) pairs: on the 1 GB tier ARC prefilled 563,464 vs 832,336 and 535,916 vs 804,788 uncached agent tokens (-32%, -33%); on the 4 GB tier the two arms' uncached tokens on common turns are identical (405,495 = 405,495; 417,820 = 417,820). The aggregate hit share and output tok/s gaps come from the bench: the one-shot workers were closed-loop, so the arm that answered them faster got more of them (4 GB: arc 20 and 16 one-shots, 721k and 577k uncached tokens, vs base 13 and 14, 469k and 505k), and with prefill pinned near 610 tok/s those extra one-shots took the agents' turns (arc 71 and 91 agent turns vs 96 and 98). agent-load now sends one-shots open loop (--oneshot-every S); the speed comparison needs a rerun on it.
Tier
Arm
Agent turns
One-shots
Uncached on common turns
Aggregate hit share (confounded)
Output tok/s (confounded)
1 GB (6 workers x 10k words)
base
39, 37
40, 41
832,336, 804,788
0.147, 0.131
17.3, 16.3
1 GB
arc
44, 44
50, 44
563,464, 535,916
0.419, 0.419
18.8, 24.1
4 GB (4 workers x 30k words)
base
96, 98
13, 14
405,495, 417,820
0.849, 0.852
48.6, 47.7
4 GB
arc
71, 91
20, 16
405,495, 417,820
0.793, 0.840
30.3, 42.2
Also: agent-load here is the pre-fix version (worker tag at token 0, so sessions share no system prompt); both arms ran it alike. arc's SSD tier held 0.84 GB vs base's 3.8 GB on the 4 GB tier (--prefix-cache-disk-write-max 500).
2026-11-11, ARC rerun on the open-loop bench, 4 GB tier, one pair (cache-ab.sh, ARMS="base arc" EVERY=40 OW=30000, ~/bench/cache-ab5-4g-open). With one-shots on a fixed schedule both arms got the same work (15 one-shots each), and ARC is neutral with room. It also writes 92% less to the SSD (68 vs 796 MB serving) with no restart loss, because --prefix-cache-disk-write-max 500 skips entries the tier would never serve. Speed and restart output vary arm to arm by more than the difference.
Arm
Requests
Hit share
Output tok/s
TTFT p50 / p90
SSD MB serving / tier
Restart hit share
base
106
0.840
42.1
23.1 / 109.9 s
796 / 3738
0.977
arc
103
0.835
43.0
16.4 / 133.8 s
68 / 868
0.979
2026-11-12, B1 (ARC eviction, mlx-serve-b1new sha256 9c391bb3) vs its upstream base f8755298 (mlx-serve-main-f875 sha256 31260304), 2 GB and 4 GB tiers (cache-ab.sh inside borrow B from ~/bench/day-chain-1112b.sh, lossless TP2 group C on studio3+4, ARMS="base arc arc base" W=8 EVERY=40 OW=10000, no --prefix-cache-disk-write-max; ~/bench/b1new-{2GB,4GB}-1112). Verdict: drop B1. It wins a little in-run and loses on every restart, the dip seen at 2 GB on 2026-11-11 repeated at 4 GB. Its SSD tier ends at about half the bytes of base's, so less survives the restart; the working hypothesis is that T1-first eviction drops the newest seen-once tips. B2 (the SSD write cut) ships without it.
Tier
Arm
Output tok/s
In-run hit share
Restart hit share
Restart TTFT p50
SSD MB serving / idle
Tier at shutdown
2 GB
base
58.6, 55.1
0.796, 0.752
0.973, 0.959
0.71, 0.75 s
445 / 1394, 990 / 1084
1691, 1672 MB
2 GB
arc
64.4, 59.2
0.812, 0.798
0.836, 0.852
17.8, 0.70 s
770 / 1122, 478 / 1393
1652, 1720 MB
4 GB
base
72.9, 72.8
0.857, 0.857
0.971, 0.850
0.70, 19.1 s
597 / 3082, 681 / 3126
3450, 3502 MB
4 GB
arc
74.3, 79.3
0.869, 0.894
0.580, 0.848
19.4, 19.7 s
627 / 1376, 883 / 1254
1853, 1882 MB
The restart phase is 8 requests, so one cold request moves its TTFT p50 by ~19 s (base's own second 4 GB restart did). 0 errors in every arm. The same chain ran the A1 served check on studio4 first: A1-SERVED-OK.
2026-11-12, EXL3 2.81bpw against iQ-MLX 3.0bpw v1.1, single stream on one Studio (~/bench/eq-compare.sh from studio1 inside ds41-tp2x2.sh borrow A --both-down, both arms on studio2 with mlx-serve-ms2, --max-concurrent 1 --ctx-size 393216 --prefix-cache-mem 32GB --prefix-cache-entries 128 --prefill-decode-share 0 --no-drafter --no-pld, MTP and DSpark on as served, MLX_SERVE_PREFILL_CHUNK=8192; E with turboexl3_ds41-resdec, Q built-in; order E Q Q E, one fresh server per arm; ~/bench/eq-compare-20261112-1409). DSpark decode on the 16 agent captures greedy (ds41-replay.py, 1,500 tokens each, token-weighted): E 99.5 tok/s (99.52, 99.46), Q 108.6 (106.23, 111.05), Q +9%; 32/32 captures usable per arm. Cold prefill (tp-speed.py, fresh random prompts, 2 reps per arm): 8k E 2,017 / Q 1,553, 32k 2,415 / 1,639, 128k 2,461 / 1,505 tok/s, so E prefills 1.3x to 1.6x faster. With KLD (E 0.0688, Q 0.1527, row below), E wins quality and prefill on a single stream and Q wins DSpark decode by 9%. Q's batching across lanes is not measured here; plan 63's two-lanes-per-box window measures it. The iQ pack on studio2 is a copy of studio4's (138 files, 427,295,345,697 bytes) with the Engram shards hard-linked from studio2's lossless pack after a 2 x 1 GiB slice match.
2026-11-12, iQ-MLX 3.0bpw v1.1 full API KLD on the 7,495-row fixture (~/bench/iq11-kld.sh inside borrow B, queue job 012: mlx-serve-ms2 on studio4 serving ~/models-iq/DeepSeek-V4.1-Flash-1017-MLX-Serve-iQ-MLX-3.0bpw (README row 1.1, 2026-10-29), bench/kld/api-kld.py from studio1 against the 2026-10-28 teacher; ~/bench/kld/iq11-20261112).0.1527 over 7,495 rows, top-1 0.9090, against lossless 0.0172, EXL3 2.81 0.0688, EXL3 2.25 0.1430, STQ 1.75 0.1589 (row 2026-11-08 above). v1.0 read 0.1832 by this method on 2026-10-28. The card's own 0.0963 is on another set. The mean hides a split: code, math, reasoning, design and agent prompts sit at 0.018-0.098 (code-lru 0.0177, code-sql 0.0364, math-series 0.0207, math-probability 0.0239, reasoning-schedule 0.0239, reasoning-bridge 0.0595, design-ratelimit 0.0469, design-offline 0.0975, agent-debug 0.0421, agent-plan 0.0937), while prose, story and multilingual sit at 0.32-0.44 (prose-lighthouse 0.4170, prose-sourdough 0.3686, multi-es 0.3182, multi-ja 0.3698, story-ferry 0.4353, story-robot 0.3596). The split does not favor iQ against EXL3: per prompt it tracks EXL3 2.25 (studio1 ~/bench/exl3-w1/kld/exl3-api.json) and runs about 2x EXL3 2.81 (~/bench/exl3-w4/kld/e281-api.json) on every prompt, code and agent included. code-lru 0.0062 / 0.0170 / 0.0177 (2.81 / 2.25 / iQ), code-sql 0.0182 / 0.0351 / 0.0364, agent-debug 0.0246 / 0.0388 / 0.0421, agent-plan 0.0441 / 0.0817 / 0.0937, reasoning-bridge 0.0267 / 0.0572 / 0.0595, prose-lighthouse 0.2261 / 0.4382 / 0.4170, story-ferry 0.2097 / 0.4215 / 0.4353.
2026-11-12, B1 + B2 together (mlx-serve-b2feed sha256 da419073 = STRML/mlx-serve pr/prefix-cache-ssd-feed b19228ef, B2's rate-capped SSD feed stacked on B1) vs mlx-serve-main-f875, 4 GB tier, --prefix-cache-disk-write-max 500 on the arc arm (the setup of the row above; ~/bench/b2feed-4GB-1112). Verdict: drop B1 and B2. B2 cannot ship alone: its feed reads B1's T1/T2 lists (frequent, lineage, shrinkVictim), so a rebase off B1 conflicts in 5 hunks of prefix_cache.zig. Together they win in-run and lose on restart, the same pattern as B1 alone. Restart share swings arm to arm (base read 0.97 in the row above and 0.73 / 0.58 here), but the arc arm sat below base on both restarts again.
Arm
Output tok/s
In-run hit share
Restart hit share
Restart TTFT p50
SSD MB serving / idle
Tier at shutdown
base
72.7, 75.9
0.861, 0.865
0.733, 0.578
1.7, 45.2 s
497 / 3148, 904 / 3138
3415, 3515 MB
B1+B2
79.3, 82.7
0.883, 0.894
0.621, 0.230
37.0, 80.0 s
527 / 1068, 55 / 1095
1113, 1040 MB
The SSD write cut holds (idle writes -65%), and the tier ends at a third of base's bytes, which is the likely cause of the restart loss.
2026-11-11, --prefill-decode-share 0 vs 0.5 on a lossless TP2 group (group-ab.sh, stack8, group C on studio3+4 inside borrow B, 4 agent sessions over captures e34362 and edf662, 600 s with a 120 s warmup, no one-shots; ~/bench/share-ab-1111). share 0 cuts TTFT and adds a little output on a mostly cached agent load; per-request decode is unchanged.
Arm
share
Output tok/s
Uncached prompt tok/s
TTFT p50 / p90
Decode p50
1
0.5
123.2
410
1.3 / 5.0 s
35.6
2
0
128.7
411
0.8 / 2.9 s
35.6
3
0.5
123.7
418
1.4 / 4.8 s
37.5
4
0
125.8
447
0.8 / 2.6 s
35.5
2026-11-11, mlx-serve-ms2 (STRML/mlx-serve perf/dsv41-multisession 17533654: group DSpark backoff and GroupCost fixes, group rounds that split, 4096-row DS4.1 prefill beside decoders, every DS4.1 chunk capped at 8192 rows) vs mlx-serve-stack8, at share 0.5 and 0, 2 and 4 sessions, plus a cold 30k-word one-shot every 120 s, open loop (group-ab.sh, ~/bench/ms-ab-1111, one run an arm). ms2 wins every pair; ms2 at share 0 is the best cell: +15% output at 4 sessions over the live setting (stack8, share 0.5) and TTFT p90 16.5 s -> 2.8 s. Per-session decode is unchanged, so the gain is fewer stalls behind prefill.
share
W
stack8 out tok/s
ms2 out tok/s
TTFT p50 / p90 stack8
TTFT p50 / p90 ms2
0.5
2
92.8
98.5
1.0 / 7.4 s
0.7 / 4.8 s
0.5
4
102.4
114.0
1.4 / 16.5 s
0.9 / 7.2 s
0
2
97.5
98.7
0.7 / 3.8 s
0.7 / 2.4 s
0
4
112.3
117.6
0.8 / 3.8 s
0.8 / 2.8 s
Tests on 17533654: engines.mlx 1219 pass, plugins.deepseek 360 pass, full-suite shards 1-4 pass; the two upstream crashes that stop a full run are ddalcu/mlx-serve#1173 and ddalcu/mlx-serve#1175.
2026-11-11, upstream PR ddalcu/mlx-serve#1146 (DS4.1 tensor parallel past two Macs) at 12997757 vs main 9191fbdf (mlx-serve-pr1146 68446e8d, mlx-serve-main9191 3c3486cd; bench/studio-cluster/pr1146-pair.sh, pr1146-tp4.sh; ~/bench/pr1146-20261111-1819, pr1146-tp4-20261111-1938; lossless pack, JACCL_FIT_BUFFER=1 JACCL_ORDERED_RS=1). 2 Macs ABBA in one borrow of group A, 4 Macs one visit with live down 19:40-19:57. Plain decode (DSpark off, 256 greedy tokens) 2k / 32k: main @2 63.34 / 62.74 (6 reps), pr @2 65.53 / 64.99 (6), pr @4 81.69 / 79.65 (3): +3.5% at a pair, 1.23-1.25x from 2 to 4. 16-capture replay (DSpark on, token-weighted): main @2 122.6 / 122.6, pr @2 125.2 / 125.1, pr @4 161.1 (1.29x); 0 errors. Each binary repeats bit for bit; main and pr differ on 4 of 16 greedy texts with DSpark on and agree 4/4 replayed plain, so the split is verify numerics. KLD (128 rows) main @2 and pr @2 0.0055, pr @4 0.0048. Hardware: 4-Mac load, clean stop, unload/reload, vision, dist-probe --size 4 pass; 3 Macs refused by design (heads); reload with a worker unreachable not run. Bot approved at 57882322 (Fable's simplify, -427/+123).
2026-11-11, upstream PR ddalcu/mlx-serve#1140 (DSpark round sizing) at cd8dcb32 vs main 9191fbdf, one box each (studio3 / studio4 crossed), EXL3 2.81 DS4.1 on turboexl3_ds41-resdec, 4 fresh loads a binary (bench/studio-cluster/pr1140-ab.sh, ~/bench/pr1140-20261111-1916). Greedy, identical text across binaries on every pick: first request after load 111.5 -> 111.8 tok/s; cold prompt 155 / 189 / 207 89.9 / 119.2 / 114.4 -> 91.3 / 119.2 / 118.2; cached 70 / 155 / 189 / 207 +0.5 / +1.9 / 0 / +3.0%; 1,000-token essay 58.4 -> 58.3; sd <= 0.21. The branch learns plain_ms 31-35 (main stays at the 17.70 prior). Every greedy request logs plain_ticks=0 skipped=0 probes=0, so the warm-up skip and the 2x clamp never ran; both removed in 20427e34.
2026-11-11, the multisession fixes on bare upstream main: mlx-serve-mspr (STRML/mlx-serve pr/dsv41-multisession-sched 16dcd5e9 = main 9a173773 + the 7 fixes, sha256 d9e0cf4b) vs mlx-serve-main9191, ABBA, share 0, 2 and 4 sessions over captures e34362 and edf662, a cold 30k-word one-shot every 120 s, open loop, 480 s steady a run (group-ab.sh, ~/bench/mspr-ab-1111, lossless TP2 group B). 4 sessions: output 100.7 / 101.2 -> 105.2 / 104.5 tok/s (+4%), TTFT p90 3.92 / 3.95 -> 3.12 / 2.73 s, decode p50 30.8 / 30.5 -> 32.6 / 31.8. 2 sessions: output 87.0 / 82.6 -> 88.6 / 86.7, TTFT p90 2.65 / 2.83 -> 3.10 / 3.25 s: within noise, p90 slightly worse. 0 errors. Read: most of ms2's +15% over stack8 came from share 0 vs 0.5, not from these fixes; and this run mixes the prefill-width and group-round themes at a non-default share, so it is not PR evidence (Fable's plan review; the split and its own benches are in docs/plans/upstream-pr-split.md).
2026-11-12, DS4.1 4096-row prefill beside decoders (A2: STRML/mlx-serve pr/dsv41-prefill-beside-decode dbc50d56, mlx-serve-a2 sha256 1d2b4bfb) vs upstream main 9a173773 (mlx-serve-main9a17 a8c4888f), one M5 Ultra (studio4 in a borrow of group B), iQ-MLX 3.0bpw, default --prefill-decode-share 0.25 (bench/studio-cluster/a2-bench.sh, upstream's test_prefill_interleave.sh probe: one stream counting while a 12k-word cold prompt prefills; visits main a2 w2048 w1024 then reversed, 3 probes a visit; ~/bench/a2-bench-1111). Medians of 6: main max gap 0.66 s, p99 535 ms, prefill wall 16.6 s, hosted decode 0.35 of it; a2 max gap 1.69 s (2.6x), p99 45 ms, prefill 12.7 s (-24%), 0.32; a2 at --prefill-chunk 2048 1.01 s / 860 ms / 14.2 s; at 1024 0.66 s / 533 ms / 16.6 s (= main). Read: the wider chunk buys a quarter of a long prefill's wall with a 2.6x longer worst decode stall, against the default share whose job is bounding that stall. Not upstreamed; kept on our fork for share 0. The probe's B TTFT field read -1 (a one-word reply streams no content), so the prefill wall is the server's [interleave] prefill line.
2026-11-12, ARC RAM tier alone (B1: STRML/mlx-serve pr/prefix-cache-arc-tier 75c1d7b9, mlx-serve-b1, no SSD feed flag) vs upstream main 9a173773 (mlx-serve-main9a17), lossless TP2 group B, open loop, 8 sessions over capture e34362 + a 10k-word one-shot every 40 s, base arc arc base per tier (bench/studio-cluster/b1-window.sh over cache-ab.sh with ARC_EXTRA=, ~/bench/b1-{1,2,4}GB-1112). Output tok/s base / arc: 1 GB 35.4, 59.8 / 50.7, 55.6 (base's first arm cold: share 0.449 vs 0.774 on its repeat; unusable); 2 GB 58.9, 57.8 / 57.5, 54.8 (neutral to -4%); 4 GB 70.9, 74.9 / 81.6, 77.5 (+9%), cache share 0.86 -> 0.89. arc_p from the per-arm rank-0 logs: 0 in all 329 readings at 4 GB; moves to 95-307 at 1-2 GB, where ARC gains nothing. Read: the 4 GB win is the T1-before-T2 order, not the adaptivity; B1 is being cut to that (no ghost lists, no arc_p) per the split plan, and re-measured at its rebased head.
2026-11-12, mlx-serve ms3 vs ms2 binary A/B on group B (studio3+studio4), DS4.1 lossless 2x TP2 (queue job 023, rebuild-window.sh mlx-serve-ms2 mlx-serve-ms3, agent-load replay of 2 sessions, 480 s windows, ABBA with a=ms2, b=ms3, 0 errors in every arm). Verdict: fails plan 65's W=4 gate (65-live-rebuild.md:93). TTFT p90 at W=4 is 3.53 s mean for ms3 vs 2.73 s for ms2, +0.80 s against a +0.5 s cap (arm 6 alone read 4.00 s). Decode p50 at W=4 is 34.35 vs 35.41 tok/s (-2.99%, inside the 3% bound by 0.01 point); at W=2 64.75 vs 65.12 (-0.6%). request_rejected_total 0 in every arm. Throughput is level. ms2 sha256 38dd5681efd35538, ms3 fc64df396b545fb1. No cutover on this result; KLD comes from the group A quality window, job 024.
workers
ms2 out tok/s (2 arms)
ms3 out tok/s (2 arms)
delta
TTFT p90 ms2
TTFT p90 ms3
2
97.7, 98.6
100.3, 99.5
+1.8%
2.29, 2.66 s
2.24, 3.18 s
4
115.4, 114.5
115.4, 113.9
-0.3%
2.77, 2.69 s
3.06, 4.00 s
Prompt tok/s at W=4: ms2 405.4, 420.8; ms3 406.0, 420.8. Cache share 0.96-0.97 in all arms.
2026-11-13, TP1 capacity under agent load, iQ-MLX 3.0bpw v1.1 against EXL3 2.81bpw, one width per box on a fresh server (~/bench/tp1-par.sh from studio1 inside ds41-tp2x2.sh borrow A|B --both-down, HOLD=0; quality-arm.shARM=iq|exl3 on mlx-serve-ms2, MC=8 CTX=262144 SHARE=0, prefix cache at each arm's served default (iQ 8 GB, EXL3 32 GB), EXL3 on turboexl3_ds41-resdec; agent-load.py over capture sessions e34362 and edf662 plus a cold 30k-word one-shot every 120 s, 120 s warmup, 480 s window; ~/bench/iq-tp1-load/par-*). iQ batches across agents and EXL3 does not: a box's iQ output rises with load (66 to 103 tok/s) while EXL3's falls (55 to 45) and its queue sets TTFT.
W
iQ out tok/s
EXL3 out tok/s
iQ / EXL3
decode p50 iQ / EXL3
TTFT p90 iQ / EXL3
errors iQ / EXL3
1
66.3 (studio2)
55.1 (studio2)
1.20x
88.3 / 77.5
2.5 / 3.5 s
0 / 1
2
81.2 (studio3)
53.0 (studio3)
1.53x
56.4 / 71.9
2.7 / 21.4 s
0 / 2
4
91.0 (studio4)
50.7 (studio4)
1.79x
28.0 / 74.5
5.3 / 35.1 s
0 / 4
8
102.7 (studio1)
44.9 (studio1)
2.29x
16.6 / 74.1
16.2 / 77.7 s
0 / 5
Cache share 0.94-0.98 in every arm. Every EXL3 error is an HTTP 400 on the captures' image turns (9 and 19): the EXL3 pack has no vision tower. Read for plan 61 step 0: an iQ box carries 2 agents at solo-level TTFT (p90 2.7 vs 2.5 s) and 56 tok/s each, and 4 at ~28 tok/s each; past 4 the TTFT tail grows. Contaminated and not used: studio2's earlier iq-tp1-load.sh, which ran W=1, 2, 4 in a row on one server, read W=2 51.5 tok/s (cache share 0.79, TTFT p90 19.5 s) and W=4 54.4 (0.70, 17.7 s) because the 8 GB prefix cache carried the earlier widths' conversations; rerun widths on a fresh server.
2026-11-13, where an iQ TP1 decode token goes (Metal System Trace of one server, studio1 inside borrow A; quality-arm.sh ARM=iq MC=1, mlx-serve-ms2, one greedy 1,500-token stream from a 67-token prompt, 4 s recording 8 s in, gputrace-busy.py over the last 3 s; ~/bench/tp1-trace-20261113-0946; DSpark on as served, then --no-mtp). GPU busy 93.2% (DSpark) / 94.1% (plain), idle 205 / 178 ms. Median gap 0.8 us; nearly all idle sits in 49 / 66 gaps over 1 ms (2.8% / 3.5% of wall, up to 9.2 / 5.1 ms), each at a command-buffer boundary before a short buffer, in plain decode often every 15-20 ms (about once a token): a host submit or readback wait, cause not named. Command buffers under 20 us hold 0.1% of GPU time. Read: TP1 decode is GPU-bound like TP4 (row 2026-11-07, 90%), so host-side work (Sushi Cooler's own-queue decode, per-pass waits) is capped near 6% and kernel fusion is the lever. The per-kernel census needs a libmlx built with -DMLX_METAL_DEBUG=ON (bench/studio-mlx-debug-build.sh); the MLX_METAL_DEBUG=1 environment variable alone labels nothing (~/bench/tp1-trace-20261113-1003: 59,709 buffers all "Command Buffer 0"). Xcode (for xctrace) is on studio1 only.
2026-11-13, iQ cold prefill: Engram SSD reads are 39% of a random-id 32k prompt (studio3 inside borrow B; mlx-serve-ms2, ARM=iq MC=1 SHARE=0 --no-drafter --no-pld, MLX_SERVE_PREFILL_CHUNK=8192, /v1/completions max_tokens 1, fresh prompts, 2 reps; ~/bench/prefill-gap-20261113-1002). Random token ids 2,413 / 2,415 tok/s (13.6 s); the same depth as a repeating 16-id cycle, so Engram rows repeat inside each chunk, 3,950 / 3,935 (8.3 s). MLX_SERVE_DSV41_ENGRAM_LRU_MB 256 vs 16384 changes nothing (2,397-2,418 / 3,935-3,944): prompt rows take the span path and skip the LRU. So plan 75 step 1's single-box 3,818 tok/s at 32k (R_1, its ledger row in commit ea426b2443 on branch docs/tp4-levers-6, not yet on main; table in the run's summary.md) came from a looping prompt with few Engram reads, and an Engram prefetch off the critical path is worth up to ~1.6x on TP1 prefill as well as PP. Open: the 2026-11-12 row read iQ at 1,639 tok/s at 32k on studio2 (whose iQ Engram shards are hard-linked from the lossless pack), against 2,415 here on studio3; plan 75's tier 1 table-read bench runs on all four boxes and should show whether studio2's reads are slower.
2026-11-13, iQ-MLX 3.0bpw v1.1 at TP2 on studio3+studio4, plan 61b stage 0 (~/bench/iq-tp2.sh from studio1 inside ds41-tp2x2.sh borrow B --both-down, HOLD=0; ds41-group-iq.sh on mlx-serve-ms2, JACCL_ORDERED_RS=1 JACCL_FIT_BUFFER=1, PREFIX_MEM=8GB CTX=262144; agent-load.py as in the TP1 capacity row above; ~/bench/iq-tp2-20261113-1216). TP2 runs the MoE fallback kernels (no fused affine path for TP ranks yet), so every number is a lower bound. Group start 46 s to GROUP-UP. Wired per rank 110 / 116 GiB (TP1 ~193). A warm iQ TP1 restart on studio3 after the TP2 stop: 30 s to ARM-UP.
TP2 (studio3+4)
TP1 (row above)
Cold prefill 8k, random ids, 2 reps
2,919 / 3,009 tok/s
Prefill 32k (8,191 cached from the 8k prompt), 2 reps
3,978 / 4,065 tok/s
W=1 out tok/s, decode p50, TTFT p90
77.4, 103.8, 2.5 s
66.3, 88.3, 2.5 s
W=2 (contaminated, see below)
52.1, 57.8, 22.9 s, cache share 0.74
81.2, 56.4, 2.7 s
W=4 (contaminated)
60.1, 27.3, 17.4 s, cache share 0.71
91.0, 28.0, 5.3 s
W=1 is clean (cache share 0.98, 0 errors): TP2 decodes 1.18x a TP1 box for one session on the fallback kernels. W=2 and W=4 ran on the same server after W=1, the failure the TP1 row names: the 8 GB prefix cache still held the earlier width's conversations, cache share fell to 0.71-0.74 and the TTFT tail went to 17-23 s. They are not a TP2 capacity reading. A rerun with a fresh group per width (~/bench/iq-tp2-fresh.sh, staged on studio1) was not run: benchmarking stopped here (Sam, 2026-11-13). Memory at load: rank 0 245-248 GB used with 7.7-10 GB unused, rank 1 250 GB used with 5.0-5.7 GB unused (top PhysMem).
2026-11-13, does a prefix-cache SSD entry survive an iQ TP1 -> TP2 -> TP1 switch (~/bench/iq-kv-switch.sh from studio1 inside borrow B --both-down, HOLD=0; mlx-serve-ms2, the same HOME (~/bench/dist-home on studio3) for every server, --prefix-cache-disk 64GB --shutdown-persist-secs 60, 8 GB RAM tier; one 32,768-token random-id prompt sent cold, warm, then after each switch; ~/bench/iq-kv-switch-20261113-1256). No: a layout switch pays a full cold prefill. TP1 cold 32k 14.9 s, warm 0.16 s (32,767 cached). On SIGTERM each server wrote its entry ([disk-cache] shutdown persist: 1 written (106.3 MB)). TP2 on studio3+4 then read cached=0 (12.4-12.6 s, 2,601-2,653 tok/s), and TP1 restarted after TP2 also read cached=0 (11.3-11.6 s). No same-layout restart control was run, so this does not say whether the miss is the width change or the restore path. The first pass without --shutdown-persist-secs wrote nothing to disk and is not used.