Skip to content

Add second hybrid GGUF cohort - #588

Merged
justinchuby merged 3 commits into
mainfrom
justinchuby-expand-hybrid-gguf-cohort
Aug 25, 2026
Merged

justinchuby merged 3 commits into
mainfrom
justinchuby-expand-hybrid-gguf-cohort

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • add exact dense graph-import contracts for jamba, nemotron_h, and granitehybrid from pinned llama.cpp metadata, schedules, tensor closure, and Mamba transforms
  • defer unsupported MoE/MTP/quantization subsets and document caller-owned hybrid state rollback/reorder semantics
  • defer minimax-01, plamo2, and falcon-h1 before graph construction; remove the false falcon_h1 alias to ordinary Falcon
  • add schedule mutation, closure, mapping, processor, task-dispatch, and Falcon early-rejection regressions; update the pinned census and generated support documentation

Validation

  • 1032 passed in focused GGUF/task tests
  • 1031 passed in representative graph tests
  • full lint passed
  • broad non-integration suite: 6211 passed, 52 skipped; two pre-existing glm_moe_dsa shape-inference/checker failures remain and are unrelated to this diff

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 781bb67 → 965080c

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.

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 781bb67 → 965080c

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-add-hybrid-gguf-cohort branch from 048954f to 75ac6af Compare August 25, 2026 15:53
Base automatically changed from justinchuby-add-hybrid-gguf-cohort to main August 25, 2026 15:53
@justinchuby
justinchuby requested a review from a team August 25, 2026 15:53
justinchuby and others added 3 commits August 25, 2026 08:54
Add exact dense graph-import contracts for Jamba, Nemotron-H, and GraniteHybrid from the pinned llama.cpp loader metadata and tensor inventories. Fail closed on unsupported MoE, MTP, quantization, schedule, and state representations.

Defer MiniMax-01, PLaMo2, and Falcon-H1 before graph construction, and remove the false Falcon-H1 alias to the ordinary Falcon transformer.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Correct Jamba B/C layernorm mapping so all recurrent initializers receive weights, reverse GraniteHybrid Q/K projection biases, and reject partial global bias families before graph construction.

Also make Nemotron-H MoE rejection actionable, fix architecture-specific diagnostics, remove stale Falcon-H1 goldens, and add end-to-end weight-closure regressions.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Reconcile the second hybrid GGUF cohort with the post-squash architecture registry contract. Explicitly reject preserved quantized projection imports for Jamba, Nemotron-H, and GraniteHybrid, and regenerate the support matrix from those verdicts.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-expand-hybrid-gguf-cohort branch from ca35d99 to 965080c Compare August 25, 2026 15:58
Copilot AI lite review requested due to automatic review settings August 25, 2026 15:58
@justinchuby
justinchuby merged commit bd54679 into main Aug 25, 2026
17 of 22 checks passed
@justinchuby
justinchuby deleted the justinchuby-expand-hybrid-gguf-cohort branch August 25, 2026 15:59
justinchuby added a commit that referenced this pull request Aug 25, 2026
## Summary

- pin suffix-exact loader tensor inventories for `bailingmoe3`,
`deepseek4`, `kimi-k3`, `kimi-linear`, and `lfm2moe` at llama.cpp
`8d9af256337d1a501250f9bbf4c0859a654bddd6`
- register explicit DEFERRED verdicts that reject before config
extraction, quantization handling, model lookup, or graph construction
- remove the unsafe DeepSeek-V4 GGUF dense-fallback claim while
preserving the valid Hugging Face `deepseek_v4` registration
- document exact schedule, mixed-state, MoE, auxiliary/MTP, and
quantization constraints

## Validation

- focused GGUF tests: 885 passed
- broad non-integration suite excluding unrelated baseline `glm_moe_dsa`
shape-inference failure: 6223 passed, 52 skipped
- full lint: clean
- independent high-confidence review: no significant findings

## Stack

Targets `justinchuby-expand-hybrid-gguf-cohort` / #588.

---------

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>

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

Adds GGUF import support for Jamba, Nemotron-H, and GraniteHybrid, with deferred unsupported variants and removal of the incorrect Falcon-H1 alias.

Changes:

  • Adds hybrid schedules, mappings, processors, cache handling, dispatch, and pinned contracts.
  • Adds regression tests and documentation updates.
  • Removes obsolete Falcon-H1 fixtures and registrations.

Three critical blockers remain: Nemotron-H Q/K permutation, GraniteHybrid bias closure, and GraniteHybrid bias fusion.

Reviewed changes

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

Show a summary per file
File Review summary
tests/synthetic_parity_test.py Removes obsolete Falcon-H1 parity coverage.
tests/model_coverage_test.py Removes obsolete Falcon-H1 coverage.
tests/build_graph_test.py Removes obsolete Falcon-H1 graph expectations.
tests/_test_configs.py Removes obsolete Falcon-H1 configurations.
testdata/golden/causal-lm/falcon-h1-0_5b.json Removes obsolete golden data.
testdata/golden/causal-lm/falcon-h1-0_5b_generation.json Removes obsolete generation golden data.
testdata/cases/causal-lm/falcon-h1-0_5b.yaml Removes obsolete Falcon-H1 test case.
src/mobius/tasks/_cache_utils.py Adds hybrid cache-state validation and dispatch support.
src/mobius/models/nemotron_h.py Adds Nemotron-H schedule validation.
src/mobius/models/jamba.py Adds Jamba schedule and optional RoPE validation.
src/mobius/models/granitemoehybrid.py Updates GraniteHybrid validation and documentation.
src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json Pins hybrid tensor contracts.
src/mobius/integrations/gguf/_tensor_processors.py Critical (2 votes): GraniteHybrid gate/up biases are not fused, causing learned biases to be dropped.
src/mobius/integrations/gguf/_tensor_processors_test.py Tests tensor transformations.
src/mobius/integrations/gguf/_tensor_mapping.py Adds hybrid tensor mappings.
src/mobius/integrations/gguf/_tensor_mapping_test.py Tests hybrid tensor mappings.
src/mobius/integrations/gguf/_config_mapping.py Adds hybrid configuration derivation.
src/mobius/integrations/gguf/_config_mapping_test.py Tests hybrid configuration conversion.
src/mobius/integrations/gguf/_builder.py Critical (3 votes): GraniteHybrid bias suffixes are excluded from closure validation, rejecting documented biased checkpoints.
src/mobius/integrations/gguf/_builder_test.py Tests hybrid closure and rejection behavior.
src/mobius/integrations/gguf/_arch_registry.py Critical (1 vote): Nemotron-H attention Q/K reverse permutation is missing, producing incorrect attention weights.
src/mobius/integrations/gguf/_arch_registry_test.py Tests registry and support behavior.
src/mobius/_registry.py Removes the Falcon-H1 fallback registration.
src/mobius/_configs/_base.py Removes the Falcon-H1 configuration alias.
scripts/detect_affected_models_test.py Removes Falcon-H1 affected-model handling.
docs/api/build_from_gguf.md Documents hybrid support and deferred architectures.
Suppressed comments (3)

src/mobius/integrations/gguf/_arch_registry.py:562

  • The registered GraniteHybrid processor explicitly calls _process_llama() for Q/K tensors, and the upstream loader uses the interleaved-rope permutation. Leaving llama_qk_permute at its default False keeps needs_llama_qk_permute() false, so reuse_gguf_weights=True cannot record the required transform and unnecessarily falls back to sidecar weights for every transformed Q/K tensor. Declare llama_qk_permute=True here so the registry and reuse bookkeeping match the processor.
        tensor_processor="granitehybrid",

src/mobius/integrations/gguf/_builder_test.py:4717

  • This regression inventory is hand-written and is not derived from the newly pinned tensor contracts. In particular, the GraniteHybrid case omits the ffn_* .bias tensors present in llamacpp_pin.json:61, so the test can pass while the closure rejects the actual declared dense checkpoint (and future pin edits can drift from this test). Build the fixture from the pinned inventory, or add explicit cases covering every pinned optional family and the all-or-none bias rules.
    @staticmethod
    def _second_cohort_names(architecture: str) -> list[str]:
        names = ["token_embd.weight", "output_norm.weight"]
        if architecture == "jamba":
            common = [

src/mobius/integrations/gguf/_config_mapping.py:1300

  • The Nemotron-H postprocessor derives mamba_n_groups from GGUF metadata but never checks that mamba_n_heads is divisible by it. Mamba2Block computes heads_per_group = num_heads // n_groups and expands grouped B/C using that truncated value, so malformed metadata can produce an invalid or silently wrong SSM graph instead of being rejected. Apply the same group-divisibility validation used by the Mamba2 postprocessor before constructing NemotronHConfig.
    if min(inner_size, num_heads) <= 0 or inner_size % num_heads:
        raise ValueError(
            "nemotron_h.ssm.inner_size must be positive and divisible by ssm.time_step_rank"
        )

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

tensor_map_recipe=("nemotron_h",),
config_key_map="nemotron_h",
config_postprocessor="nemotron_h",
tensor_processor="mamba",
Comment on lines +1055 to +1059
common = {
"attn_norm.weight",
"ffn_norm.weight",
"ffn_gate.weight",
"ffn_up.weight",
Comment on lines +336 to +338
state_dict[f"{prefix}input_linear.weight"] = torch.cat(
(state_dict.pop(name), state_dict.pop(up_name)), dim=0
)
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