Archived
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:
1 parent
9eaf10da6e
commit
ea0908596b
60 files changed
+4619
-193
No files matched your search
+26
-2
@@ -598,6 +598,30 @@ int r4d_gemm_mxfp4a8_tiled_group(void);
|
||||
// scratch, which only the plugin ABI provides.
|
||||
int r4d_gemm_mxfp4a8_decode_max_m(void);
|
||||
|
||||
// M2XFP4 weight, fp8 activation: the MXFP4 rows at the paper's weight-side Sg-EM (arXiv 2601.19213
|
||||
// §4.4.2). Beside each E8M0 exponent per 32 K (whose adaptive bias the quantiser already folded
|
||||
// in) the weight carries one meta byte per (row, 32 of K): four two-bit subgroup multipliers, the
|
||||
// subgroup s covering columns [8s, 8s+8) of the group, value k_s in 0..3. The exact weight is
|
||||
// e2m1mag[c&7] * sign(c) * 2^(scale-127) * (1 + k_s/4); r4d_m2xfp4.h folds it into the same e4m3
|
||||
// staging bytes through a second table index, so the fold, the Wref epilogue and the activation
|
||||
// scale grids are the MXFP4 kernels'. `wm` is the [K/32][N] meta plane, `ldws` its row pitch (0 =
|
||||
// N); the k=3 multipliers on odd-mantissa codes round as r4d_m2xfp4.h documents, <= 2^-4 relative.
|
||||
void r4d_gemm_m2xfp4a8_tiled(long at, long ascale, long wq, long ws, long wm, long wref, long c,
|
||||
int M, int K, int N, int TN, int as_group, int as_rs, long stream,
|
||||
int ldws = 0, int ldc = 0);
|
||||
void r4d_m2xfp4a8_tile_a(long a, long at, int M, int K, long stream, int lda = 0);
|
||||
long r4d_m2xfp4a8_tile_a_bytes(int M, int K);
|
||||
int r4d_gemm_m2xfp4a8_tiled_group(void);
|
||||
// The decode band (M <= 128) is r4d_rad_gemm_m2xfp4a8_decode only, as for mxfp4a8: the split
|
||||
// partial and the arrival counters are the plugin ABI's. The raw entry takes the scratch that
|
||||
// carries both: the fp32 split partial with the counters in its tail (m2d_partial_bytes; null
|
||||
// runs unsplit only at KS 1).
|
||||
void r4d_gemm_m2xfp4a8_decode(long a, long ascale, long wq, long ws, long wm, long wref, long c,
|
||||
int M, int K, int N, int KS, int BK, int NT, int as_group,
|
||||
int as_rs, long scratch, long scratch_bytes, long stream,
|
||||
int lda = 0, int ldws = 0, int ldc = 0);
|
||||
int r4d_gemm_m2xfp4a8_decode_max_m(void);
|
||||
|
||||
// ---- Block-scaled FP8, as checkpoints ship it -------------------------------------------------
|
||||
//
|
||||
// Reads the weight as safetensors stores it: `<linear>.weight` F8_E4M3 row-major [N][K] and
|
||||
@@ -633,8 +657,8 @@ int r4d_gemm_fp8a16_nt_m1_block(void);
|
||||
int r4d_gemm_fp8a16_nt_m1_max_m(void);
|
||||
|
||||
// `a` is E4M3 [M][K] with `ascale` f32 [M][ceil(K/128)], r4d_quant_act_fp8's output. `scratch` is
|
||||
// the split-K partial plane; 0 runs the launch unsplit (correct, slower). Size it with the query,
|
||||
// which returns 0 when this shape will not split.
|
||||
// the split-K partial planes with the finisher's arrival counters in the tail; 0 runs the launch
|
||||
// unsplit (correct, slower). Size it with the query, which always includes the counters.
|
||||
//
|
||||
// Split-K is not bit-comparable across settings: ksplit repartitions K, so the accumulation order
|
||||
// differs. Two runs of the same binary still agree.
|
||||
|
||||
Reference in new issue
Block a user