Skip to content

Add exact MiniMax-01 GGUF support - #616

Merged
justinchuby merged 3 commits into
mainfrom
justinchuby-minimax-01-gguf
Aug 25, 2026
Merged

Add exact MiniMax-01 GGUF support#616
justinchuby merged 3 commits into
mainfrom
justinchuby-minimax-01-gguf

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • add a dedicated MiniMax configuration and exact hybrid Lightning/full-attention graph matching pinned llama.cpp 8d9af256337d1a501250f9bbf4c0859a654bddd6
  • add fail-closed GGUF metadata, schedule, tensor-family, shape, and closure validation with exact float and quantized tensor mapping
  • preserve quantized projection/expert and embedding roles, tied packed embedding/output storage, FP32 router semantics, and heterogeneous recurrent/KV graph state
  • add synthetic Transformers parity plus ORT prefill/decode, replay, batch reorder, float/quantized import, CLI, and save/reload coverage
  • update the GGUF support census and pin the public MiniMax reference revision

Runtime scope

Released ORT GenAI packaging remains deferred to #605 because MiniMax requires heterogeneous KV/recurrent state slots plus bounded rollback snapshots that the current package schema cannot faithfully represent. Graph-call state threading, deterministic replay, and batch reorder are covered here.

No small public exact checkpoint exists; the approximately 456B public checkpoint is distributed across 413 shards, so real-checkpoint parity and OGA E2E are not locally feasible.

Validation

  • 51 passed, 4 skipped — focused MiniMax config, graph, GGUF closure/import, synthetic parity, weight alignment, Lightning, CLI/roundtrip, and ORT state tests
  • 7626 passed, 56 skipped — broad non-integration suite
  • initialized lintrunner -a — clean
  • generated GGUF documentation and git diff --check — clean
  • GPT-5.6 Sol medium architecture and GGUF reviews completed; all findings resolved, including quantized/tied embedding execution and stale runtime-deferral text

Rebased linearly onto merged #615 (cc80c77db0e8e176a04e66611423399270bcfa63).

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing cc80c77d4957ef

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 68 68 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 105 105 +0.0%
gpt2 model_size_bytes 388 KB 388 KB +0.0%
gpt2 num_nodes 54 54 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 60 60 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 56 56 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 94 94 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 58 58 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 54 54 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 60 60 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 56 56 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 429 429 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 176 176 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing cc80c77d4957ef

Model Sub-model Changes Status
bert (feature-extraction) model 0
falcon model 0
gemma2 model 0
gemma4 (gemma4) decoder 0
gemma4 (gemma4) embedding 0
gemma4 (gemma4) vision_encoder 0
gemma4_text model 0
gpt2 model 0
llama model 0
llama (static-cache) model 0
mamba (ssm-text-generation) model 0
phi3 model 0
phi3 (static-cache) model 0
qwen model 0
qwen (static-cache) model 0
qwen2 model 0
qwen2 (static-cache) model 0
qwen2_moe model 0
qwen2_moe (static-cache) model 0
qwen3 model 0
qwen3 (static-cache) model 0
qwen3_5_moe (hybrid-text-generation) model 0
qwen3_5_text (hybrid-text-generation) model 0
qwen3_5_vl (hybrid-qwen-vl) decoder 0
qwen3_5_vl (hybrid-qwen-vl) embedding 0
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0
qwen3_moe model 0
qwen3_moe (static-cache) model 0
qwen3_next (hybrid-text-generation) model 0
t5 (seq2seq) decoder 0
t5 (seq2seq) encoder 0
whisper (speech-to-text) decoder 0
whisper (speech-to-text) encoder 0

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@justinchuby
justinchuby force-pushed the justinchuby-granitehybrid-moe-gguf branch 2 times, most recently from 9cbc655 to 8690dcd Compare August 25, 2026 18:33
Base automatically changed from justinchuby-granitehybrid-moe-gguf to main August 25, 2026 18:34
@justinchuby
justinchuby requested a review from a team August 25, 2026 18:34
justinchuby and others added 3 commits August 25, 2026 11:35
Implement the pinned MiniMax-01 hybrid architecture, strict GGUF metadata and tensor validation, exact Lightning Attention state handling, and quantized projection preservation. Add synthetic parity, ORT state threading, import, CLI, save/reload, and rejection coverage while deferring released runtime packaging until heterogeneous rollback semantics are representable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: aedc6984-fda0-45fc-bddb-a6317953da96
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Include MiniMax-01 in the quantized-import closure set introduced by the squash-merged parent so the pinned capability test matches the reviewed packed projection support.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Construct MiniMax token embeddings through the quantization-aware factory so untied packed tables import and tied packed heads share executable storage. Strengthen exact role and ORT coverage, and correct the runtime-only deferral documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
justinchuby force-pushed the justinchuby-minimax-01-gguf branch from 3f5fdf1 to d4957ef Compare August 25, 2026 18:50
Copilot AI lite review requested due to automatic review settings August 25, 2026 18:50
@justinchuby
justinchuby merged commit b30c522 into main Aug 25, 2026
14 of 23 checks passed
@justinchuby
justinchuby deleted the justinchuby-minimax-01-gguf branch August 25, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class, exact GGUF import support for the MiniMax-01 / MiniMax-Text-01 hybrid architecture in Mobius, aligning the exported ONNX graph and GGUF tensor/metadata contract with the pinned llama.cpp behavior while explicitly keeping ORT GenAI “runtime packaging” deferred due to heterogeneous state/rollback limitations tracked in #605.

Changes:

  • Introduces a dedicated MiniMaxConfig plus registry wiring for multiple HF model_type spellings, and updates the MiniMax model graph to faithfully represent hybrid Lightning/full-attention scheduling, scaling, and routing behavior.
  • Adds MiniMax GGUF architecture registration, config/tensor mapping, and strict fail-closed contract validation (metadata + closure + per-tensor shapes) before graph construction.
  • Expands test coverage for MiniMax GGUF import (float + keep-quantized), state threading/replay/reorder, tied embeddings/LM head behavior, and schedule derivation; updates docs + pinned reference revision.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/_test_configs.py Adds MiniMax test config coverage and explicitly selects MiniMaxConfig.
testdata/cases/causal-lm/minimax-text-01.yaml Pins a specific MiniMax reference revision and updates notes to reflect current support/deferment.
src/mobius/models/minimax.py Reworks MiniMax model to match the exact hybrid schedule, scaling, routing gate, and quantized-linear plumbing.
src/mobius/integrations/gguf/_tensor_mapping.py Adds MiniMax GGUF tensor-family → Mobius weight-name mapping.
src/mobius/integrations/gguf/_config_mapping.py Adds MiniMax GGUF metadata mapping, schedule derivation, and a MiniMax postprocessor that restores pinned semantics.
src/mobius/integrations/gguf/_config_mapping_test.py Adds tests for MiniMax default scheduling and interval validation.
src/mobius/integrations/gguf/_builder.py Adds strict MiniMax-01 GGUF contract validation (metadata + closure + shapes) before graph build.
src/mobius/integrations/gguf/_builder_test.py Adds end-to-end MiniMax GGUF build tests (float + quantized), state behavior, tieing, CLI, and fail-closed rejection cases.
src/mobius/integrations/gguf/_arch_registry.py Promotes minimax-01 to supported (config/tensor/graph) while keeping runtime packaging deferred with updated reason.
src/mobius/integrations/gguf/_arch_registry_test.py Updates expected supported-architecture census and includes minimax-01.
src/mobius/components/_moe.py Adds disable_qmoe switch to force the dense MoE path even when QMoE would otherwise be eligible.
src/mobius/components/_lightning_attention.py Updates LightningAttention to MiniMax-01 exact head geometry, masking semantics, slope formula, and quantized-linear plumbing.
src/mobius/components/_lightning_attention_test.py Adds unit tests to pin the new MiniMax-01 decay formula behavior.
src/mobius/_registry.py Registers multiple MiniMax model_type spellings with MiniMaxConfig.
src/mobius/_configs/_base.py Adds MiniMax-specific config fields to ArchitectureConfig and introduces MiniMaxConfig.from_transformers.
src/mobius/_configs/_base_test.py Adds unit test for MiniMaxConfig.from_transformers extraction.
src/mobius/_configs/init.py Exports MiniMaxConfig.
docs/api/build_from_gguf.md Updates the generated GGUF support census and MiniMax-01 row/details.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

justinchuby added a commit that referenced this pull request Aug 25, 2026
## Summary
- implement the pinned Kimi Linear hybrid KDA/NoPE-MLA graph, dense/MoE
schedule, and heterogeneous recurrent/KV state ABI
- add strict GGUF metadata/tensor closure, layout transforms, compatible
quantized MatMul/expert preservation, and malformed-input rejection
- add graph, weight, ORT state/replay/reorder/padding, GGUF
float/quantized, roundtrip, CLI, and documentation coverage

## Runtime boundary
Generic OGA packaging remains deferred to #605 because the released
decoder schema cannot represent mixed MLA KV and KDA convolution/matrix
states exactly.

## Validation
- focused Kimi: 34 passed
- full GGUF: 2684 passed
- broad non-integration: 7223 passed, 54 skipped
- generated GGUF docs check passed
- initialized lint completed with only pre-existing Falcon-H1 warnings
- two independent reviews completed and findings fixed

Stacked on #616 (`justinchuby-minimax-01-gguf`).

---------

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants