libr4d: rmsnorm_quant_i8 at decode heights loads the row's operands before its reductions

The kernel re-read its row from memory in each of three passes, each behind a barrier, so a
row cost three dependent round trips: 11 us a launch at any height on gfx1201 against a 4.2 us
launch floor. Every pass partitions the row the same way, so at 1024 threads (M <= 32, n <= 8192)
each thread now loads its own columns of the branch row, the residual and both gains in one go
and keeps them in registers; only the fragment-order store crosses threads, through LDS as
before. Same sums in the same order and the same per-element arithmetic, so the same bytes.
8.2 us a launch in a four-card microbenchmark at 1, 4, 8 and 16 rows of 5376.

The row gains a reg axis (1 the new form and the default, 0 the old), and the selftest checks
both forms against the unfused chain at M=8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AshlynandClaude Opus 5.5 authored and StillDeadcode committed 2026-10-21 09:24:39 +02:00
1 parent 3251975384
commit 13a917910f
4 files changed
+141 -9

No files matched your search

+3
View File
@@ -359,6 +359,9 @@ void r4d_cfg_split (const RadArgs*, struct R4dSplitCfg*);
void r4d_cfg_ar (const RadArgs*, struct R4dArCfg*);
void r4d_cfg_topk (const RadArgs*, struct R4dTopkCfg*);
void r4d_cfg_mv (const RadArgs*, struct R4dMvCfg*);
/* rmsnorm_quant_i8's decode form: 1 the row's operands in registers before the reductions, 0 the
* pass-per-read kernel; the row's `reg` axis. */
int r4d_cfg_rmsq8_reg(const RadArgs*);
} /* extern "C" */