Verba/Rapida

Esperimenti #137

Head dim 512's fused kernel at decode below 1,024 keys: `MLX_SDPA_D512_MIN_KL` lowered, so the 5 full...

done

Il testo degli esperimenti resta in inglese, come l'ha scritto il laboratorio.

Cosa è stato provato

Head dim 512's fused kernel at below 1,024 keys: `MLX_SDPA_D512_MIN_KL` lowered, so the 5 full layers stop running five unfused dispatches per call at 1k (`2026-11-07-mac-profile-best` § row 104m); rounding changes, so a blind read before any race

Modello e configurazione

the best

Guadagno atteso

-0.25 ms at 1k, nothing at 8k (inferred from the audit's 49 us per call); row 28 found this kernel 5.8x slower at 8k keys on another engine, so test the time first

Da dove viene l'idea

row 104m

Esito

done 2026-11-13: , 1k decode +0.05% (block pairs +0.01, -0.01, +0.08, +0.05), 8k +0.12%, 7 of 10 1k replies changed; only 23.4% of 1k steps are below 1,024 keys, about 0.02 ms a step there (`2026-11-13-mac-r137-d512-1k/README.md`)

Lezione

lowering `MLX_SDPA_D512_MIN_KL` to 0 on the best moves 1k decode by +0.05% (+0.2% on the steps below 1,024 keys) and changes 7 of 10 replies, so head dim 512's five unfused dispatches cost about 0.02 ms a step, not the 0.25 ms the audit's per-call figure implied. The bench's 1k are 1,001 , so only their first 23 decode steps are below the threshold.

Adottato

no (no gain, and lossy)

Vuoi vedere cosa hanno prodotto questi esperimenti? Lesto, il motore di inferenza per Gemma 4 sui Mac con Apple silicon, è su lestoengine.com

Creato da Federico Andrioli, @fedeandri su X Le misure di un laboratorio di ricerca, ricavate direttamente dai suoi file. Dati aggiornati al