Repository navigation
Conversation
…pace probe has_linear() recognised only .weight (dense/NVFP4) and .trellis (EXL3), so a compressed-tensors NVFP4 checkpoint - whose projections are stored as .weight_packed - probed 0 routed-expert layers and the build was refused with "qwen4_exp: 0 of 48 layers have routed experts", despite the format being detected and all tensors loading. Attention probes passed because those weights are FP8 with a plain .weight; only the NVFP4 experts are packed. Verified on 2x DGX Spark (GB10, sm_121) at TP2 with a compressed-tensors NVFP4 Flash-Next checkpoint: probe reports 48/48 and the model serves. ModelOpt and EXL3 paths are unaffected. Co-Authored-By: Claude Opus 5 <[email protected]>
|
All contributors have signed the CLA. Thank you! |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
…e probe Mirrors exl3_layout_is_counted for a mixed-precision compressed-tensors checkpoint: attention and lm_head FP8 with a plain .weight, routed experts NVFP4 with .weight_packed, BF16 n-gram shards deferred. Without the has_linear fix this fails with 0 routed-expert layers, which is exactly the load that was refused in the field. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audit_namespace()refuses to build any compressed-tensors NVFP4 checkpoint withqwen4_exp: 0 of 48 layers have routed experts, even though the MoE loader behind the probe handles the packed layout. The probe looks for a projection under.weightor.trellisonly; compressed-tensors spells it.weight_packed.Reproduction
Serve any compressed-tensors NVFP4 Flash-Next checkpoint — e.g.
RedHatAI/Qwen3.8-Flash-Next-NVFP4(quant_method: compressed-tensors,format: nvfp4-pack-quantized), whichinstall/checkpoint.jsonalready lists as a supported alternative to the NVIDIA ModelOpt build:The format is detected correctly and the weights do load — only the pre-flight count is wrong.
Root cause
crates/spark-model/src/weight_loader/qwen4_exp/probe.rs:In a compressed-tensors checkpoint the routed experts are stored as
…mlp.experts.{e}.gate_proj.weight_packed(+.weight_scale,.weight_global_scale), sohas_linearreturns false for every layer andexpert_tensorsstays 0.This only bites the experts because, in a mixed-precision checkpoint, attention and the shared expert are FP8 with a plain
.weight— which is why the same probe reports the GDN/full-attention split correctly while the MoE count is zero.Verification
Built from this branch with only this change and served on 2× DGX Spark (GB10, sm_121) at TP2 over ConnectX-7, profiles
8x32kand4x262k:48routed-expert layers (was0); model builds and serves17*23 = 391)8x32k: 74.2 tok/s code, 50.6 prose, TTFT 0.12–0.18 s4x262k: 33K-token cold prefill TTFT 8.47 s, then 44.9 tok/s decodeModelOpt and EXL3 checkpoints are unaffected — the added clause is a third alternative in an
||chain, reached only when the first two miss.Scope
has_linearalso backs thelm_head,linear_attn.in_proj_qkv,self_attn.q_proj,indexer.index_qk_projand vision probes, so fixing the helper makes those tolerant of packed layouts too, rather than special-casing the MoE one.Note for upstream
Avarok-Cybersecurity/atlasmaincarries the same bug in an earlier form —probe.rsdoes a barestore.contains(&format!("{lp}.mlp.experts.{first_local}.gate_proj.weight"))with no helper — so it would need the equivalent change when these series are proposed upstream.