Archived
moe prefill forms behind R4D_MOE_PF2: wide gather, parallel scan and map prefix, 256-column down
In a prefill chunk moe_gather loads two bytes a lane and waits on every slot, moe_scatter scans on one thread, and so does the run map's prefix. R4D_MOE_PF2=1, or a mask of the parts: 2 a wave a token and 16 bytes a lane with every slot's row in flight, 4 its column groups last first, 8 a parallel scan with the tail folded into the placement, 16 the map prefix in parallel, 32 a 256-column run-aligned down tile (w4). Each part keeps its sums in the same order or is integers: bit-identical. Unset, every launch is as before.
This commit is contained in:
1 parent
33778b2b8c
commit
e31be583a9
3 files changed
+668
-14
No files matched your search
@@ -652,6 +652,14 @@ void r4d_moe_gemm_pin_prefill(int form);
|
||||
// every class's K a multiple of 256, a format that folds scale groups). The two are bit-identical,
|
||||
// and r4d_selftest compares their bytes.
|
||||
void r4d_moe_gemm_pin_fk(int pin);
|
||||
// THE PREFILL MoE FORMS (R4D_MOE_PF2), pinned for a test: below zero the switch's rule, otherwise
|
||||
// the value the switch would hold -- 0 none, 1 every part, else a mask of the parts (r4d_moe.hip
|
||||
// lists them). Every part is bit-identical to the form it replaces, and r4d_selftest compares their
|
||||
// bytes: moe_gather and moe_scatter at a prefill chunk, and the GEMM's run-aligned form.
|
||||
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 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
|
||||
|
||||
Reference in new issue
Block a user