Repository navigation
fix(qwen4_exp): accept compressed-tensors .weight_packed in the namespace probe - #173
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 N 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: the probe reports every layer and the model serves. ModelOpt and EXL3 paths are unaffected - the added clause is a third alternative in an || chain, reached only when the first two miss. Co-Authored-By: Claude Opus 5 <[email protected]>
|
All contributors have signed the CLA. Thank you! |
|
I have read the CLA Document and I hereby sign the CLA |
…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]>
|
Added a regression test, Verified by building the engine and running the crate's own test list, with Note the build I ran this in was pinned to a downstream fork's engine commit (that is the GB10 Flash-Next tree I have hardware for); the test itself touches only |
|
Thanks for the PR @AdamSWS! Will get to this ideally tomorrow, seems like this was showing up in mysterious ways on another PR. Please join the discord if you like, we can chat in more detail on it :) |
#167 and #169 merged to main directly; the train already carried their heads, so this records the shared history. #185 (serve-amd.sh THINKING switch) and #173 (qwen4_exp compressed-tensors probe) come along. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
audit_namespace()refuses to build any compressed-tensors NVFP4 checkpoint withqwen4_exp: 0 of N layers have routed experts, even though the format is detected correctly, every tensor loads, and the MoE loader behind the probe handles the packed layout.has_linear()recognises.weightand.trellisbut not.weight_packed.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(plus.weight_scale/.weight_global_scale), sohas_linearis false for every layer andexpert_tensorsstays 0.Only the experts are affected 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.Reproduction
Any compressed-tensors NVFP4 Flash-Next checkpoint, e.g.
RedHatAI/Qwen3.8-Flash-Next-NVFP4(quant_method: compressed-tensors,format: nvfp4-pack-quantized):Verification
Built an engine from the equivalent downstream tree with only this change and served on 2× DGX Spark (GB10, sm_121) at TP2 over ConnectX-7:
0); the model builds and serves17*23 = 391)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. ModelOpt and EXL3 checkpoints are unaffected.The same fix is open against a downstream fork as Enntity#1, where it was first found.