Verba/Rapida

Experiments #160

A 16-row-tile variant of Lesto's fused gate+up+GeGLU MoE prefill kernel for 4 to 31 rows an expert, the...

runnable

What was tested

A 16-row-tile variant of Lesto's fused gate+up+GeGLU kernel for 4 to 31 rows an expert, the band where MLX's sorted row-block kernel runs `bm = 16` (`.cpp:1734`) and row 158's 32-row tiles (`BM = 32`, `src/moe_prefill_fused.zig:16`) padded and lost: a `BM = 16` instantiation chosen by rows an expert, so the fusion's saved passes stop paying for padding; lossless by the same per-row accumulation (row 158 was bit-identical at 20 rows an expert against MLX's 16-row kernel; `MLX_SERVE_MOE_PREFILL_FUSED_CHECK=1` at 384 and 2,656 slots)

Model and setup

the best

Expected gain

sized from row 158: 57 of 100 session turns fall in the band (64 to 511 new , 323; F5); the fused path's own saving there is unmeasured: at most about -15 ms a turn (row 109 stage 1's 2.8 to 3.4 ms a layer per 2,048-token chunk scaled by slots, the scaling row 158 refuted at 32-row tiles), so about -0.4% per-turn paired median reply at best and 0 if the fusion saves nothing at these sizes; row 158's +30 ms in-band loss bounds what padding costs, not what fusion saves (inferred)

Where the idea came from

row 158 result, 2026-11-13

Outcome

runnable after rows 153w and 153d: a timing-free kernel check first (bit identity and per-layer time at 8, 16 and 24 rows an expert against MLX's 16-row kernel), then a diagnostic with the switch on and off on 20 warm turns, bar -6 ms (`2026-11-13-mac-engine-audit/README.md` ยง Result, row 158)

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