MXFP4 decode rows: review fixes and docs

The parts of the series' review rounds that concern these rows, carried over when the series was
split:

- gemm_mxfp4a8_decode: the 64-wide slab is chosen by the split the launch runs (a pin or a tuned
  point included), as before the register kernel; the header states the split-row bound the rule
  applies (ks*M = 1024).
- r4d_selftest: the priority order of the MXFP4 rows is checked (gemv / gemv_wide over decode,
  decode_shortk over gemv_wide, decode over tiled); gemv_wide's numeric cases at K 256 and at 56
  rows; the M-invariance check names the decode_shortk corner it does not cover.
- Comments: gemv_wide's two-tile condition (N >= 4096, K >= 3072, an even tile count), the
  decode_shortk corner's bit change at M = 33, decode_shortk in the list of rows whose state is
  keyed on the output.
- libr4d/README.md: the rows by row count, with the measurements behind each band;
  docs/TOOLS.md: r4d_selftest and its --perfmxd mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
mici81andClaude Opus 5.5 authored and StillDeadcode committed 2026-10-24 11:09:03 +02:00
1 parent 40d205929a
commit fb880cbc2d
6 files changed
+140 -14

No files matched your search

+7 -5
View File
@@ -4812,7 +4812,8 @@ static const RadConstraint cGemmMxfp4A8Gemv[] = {
/* gemm_mxfp4a8_gemv_wide: the same entry at 9..64 rows, where only the WMMA form serves (K % 128).
* The form's sum order for a row is its 16-row tile's chain alone, so a row's bits are the same in
* both rows at every M. Several streams with speculation (4 x 1 + 7 drafts = 32) land here, except
* the decode kernel's short-K corner below. */
* in the decode kernel's short-K corner below, which sums 33..64 rows in the decode kernel's order (a
* row's bits there change at M = 33). */
static const RadConstraint cGemmMxfp4A8GemvWide[] = {
C_GE("M", 9), C_LE("M", 64), C_DIV("K", 128), C_DIV("N", 16), C_IN("dtype", "mxfp4a8"),
};
@@ -9453,10 +9454,11 @@ extern "C" const RadKernelInfo* rad_kernel_at(int i) {
* every collective the peer flags and exchange buffers the all-reduces own
*
* gemm_fp8a8_nt_m16's finisher counters are keyed on the stream and the output;
* gemm_mxfp4a8_decode's split partial is the op's scratch and its arrival counters are keyed on the
* output alone; router_gemm_topk_scatter_bf16's arrival counter belongs to its op instance (taken
* at init, one per declared op and band). Concurrent launches never share these, so those three
* rows are concurrent. A new row with stream-ordered state belongs in the list above.
* gemm_mxfp4a8_decode's (and gemm_mxfp4a8_decode_shortk's, the same entry) split partial is the
* op's scratch and its arrival counters are keyed on the output alone;
* router_gemm_topk_scatter_bf16's arrival counter belongs to its op instance (taken at init, one
* per declared op and band). Concurrent launches never share these, so those four rows are
* concurrent. A new row with stream-ordered state belongs in the list above.
*
* lora_* ordered on purpose: the core appends them behind the GEMM whose `y` they
* update and refills the pools they read between steps with its own copies,