Verba/Rapida

Experiments #27

Engine code audit of decode attention on mlx-vlm 0.7.10 / MLX 0.32.4 (row 13c: attention about 131 GB/s...

obsolete

What was tested

Engine code audit of on mlx-vlm 0.7.10 / MLX 0.32.4 (row 13c: attention about 131 GB/s, the least efficient part; `docs/experiments/2026-10-28-mac-decode-profile/README.md` § Code audit): timing-free first, settle the two suspects on the rented Mac: (a) a full copy per layer per step under pipelined decode (count allocations or time a step with `async_eval` against synchronous eval in the profiler), (b) the head_dim 512 path (time one full-attention layer's SDPA at 512, 1,024 and 8k keys); then patch the confirmed one as an overlay (in-place KV write, or a one-read GQA path for D = 512) and pair it against unpatched mlx-vlm

Model and setup

gemma-4-26b-a4b OptiQ-4bit

Expected gain

2 to 4 ms per step if suspect (a) is real (**guess**), toward 100

Where the idea came from

row 13c

Outcome

obsolete 2026-11-02: an mlx-vlm attention audit, covered by rows 28, 89s, 92, 96 and 83

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