Experiments #47
Where the Mac best's 5 ms of non-byte step time goes (row 46): mlx-serve's own decode profiler...
done
What was tested
Where the Mac best's 5 ms of non-byte step time goes (row 46): mlx-serve's own The writing phase: the model produces the reply one token at a time. Read more profiler (`MLX_SERVE_DECODE_PROFILE=1`, per-sub-block evals: embed, The step where each token looks back at the earlier tokens to decide what matters. Read more, MLP, Mixture of experts: a model made of many specialist sub-networks where only a few run per token. Read more router and experts, LM head) on the best at 1k and 8k; the serialized total against the pipelined 15 ms shows dispatch overhead against compute, and the split names the sub-block to optimize (first lines: router 9.2 ms serialized, as much as the experts' 8.5)
Model and setup
gemma-4-26b-a4b mixed 4/8 (the best)
Expected gain
names the next Mac lever (**measured**, diagnostic)
Where the idea came from
row 46
Outcome
done 2026-10-30: serialized 38 ms per The unit of text a model reads and writes: roughly a short word or a piece of a longer one. (pipelined 15): attention 11.4 to 12.4, MLP 24.7 (router 9.3, experts 8.5), head 1.8; the profiler's syncs dominate, so it ranks sub-blocks but cannot size the 5 ms; a code read of the pipelined loop follows
Lesson
mlx-serve's decode profiler serializes every sub-block (38 ms per token against 15 pipelined), so it can rank sub-blocks but cannot size per-step overhead; find overhead in the pipelined loop's syncs and dispatch.
Adopted
no (a diagnostic)