glm5next: experts split by width at four ranks and up, whole for the file tier

Whole experts on their rank let the routed weights live on the drive, which
a two-card host needs, but at four and eight ranks they leave the shapes the
MXFP4 kernels are tuned for: glm_prefill wants 288 experts an op and finds 72.
On 4 x R9700 that cost prefill two thirds and four-stream throughput 37%.

Keep the width split at four ranks and up, as the kernels expect, and take
whole experts at two ranks or when --weights-disk-tier needs them (ABI 37,
RadBuildCtx::expert_file_tier). The file tier's graph at eight ranks keeps
main's pin, and the route-count fix that came with expert parallelism stays.
This commit is contained in:
AnimusNull authored and AnimusNull committed 2026-11-05 14:19:17 +00:00
1 parent b954585f9f
commit 8ef50a7708
8 files changed
+56 -29

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ extern "C" {
* version is refused at load with both versions printed. Each also exports the layout's fingerprint
* (rad_abi_layout.h), so two layouts given one number are refused as well. A new optional export
* (e.g. rad_plugin_reference) is not a change of shape: a plugin without it gets the default. */
#define RAD_ABI_VERSION 36u
#define RAD_ABI_VERSION 37u
/* ================================================================== plugin identity */
/* One value per plugin, not flags (QUANT is 3). RAD_PLUGIN_QUANT is a quantiser plugin:
+1
View File
@@ -146,6 +146,7 @@ ABI_FIELD(RadBuildCtx, calib_layer_hi)
ABI_FIELD(RadBuildCtx, calib_tokens)
ABI_FIELD(RadBuildCtx, gen_max_pixels)
ABI_FIELD(RadBuildCtx, gen_max_refs)
ABI_FIELD(RadBuildCtx, expert_file_tier)
ABI_STRUCT(RadAudioGenBatch)
ABI_FIELD(RadAudioGenBatch, n_lane)
ABI_FIELD(RadAudioGenBatch, lane)
+6
View File
@@ -295,6 +295,12 @@ typedef struct RadBuildCtx {
* fixed buffers ignores them, and the core says so at startup. */
int64_t gen_max_pixels;
int64_t gen_max_refs;
/* ---- appended in ABI 37 (where a routed expert may live) */
/* --weights-disk-tier: nonzero when weights may stay in the container. An expert read from the
* drive has to be stored whole, so a plugin that can lay its routed experts out either way
* keeps them whole for this; 0 leaves it free to split them across the ranks by width. */
int expert_file_tier;
} RadBuildCtx;
/* ================================================================== control vectors */