Skip to content

Add MiniMax-M2, Mistral4, and GLM-DSA GGUF graphs - #686

Merged
justinchuby merged 4 commits into
mainfrom
justinchuby-add-dense-gguf-graphs
Aug 28, 2026
Merged

Add MiniMax-M2, Mistral4, and GLM-DSA GGUF graphs#686
justinchuby merged 4 commits into
mainfrom
justinchuby-add-dense-gguf-graphs

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

  • add exact explicit-float MiniMax-M2 import with non-square Q/O geometry, full-vector Q/K RMSNorm, partial NeoX RoPE, F32 correction-biased sigmoid routing, and dynamic/static KV coverage
  • add Mistral4 as its pinned DeepSeek-V2 MLA/MoE architecture, including a dedicated latent K-only cache and metadata-owned YaRN scaling; correct the vendored llama.cpp census that previously mislabeled it as Mistral3
  • complete GLM-DSA tensor routing and split K/V-B transforms while preserving the dedicated DSA cache contract and fail-closed MTP boundary
  • promote all three graph routes in the registry/census and regenerate the GGUF support documentation

This includes and supersedes the draft GLM-only work in #682.

Post-review fixes

  • canonicalize glm_dsa aliases for validation/task/package dispatch while retaining the raw alias prefix for metadata reads; the alias-spelled GGUF proves the exact mixed full/shared indexer schedule, dedicated default task, complete indexer initializer materialization, and executable dense-MLA logits
  • consume Mistral4's serialized rope.scaling.yarn_log_multiplier through yarn_apply_mscale; an independent metadata oracle pins 0.0707, factor 4, qk dim 4 to 0.6028141, and mutation to 0.1 discriminates the result
  • fail closed during Mistral4 config extraction unless the multiplier is a non-boolean finite number in the inclusive semantic range [0.0, 0.1]; the wire endpoint is float(np.float32(0.1)), used for both validation and normalization
  • reject NaN, +inf, -inf, negative values, and the immediate float32 successor above 0.1; real GGUFWriter/GGUFModel round trips accept both endpoints and prove finite attention scale and rotary caches before graph execution
  • call the immediate Mistral4 superclass initializer and force GlmMoeDsaTask() when callers omit task
  • reply to and resolve both GitHub review threads

Evidence and capability boundaries

Pinned semantic source: ggml-org/llama.cpp@8d9af256337d1a501250f9bbf4c0859a654bddd6.

All three real candidates exceed the 16 GiB bounded-artifact policy, so the PR records immutable metadata-only LFS evidence and uses reduced synthetic GGUFs for executable graph/cache parity:

Architecture Smallest pinned candidate Complete bytes
minimax-m2 mradermacher/MiniMax-M2-i1-GGUF@2d4f9b1a86d32ce4dfc47db312c8d6fcae8d7b37 / MiniMax-M2.i1-IQ1_S.gguf 46,514,882,176
mistral4 unsloth/Mistral-Small-4-119B-2603-GGUF@bd93c721735aa32c035c0f19e738cb3371fd56ff / Mistral-Small-4-119B-2603-UD-IQ1_M.gguf 32,306,941,632
glm-dsa unsloth/GLM-5.2-GGUF@abc55e72527792c6e77069c99b4cb7de16fa9f23 / six UD-IQ1_S shards 216,715,360,960

No GGUF payload was downloaded. Hub probes read file metadata only. Runtime support remains DEFERRED, and quantization-preserving import is REJECTED; callers must use keep_quantized=False. GLM routed DSA/MLA MTP, Mistral4 NextN/legacy MLA/Q-LoRA-free/nonzero-temperature layouts, and unowned GLM RoPE scaling all fail closed. There are no production model-ID or revision gates.

Coverage waivers: real-weight L2/L4/L5 and runtime generation evidence cannot fit the artifact budget. Synthetic tests instead execute full-logit prefill/cached decode, MiniMax static cache, Mistral latent-vs-expanded MLA parity, GLM indexer scheduling, alias-spelled weight closure, and weight application.

Rebase reconciliation

Rebased onto #685 at 86e70a846b572a5266170420373781d2cac23450. The combined tree preserves the Grok/GroveMoE/Hunyuan-MoE and MiniMax-M2/Mistral4/GLM-DSA cohorts in registry dispatch, tensor-contract validation, architecture fingerprint isolation, model coverage, parity exclusions, census, and generated docs. Combined pins are 105 supported architectures and 107 dependency-blocked / 100 evidence-only / 47 immediately implementable remaining routes.

Validation

  • focused combined GGUF/model coverage suite: 2417 passed, 273 skipped
  • immutable Hub metadata probes: 3 passed
  • broad serial non-integration suite: 8981 passed, 64 skipped, 12 deselected, 1 subtest passed
  • lintrunner f --output oneline --all-files and lintrunner -a --output oneline
  • python scripts/generate_gguf_support_docs.py --check
  • git diff --check origin/main...HEAD
  • changed-line mypy: 0 errors (29 pre-existing production-file errors outside changed lines)
  • independent max-effort review found no significant issues and verified both cohorts, the float32 YaRN endpoint, pre-graph failure timing, fingerprint isolation, tensor mapping, cache semantics, census/docs, and fail-closed ordering

Base: 86e70a846b572a5266170420373781d2cac23450
Head: 208f2cb3c7c5215ea9bcf8547a54109acf768bee

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 28, 2026 05:49
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 86e70a8208f2cb

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 324 KB 324 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 450 450 +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.

Comment thread src/mobius/models/gguf_mistral4.py Fixed
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 86e70a8208f2cb

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)

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 explicit-float GGUF graph support for three previously deferred architectures (MiniMax-M2, Mistral4, GLM-DSA) by introducing new model/task wiring, GGUF tensor mapping + preprocessing, strict tensor-closure validation, and synthetic execution/evidence scaffolding. It promotes these routes in the GGUF architecture registry/census while keeping runtime support and quantized import fail-closed/deferred per the artifact budget constraints.

Changes:

  • Add new explicit-float GGUF model/task implementations for MiniMax-M2 and Mistral4, plus complete GLM-DSA tensor routing and KV-B split handling.
  • Enforce exact GGUF tensor closure for the promoted “remaining dense” cohort and add synthetic parity + metadata-only artifact evidence tests.
  • Update GGUF architecture registry/census, loader pin inventory, and generated docs to reflect the newly importable routes and their deferred runtime/quantization boundaries.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/synthetic_parity_test.py Excludes new GGUF-only model_types from HF-reference parity set.
tests/model_coverage_test.py Documents new registered GGUF-only routes and their evidence boundaries.
tests/gguf_remaining_dense_artifact_test.py Adds integration metadata-only Hub/LFS identity assertions for oversized candidates.
tests/build_graph_test.py Marks mistral4_gguf as specialized (covered by dedicated GGUF tests).
tests/_test_configs.py Adds tiny config for minimax_m2_gguf route.
src/mobius/tasks/_mistral4_gguf.py New dedicated task with latent K-only cache ABI wiring for Mistral4 GGUF.
src/mobius/tasks/_glm_moe_dsa.py Rejects static-cache for GLM-DSA and adds cache ABI/runtime-support metadata.
src/mobius/tasks/init.py Exports/registers the new Mistral4 GGUF task.
src/mobius/models/glm_moe_dsa.py Splits KV-B into K/V projections; adds weight preprocessing for fused KV-B input.
src/mobius/models/glm_moe_dsa_test.py Strengthens preprocess-weights coverage (graph parameter coverage + KV-B split correctness).
src/mobius/models/gguf_mistral4.py New explicit-float Mistral4 decoder with per-layer latent K-only cache.
src/mobius/models/gguf_minimax_m2.py New explicit-float MiniMax-M2 decoder + sigmoid routing gate with correction bias.
src/mobius/models/init.py Exports the new GGUF model classes.
src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json Corrects Mistral4 loader census and tensor inventory to DeepSeek2 pin.
src/mobius/integrations/gguf/_tensor_processors.py Adds split-MLA KV-B reshape/fuse processor; registers for GLM-DSA + Mistral4.
src/mobius/integrations/gguf/_tensor_processors_test.py Adds GLM-DSA processor unit test for KV-B reshape.
src/mobius/integrations/gguf/_tensor_mapping.py Adds GGUF→HF name maps for MiniMax-M2, Mistral4, and GLM-DSA.
src/mobius/integrations/gguf/_route_census_test.py Updates expected category counts and asserts new evidence-only boundaries.
src/mobius/integrations/gguf/_remaining_dense.py Adds strict closure validators for the three promoted routes.
src/mobius/integrations/gguf/_remaining_dense_test.py Adds synthetic GGUF generation, closure tests, and executable prefill/decode parity.
src/mobius/integrations/gguf/_glm_moe_dsa_test.py Updates GLM-DSA config/tensor mapping tests to official geometry + new routing.
src/mobius/integrations/gguf/_docs.py Includes oversized-artifact evidence records in docs tables.
src/mobius/integrations/gguf/_conventional_decoder_test.py Removes outdated Mistral4 conventional-decoder expectation.
src/mobius/integrations/gguf/_config_mapping.py Adds key maps + postprocessors for MiniMax-M2/Mistral4/GLM-DSA and fail-closed rules.
src/mobius/integrations/gguf/_builder.py Hooks remaining-dense tensor contract validation; adds static-cache/task restrictions.
src/mobius/integrations/gguf/_artifact_blocker_evidence.py New immutable oversized-artifact evidence records + iteration API.
src/mobius/integrations/gguf/_arch_registry.py Promotes MiniMax-M2/Mistral4 and completes GLM-DSA spec (tensor map + processor).
src/mobius/integrations/gguf/_arch_registry_test.py Updates expected importable architecture counts and verdict coverage assertions.
src/mobius/components/_deepseek_mla.py Adds optional split KV-B projection path for MLA component.
src/mobius/_registry.py Registers minimax_m2_gguf and mistral4_gguf model types.
src/mobius/main.py Adds CLI --static-cache rejections for GLM-DSA and Mistral4 GGUF.
docs/api/build_from_gguf.md Regenerates GGUF support tables and adds the new artifact-budget blocker rows.

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

Comment thread src/mobius/integrations/gguf/_builder.py Outdated
@justinchuby
justinchuby force-pushed the justinchuby-add-dense-gguf-graphs branch from 958e485 to d03ea6d Compare August 28, 2026 06:01
justinchuby and others added 4 commits August 28, 2026 00:40
Implement exact explicit-float MiniMax-M2, Mistral4 latent-cache, and GLM-DSA import paths. Correct the pinned Mistral4 DeepSeek-V2 inventory, preserve packed/runtime fail-closed boundaries, and record immutable oversized artifact evidence.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 0ee8718a-33b9-4015-9e20-3745bad54686
Signed-off-by: Justin Chu <[email protected]>
Canonicalize GLM-DSA alias dispatch while retaining raw metadata prefixes, force the dedicated task, and add alias-spelled weight/execution closure. Restore Mistral4 YaRN scaling from serialized metadata and add an independent mutation discriminator.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 0ee8718a-33b9-4015-9e20-3745bad54686
Signed-off-by: Justin Chu <[email protected]>
Validate the serialized float32 yarn_log_multiplier before graph construction, accept the exact encoded [0.0, 0.1] endpoints, and reject non-finite or out-of-range values with real GGUF round-trip coverage.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 0ee8718a-33b9-4015-9e20-3745bad54686
Signed-off-by: Justin Chu <[email protected]>
Pin the combined supported-architecture and remaining-route census after integrating the Grok, GroveMoE, and Hunyuan-MoE cohort from main with the MiniMax-M2, Mistral4, and GLM-DSA cohort.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 0ee8718a-33b9-4015-9e20-3745bad54686
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-add-dense-gguf-graphs branch from 0e91cbb to 208f2cb Compare August 28, 2026 08:19
@justinchuby
justinchuby merged commit 49c6c71 into main Aug 28, 2026
23 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-add-dense-gguf-graphs branch August 28, 2026 08:35
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