Archived
libr4d: moe_gemm_fp8a8_f32scale's small-M form at GLM's MTP gate_up slice -- a draft pass routes one token
Every draft pass runs the MTP layer's experts on one token: eight experts, and the expert-major
form's four column tiles a block below 128 routed rows left sixteen blocks, each a chain of 64
stages of 256 K. fp8_f32scale_small takes one column tile of the y-th touched expert a block
(grid rows min(experts, rows) + 1, as the MXFP4 small-M form), stages of 512 K, unconditional
loads masked at the store, LDS-only barriers, and a 128 of K's eight fragment pairs loaded before
its WMMA chain; the per-element sequence is the expert-major form's, so are the bytes.
The rule takes it at the MTP gate_up slice (288 experts, top 8, 512 x 4096) to 384 routed rows.
Down's K of 256 gains nothing from it (within a few percent, a quarter slower at three tokens) and
keeps the expert-major form. Measured (r4d_selftest --cold 256 --perfmxf8), expert-major against
small-M, us:
tokens 1 2 4 8 16
73.6 83.6 118.4 214.0 375.6
36.7 65.8 114.9 203.9 343.9
Byte for byte against the expert-major form at 1 to 16 tokens during the work, and in r4d_emu,
whose grouped cases hold both forms at GLM's MTP slices to a host restatement of the sequence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
961a9b3f13
commit
4fdc786332
3 files changed
+348
-2
No files matched your search
@@ -15235,7 +15235,8 @@ static void mx_perf(const Plugin& pl, int64_t Mtok, int iters, int64_t E, int64_
|
||||
const int64_t pbm = pwide || (K > 256 && Tr >= 12288) ? 64 : 32;
|
||||
const bool p64 =
|
||||
glm && Tr >= (P.srt ? 5760 : 769) && (Tr + pbm - 1) / pbm + E <= 65535;
|
||||
const bool small = glm && Tr <= (P.srt ? 32 : 384);
|
||||
const bool small = (glm && Tr <= (P.srt ? 32 : 384)) ||
|
||||
(f8 && E == 288 && top_k == 8 && !P.srt && Tr <= 384);
|
||||
const bool expert = !p64 && !small && (f8 || Tr <= (glm ? (P.srt ? 6143 : 768) : 511));
|
||||
const bool pipe = !p64 && !small && !expert && glm;
|
||||
const int64_t jr = p64 ? pbm : pipe ? 32 : 16;
|
||||
|
||||
Reference in new issue
Block a user