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

+3 -2
View File
@@ -1,4 +1,4 @@
/* abi_layout_table.h -- every abi/ struct's size and field offsets at RAD_ABI_VERSION 36 and
/* abi_layout_table.h -- every abi/ struct's size and field offsets at RAD_ABI_VERSION 37 and
* RAD_FORMAT_VER 2, as { type, field, offset, size } rows ("" is the struct itself). A snapshot
* of the headers on x86-64 Linux, which abi_layout_test.cpp holds the layout to; regenerate it
* from the test's printout only together with a version bump. */
@@ -109,7 +109,7 @@
{ "RadBufDecl", "domain", 60, 4 },
{ "RadBufDecl", "derive", 64, 8 },
{ "RadBufDecl", "kv", 72, 4 },
{ "RadBuildCtx", "", 0, 200 },
{ "RadBuildCtx", "", 0, 208 },
{ "RadBuildCtx", "rank", 0, 4 },
{ "RadBuildCtx", "world_size", 4, 4 },
{ "RadBuildCtx", "max_tok", 8, 8 },
@@ -142,6 +142,7 @@
{ "RadBuildCtx", "calib_tokens", 176, 8 },
{ "RadBuildCtx", "gen_max_pixels", 184, 8 },
{ "RadBuildCtx", "gen_max_refs", 192, 8 },
{ "RadBuildCtx", "expert_file_tier", 200, 4 },
{ "RadAudioGenBatch", "", 0, 344 },
{ "RadAudioGenBatch", "n_lane", 0, 8 },
{ "RadAudioGenBatch", "lane", 8, 8 },