moe_gemm_q decode form: the block's run in one round trip

A decode-form block finds its run by a chunked search: four to six
dependent L2 round trips and two barriers a chunk, paid also by blocks that
find nothing. R4D_MOE_RUNSCAN=1 loads the block's sorted rows and all
offsets in one batch, numbers the runs in expert order with a DPP scan, and
hands the run's bounds over LDS. Up to 512 experts; above that the chunked
search runs. Bit-identical, off by default. Flash-Next at tp 4 with UW and
RS: 36.9 -> 36.1 ms a step at 16 concurrent.
This commit is contained in:
keptn42 authored and StillDeadcode committed 2026-10-06 11:22:43 +02:00
1 parent 6e14caaedd
commit 7843a3d400
3 files changed
+154 -35

No files matched your search

+3
View File
@@ -635,6 +635,9 @@ void r4d_moe_gemm_pin_fk(int pin);
// THE DECODE FORM'S WEIGHT ADDRESS, pinned for a test: 0 is R4D_MOE_UWLOAD's rule, 1 the generic
// table pointer, 2 a uniform global base. Bit-identical, and r4d_selftest compares their bytes.
void r4d_moe_gemm_pin_uw(int pin);
// THE DECODE FORM'S RUN SEARCH, pinned for a test: 0 is R4D_MOE_RUNSCAN's rule, 1 the chunked
// search, 2 the one-pass search. Bit-identical, and r4d_selftest compares their bytes.
void r4d_moe_gemm_pin_rs(int pin);
// THE GATED RESIDUAL READ'S PREFILL TILE, pinned for a test: 0 is the launcher's rule, 1 the decode
// tiles' kernels at 128 rows (hc_down_tiled, then hc_up_tiled into `ubuf` and hc_mix), 2 the wide
// kernels (which then refuse a shape they are not built for), 3..9 the PF2 forms that