Experiments #158
The fused gate+up+GeGLU MoE prefill path admitted from 4 rows per expert (today 32...
done
What was tested
The fused gate+up+GeGLU Mixture of experts: a model made of many specialist sub-networks where only a few run per token. Read more Prefill: the model reading the whole prompt before it can write the first token. Read more path admitted from 4 rows per expert (today 32, `moe_prefill_fused.zig:24`, `:180-185`): between 4 and 31 rows per expert MLX already runs the sorted row-block kernel at `bm = 32` (`Storing the model's numbers with fewer bits to make it smaller and faster, at some risk to quality. Read more.cpp:1996-2013`, `:1568`), the The unmodified model or build that every variant is compared against. the fused path is bit-identical to by construction (`src/transformer.zig:11345-11347`); 57 of 100 Cold means the server has never seen this prompt start; warm means part of it is already remembered from before. session turns fall there (64 to 511 new The unit of text a model reads and writes: roughly a short word or a piece of a longer one., The middle value when results are sorted: half the requests were faster, half slower. 323); lossless if `MLX_SERVE_MOE_PREFILL_FUSED_CHECK=1` holds at 384, 2,584 and 5,560 slots (`2026-11-13-mac-engine-audit/README.md` F5)
Model and setup
the best
Expected gain
warm first token about -15 ms on those turns (row 109 stage 1's 2.8 to 3.4 ms a layer per 2,048-token chunk scaled by slots, inferred), per-turn paired median reply -0.2% to -0.4%
Where the idea came from
row 109; engine audit 2026-11-13
Outcome
done 2026-11-13: A valid experiment that did not beat the best score by more than the noise., lossless (30 of 30 identical, fused checks true at 20 rows an expert) but every in-band warm first token slower, 11 of 11, median +30 ms (32-row tiles pad at 4 to 26 rows an expert; diagnostic, one block); the 32-row floor stays, row/158 out of the stack (`2026-11-13-mac-engine-audit/README.md` ยง Result, row 158)
Lesson
admitting Lesto's fused 32-row-tile MoE prefill from 4 rows an expert keeps replies identical but makes warm first tokens about 30 ms slower in the band it opens (4 to 26 rows an expert), because the tiles pad where MLX's 16-row kernel does not; the 32-row floor stays.
Adopted
no (slower in the band it opens; LESTO `row/158` stays on lesto-dev unmerged, out of the 154 and 159 stack)