Repository navigation
Fix Qwen3.6 Olive mixed-precision export - #515
Conversation
Match Mobius graph construction to Olive's Qwen3.5/3.6-MoE quantization selection by keeping GatedDeltaNet projections and the shared-expert gate floating point while preserving quantized attention, shared experts, and QMoE weights. Co-authored-by: Copilot <[email protected]> Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d
Performance Comparison
|
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
There was a problem hiding this comment.
Pull request overview
Updates Mobius’ Qwen3.5/3.6-MoE export path to match Olive’s mixed-precision module selection so Olive-format checkpoints bind correctly (keeping specific projections/gates in floating point while preserving quantized attention, shared-expert MLP, and fused QMoE experts).
Changes:
- Add an Olive-scoped opt-out so Qwen3.5/3.6 MoE
linear_attn(GatedDeltaNet) projections andshared_expert_gateremain float while the rest of the decoder stays quantized. - Extend
Qwen2MoELayerwithshared_expert_gate_classto override the gate factory without affecting existing callers. - Add targeted unit tests covering mixed float/quantized layouts across MoE text/VL, dense Olive behavior, and non-Olive quantizers; document the change in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/mobius/models/qwen35.py | Adds Olive-only float-module exceptions for MoE linear_attn and shared_expert_gate while preserving existing quantized graph behavior elsewhere. |
| src/mobius/models/qwen35_test.py | Adds focused tests validating mixed-precision module construction and state-dict preprocessing/binding behavior. |
| src/mobius/models/moe.py | Adds shared_expert_gate_class override for Qwen2MoELayer to support float gate in otherwise-quantized checkpoints. |
| CHANGELOG.md | Documents the Olive mixed-precision fix and the new shared_expert_gate_class API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
justinchuby
left a comment
There was a problem hiding this comment.
Could you explain why it's excluded? Is it due to accuracy reasons?
Co-authored-by: Copilot <[email protected]> Copilot-Session: e10674c1-6909-4b09-9f5a-d41b28c89d2d
|
On why Olive excludes these modules: the two cases have slightly different motivations.
The Mobius change itself is a checkpoint-layout compatibility fix: post-#2630 Olive checkpoints contain float tensors for both groups. Building MatMulNBits modules for them produces packed-shape/scale initializers that do not exist, so export cannot bind the weights. The rest of the decoder remains quantized. |
Summary
This aligns Mobius with the module selection introduced by microsoft/Olive#2630 and unblocks the multimodal Qwen3.6-35B-A3B recipe in microsoft/olive-recipes#588.
Validation
python -m pytest -q src/mobius/models/qwen35_test.py src/mobius/components/_gated_deltanet_test.py src/mobius/components/_moe_test.py(57 passed)