mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
The float4 branch added in a2ca43e53 summed x*x over four contiguous elements per
thread, a different FP32 order from gr_norm_rs_kernel (thread t adds d = t + 256 k in
turn). rs then differed in the last bit in about 1 row in 5, a few BF16 rows of the
normalized image flipped, and 10 of 300 JamC-QA answers changed on gfx1151 (7 of them
right to wrong). STRATA_GR_UNFUSED=1 restored the old bits.
The vector loads and stores stay. The written row goes to shared memory (10 KB) and each
thread reads its own d = t + 256 k elements back, so the reduction is the scalar path's
and the kernel comment's claim (same bits as gr_write + gr_norm_rs) holds again. On
gfx1201 the kernel time is unchanged (3.160 ms against 3.162 ms at T = 16384).
New test hip_prefill_gr_write_norm_parity (and gr_write_norm_parity on CUDA): the fused
kernel against gr_write + gr_norm_rs, bitwise, for R, rs, the BF16 image, its low half
and the FP16 image, aligned and unaligned. On the old kernel it reports 3063 of 16388 rs
words differ at T = 4097; with the fix, 0.