M2XFP4 (MXFP4v2): quantiser, gfx1201 WMMA kernels, host rows, df2 wiring, .rad packer (Import::ParoM2), stability fixes (counters-in-scratch x3, aql publish fences), kbench rows, runbook (REMAINING.md)

This commit is contained in:
hugypufy committed 2026-10-23 12:25:59 +01:00
1 parent 9eaf10da6e
commit ea0908596b
60 files changed
+4619 -193

No files matched your search

+14 -3
View File
@@ -2003,6 +2003,17 @@ static int ref_check_gemm_q(const char* op, const RadArgs* a) {
}, \
nullptr, lay, ref::ref_relayout_planes<lay>, fn##_shape, ref::ref_unrelayout_planes<lay> }
/* gemm_nt_q: its zero-point grids join scale and zero (ref_planes.h) while its m2xfp4 arm
* concatenates codes and meta, so the row carries the hook's own relayout pair. */
#define ROWL_GQ(nm, opname, fam, what, dts, check, fn, lay) \
{ nm, opname, fam, what, SHAPE_ANY, dts, RAD_DOMAIN_HOST, 0, \
nullptr, 0, nullptr, 0, nullptr, nullptr, nullptr, \
[](const RadArgs* a, RadStream s) -> int { \
const int rc = check(opname, a); \
return rc < 0 ? rc : fn(a, s); \
}, \
nullptr, lay, ref::ref_relayout_gemm_q<lay>, fn##_shape, ref::ref_unrelayout_gemm_q<lay> }
#define DT_FLOAT "bf16 f16 f32 fp8_e4m3 fp8_e5m2 i8 i32, chosen per operand from its own dtype"
#define DT_ANY "any dtype rad_types.h names, per operand"
#define DT_FLOAT_CB DT_FLOAT "; or u4 / u5 codes into an f32 table, joined (w4nl* / w5nl*)"
@@ -2178,9 +2189,9 @@ SIMPLE("ref_dequant", "dequant", "quant", "group-scaled dequantisation", DT_ANY,
SIMPLE("ref_gemm_nt", "gemm_nt", "gemm", "C = A B^T, f32 accumulate", DT_FLOAT, ref_gemm_nt),
SIMPLE("ref_gemm_nt_bias", "gemm_nt_bias", "gemm", "C = A B^T + bias", DT_FLOAT,
ref_gemm_nt_bias),
ROWL("ref_gemm_nt_q", "gemm_nt_q", "gemm", "C = A B^T with group-scaled quantised operands",
"i8 / fp8 / float A; w4, w2, mxfp4, i8 or float B; u2 / u4 / u5 codes with an f16 scale "
"and integer zero per group, joined; f32 accumulate",
ROWL_GQ("ref_gemm_nt_q", "gemm_nt_q", "gemm", "C = A B^T with group-scaled quantised operands",
"i8 / fp8 / float A; w4, w2, mxfp4, m2xfp4, i8 or float B; u2 / u4 / u5 codes with an f16 "
"scale and integer zero per group, joined; f32 accumulate",
ref_check_gemm_q, ref_gemm_nt_q, ref::ref_layout_gemm_q),
SIMPLE("ref_gemm_nt_q_bias", "gemm_nt_q_bias", "gemm", "quantised C = A B^T + bias",
"i8 / fp8 / float A; w4, w2, mxfp4, i8 or float B; f32 accumulate", ref_gemm_nt_q_bias),