Verba/Rapida

Experiments #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

What was tested

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)

Model and setup

the best

Expected gain

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

Where the idea came from

row 170c

Outcome

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)

Lesson

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).

Adopted

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

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