libr4d: rmsnorm_quant_i8 -- rmsnorm and the w4a8 activation quantiser in one pass

A w4a8 linear is fed by rmsnorm then quant_act_i8, two single-row
dispatches at a decode batch; in a sandwich-norm model (Gemma 2/3/4) the
residual junction in front adds a post-norm, the add and a layer scalar,
five dispatches at every junction. rmsnorm_quant_i8 is that chain in one
pass over the row, with the junction optional (w_post, scalar and the
residual operand).

Byte-identical to the chain it replaces: the same row partition
(r4d_act_threads) and a bf16 rounding wherever the chain stores. The
selftest compares it against the chain at three forms x M 1/8/40.
This commit is contained in:
keptn42 committed 2026-10-11 02:23:39 +00:00
1 parent 8bde9f9c16
commit dd6a7071a8
6 files changed
+387

No files matched your search

+1
View File
@@ -141,6 +141,7 @@ set(R4D_UNITS
"r4d_model_bf16|"
"r4d_sample_stages_f32|"
"r4d_quant_act_i8|"
"r4d_rmsnorm_quant_i8|"
"r4d_had_quant_act_i8|"
"r4d_rmsnorm_had_quant_i8|"
"r4d_ar_ln_had_quant_i8|"