qwen4exp: the plugin owns the expert width split; geom_from does not refuse it first

geom_from divides n_ff by the world before the plugin's own split runs,
and 640 does not divide by 3. The plugin cuts the routed experts' width by
whole fp8 blocks and parity at any world up to the block count (1.0.8),
so the refusal is answered before it is asked. geom_from gains
arch_splits_ff (default off): with it, a width the world does not divide
is left whole in g.n_ff for the plugin to slice; a width that divides is
unaffected, and every other plugin keeps the refusal because for them
g.n_ff is the per-rank width. qwen4exp opts in.
This commit is contained in:
baKon authored and StillDeadcode committed 2026-10-05 19:31:12 +02:00
1 parent 2149a1a757
commit 6b394ccca6
2 files changed
+15 -3

No files matched your search

+4 -1
View File
@@ -318,7 +318,10 @@ static int declare(RadBuilder* b, const RadModelMeta* meta, const RadBuildCtx* c
m.nm = Names(ctx->scope ? ctx->scope : "");
Names& nm = m.nm;
RAD_ARCH_TRY(geom_from(m.g, meta, ctx, "bf16", RAD_BF16));
/* arch_splits_ff: the routed experts' width (640 = five fp8 blocks) is split by the plugin
* below, by whole blocks and parity, at any world up to the block count -- three ranks included,
* which 640 does not divide. geom_from must not refuse what the plugin then answers. */
RAD_ARCH_TRY(geom_from(m.g, meta, ctx, "bf16", RAD_BF16, /*arch_splits_ff=*/true));
Geom& g = m.g;
/* Qwen4-Exp's norms are all `x_hat * (1 + w)` -- `Qwen3NextRMSNorm.forward` is