Files
Strata/include/strata/kernels
Eddoursul bedc0c6c8a QSA block scores: query batches in a per-thread GEMM form; bitwise
The prompt path's batches (256 queries at a time) went through the decode windows' kernel: an 8-lane group per key
block, each score's tree finished across the group by shuffles, ~28 clocks a (query, block) pair.

batch_scores_kernel takes batches of 12 queries or more.  Lane l of a warp scores key blocks l + 32 j (j < 4) of a
128-block tile against the warp's 2 queries, all four heads: a dot4 per leaf in the original contraction, the 32
leaves summed on a stack in the butterfly's tree (bit-reversed order), so every score is bitwise the warp form's.  A
warp's lanes read the same query values, a shared-memory broadcast (~2.4 clocks a 16-byte load against ~4.3 for
distinct addresses).  Persistent: one block an SM with an equal share of the (tile, chunk of 16 queries) units; the
keys reload between barriers when the tile changes, and each warp stages its queries into a slot of its own, the next
unit's even leaves once this unit is done with them, the odd ones after its last leaf.  The decode windows keep
block_scores_kernel, which now takes the same dot4.

qsa_select_parity: scores bitwise and selections equal over decode windows and prompt batches of 11-256 queries;
--bench, a 256-query batch: 16K 254 -> 77 us, 64K 893 -> 493, 131K 1734 -> 892.  Window hashes after the 16K prompt
identical on both models.  Prompt time (IQ3_XXS, both GPUs, 2 rounds): 16K 8203 -> 8024 ms (-2.2%), 65K 30970 ->
30125 (-2.7%), 131K 63680 -> 60764 (-4.6%).

Claude-Session: https://claude.ai/code/session_01Ljcr81CGEb4dQcdiAZcXAs
2026-09-28 10:43:34 +02:00
..