Repository navigation
Promote exact scaled-RoPE and MLA GGUF subsets - #640
Merged
Merged
Conversation
Declare which architecture tensor processors have exact packed-domain equivalents and reject GPT-2 quantization preservation because its required projection transpose cannot yet preserve packed values, scales, and zero-points coherently. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Consume serialized per-dimension RoPE and xIELU values, map the complete Apertus tensor closure including optional biases, and preserve packed quantized projections. Keep runtime support deferred pending representative real-weight parity evidence. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Implement PLM's direct split query path, normalized latent KV expansion, shared interleaved RoPE key, expanded asymmetric caches, tied output ownership, and non-gated ReLU-squared FFN. Add strict GGUF metadata and tensor closure validation plus packed fused-KV preservation and cache parity tests. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Promote the ordinary-RoPE, split-QKV Pangu-Embedded path with exact bias, cache, tensor-closure, and tied-output contracts. Keep fused QKV and tensor-backed LongRoPE fail-closed so packed quantization values are never silently transformed.\n\nRecord precise residual blockers for Maincoder, Mistral4, PLaMo, and PLaMo3, including PLaMo3's periodic iSWA cache schedule. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Implement dense MiniCPM and MiniCPM3 GGUF imports with pinned scale semantics, Q/K transforms, LongRoPE factors, MLA projections, asymmetric expanded caches, and strict tensor closure boundaries. Keep runtime promotion deferred and reject unrepresentable expert, latent-state, and serialized RoPE-frequency variants. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Give the GGUF-only MiniCPM module registrations representative tiny scale and MLA geometry so the shared graph suite exercises both promoted architectures instead of failing on intentionally strict production invariants. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Keep the registry test imports formatted and remove MiniCPM3 from the legacy deferred-graph assertion now that its strict promoted contract validates geometry before graph construction. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Assert exact promoted GGUF families reject missing required metadata before config extraction, matching their architecture-specific validators after replaying onto the legacy dense promotion. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1a957193-e630-44b2-bc50-8e506899acc2 Signed-off-by: Justin Chu <[email protected]>
Keep Pangu-Embedded restricted to ordinary RoPE and require MiniCPM LongRoPE factors to use floating-point storage so quantized sidecars cannot be silently consumed outside the packed-weight contract. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 1a957193-e630-44b2-bc50-8e506899acc2 Signed-off-by: Justin Chu <[email protected]>
Performance Comparison
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR promotes additional llama.cpp-pinned GGUF “exact / fail-closed” import subsets by adding dedicated architecture implementations (PLM, MiniCPM, MiniCPM3), expanding GGUF tensor-closure validation and config postprocessing, and updating the GGUF support registry/docs/tests accordingly.
Changes:
- Add exact PLM decoder model + GGUF config/tensor mapping and quantized-preserving import coverage.
- Add exact MiniCPM (dense) and MiniCPM3 (MLA) GGUF-specific model graphs plus extensive closure/parity tests.
- Promote Apertus and Pangu-Embedded GGUF routes (including stricter quantized-keep safety checks) and update the support matrix/docs.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/_test_configs.py | Adds tiny config entries for plm, minicpm_gguf, and minicpm3_gguf graph-build coverage. |
| src/mobius/models/plm.py | Introduces an exact PLM decoder model built on DeepSeekMLA with strict config validation. |
| src/mobius/models/plm_test.py | Adds PLM unit tests for parameter contracts, cache shapes, parity, and fail-closed variants. |
| src/mobius/models/minicpm.py | Introduces exact MiniCPM and MiniCPM3 GGUF-specific text graphs and scaling behavior. |
| src/mobius/models/apertus.py | Extends Apertus to own xIELU scalars via initializers and optional Q/K norm bias handling. |
| src/mobius/models/init.py | Exports new MiniCPM/MiniCPM3 and PLM model classes. |
| src/mobius/integrations/gguf/_upstream_data/llamacpp_pin.json | Updates pinned architecture tensor inventories/metadata requirements (Apertus + MiniCPM3). |
| src/mobius/integrations/gguf/_tensor_processors.py | Adds PACKED_SAFE_PROCESSORS to gate keep_quantized=True safety. |
| src/mobius/integrations/gguf/_tensor_mapping.py | Adds mapping tables for PLM, MiniCPM3, and Apertus extras. |
| src/mobius/integrations/gguf/_plm_test.py | Adds synthetic PLM GGUF contract tests, including packed KV-B preservation. |
| src/mobius/integrations/gguf/_minicpm_test.py | Adds focused MiniCPM/MiniCPM3 GGUF exactness/closure/permutation tests. |
| src/mobius/integrations/gguf/_dense_c01_test.py | Adjusts dense C01 pre-config failure tests for updated promotion boundaries. |
| src/mobius/integrations/gguf/_conventional_decoder_test.py | Promotes/validates pangu-embedded conventional decoder constraints and deferral reasons. |
| src/mobius/integrations/gguf/_config_mapping.py | Adds postprocessors for Apertus, PLM, MiniCPM/MiniCPM3, and Pangu-Embedded strict config restoration. |
| src/mobius/integrations/gguf/_builder.py | Adds MiniCPM/MiniCPM3 GGUF tensor-closure validation; extends dense C01 closure for Apertus. |
| src/mobius/integrations/gguf/_arch_registry.py | Promotes PLM/MiniCPM/MiniCPM3/Apertus/Pangu-Embedded import specs; rejects GPT-2 quantized-preserving import. |
| src/mobius/integrations/gguf/_arch_registry_test.py | Updates expected supported counts/sets and adds a safety test ensuring quantized import doesn’t skip required processors. |
| src/mobius/integrations/gguf/_apertus_test.py | Adds Apertus end-to-end synthetic GGUF tests for rope/xIELU/bias ownership and execution. |
| src/mobius/_registry.py | Registers PLM and GGUF-specific MiniCPM/MiniCPM3 module types in fallback registrations. |
| src/mobius/_configs/_base.py | Adds config fields for per-layer xIELU scalar ownership and per-layer Q/K norm bias flags. |
| docs/api/build_from_gguf.md | Updates generated GGUF support census and architecture rows (Apertus, GPT-2, MiniCPM, MiniCPM3, PLM, Pangu-Embedded). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+41
to
+45
| if rope_dim % 2: | ||
| raise ValueError("PLM qk_rope_head_dim must be even") | ||
| if config.num_key_value_heads != config.num_attention_heads: | ||
| raise ValueError("PLM caches expanded K/V for every attention head") | ||
| if config.q_lora_rank is not None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes the maximal exact, fail-closed GGUF subset for this architecture cohort:
Runtime/OGA promotion remains deferred because representative real-weight GGUF full-logit and deterministic generation parity was not available.
Residual blockers
Validation
rope_freqs.weightadmission and quantized MiniCPM LongRoPE sidecar acceptance.Waivers
No runtime/OGA, representative real-weight GGUF prefill/decode full-logit parity, or generation claim is made. Synthetic graph, tensor closure, packed-value transformation, and cached execution coverage is included for promoted routes.