Update QMoE emission for ORT raw-weight prepack support - #460
Update QMoE emission for ORT raw-weight prepack support#460justinchuby with Copilot wants to merge 2 commits into
Conversation
|
|
Emit the new weights_prepacked=0 QMoE attribute for raw int expert weights now that ORT can prepack them internally. Add focused assertions for both component-built and rewrite-fused QMoE nodes. Signed-off-by: GitHub <noreply@github.com> Co-authored-by: justinchuby <11205048+justinchuby@users.noreply.github.com>
Performance Comparison
|
There was a problem hiding this comment.
Pull request overview
Aligns Mobius’s com.microsoft::QMoE emission with the updated ORT QMoE ABI by explicitly opting into raw (non-prepacked) int4/int8 expert weights, preventing ORT CUDA from misinterpreting emitted raw tensors as prepacked.
Changes:
- Set
quant_type="int"andweights_prepacked=0when emitting fusedQMoEfromMoELayer. - Apply the same ABI attributes when rewriting dense-fallback MoE subgraphs into a single
QMoEnode. - Add regression assertions in both component and rewrite-rule tests to lock in the ABI attributes (Fixes #348).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/mobius/rewrite_rules/_qmoe_fusion.py | Adds quant_type / weights_prepacked attributes to rewritten fused QMoE nodes. |
| src/mobius/rewrite_rules/_qmoe_fusion_test.py | Asserts the rewritten QMoE node includes the new ABI attributes. |
| src/mobius/components/_moe.py | Adds quant_type="int" and weights_prepacked=0 to MoELayer’s op.QMoE(...) emission. |
| src/mobius/components/_moe_test.py | Asserts MoELayer-emitted QMoE nodes include the new ABI attributes. |
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
ORT QMoE now supports raw int4/int8 expert weights via
weights_prepacked=0. Mobius was emitting raw QMoE weight tensors without explicitly opting into that mode, leaving CUDA to interpret them as prepacked.QMoE emission
quant_type="int"andweights_prepacked=0on fusedcom.microsoft::QMoEnodes emitted byMoELayer.Dense MoE rewrite
QMoEnode.Regression coverage