Skip to content

Promote evidence-backed multimodal GGUF bundles - #632

Merged
justinchuby merged 5 commits into
mainfrom
justinchuby-multimodal-gguf-support
Aug 25, 2026
Merged

justinchuby merged 5 commits into
mainfrom
justinchuby-multimodal-gguf-support

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • promote Gemma 3, Qwen2-VL, and Qwen2.5-VL text + mmproj graph import
  • preserve canonical decoder, vision_encoder, and embedding package roles and Harden GGUF metadata array header parsing #625-Fix atomic GGUF runtime CLI publication #630 package/runtime invariants
  • add exact pinned llama.cpp tensor closures, projector override resolution, Qwen QKV/temporal patch transforms, Gemma projector mapping, and supported quantization paths
  • bind real pinned Hugging Face processor contracts to float32 graph boundaries, independent image/video streams, batch-major media ordering, and empty-media behavior
  • keep all downstream multimodal runtime verdicts deferred rather than inferring runtime support from graph construction

Evidence

  • real Gemma 3, Qwen2-VL, and Qwen2.5-VL mmproj artifact revisions, sizes, SHA-256 values, qtype inventories, and paired text targets are recorded in the registry and docs
  • value-based tensor/projector mapping tests cover Gemma 3 and both Qwen variants
  • synthetic execution covers two-row mixed image/video ordering, text-only and empty-media embedding, Qwen vision execution, decoder prefill, and cached decode
  • Gemma 3 tests cover the processor-native 256 <image_soft_token> placeholders, safe out-of-vocabulary lookup handling, flattened batch offsets, and projector parity
  • generated generic decoder metadata remains graph-derived

Runtime waivers

Graph import is supported; downstream runtime support remains deferred. Gemma 3 parent processor assets are gated and no ORT GenAI media orchestrator was proven. Qwen runtime still needs proven video alias/timing plumbing and 3D M-RoPE position construction. No audio/codec bundle was promoted without a complete expressible processor/state/runtime contract.

Residual multimodal blockers

  • Qwen3-VL: DeepStack decoder-layer injection
  • Gemma3n: complete MobileNetV5 vision and Conformer audio bundle
  • Gemma4 audio: remaining a.pre_encode.* and Conformer parity
  • generated-audio sidecars: stateful codec/generation contracts

Validation

  • focused GGUF/mmproj/multimodal/package/runtime: 3215 passed
  • broad non-integration: 7849 passed, 56 skipped, 1 subtest passed
  • initialized repository lint: clean
  • GPT-5.6 Sol medium architecture review: fixed Gemma 3 boundary-vs-soft-token blocker; no remaining high-confidence findings
  • GPT-5.6 Sol medium regression review: fixed Qwen evidence references, added vision/prefill/decode execution, and closed the docs artifact census

Base: 6ff5f78dafb90609372de023a5ab9d27098dca6d
Head: ed370d8cecf7adc985d5b372ee050b661f069607

justinchuby and others added 5 commits August 25, 2026 14:13
Wire the Gemma 3 text and vision-projector pair into the canonical multimodal package path, including exact tensor closure, artifact evidence, config recovery, and flattened batch media indexing.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Correct the pinned sidecar FFN mapping and offset RMS norm conversion, then cover exact closure, dtype policy, dispatch, package roles, batched feature offsets, and projector parity with focused synthetic tests.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Add evidence-backed Qwen2-VL and Qwen2.5-VL text plus mmproj assembly, preserving independent image and video streams and canonical package roles. Pin real artifacts and processor contracts, strengthen Gemma 3 processor boundaries, and keep downstream runtimes explicitly deferred until orchestration is proven.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Remove qwen2vl from the deferred preflight cohort and apply repository formatting to the final multimodal implementation and evidence tests.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Target processor-native image soft tokens without indexing beyond the text embedding table. Add Qwen vision, prefill, and cached decode execution evidence, correct parity references, and close the multimodal artifact documentation census.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 25, 2026 21:29
@justinchuby
justinchuby merged commit 2db9d33 into main Aug 25, 2026
16 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-multimodal-gguf-support branch August 25, 2026 21:30
@github-actions

Copy link
Copy Markdown

Performance Comparison

Comparing 6ff5f78 → ed370d8

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 265 265 +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 127 127 +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 429 429 +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.

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 promotes evidence-backed multimodal GGUF + mmproj graph import for Gemma 3 and Qwen2/Qwen2.5-VL within mobius’ GGUF integration, while preserving the canonical 3-model VLM split (decoder, vision_encoder, embedding) and explicitly keeping runtime support deferred (graph import + synthetic execution only).

Changes:

  • Add a Gemma 3–specific 3-model VLM task with a float32, single-image vision boundary and safe <image_soft_token> embedding handling.
  • Add a Qwen2/Qwen2.5-VL “multimedia” embedding path that keeps independent image/video feature streams and supports empty-media / mixed media ordering.
  • Implement and validate pinned mmproj tensor closures + mappings + config extraction, extend the projector/arch registries, and update docs/tests to lock the artifact census and processor contracts.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/mobius/tasks/_vision_language_3model.py Adds Gemma3VisionLanguageTask and Qwen2VLMultimediaTask; shifts Qwen/GLM OCR vision boundaries to float32 where appropriate.
src/mobius/tasks/init.py Exports and registers the new gemma3-vision-language task key.
src/mobius/models/qwen_vl.py Casts packed patch inputs at the boundary and updates embedding fusion to optionally scatter both image and video features.
src/mobius/models/gemma3.py Casts vision inputs at the boundary, makes embedding robust to OOV soft tokens, and flattens image placeholder indexing across batch.
src/mobius/models/gemma3_test.py Adds unit tests covering Gemma3 embedding edge cases, projector parity, and canonical 3-model package keys/contracts.
src/mobius/integrations/gguf/_mmproj.py Adds Gemma3/Qwen VLM builders, pinned config extraction, tensor-closure validation, mapping loaders, and legacy Gemma3 identity compatibility.
src/mobius/integrations/gguf/_mmproj_test.py Adds synthetic GGUF/mmproj writers plus preflight, value-parity, and mixed-media execution tests for Gemma3 + Qwen VL.
src/mobius/integrations/gguf/_mmproj_registry.py Promotes gemma3/qwen2vl_merger/qwen2.5vl_merger to graph-importable, adds real artifact pins and pinned processor contracts.
src/mobius/integrations/gguf/_mmproj_registry_test.py Updates supported projector types and validates new artifact pins + processor contracts.
src/mobius/integrations/gguf/_mmproj_mapping.py Extends mmproj→HF name mapping to include Gemma3 vision and Qwen vision tensors.
src/mobius/integrations/gguf/_mmproj_mapping_test.py Adds mapping tests for Gemma3 vision tensor names.
src/mobius/integrations/gguf/_docs_test.py Adds a docs guard ensuring the manual real-artifact table covers every registry pin.
src/mobius/integrations/gguf/_config_mapping.py Treats qwen2vl as an M-RoPE arch and enforces/slices dimension_sections to a 3-entry mrope_section.
src/mobius/integrations/gguf/_builder_test.py Adjusts a pinned architecture list to reflect qwen2vl no longer being “fails before config extraction”.
src/mobius/integrations/gguf/_arch_registry.py Promotes qwen2vl to a supported config/tensor-map route with a VLM builder; wires Gemma3 VLM builder.
src/mobius/integrations/gguf/_arch_registry_test.py Updates supported/importable counts and exact paired builder expectations to include Gemma3 and Qwen2VL.
src/mobius/integrations/gguf/init.py Exposes the new Gemma3 and Qwen VLM GGUF builders.
src/mobius/_registry.py Switches Gemma3 HF registration to the new gemma3-vision-language task.
docs/api/build_from_gguf.md Updates the published support matrix and adds pinned real-artifact + processor contract documentation for Gemma3 and Qwen VL.

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

@github-actions

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 6ff5f78 → ed370d8

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 added a commit that referenced this pull request Aug 25, 2026
## Summary

- clean up still-valid typing, documentation, test robustness,
error-message,
  maintainability, and performance findings left by the GGUF PR stack
- preserve the behavioral fixes merged in #625-#632
- hash reused multi-GB GGUF sources once, at the final pre-publication
integrity
  gate, while retaining cheap identity checks around staging

Exact base: `2db9d33debdc254d879a51b14434c9a81c230f4f`

Exact head: `4541ed2bc9d2ab4227484510b4a85b2d9113eb25`

## Reconstructed original 17-item low-priority tranche

The persisted audit retained only the totals, so this list was
reconstructed
from the live threads and current source. All but the already-fixed #596
comment are addressed in this PR.

| PR | Comment | Disposition |
|---|---:|---|
| #550 | 3837144656 | Implemented: correct tuple return annotation |
| #552 | 3837389183 | Implemented: multichannel waveform shape docs |
| #559 | 3837716261 | Implemented: name-based cache assertions |
| #573 | 3854308350 | Implemented: one final GGUF hash, with integrity
regression coverage |
| #574 | 3854345521 | Implemented: `TensorRole \| None` typing |
| #574 | 3854345597 | Implemented: removed obsolete verdict filtering |
| #577 | 3854472859 | Implemented: documented SSM sequence length |
| #578 | 3843112613 | Implemented: documented F64 passthrough |
| #579 | 3854518332 | Implemented: generalized fused-projection error |
| #580 | 3854576300 | Implemented: removed brittle node counts |
| #583 | 3854681386 | Implemented: documented conditional draft outputs
|
| #587 | 3854816872 | Implemented: corrected MTP output contract docs |
| #596 | 3846110059 | Already fixed on base: unambiguous GQA bias
comment |
| #600 | 3855174281 | Implemented: metadata-count-only MTP error |
| #607 | 3855776048 | Implemented: stable route-field assertions |
| #607 | 3855776086 | Implemented: public tensor iterator |
| #609 | 3856486136 | Implemented: fail-closed LM-head comment |

## Current unresolved-thread disposition

This covers all 48 Copilot threads returned by the reproducible
#600-#630
query. The one human #623 thread is excluded.

| PR | Comment | Current-main disposition and evidence |
|---|---:|---|
| #600 | 3855174177 | Already fixed by #629: package cycle and
reserved-sidecar validation |
| #600 | 3855174238 | Already fixed by #629: explicit MTP sidecar
naming/loading |
| #600 | 3855174281 | Implemented here: error no longer invents an
observed block count |
| #602 | 3848155961 | Outside exact stack; already fixed: top-level
`expert_dtype` is classified before early return |
| #602 | 3848155983 | Outside exact stack; still-valid behavioral
block-quant validation, unchanged |
| #602 | 3848156000 | Outside exact stack; still-valid truncated-read
behavioral finding, unchanged |
| #602 | 3848156022 | Outside exact stack; still-valid descriptor
byte/dtype validation, unchanged |
| #602 | 3848156040 | Outside exact stack; still-valid expert-bank
payload validation, unchanged |
| #603 | 3855249765 | Already fixed by #630: runtime preflight preserves
shard sets |
| #603 | 3855249840 | Already fixed by #630: success output follows
durable runtime publication |
| #604 | 3855343082 | Implemented here: graph-only MTP persistence
distinguished from runtime rejection |
| #604 | 3855343131 | Already fixed by #630: runtime success messages
are atomic |
| #607 | 3855776001 | Implemented here: missing generation golden skips
before provenance read |
| #607 | 3855776048 | Implemented here: only stable route fields are
asserted |
| #607 | 3855776086 | Implemented here: tensor count uses
`tensor_items_raw()` |
| #608 | 3856079371 | Still-valid behavioral cache-symlink containment
finding; unchanged |
| #608 | 3856079415 | Still-valid behavioral lowercase-digest validation
finding; unchanged |
| #609 | 3856486136 | Implemented here: comment matches value-preserving
policy |
| #610 | 3855541683 | Already fixed by #628: Falcon bias precedence is
explicit |
| #610 | 3855541761 | Already fixed by #628: CTRL tiny config exercises
projection biases |
| #611 | 3856595840 | Implemented here: runtime test resolves the
distribution providing the module |
| #612 | 3855677383 | Already fixed by #625: supported-version
endianness detection |
| #612 | 3855677427 | Implemented here: shared `INT64_MAX` sentinel |
| #612 | 3855677460 | Implemented here: shared PLaMo2 width inference |
| #612 | 3855677486 | Implemented here: accepted PLaMo2 activation
spellings are explicit |
| #613 | 3855845678 | Implemented here: canonical issue URL |
| #613 | 3855845757 | Implemented here: Mamba-1 function-registration
docs |
| #613 | 3855845806 | Implemented here: test expects the canonical issue
URL |
| #614 | 3855988545 | Implemented here: removed stale Nemotron-H
divergence comments |
| #614 | 3855988597 | Already fixed by #628: zero-head geometry raises
actionable `ValueError` |
| #615 | 3856082290 | Already fixed by #626: dense GraniteHybrid bias
closure |
| #618 | 3856729330 | Implemented here: required routes filter ORT GenAI
evidence |
| #618 | 3856729409 | Implemented here: env-selected runtime version is
authoritative |
| #618 | 3856729490 | Stale/N/A: PR-description-only matrix claim;
repository workflow claims one pinned version |
| #618 | 3856729563 | Implemented here: schema tail restored to normal
indentation |
| #619 | 3856342484 | Already fixed on base: Kimi Linear uses
`/issues/605` |
| #619 | 3856342532 | Already fixed by #628: config rejects convolution
kernels below 2 |
| #619 | 3856342580 | Already fixed by #628: GGUF contract rejects
convolution kernels below 2 |
| #620 | 3855717041 | Already fixed by #627: tied LM-head-only
checkpoints are retained |
| #621 | 3856722324 | Already fixed by #628: Kimi-K3 required metadata
is complete |
| #623 | 3855931210 | N/A to current main: comment belongs to open,
unmerged #623 |
| #623 | 3855939302 | N/A to current main: comment belongs to open,
unmerged #623 |
| #623 | 3855939358 | N/A to current main: comment belongs to open,
unmerged #623 |
| #623 | 3855939394 | N/A to current main: comment belongs to open,
unmerged #623 |
| #624 | 3856777152 | Implemented here: runtime compatibility reuses the
emitted model type |
| #625 | 3857049733 | Implemented here: unsupported header reports both
endian candidates |
| #629 | 3857313182 | Newer post-audit behavioral sidecar-symlink
cleanup finding; unchanged |
| #629 | 3857313251 | Newer post-audit cross-platform path-safety
finding; unchanged |

## Validation

- affected GGUF/package/ORT GenAI/model/schema tests: 1,040 passed
- broad non-integration suite: 7,851 passed, 56 skipped, 1 subtest
passed
- generated GGUF docs checks: 7 passed
- initialized `lintrunner`; full lint/format passed
- GPT-5.6 Sol medium review: one integrity finding fixed; re-review
found no significant issues

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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