libref, libavx: had_quant_act_i8g, the activation of the i8a8h GEMMs

had_quant_act_fp8 at int8 codes (top 127), one body shared by both in each library, so a
rotated int8 trunk runs on the host kernels too. gemm_nt_q needs no change: both libraries pick
the int8 product from the operands' dtypes, and i8a8h's rotation is in the values. libref's
operand description takes i8a8h, and rad-avx-check gains cases for the op and the dtype.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
eddie168168andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-19 10:42:13 +02:00
1 parent 037427e67e
commit 61afe50b96
10 files changed
+84 -11

No files matched your search

+10
View File
@@ -1062,6 +1062,12 @@ static const RadOpSchema kSchemas[] = {
"amax(rotated) / 448, shaped [M, n/group] in f32. n must be a multiple of `group` -- a rotation "
"block cannot straddle the end of a row. NOT interchangeable with quant_act_fp8 in either "
"direction: the consumer must be a weight that was rotated the same way." },
/* Its int8 twin, the activation of the i8a8h GEMMs; the factor of `group` is the weight's here
* too. */
{ "had_quant_act_i8g", ARR(pQuant), ARR(oQuantFp8),
"quant_act_i8g with a Walsh-Hadamard rotation of width `group` along n first: scale = "
"amax(rotated) / 127 per group, [M, n/group] in f32, n a multiple of `group`. Pairs with an i8 "
"weight rotated the same way, its scale carrying the factor of `group` (dtype i8a8h)." },
/* The calibration op, the only one no forward pass issues: it runs under a calibration flag and
* its output is read at convert time, in another process, through a file. `dtype` is the input's:
* fp8a8 where the tap is a quantiser's output, bf16 without `a_scale` for a plain activation. */
@@ -1788,6 +1794,10 @@ SIMPLE("ref_had_quant_act_fp8", "had_quant_act_fp8", "quant",
"width-`group` Hadamard, then the same symmetric block-scaled E4M3 quantiser",
"float in, fp8_e4m3 out, f32 scale per group; n a multiple of group",
ref_had_quant_act_fp8),
SIMPLE("ref_had_quant_act_i8g", "had_quant_act_i8g", "quant",
"width-`group` Hadamard, then the symmetric int8 quantiser, one scale per group",
"float in, i8 out, f32 scale per group; n a multiple of group",
ref_had_quant_act_i8g),
SIMPLE("ref_gram_accum", "gram_accum", "quant",
"h += x^T x over a dequantised E4M3 activation, or a plain bf16 one -- the Gram matrix "
"GPTQ calibrates on",