Verba/Rapida

Experiments #168

Lesto's one-token MoE gate-up kernel against moe-lab's int4 g64 one-token expert kernel (Tigerly1/moe-lab...

done

What was tested

Lesto's one-token gate-up kernel against moe-lab's int4 g64 one-token expert kernel (Tigerly1/moe-lab `moelab/variants/mlx/metal_q4_moe.py`, the author of mlx-lm 2044) at Gemma 4's shapes on the M4: 6 of 128 experts, gate and up 704 x 2816, scales and biases, one ; a timing-free microbench of GB/s for both, overlapped and as a dependent chain, plus whether moe-lab's kernel takes a bias (Grok web reports 2044 needs none). Lesto's gate-up reads about 228 GB/s in row 165's split mode; moe-lab reports 239 to 255 on other models' shapes. A port is worth a row only if the gap holds (at most about 0.1 to 0.15 ms a step)

Model and setup

the best

Expected gain

diagnostic

Where the idea came from

sweep `docs/research/2026-11-19-mac-moe-decode-kernels-merge.md` ranked 1

Outcome

done 2026-11-19: step 1 KILL (`2026-11-19-mac-r168-moe-gateup-kernel/README.md`): moe-lab / Lesto 0.9657 [0.9159, 1.0260] a call, chained and null-subtracted (60.9 against 63.1 us), under the 10% line; moe-lab takes the bias; its f32 epilogue halves the error; no port row

Lesson

at Gemma 4's MoE shapes (6 of 128 experts, 704 x 2,816, group 64, with bias), moe-lab's one-token gate-up kernel is only 3.4% [-2.6, +8.4] faster than Lesto's, under the 10% kill line, so the gate-up has no kernel-swap margin. Its f32 epilogue does halve the output error against an f32 truth, which matters only for a rounding-class row.

Adopted

no (killed at step 1: no port row is opened)

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