You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1a88a3c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(weight_utils): match Olive's underscore quantized-weight suffix convention
preprocess_olive_weights() assumed a dotted suffix convention
(<pname>.qweight/.scales/.qzeros) that never matches Olive's actual
on-disk keys, which use an underscore suffix appended directly to the
owning parameter name (<pname>_qweight/_scales/_qzeros, e.g.
"...gate_proj.weight_qweight" or "...experts.gate_up_proj_qweight" --
see olive/common/quant/state_dict.py). Every endswith/replace check in
this function silently failed to match, so any real Olive-quantized
checkpoint fell through to the "pass through unchanged" branch instead
of being renamed/reshaped for MatMulNBits/GatherBlockQuantized/QMoE
consumption, and was missing an explicit rename branch for `_scales`
entirely.
This was flagged (for a different, narrower symptom) in #427, which
scoped itself to a defensive ndim==2 guard for RTN's older moe=True
3-D case and left "real MoE quantization support" for a follow-up.
#451 added that follow-up (QMoE emission for Qwen3.5/3.6-MoE), but its
projections dict and `preprocess_olive_weights` reshape logic were
themselves written against the same incorrect dotted-suffix
assumption, so they never actually exercised a real Olive checkpoint
end-to-end.
Repro: chaining Olive's Rtn(moe=true) -> MobiusBuilder against
yujiepan/qwen3.5-moe-tiny-random surfaced "N initializer(s) without
weights" at save time, because every quantized nn.Linear/nn.Embedding
key in the checkpoint (attention/MLP projections, embeddings) failed
to match and was left un-renamed.
Fix: introduce a `_rename` helper that strips the underscore suffix,
drops a redundant trailing ".weight" component (present for regular
nn.Linear/nn.Embedding parameters but not for bare fused-MoE
parameters like "gate_up_proj"), and appends the target dotted name.
Update the embed_tokens special case (which keeps the "qweight" name
for GatherBlockQuantized instead of renaming to "weight") accordingly,
and add the previously-missing "_scales" rename branch for the
general (non-embedding) case. Update tests in
_weight_utils_test.py/qwen35_test.py/_moe_test.py that had been
written against the same incorrect fixture convention.
Note: this fixes weight *naming*, not quantization *coverage*. Qwen3.5's
Qwen35Attention/GatedDeltaNet/MLP call sites still hardcode plain Linear
regardless of config.quantization (only the MoE fused-expert path added
in #451 threads through quantization), so self_attn/linear_attn/MLP
weights in a quantized Qwen3.5/3.6 checkpoint still fail to load with a
shape mismatch after this fix. Tracked separately.
0 commit comments