Repository navigation
feat: support Granite MoE SWA expert defusion - #71
Merged
Merged
Conversation
Register granitemoe_swa in the public model registry and add meta-model and forward-equivalence coverage. The checkpoint stores routed experts as packed gate_up_proj/down_proj tensors; the generic defusion path splits them into numbered gate_proj/up_proj/down_proj linears while keeping the shared expert MLP intact. Bump the package version to 0.0.30.
Qubitium
pushed a commit
to ModelCloud/GPTQModel
that referenced
this pull request
Nov 13, 2026
#3833) Add granite_swa and granitemoe_swa model definitions. - granite_swa reuses the Llama decoder layout; the learnable attention sinks stay in their source dtype while the attention and MLP projections are quantized. - granitemoe_swa relies on Defuser's registered granitemoe_swa support to split packed routed-expert gate_up_proj/down_proj tensors into per-expert linears; the router stays non-quantized and the shared SwiGLU MLP stays quantizable. Bump the Defuser floor to 0.0.30 for the new registry entry. Register both model types, add the module-plan and fusion-admission inventory entries, add real meta-model module-tree tests, and add GPTQ evaluation tests for both checkpoints. Update the README support table and the fusion coverage counts. Depends on ModelCloud/Defuser#71.
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
Add
granitemoe_swato the public model registry and defuse its packed routed-expert tensors through the existing generic path.The Granite MoE SWA checkpoint stores every routed expert as a fused
experts.gate_up_projtensor plusexperts.down_proj. Conversion now exposes numbered per-expertgate_proj/up_proj/down_projlinear modules while leaving the shared expert MLP and router untouched. No model-specific replacement class or forward patch is required.granite_swa(dense) is not registered because it has no packed expert or fused MLP tensors to defuse.Changes
granitemoe_swaindefuser/model_registry.py.GraniteMoeSWAExperts.0.0.30.Validation
Targeted tests:
The new conversion preserves the original expert forward outputs (
torch.testing.assert_close) and leaves all meta parameters on themetadevice.Note: the broader meta-model and candidate-coverage suites contain pre-existing failures for unrelated model types whose upstream Transformers classes have changed. Those failures are present on
mainbefore this change and are not caused by this PR.