libr3d: README, the dot2 and wave-matrix GEMM arms do not round alike

gemm_nt_bf16_m16 and gemm_nt_bf16_tiled each carry a dot2 family and a
wave-matrix family on the impl axis. Both are within one bf16 store step
of libref on every launch, but they are not bit-identical to each other,
so a tune cache that moves a shape between them changes outputs at the
bit level.

Measured on gfx1152 (Radeon 860M) with LFM3-1.7B bf16, teacher-forced
against an f32 reference: tiled arms 0 and 1 give one record bit for
bit, arms 2 and 3 another. Over three long prompts (8,191, 4,999 and
2,047 positions) the wave-matrix to dot2 KL ratio is 1.008, 1.024 and
1.094, each 95% interval including 1 (paired block bootstrap). One
position of one 721-token prompt reads KL 0.005 on the dot2 arms and
2.08 on the wave-matrix arms; the op oracle at zero tolerance finds
both families one store step from libref at most on that prompt's 129
GEMM launches.

Documentation only: no kernel, row or build file changes.
This commit is contained in:
DokterSmol authored and StillDeadcode committed 2026-11-21 12:51:39 +01:00
1 parent 288fbfbf3a
commit 689f554596
1 file changed
+11
+11
View File
@@ -236,6 +236,17 @@ The GEMM band is covered by row count:
split order). M ≤ 16 stays with the m16 rows, whose wave-per-run-of-columns shape is the right
one there: the two ranges are complements, so neither competes for the other's band.
The dot2 arms and the wave-matrix arms of these two rows do not round alike. Each is within one
bf16 store step of libref on every launch, but the two families are not bit-identical to each
other, so a tune cache that moves a shape from one family to the other changes a model's outputs
at the bit level. Within a family the tiled row's arms agree bit for bit (gfx1152, LFM3-1.7B: arms
0 and 1 give one record, arms 2 and 3 another). Neither family is the more accurate: over three
long teacher-forced prompts the KL against an f32 reference differs by a ratio of 1.01 to 1.09,
each 95% interval including 1. Single positions can still differ by far more than that: one
position of one 721-token prompt read KL 0.005 on the dot2 arms and 2.08 on the wave-matrix arms,
with every launch of both within the one-step bound. Evidence that is compared bit for bit, or
judged at single positions, should name the tune cache it ran with.
The quantised m64 prefill rows run on the wave matrix with the same tiling:
`gemm_nt_q_w4a16asym_m64` (1..64 rows; unsigned 4-bit codes, an f16 scale and an integer zero per
128 of K, against an f16 activation) and `gemm_nt_q_w5a16_m64` (1..64 rows; ParoQuant's int5: the