Repository navigation
Labels
area:modelsModel architectures, weights, loading, metadatapriority:highHigh prioritystatus:doneCompletedtype:enhancementNew features, capabilities, or significant additions
Milestone
Description
Summary
Port the IBM Granite model family from mlx-lm. mlxcel has a Granite tool-call format name but not the model architecture. Granite is a widely used open family and upstream remains active (tied-embeddings sanitize fix ml-explore/mlx-lm#1298, 2026-06).
Upstream references
- Dense: https://github.com/ml-explore/mlx-lm/blob/main/mlx_lm/models/granite.py
- MoE: https://github.com/ml-explore/mlx-lm/blob/main/mlx_lm/models/granitemoe.py
- Hybrid (Mamba2 + attention): https://github.com/ml-explore/mlx-lm/blob/main/mlx_lm/models/granitemoehybrid.py
- Recent fix: fix: add sanitize method to Granite model for tied embeddings ml-explore/mlx-lm#1298
Scope (incremental, per mlxcel porting policy)
Land one variant with a working checkpoint and tests before broadening:
- Dense Granite (granite.py): base transformer with Granite scalar multipliers (
attention_multiplier,embedding_multiplier,residual_multiplier,logits_scaling). - GraniteMoE (granitemoe.py): reuse
src/models/switch_layers.rs. - GraniteMoEHybrid (granitemoehybrid.py): Mamba2 + attention hybrid; reuse the mamba2 /
src/models/gated_delta.rsmachinery and the hybrid cache pattern used by Jamba / Nemotron-H.
Acceptance criteria
-
src/models/granite.rs(and MoE / hybrid as scope advances) implemented. - Registered in
src/models/detection.rs(granite,granitemoe,granitemoehybrid). - bf16 to f16 conversion applied at the weight-loading boundary (
load_and_sanitize_weights). - Granite scalar multipliers (attention, embedding, residual, logits) applied correctly.
- Unit tests in
granite_tests.rs. -
docs/supported-models.mdupdated and family added to the detection table. - Validated with a real mlx-community Granite checkpoint:
mlxcel listshows it andmlxcel generateproduces coherent output.
Effort
Medium (dense) to High (hybrid).
Metadata
Metadata
Assignees
Labels
area:modelsModel architectures, weights, loading, metadatapriority:highHigh prioritystatus:doneCompletedtype:enhancementNew features, capabilities, or significant additions
Activity
inureyes commentedon Jun 13, 2026
Dense
granitelanded in #254 (validated against mlx-community/granite-3.3-2b-instruct-4bit). Per the chosen plan,granitemoehybrid(Granite 4.x, Mamba2 + attention hybrid) will be implemented together with #247 (Falcon-H1) and #251 (PLaMo 2) on shared hybrid-cache infrastructure, and that follow-up will close this issue. Puregranitemoeis deferred: no public MLX checkpoint exists to validate it.feat(models): add IBM Granite dense (granite) (#254)
inureyes commentedon Jun 13, 2026
Reopening: this issue was auto-closed when PR #254 merged because the PR body contained the literal phrase 'will close #245' (GitHub's closing-keyword parser matches 'close #245' regardless of surrounding tense/context). Dense
graniteis merged and validated. This issue stays open for thegranitemoehybrid(Granite 4.x) variant, which lands with the shared Mamba2 hybrid infrastructure alongside #247 and #251.feat(models): add IBM Granite dense (granite) (lablup#254)