moe_gemm_q decode form: the sorted operand's own kernel, a block a run tile and G column tiles

At 16 sequences the (tile, run) grid gives down 25 600 blocks. Many find no
run, the others stage 4-8 KB of weight behind a search and a barrier pair,
and a run that crosses a 16-row tile is read twice. R4D_MOE_DOWN2=1 sends
down's decode-form launch to moe_down_dec_kernel: one block per 16-row tile
of a run, found among all runs in one round trip, and G 64-column tiles a
block whose passes form one pipeline. G follows the routed rows (1 below
200, 2 below 480, 4 above) or R4D_MOE_DOWN2_G. Bit-identical, off by
default. 16 concurrent: 36.4 -> 33.9 ms a step.
This commit is contained in:
keptn42 authored and Deadcode committed 2026-10-07 11:13:46 +02:00
1 parent 432b50d7dd
commit ee5fcf1024
3 files changed
+762

No files matched your search

+5
View File
@@ -660,6 +660,11 @@ void r4d_moe_pf2_pin(int pin);
// The parts the launches since the last call took, under a pin, as R4D_MOE_PF2's mask; cleared by
// the call. A test reads it to know a part's kernel ran rather than the default's.
uint32_t r4d_moe_pf2_used(void);
// THE SORTED OPERAND'S DECODE KERNEL, pinned for a test: 0 is R4D_MOE_DOWN2's rule (and
// R4D_MOE_DOWN2_G's), -1 the (tile, run) form, n > 0 moe_down_dec_kernel at n column tiles a block.
// Inside the decode form only, which r4d_moe_gemm_pin_prefill(2) pins. Bit-identical, and
// r4d_selftest compares their bytes.
void r4d_moe_gemm_pin_down2(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 the PF2 kernels the rule takes from