Verba/Rapida

Experiments #73

Fewer Metal command buffers per decode step: the best with `MLX_MAX_OPS_PER_BUFFER=1000` and...

done

What was tested

Fewer Metal command buffers per step: the best with `MLX_MAX_OPS_PER_BUFFER=1000` and `MLX_MAX_MB_PER_BUFFER=2048` (M4 Pro defaults 40 ops / 40 MB; MLX issue 4521: +5% to +13.7% on , bit-identical): race on the 50 sessions plus a hash check

Model and setup

the best

Expected gain

about +6% decode (**inferred** from about 20 us per boundary)

Where the idea came from

sweep 2026-10-30 mac-bytes, row 68

Outcome

done 2026-10-30: loss, decode 32.9 against 67.2 at 1000 ops / 2048 MB (race stopped after 68 rows); sweep of moderate limits in row 73b

Lesson

raising MLX's command-buffer limits to one buffer per decode step halved mlx-serve's decode on the M4 Pro (32.9 against 67.2 tok/s), the opposite of the +5% to +14% reported on Ultra and Max MoE: a setting measured on other chips is a hypothesis, and the cost of losing CPU and overlap can dwarf the per-buffer saving.

Adopted

no (decode -51%)

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