Archived
Two gemm_nt_q rows at dtype m2xfp4: a split-K decode kernel that stages the weight through LDS, and a tiled prefill kernel after the mxfp4a8 one. The relayout appends the [K/32][N] meta plane to the fragment-order codes and r4d_m2xfp4.h's e4m3 staging table takes the subgroup multiplier as a second index, so the WMMAs and the epilogue are the mxfp4 kernels'. The decode row keeps its own per-output arrival counters, as mxd_out_ctr does. r4d_emu_m2xfp4 runs both kernels on the host, and r4d_selftest and kbench (a 4e-2 tolerance for the k = 3 rounding) cover the rows. The raw entry points are declared in r4d_m2xfp4.h, beside the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
904 B
C++
18 lines
904 B
C++
/* cfg_stub.cpp -- the two tuned-configuration readers the M2XFP4 GEMM units call
|
|
* (r4d_cfg_mxfp4_decode, r4d_cfg_mxfp4_tiled), which libr4d defines on its declaration side
|
|
* (r4d_rows.cpp) beside the row tables. That side is not in the emu build, and every r4d_emu_*
|
|
* binary links every unit, so the readers are defined once here. Every axis default of
|
|
* tGemmMxfp4Decode and tGemmMxfp4Tiled is 0, the kernels' own rule, so reading the key or 0 is
|
|
* what r4d_rows.cpp's readers return for a caller with no tuned point. */
|
|
#include "r4d_args.h"
|
|
|
|
extern "C" void r4d_cfg_mxfp4_decode(const RadArgs* a, R4dMxDecCfg* out) {
|
|
out->ks = (int)rad_args_geti_or(a, "ks", 0);
|
|
out->bk = (int)rad_args_geti_or(a, "bk", 0);
|
|
out->nt = (int)rad_args_geti_or(a, "nt", 0);
|
|
}
|
|
|
|
extern "C" void r4d_cfg_mxfp4_tiled(const RadArgs* a, R4dMxTileCfg* out) {
|
|
out->tn = (int)rad_args_geti_or(a, "tn", 0);
|
|
}
|