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
View File
@@ -1028,6 +1028,7 @@ RadBuildCtx Engine::build_ctx(int rank, int64_t max_tok) const {
bc.state_dtype = cfg_.state_cache_dtype == "f16" ? RAD_F16 : 0;
bc.draft_coupling = cfg_.draft_coupling ? 1 : 0;
bc.tp_wire_min_bytes = cfg_.tp_wire_min_kb * 1024;
bc.expert_file_tier = cfg_.weights_disk_tier ? 1 : 0;
bc.scope = "";
bc.max_enc_patches = cfg_.mm_max_patches > 0 ? cfg_.mm_max_patches : 0;
bc.max_audio_frames = cfg_.mm_audio_frames > 0 ? cfg_.mm_audio_frames : 0;