Skip to content

Promote first GGUF MoE architecture cohort - #680

Merged
justinchuby merged 4 commits into
mainfrom
justinchuby-promote-gguf-moe-cohort
Aug 27, 2026
Merged

justinchuby merged 4 commits into
mainfrom
justinchuby-promote-gguf-moe-cohort

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • promote float GGUF graph routes for arctic, dbrx, ernie4_5-moe, and nomic-bert-moe
  • preserve architecture-specific routing order, normalization, expert layouts, activations, norms, RoPE, shared-expert behavior, and layer schedules
  • add strict config/tensor/shape closure and CPU graph execution coverage
  • keep preserved quantized import rejected and runtime support deferred for all four routes
  • retain normal Hugging Face revision behavior: no production model-ID revision pins, defaults, or rejection gates

Evidence

  • Arctic: pinned llama.cpp synthetic architecture fixture
  • DBRX: pinned 64 MiB bounded header from dbrx-instruct.i1-IQ1_S.gguf
  • ERNIE 4.5 MoE: pinned full ERNIE-4.5-21B-A3B-Thinking.i1-IQ1_S.gguf
  • NomicBERT-MoE: pinned full nomic-embed-text-v2-moe.Q2_K.gguf
  • total transferred payload: 4,816,875,008 bytes, below the 16 GiB cap; payloads were removed after evidence collection

Validation

  • broad serial suite: 8662 passed, 64 skipped, 12 deselected
  • focused cohort, attention, registry, census, Kimi K3 compatibility, and CPU execution tests pass
  • lintrunner f --output oneline --all-files
  • generated GGUF documentation check passes
  • changed-source mypy was run; the repository remains baseline-red in pre-existing diagnostics outside the cohort-added source lines
  • two independent reviews completed; ERNIE ignored output-bias handling and Arctic stacked-expert loading findings were fixed and re-reviewed

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 27, 2026 16:37
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 354b9ff → 8a39113

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.

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

Promotes a first cohort of GGUF Mixture-of-Experts architectures (arctic, dbrx, ernie4_5-moe, nomic-bert-moe) from deferred graph routes into float-only, suffix-/closure-validated import paths, with dedicated model graph implementations and CPU execution coverage.

Changes:

  • Adds GGUF-specific MoE model/encoder graph implementations (DBRX/Arctic/ERNIE 4.5 MoE decoders; NomicBERT-MoE encoder) and wires them into the registry.
  • Extends GGUF config/tensor mapping plus strict tensor-closure validation for the cohort (including expert stack unpacking) while keeping quantized import rejected and runtime deferred.
  • Adds/updates tests and documentation to pin route census counts and validate config semantics + tiny CPU execution.

Reviewed changes

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

Show a summary per file
File Description
tests/_test_configs.py Adds tiny test configs for the four promoted GGUF MoE module types.
src/mobius/models/moe.py Introduces GGUF-specific MoE decoder variants for DBRX/Arctic/ERNIE 4.5 and tightens MoETextModel typing/validation.
src/mobius/models/gguf_encoders.py Adds NomicBERT-MoE encoder implementation and supporting attention/MLP/token-type utilities.
src/mobius/models/init.py Exports the new GGUF cohort model classes.
src/mobius/integrations/gguf/_tensor_mapping.py Adds extra tensor mapping recipes for DBRX/Arctic/ERNIE 4.5 MoE/NomicBERT-MoE.
src/mobius/integrations/gguf/_route_census_test.py Updates pinned route census category counts after promotions.
src/mobius/integrations/gguf/_moe_cohort_test.py New end-to-end cohort tests: closure, mapping, config semantics, expert unpacking, and CPU execution.
src/mobius/integrations/gguf/_config_mapping.py Adds cohort-specific postprocessors (dbrx/arctic/ernie45_moe) and specialized encoder handling for nomic-bert-moe.
src/mobius/integrations/gguf/_builder.py Adds strict cohort tensor-contract validator; updates encoder dispatch lists; improves MoE weight-shape validation routing.
src/mobius/integrations/gguf/_builder_test.py Removes arctic/dbrx from a test list expecting “fails before graph” behavior.
src/mobius/integrations/gguf/_arch_registry.py Promotes the four architectures into importable GGUF specs (runtime deferred, quantized import rejected).
src/mobius/integrations/gguf/_arch_registry_test.py Updates supported counts and adjusts remaining-deferred cohort tests around the promotions.
src/mobius/components/_attention.py Refactors Attention to allow QKV projection customization; adds FusedQKVAttention (optional clamp-before-split).
src/mobius/components/_attention_test.py Adds a focused unit test ensuring fused projection clamp happens before Split.
src/mobius/components/init.py Exposes FusedQKVAttention from the components public API.
src/mobius/_registry.py Registers new GGUF cohort module types and tasks.
src/mobius/_configs/_base.py Adds attention_clamp and moe_layer_frequency fields to ArchitectureConfig.
docs/api/build_from_gguf.md Updates the support matrix / census figures and architecture listings for the promoted routes.

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

Comment thread src/mobius/models/moe.py Resolved
Comment thread src/mobius/models/gguf_encoders.py Resolved
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 354b9ff → 8a39113

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-promote-gguf-moe-cohort branch from 2331f20 to 0780f6d Compare August 27, 2026 18:06
justinchuby and others added 3 commits August 27, 2026 11:12
Add exact float graph routes for Arctic, DBRX, ERNIE 4.5 MoE, and NomicBERT-MoE with strict tensor/config closure, architecture-specific routing semantics, and deterministic evidence coverage. Keep quantized import rejected and runtime claims deferred until their ABIs are proven.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 72a2c1ea-03e1-42a3-8439-c5a0f2e3fde7
Signed-off-by: Justin Chu <[email protected]>
Reject ERNIE attention-output bias that llama.cpp ignores, unpack Arctic stacked experts into graph-owned parameters, and scope Arctic shape validation so block-sparse MoE routes remain unaffected. Add end-to-end parameter-name and malformed-shape regressions.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 72a2c1ea-03e1-42a3-8439-c5a0f2e3fde7
Signed-off-by: Justin Chu <[email protected]>
Improve expert configuration diagnostics, fail explicitly when NomicBERT-MoE token-type metadata is absent, and regenerate the support census after rebasing onto current main.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 72a2c1ea-03e1-42a3-8439-c5a0f2e3fde7
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-promote-gguf-moe-cohort branch from 0780f6d to 34646fe Compare August 27, 2026 18:17
Serialize new graph configuration fields only for their consuming architectures so pinned runtime route identities remain stable. Treat ERNIE shared width and merged tensors as authoritative while validating the optional shared-count multiplier exactly.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 72a2c1ea-03e1-42a3-8439-c5a0f2e3fde7
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit 0c7ac6c into main Aug 27, 2026
17 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-promote-gguf-moe-cohort branch August 27, 2026 19:13
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