Esperimenti #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
Il testo degli esperimenti resta in inglese, come l'ha scritto il laboratorio.
Cosa è stato provato
Engine code audit of The writing phase: the model produces the reply one token at a time. Approfondisci The step where each token looks back at the earlier tokens to decide what matters. Approfondisci 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 The memory where the model keeps what it has already read, so it does not recompute it for every new token. Approfondisci 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
Modello e configurazione
gemma-4-26b-a4b OptiQ-4bit
Guadagno atteso
2 to 4 ms per step if suspect (a) is real (**guess**), toward 100 How many tokens the model writes each second once it has started.
Da dove viene l'idea
row 13c
Esito
obsolete 2026-11-02: an mlx-vlm attention audit, covered by rows 28, 89s, 92, 96 and 83