Experiments #175dk2
Row 175dk's kernel body rewritten along its measured mechanism: each lane holds D/32 contiguous elements...
done
What was tested
Row 175dk's kernel body rewritten along its measured mechanism: each lane holds D/32 contiguous elements loaded as vectors (the host declines unaligned rows), a block's keys split across the threadgroup's simdgroups (SGK) with the pairs' online-softmax state combined in threadgroup memory as MLX's `_gqa_` 2-pass kernel does, no staging; masks, decline rules, switch and pass 2 kept. Step 1: the same microbench, checks and 95 us a round line as row 175dk; step 2 as row 175dk's
Model and setup
the The small guessing model used in speculative decoding. Read more verify's The step where each token looks back at the earlier tokens to decide what matters. Read more
Expected gain
up to about +9% The writing phase: the model produces the reply one token at a time. Read more at k = 3 (the same 2.2 ms ceiling)
Where the idea came from
row 175dk
Outcome
done 2026-11-21 (engine-rows): line not met (0 us a round against 95); the contiguous layout fixed the control (sg24p1 604 us against row 175dk's 3,206, 1.21 times MLX's 497), but every multi-pair configuration is slower and the time grows with the pairs a simdgroup handles (3.3 times at 3 pairs); MLX's 3-row call is 2.46 times one row, so the excess is per-query work, not repeated K/V reads (`2026-11-20-mac-r175dk2-mq-attention-v2/README.md` ยง Result, row 175dk2 step 1)
Lesson
once the per-lane load layout matched MLX's (control 3,206 to 604 us), a shared-K/V multi-query kernel was still slower, and its time grew with the pairs each simdgroup handles (3.3 times at 3 pairs). MLX's own 3-row call is near-linear in queries (2.46 times one row). The verify's attention excess is per-query work, not repeated K/V reads, so a kernel that only shares reads cannot recover it. Test which resource a kernel is bound by (vary its work per simdgroup at a fixed read) before designing one to save the other.
Adopted
no (line not met)