Repository navigation
fix(claim): size the MoE bandwidth floor from active parameters - #1150
Conversation
[Medium impact] The change appears safe to merge.
|
AlexsJones
left a comment
There was a problem hiding this comment.
Nice catch, claim asking DeepSeek-V3 for 14 TB/s while fit happily runs it was a clear sign the two had drifted.
Checked at f6c95cc:
fit_boundsnow sizes the bandwidth floor fromactive_parameters × quant_bpp(quant)only whenis_moeand an active count is present, and falls back to all weights otherwise. That's the sameactive_parameters.filter(|_| model.is_moe)gateestimate_tpsuses infit.rs, so the two stay in step.- The memory floor still uses
weights_gb(all experts), which is right: the weights have to be resident even if only some are read per token. read_gbuses the samequant(including a--quantoverride) as the weights estimate, so an override moves both bounds together.- The new test pins both branches (64 GB/s with an active count, 633 without), and the header only says
activewhen the read size is actually smaller than the weights.
As you note, this floor skips estimate_tps's MoE overhead factor, so it's a little more permissive than fit for MoE models. That's fine for a scheduling floor and matches how the dense case already works.
CI is green on all three platforms plus fmt and clippy. Good to merge.
What
llmfit claimsets the bandwidth floor asmin_tps × weights / efficiency, whereweightsis the whole model. For a MoE model, decode reads only the active experts per token, andfit.rs estimate_tpsalready sizes speed fromactive_parameters. Soclaimasks MoE models for far more bandwidth thanfitsays they need. For large MoE models no device can match:Same on v1.1.17 and main. #807 fixed the same mismatch in
plan.Change
fit_boundsusesactive_parameters × quant_bpp(quant)as the bytes read per token when the model is MoE and has an active count, and all weights otherwise (the same fallback asestimate_tps). The memory floor still covers all weights. The YAML comment shows the per-token size and marks itactive:Dense models are unchanged (Qwen3-8B stays at 173 GB/s). This keeps the simple
bandwidth × efficiency / bytesformula; it does not copyestimate_tps's Tier 1 split or MoE overhead factors. It also uses the catalog'sactive_parametersas is, likeestimate_tpsdoes, so a repack with an undercounted active figure gets a low floor in both.Tests
New
bounds_use_active_parameters_for_moe_bandwidth(30B total / 3B active: memory 18 Gi, bandwidth 64; without an active count, 633). It fails on main (left: 633, right: 64).cargo test: all green (llmfit-core lib 855 passed vs 854 on main).cargo fmt --checkclean.cargo clippy --all-targets --all-features: 61 warnings, the same set as main.