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

+9 -2
View File
@@ -153,6 +153,8 @@ std::vector<Case> build_cases() {
HS("dtype", "bf16") }, EB(5, 256, 2, 1.5));
add("had_quant_act_fp8", { HI("M", 5), HI("n", 256), HI("group", group),
HS("dtype", "bf16") });
add("had_quant_act_i8g", { HI("M", 5), HI("n", 256), HI("group", group),
HS("dtype", "bf16") });
add("had_quant_act_i8", { HI("M", 5), HI("n", 256), HI("group", group),
HS("dtype", "bf16") });
add("dequant", { HI("M", 5), HI("n", 256), HI("group", group),
@@ -221,11 +223,14 @@ std::vector<Case> build_cases() {
add("gemm_nt_q_bias", { HI("M", M), HI("N", 96), HI("K", 256), HI("group", 128),
HS("dtype", dt) }, 0, fl);
}
/* The int8 trunk (row-major codes, a scale per row per 128 of K on both sides) and OCP-MXFP4
* (e2m1 codes with an E8M0 exponent per 32 of K against the E4M3 activation). */
/* The int8 trunk (row-major codes, a scale per row per 128 of K on both sides; i8a8h is the
* same operands over a rotated weight) and OCP-MXFP4 (e2m1 codes with an E8M0 exponent per 32
* of K against the E4M3 activation). */
for (int M : { 1, 65 }) {
add("gemm_nt_q", { HI("M", M), HI("N", 96), HI("K", 256), HI("group", 128),
HS("dtype", "i8a8") }, 0, 2.0 * M * 96 * 256);
add("gemm_nt_q", { HI("M", M), HI("N", 96), HI("K", 256), HI("group", 128),
HS("dtype", "i8a8h") }, 0, 2.0 * M * 96 * 256);
add("gemm_nt_q", { HI("M", M), HI("N", 96), HI("K", 256), HI("group", 32),
HS("dtype", "mxfp4a8") }, 0, 2.0 * M * 96 * 256);
}
@@ -961,6 +966,8 @@ std::vector<Case> build_cases() {
HS("dtype", "bf16") }, (double)M * 2048 * 3, 0);
speed("quant_act_i8g", { HI("M", M), HI("n", 2048), HI("group", 128),
HS("dtype", "bf16") }, (double)M * 2048 * 3, 0);
speed("had_quant_act_i8g", { HI("M", M), HI("n", 2048), HI("group", 128),
HS("dtype", "bf16") }, (double)M * 2048 * 3, 0);
speed("had_quant_act_i8", { HI("M", M), HI("n", 2048), HI("group", 128),
HS("dtype", "bf16") }, (double)M * 2048 * 3, 0);
}