Experiments #111
MLX main's blocked head-dim-512 prefill attention back-ported (the 5 full layers run unfused on the M4...
not
What was tested
MLX main's blocked head-dim-512 Prefill: the model reading the whole prompt before it can write the first token. Read more The step where each token looks back at the earlier tokens to decide what matters. Read more back-ported (the 5 full layers run unfused on the M4, `scaled_dot_product_attention.cpp:745-763`, `:874-884`)
Model and setup
the best
Expected gain
at most about -0.22 s per 8k first The unit of text a model reads and writes: roughly a short word or a piece of a longer one. (-2.1%; the masked half of each diagonal block of the full layers' 1.11 s, row 106)
Where the idea came from
row 107
Outcome
not started; closed 2026-11-02 before any build: the upstream change is MLX PR 4518 (Folding the adapter's changes into the base weights to get one ordinary model. 2026-09-30, `39a182fb`, not in the vendored 0.32.3), a blocked form of the same composed attention made for memory; its own M4 Pro table shows The text you send to the model before it starts answering. speed unchanged (246.5 against 246.8 How many tokens the model writes each second once it has started.), and Lesto's head-dim-512 prefill runs MLX's composed fallback (`src/transformer.zig:2935`, `:2033`); a speed lever needs a Lesto head-dim-512 flash prefill kernel: row 117