moe_mxfp4: the small-M form at GLM's TP4 slices too

At TP4 the launcher fell back to the expert-major form for every decode step. The small-M form
now takes gate_up from 9 to 384 routed rows (past one token's 8, where it reads 5 % slower) and
down up to 384 at the K256 x4 tiles. perfmx --perfmx-tp 4, cold, gfx1201, output byte-identical:
gate_up 3 to 18 % faster from 2 to 48 tokens, down 37 % at one token and 4 % at 48.

Served at TP4 with --vision-tower-placement ram, BetterBench against the same tree without it:
decode 52.3 -> 55.7 tok/s, 1/2/3/4 conversations 49.8/73.5/85.6/91.1 -> 52.7/76.5/90.0/96.4,
prefill unchanged. Temp-0 replies identical, needles 8/8 at 4 x 119k.
This commit is contained in:
AnimusNull authored and AnimusNull committed 2026-11-05 14:18:21 +00:00
1 parent 220cb3f12c
commit b954585f9f
2 files changed
+18 -9

No files matched your search

+4 -2
View File
@@ -20125,8 +20125,10 @@ 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 =
t8 && Tr >= (P.srt ? 5760 : 769) && (Tr + pbm - 1) / pbm + E <= 65535;
const bool t4_small = glm && !t8 && Tr <= 384 && (P.srt || Tr > top_k);
const bool small =
(form == 1 || form == 3 ? Tr <= 384 : form != 2 && t8 && small_fits) ||
(form == 1 || form == 3 ? Tr <= 384
: form != 2 && ((t8 && small_fits) || t4_small)) ||
(f8 && E == 288 && top_k == 8 && !P.srt && Tr <= 384);
const bool expert = !p64 && !small && (f8 || Tr <= (t8 ? (P.srt ? 6143 : 768) : 511));
const bool pipe = !p64 && !small && !expert && glm;
@@ -20138,7 +20140,7 @@ static void mx_perf(const Plugin& pl, int64_t Mtok, int iters, int64_t E, int64_
else
for (int64_t i = 0; i < Tr; ++i)
streams += i % 16 == 0 || owner[(size_t)i] != owner[(size_t)(i - 1)];
const bool tile4 = K <= 256 || form == 3;
const bool tile4 = K <= 256 || form == 3 || (form == 0 && !t8 && P.srt);
const std::string label =
p64 ? fmt("P64 BM%lld BN%d K%d", (long long)pbm, pwide ? 128 : 64,
K > 256 && !pwide ? 256 : 128) +