Repository navigation
Add pinned GGUF mmproj capability registry - #584
Conversation
🏗️ Architecture Diff
gemma4 (gemma4) / vision_encoder — 1 change(s)Op summary: 176 → 176 nodes No op-sequence changes. Interface changes:
Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
Performance Comparison
|
5102565 to
7488b89
Compare
Enumerate the llama.cpp clip projector ABI at the pinned revision and route supported Gemma4 and Muse Glimmer sidecars through an immutable fail-closed registry. Validate metadata, tensor closure, target pairing, dimensions, media tokens, and tensor qtypes before graph construction.\n\nCorrect Gemma4 pooling and clipping-bound handling, document every projector verdict and audited artifact pin, and add registry, mixed-quantization, rejection, and independent NumPy/ORT parity coverage.\n\nCo-authored-by: Copilot App <[email protected]> Signed-off-by: Justin Chu <[email protected]>
Constrain Gemma4 vision exports to their actual single-image pooling contract. Validate the complete sidecar tensor inventory, including an exact deferred Gemma4 audio companion closure and shape policy, so unknown tensors cannot be silently dropped.\n\nRequire stable name and optional base-repository identity bindings across text and projector GGUFs, independent of file relocation. Add regression coverage for closure mutations, companion ranks, identity failures, relocation, and the static batch contract.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: cc4ea80d-0194-436b-b31b-84a8a8a42a2a Signed-off-by: Justin Chu <[email protected]>
Preserve meaningful separators in source identities, distinguish missing metadata from empty values, and reject whitespace-only bindings while retaining conservative URL normalization.\n\nRequire Gemma4 RGB rank-4 patch weights exactly matching the exported graph and validate every pinned active Gemma4 audio field, including positive integer mel-bin metadata, before graph construction. Add collision, presence, shape, and audio metadata regressions.\n\nCo-authored-by: Copilot App <[email protected]>\nCopilot-Session: cc4ea80d-0194-436b-b31b-84a8a8a42a2a Signed-off-by: Justin Chu <[email protected]>
33a0d38 to
0768c8c
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a pinned, fail-closed capability registry for GGUF clip (mmproj) sidecars and tightens VLM assembly to only proceed for exact, audited projector + text-architecture pairings. It also updates Gemma4 vision import semantics (clipping + pooling) and introduces broader preflight validation and parity tests for supported paths.
Changes:
- Introduces an immutable mmproj capability registry pinned to a specific llama.cpp commit, with explicit support gates and audited artifact pins for
gemma4vandmuse-glimmer. - Adds strict preflight validation for text/mmproj pairing (identity bindings, tensor closure, qtypes, shapes, target matching) and removes “fallback to Gemma4” VLM dispatch behavior.
- Updates Gemma4 vision encoder contract to be explicitly single-image (
[1, N, ...]), enables ClippableLinear bounds ingestion, and updates/extends unit + numerical parity tests and documentation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/mobius/tasks/_gemma4.py |
Updates Gemma4 vision encoder I/O contract to explicitly single-image batch and documents variable pooled token count constraints. |
src/mobius/integrations/gguf/_reader.py |
Adds get_tensor_shape() to retrieve logical tensor shapes without dequantizing payloads. |
src/mobius/integrations/gguf/_mmproj.py |
Adds mmproj preflight validation (identity, closure, qtypes/shapes), enforces early rejection, and tightens VLM builder dispatch based on supported projector specs. |
src/mobius/integrations/gguf/_mmproj_test.py |
Extends synthetic mmproj writers and adds preflight guard tests plus independent NumPy/ORT parity checks. |
src/mobius/integrations/gguf/_mmproj_registry.py |
Adds the pinned projector census + support gates and audited artifact pin metadata for supported projectors. |
src/mobius/integrations/gguf/_mmproj_registry_test.py |
Adds closure/immutability tests and doc-matrix synchronization checks for the registry. |
src/mobius/integrations/gguf/_mmproj_mapping.py |
Updates mapping to treat Gemma4 clipping bounds as learned parameters (not skipped stats). |
src/mobius/integrations/gguf/_mmproj_mapping_test.py |
Updates mapping tests to assert clipping bounds are mapped for Gemma4 vision. |
src/mobius/integrations/gguf/_builder.py |
Avoids misclassifying clip sidecars as standalone LMs in auxiliary quantization checks. |
docs/api/build_from_gguf.md |
Documents pinned projector support matrix, audited artifacts, and the stricter pairing/closure rules. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def projector_type_for_modality(metadata: Mapping[str, Any], modality: MMProjModality) -> str: | ||
| """Resolve the pinned global-key then modality-key projector fallback.""" | ||
| projector_type = metadata.get("clip.projector_type") | ||
| if not projector_type: | ||
| projector_type = metadata.get(f"clip.{modality.value}.projector_type") | ||
| if not isinstance(projector_type, str) or not projector_type: | ||
| raise ValueError( | ||
| f"clip mmproj has an active {modality.value} encoder but neither " | ||
| f"'clip.projector_type' nor 'clip.{modality.value}.projector_type' is set." | ||
| ) | ||
| return projector_type |
Summary
clipprojector types at8d9af256337d1a501250f9bbf4c0859a654bddd6in an immutable capability registrygemma4v) and Muse Glimmer (muse-glimmer) sidecars; fail before graph construction for unknown, deferred, mismatched, quantized, or out-of-closure projectorsValidation
PYTHONPATH=src python -m pytest src/mobius/integrations/gguf/_mmproj_registry_test.py src/mobius/integrations/gguf/_mmproj_mapping_test.py src/mobius/integrations/gguf/_mmproj_test.py src/mobius/integrations/gguf/_reader_test.py -q --tb=short— 126 passedlintrunner f --output oneline --all-files— passedglm_moe_dsasymbolic-shape/checker failures remainStacked on #583.