Skip to content

Add remaining dense GGUF architectures - #595

Merged
justinchuby merged 2 commits into
mainfrom
justinchuby-add-remaining-dense-gguf
Aug 25, 2026
Merged

justinchuby merged 2 commits into
mainfrom
justinchuby-add-remaining-dense-gguf

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • add exact pinned GGUF graph/config/tensor support for the reviewable dense cohort: 32-layer Baichuan 7B, modern ChatGLM, Phi-2, and 64-layer Seed-OSS
  • enforce fail-before-graph metadata, geometry, tensor closure, bias-family, tied-head ownership, and quantization-preservation contracts
  • add exact Baichuan Q/K inverse permutation, ChatGLM fused QKV/gate-up splitting, Phi-2 tanh-approximated GELU and complete bias topology, and Seed-OSS optional all-layer Q/K/V bias support
  • explicitly defer Apertus, MiniCPM3, OpenELM, and MPT before config extraction where current Mobius graphs cannot represent pinned llama.cpp semantics
  • update the pinned tensor census, generated support matrix, architecture coverage, and focused mutation/value/ownership tests

Pinned llama.cpp SHA: 8d9af256337d1a501250f9bbf4c0859a654bddd6

Validation

  • focused dense GGUF and registry suite: 620 passed
  • GGUF + representative graph + coverage suite: 3998 passed, 268 skipped, 7 deselected
  • broad non-integration suite: 6298 passed, 52 skipped, 1 subtest passed
  • affected post-review graph suite: 2025 passed, 44 skipped, 4 deselected
  • initialized pinned lintrunner, formatter clean, full lint clean
  • two independent high-confidence reviews completed; the first found the Phi-2 GELU approximation mismatch, which was fixed and regression-tested, and the final review reported no remaining findings

The excluded glm_moe_dsa graph/checker failures reproduce on the stacked base and are unrelated to this change.

Deferrals / waivers

  • runtime packaging remains deferred for the four supported graph-import profiles until pinned real-artifact provenance, independent full-logit parity, and deterministic generation are available
  • Apertus is fully deferred because its converter-emitted serialized Llama-3 rope_freqs tensor is consumed as per-dimension RoPE factors by the pinned loader, while the current Mobius graph derives RoPE only from scalar config
  • MiniCPM3, OpenELM, and MPT remain fully deferred for their unrepresented topology/config/tensor semantics
  • L4/L5, multi-dtype, CLI real-artifact, CUDA, ORT GenAI, Foundry Local, and Olive probes are not claimed because no pinned representative real GGUF artifact with provenance was established; these do not weaken the bounded graph-import verdicts above

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 6715f09 → cffdb2b

Model Sub-model Changes Status
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪

No architecture changes detected. ✅


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

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 6715f09 → cffdb2b

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 264 264 +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 126 126 +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 428 428 +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.

@justinchuby
justinchuby force-pushed the justinchuby-add-remaining-hybrid-gguf branch from e8d65f2 to 693ad71 Compare August 25, 2026 16:03
Base automatically changed from justinchuby-add-remaining-hybrid-gguf to main August 25, 2026 16:03
@justinchuby
justinchuby requested a review from a team August 25, 2026 16:03
justinchuby and others added 2 commits August 25, 2026 09:05
Support exact pinned GGUF import contracts for Baichuan 7B, ChatGLM, Phi-2, and Seed-OSS, including strict tensor closure, architecture-specific transforms, bias families, tie ownership, and quantization safeguards. Defer Apertus, MiniCPM3, OpenELM, and MPT before config extraction where Mobius cannot represent pinned semantics exactly.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Preserve the current quantization verdict registry while replaying the dense C01 cohort. Accept the pinned fused or split QKV alternatives for ChatGLM and Phi-2 float imports, reject their unsupported packed paths explicitly, and regenerate the support matrix in the current format.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-add-remaining-dense-gguf branch from f308da1 to cffdb2b Compare August 25, 2026 16:19
Copilot AI lite review requested due to automatic review settings August 25, 2026 16:19
@justinchuby
justinchuby merged commit e913060 into main Aug 25, 2026
16 of 21 checks passed
@justinchuby
justinchuby deleted the justinchuby-add-remaining-dense-gguf branch August 25, 2026 16:19

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 expands Mobius GGUF import coverage for additional dense C01 architectures (Baichuan 7B 32-layer, modern ChatGLM, Phi-2, Seed-OSS 64-layer) by adding pinned tensor-family/mapping/config support and enforcing stricter pre-graph validation contracts. It also updates the GGUF support matrix/docs and adds targeted tests to ensure the pinned llama.cpp semantics are validated before graph construction.

Changes:

  • Add dense C01 preflight validation to enforce pinned geometry + tensor-closure (including fused-vs-split QKV layout rules, bias-family closure, and Seed-OSS-specific constraints) before config extraction / graph build.
  • Extend GGUF tensor mapping + config postprocessing for baichuan, chatglm, phi2, and seed_oss (+ Seed-OSS extras), and update Phi weight preprocessing to split fused QKV for Phi-2.
  • Add a comprehensive dense C01 test suite and update pinned upstream census + docs support matrix accordingly.

Reviewed changes

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

Show a summary per file
File Description
src/mobius/models/phi.py Split fused qkv_proj weights/biases into q/k/v_proj during preprocessing for Phi-2-style inputs.
src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json Extend pinned llama.cpp architecture census entries with tensor-family info for newly covered/explicitly-deferred dense architectures.
src/mobius/integrations/gguf/_tensor_processors.py Minor formatting tweak in llama tensor processing block.
src/mobius/integrations/gguf/_tensor_mapping.py Add GGUF→HF mapping tables for ChatGLM + Phi-2 and a Seed-OSS extras overlay; wire them into the mapping recipe registry.
src/mobius/integrations/gguf/_dense_c01_test.py New focused test suite for dense C01 pinned-contract validation, mapping correctness, and Phi-2/ChatGLM splitting behavior.
src/mobius/integrations/gguf/_config_mapping.py Add architecture-specific config postprocessors for baichuan, chatglm, phi2, and seed_oss.
src/mobius/integrations/gguf/_builder.py Enforce dense C01 tensor-contract validation pre-config; broaden quantization-preservation rejection helper to cover additional architectures.
src/mobius/integrations/gguf/_builder_test.py Update synthetic GGUF writer to include Seed-OSS post-attention norm tensors.
src/mobius/integrations/gguf/_arch_registry.py Register new dense C01 architectures as importable (runtime deferred) and add explicit pre-config deferrals for apertus, minicpm3, openelm, mpt.
src/mobius/integrations/gguf/_arch_registry_test.py Update pinned supported/quantized verdict sets and closure test coverage to include the new architectures.
docs/api/build_from_gguf.md Update the generated GGUF support matrix and add narrative documentation for the dense C01 cohort + explicit deferrals.

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

Comment on lines +683 to +687
items = list(gguf_model.tensor_items_raw())
actual = {
name: tuple(int(dimension) for dimension in shape)
for name, _raw, _qtype, shape in items
}
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