Verba/Rapida

Esperimenti #170d

The global decode attention call's fixed cost (row 170c): about 149 us of pass 1's 198.5 us at 8k does not...

done

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

Cosa è stato provato

The global call's fixed cost (row 170c): about 149 us of pass 1's 198.5 us at 8k does not move with its KV bytes (two-point fit). Step 1, a microbench split with no engine change: copies of the port's pass 1 that each drop one part of the per-key step (the simd_sum, the two exps, the accumulation, the K or V loads), to find which holds the fixed cost; a lossless fix row only if one part dominates (`2026-11-19-mac-r170-global-kv-once/README.md` § Result, row 170c)

Modello e configurazione

the best

Guadagno atteso

up to about +1% decode if one part of 0.75 ms (five calls) can be cut by a fifth (**estimate**)

Da dove viene l'idea

row 170c

Esito

done 2026-11-19: no fixed cost to cut: four-point sweep intercept 23.1 us [15.6, 29.0], 189 GB/s; dropping the sum, the exps or the multiplies changes nothing, the K or V loads a quarter each; single loads at 146 GB/s, row 170e (`2026-11-19-mac-r170-global-kv-once/README.md` § Result, row 170d)

Lezione

on the M4 the global decode attention call's pass 1 is byte-bound: a four-point key sweep gives a 23 us intercept and 189 GB/s, and dropping the sum, the exps or the multiplies changes nothing. A byte cut pays only if the new kernel keeps the port's load rate. The single-read kernel lost a quarter of it (146 GB/s) with unaligned 40-byte lane loads (inferred).

Adottato

no (a diagnostic; it reopens row 170's lever as row 170e)

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