Archived
MXFP4 gated fold: review fixes and docs
The parts of the series' review rounds that concern the fold, carried over when the series was split: - gemm_mxfp4a8_gated_gemv: operand dtypes checked, the activation scale grid read as the gemm_nt_q rows read it (mx_ascale_grid), row pitches checked against the widths; the arrival counters are zeroed before any launch reads them (the memset is on the null stream, which the engine's streams need not wait for). - The layout hooks refuse an operand the gated row does not have; the GeGLU chain refuses out_bf16 (its bf16 plane is a temporary there). - r4d_selftest: the reference plane through the gemv row's own hook must be the same bytes; the small gated cases at K 256. - libr4d/README.md and docs/TOOLS.md: the row, and --perfmxd's fold timing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cbc299417e
commit
2721f7c951
8 files changed
+63
-25
No files matched your search
+12
-2
@@ -6121,6 +6121,16 @@ static void mxfp4a8_gated_case(const Plugin& pl, int64_t M, int64_t N, int64_t K
|
||||
ok(nm, false, "relayout refused");
|
||||
return;
|
||||
}
|
||||
/* The reference plane through the gemv row's own hook (its operand 6) must be the same bytes:
|
||||
* a remap that handed the gated row's b_ref another form would otherwise pass, both kernels
|
||||
* reading the same wrong plane. */
|
||||
{
|
||||
std::vector<uint8_t> wr_gemv;
|
||||
if (stored(rv, lp, 6, p, { "scale" }, &wr_gemv) != RAD_OK || wr_gemv != wr) {
|
||||
ok(nm, false, "b_ref stored differently by the gated and gemv rows");
|
||||
return;
|
||||
}
|
||||
}
|
||||
const int64_t nkb = K / 128, n = N / 2, gkb = n / 128;
|
||||
std::vector<uint8_t> ha((size_t)(M * K));
|
||||
std::vector<float> as((size_t)(M * (ablk ? nkb : 1)));
|
||||
@@ -27388,10 +27398,10 @@ static void device_phase(const Plugin& pl) {
|
||||
* K, and the per-row activation scale. */
|
||||
for (const int64_t m : { 1, 2, 3, 4, 5, 6, 7, 8 }) mxfp4a8_gated_case(pl, m, 17408, 5120, true);
|
||||
mxfp4a8_gated_case(pl, 8, 21504, 5376, true);
|
||||
mxfp4a8_gated_case(pl, 3, 256, 128, true);
|
||||
mxfp4a8_gated_case(pl, 3, 256, 256, true);
|
||||
mxfp4a8_gated_case(pl, 5, 1024, 640, false);
|
||||
for (const int64_t m : { 1, 4, 8 }) mxfp4a8_gated_case(pl, m, 21504, 5376, true, true);
|
||||
mxfp4a8_gated_case(pl, 3, 256, 128, true, true);
|
||||
mxfp4a8_gated_case(pl, 3, 256, 256, true, true);
|
||||
mxfp4a8_gated_case(pl, 2, 1024, 640, false, true);
|
||||
/* Parts (ParoQuant): each weight part against its own activation copy, with bounds off any
|
||||
* kernel's tile, two and three parts, at every band. */
|
||||
|
||||
Reference in new issue
Block a user