Verba/Rapida

Experiments #34

A verify-width kernel for the experts: nothing upstream speeds `gather_qmm` at 3 to 16 rows on an M4 (MLX...

closed

What was tested

A verify-width kernel for the experts: nothing upstream speeds `gather_qmm` at 3 to 16 rows on an M4 (MLX 4712 and 4787 are dense `quantized_matmul`; 4567 and 4572 tile scheduling target large M on M5), while each verified on this routes to its own 8 of 128 experts. Timing-free first: time `gather_qmm` for one MoE layer at 1, 4 and 7 rows on the rented Mac with OptiQ's 4-bit experts, to size the experts' share of a verify step against row 13's 0.95 GB per token; write the kernel (a `mx.fast.metal_kernel` that reads each touched expert block once for all rows, dflash-mlx's `verify_qmm` as the ) only if that share is large

Model and setup

gemma-4-26b-a4b OptiQ-4bit + MTP assistant

Expected gain

unknown until the sizing step (**guess** +3 to +10% )

Where the idea came from

`docs/research/2026-10-29-gap-levers-merge.md` (, ranked 4)

Outcome

closed 2026-11-13 by row 153v: the verify's cost is the path's fixed cost (1.99x a step at 2 rows), not matmul width; superseded by row 153w

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