Repository navigation
Add second hybrid GGUF cohort - #588
Conversation
Performance Comparison
|
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
048954f to
75ac6af
Compare
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]>
ca35d99 to
965080c
Compare
## 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]>
There was a problem hiding this comment.
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. Leavingllama_qk_permuteat its defaultFalsekeepsneeds_llama_qk_permute()false, soreuse_gguf_weights=Truecannot record the required transform and unnecessarily falls back to sidecar weights for every transformed Q/K tensor. Declarellama_qk_permute=Truehere 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_* .biastensors present inllamacpp_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_groupsfrom GGUF metadata but never checks thatmamba_n_headsis divisible by it.Mamba2Blockcomputesheads_per_group = num_heads // n_groupsand 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 constructingNemotronHConfig.
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", |
| common = { | ||
| "attn_norm.weight", | ||
| "ffn_norm.weight", | ||
| "ffn_gate.weight", | ||
| "ffn_up.weight", |
| state_dict[f"{prefix}input_linear.weight"] = torch.cat( | ||
| (state_dict.pop(name), state_dict.pop(up_name)), dim=0 | ||
| ) |
Summary
jamba,nemotron_h, andgranitehybridfrom pinned llama.cpp metadata, schedules, tensor closure, and Mamba transformsminimax-01,plamo2, andfalcon-h1before graph construction; remove the falsefalcon_h1alias to ordinary FalconValidation
1032 passedin focused GGUF/task tests1031 passedin representative graph tests6211 passed, 52 skipped; two pre-existingglm_moe_dsashape-inference/checker failures remain and are unrelated to this diff