Verba/Rapida

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 profiler (`MLX_SERVE_DECODE_PROFILE=1`, per-sub-block evals: embed, , MLP, 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 (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)

Want to see what these experiments produced? Lesto, the Gemma 4 inference engine for Apple silicon Macs, is on lestoengine.com

Made by Federico Andrioli, @fedeandri on X A research lab's own measurements, generated from its files. Data built