Verba/Rapida

Experiments #48

Screen of mlx-serve decode switches on the Mac best, aimed at the 5 ms of non-byte step time (rows 46, 47...

done

What was tested

Screen of mlx-serve switches on the Mac best, aimed at the 5 ms of non-byte step time (rows 46, 47; code read: Gemma 4's single-token decode is closed to every fast expert arm because they require SiLU, so it runs three stock `gather_qmm`, which the source says run serialized at decode width, `src/transformer.zig:38933-38935`, `34167-34170`, `39032-39042`): `MLX_SERVE_MOE_BATCHED_DECODE=1` (take plus batched `quantized_matmul`, not bit-identical), `MLX_SERVE_DECODE_ASYNC_LADDER` 4 and 2 (bit-identical), `MLX_SERVE_STEP_TRACE=1` (build, submit, resolve per step), 10 English 8k first turns each, before and after; a switch beyond 2% of both baselines gets a paired race

Model and setup

gemma-4-26b-a4b mixed 4/8 (the best)

Expected gain

0 to +10% decode (**code read**)

Where the idea came from

rows 46, 47

Outcome

done 2026-10-30: every switch within 0.3% of the baselines; step trace build 0.55 ms, submit 15.2 ms, resolve 0.004 ms: GPU-bound, the 5 ms is kernels below bandwidth; row 49 measures each kernel's bandwidth

Lesson

on the Mac best the host builds a step in 0.55 ms and then waits 15 ms for the : decode is GPU-bound, and the switches mlx-serve exposes (batched experts, async ladder) do not move it; the next lever is the kernels' achieved bandwidth (row 49 measures it per kernel).

Adopted

no (no switch moved decode)

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