Skip to content

Add seven Qwen and GLM GGUF projector routes - #690

Merged
justinchuby merged 4 commits into
mainfrom
justinchuby-gguf-projector-routes
Aug 28, 2026
Merged

justinchuby merged 4 commits into
mainfrom
justinchuby-gguf-projector-routes

Conversation

@justinchuby

@justinchuby justinchuby commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add exact standalone GGUF projector routes for glm4v, glma, qwen2.5o, qwen2a, qwen3a, qwen3vl_merger, and qwen3tts_spkenc
  • enforce metadata, tensor closure, shape, modality pairing, and F32/F16/BF16-only qtype contracts; quarantine qwen3tts_gen
  • cover Qwen3-VL 2x2 merge cardinality, DeepStack width packing, four-section decoder MRoPE, and route-selected transformer activation semantics
  • preserve Decouple export from downstream runtime capability gates #688's advisory-only downstream-runtime policy and semantically retain Add nine core GGUF VLM projector routes #689's core-VLM builders, roles, evidence, component-presence metadata, census, docs, and tests

Rebased commit stack

  • 171cec98 — small remaining shared standalone-dispatch/export delta after Add nine core GGUF VLM projector routes #689 absorbed the reusable projector foundation
  • 168414fe — exactly the seven Qwen/GLM routes, mappings, components, evidence, docs, and tests
  • 1de782cf — strict pre-closure metadata validation and Qwen3 audio padding/length hardening
  • 4b03d27e — processor-native Qwen3 mask ABI, consumer-scoped SiLU semantics, and single-preflight fix

Shared surfaces remain additive with #689: _MMPROJ_BUILDERS retains both core_vlm_projector and qwen_glm_projector; generic vision/audio/speaker tasks retain core component-presence metadata and Qwen multi-output audio support.

Review hardening

  • qwen3a accepts the pinned Qwen3ASRProcessor output directly as input_features_mask: int32, casts internally only for length arithmetic, compacts padding-derived rows, and publishes audio_feature_lengths
  • all seven routes validate consumed metadata types, positive/finite ranges, boolean presence flags, exact projector enums, and route-specific geometry before tensor closure or graph construction
  • clip.use_silu is validated and fingerprint-relevant only for glm4v, glma, and qwen3vl_merger; Qwen3-VL transformer FFNs follow it while final and DeepStack mergers remain tanh-GELU
  • public standalone dispatch performs the expensive Qwen/GLM preflight once; direct route-wrapper calls still validate when no prevalidated model is injected
  • the outstanding duplicate-preflight review thread was answered and resolved

Validation

  • combined focused projector/task suite: 440 passed
  • broad non-integration suite: 9,230 passed, 64 skipped, 1 subtest passed
  • lintrunner clean
  • generated GGUF docs clean
  • changed production modules pass mypy with import traversal isolated
  • independent medium-effort review and follow-up review: no findings

Immutable selected evidence totals 5,980,273,312 bytes, below the 16 GiB cap.

@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 28, 2026 16:03
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing f494a75 → 4b03d27

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 324 KB 324 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 450 450 +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

Adds standalone GGUF mmproj (“clip” sidecar) export support for a new Qwen/GLM projector cohort, extending the GGUF integration so Mobius can export exact, role-scoped sidecar graphs (vision/audio/speaker) with strict metadata/tensor-closure/shape contracts while keeping downstream runtime orchestration explicitly “deferred”.

Changes:

  • Introduces standalone sidecar tasks (GGUFAudioProjectorTask, GGUFVisionProjectorTask, GGUFSpeakerProjectorTask) and route-specific Qwen/GLM projector modules + weight mapping.
  • Extends the mmproj registry/spec system to express standalone builders, model roles, block-suffix variants, auxiliary tensor patterns, and quarantined deferred companions (e.g., qwen3tts_gen).
  • Adds comprehensive mapping, shape validation, docs updates, and an extensive test suite covering parity and contract enforcement.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mobius/tasks/_gguf_projector.py Adds standalone graph-building tasks for sidecar components (vision/audio/speaker).
src/mobius/tasks/init.py Exposes new GGUF projector tasks/models in the public task API.
src/mobius/models/gguf_qwen_glm_projector.py Implements standalone Qwen/GLM sidecar component modules and input schemas.
src/mobius/integrations/gguf/_route_census_test.py Updates route census expectations for the new projector cohort.
src/mobius/integrations/gguf/_qwen_glm_projector.py Adds Qwen/GLM route config reading, shape validation, state mapping, and package builder.
src/mobius/integrations/gguf/_qwen_glm_projector_test.py Adds parity/contract tests for all new standalone projector routes.
src/mobius/integrations/gguf/_mmproj.py Adds standalone build_mmproj_from_gguf entry point and validation enhancements (variants/quarantine).
src/mobius/integrations/gguf/_mmproj_registry.py Extends projector specs with standalone builder + roles, evidence types, and new cohort routes.
src/mobius/integrations/gguf/_mmproj_registry_test.py Expands registry tests to cover new routes, evidence, and schema changes.
src/mobius/integrations/gguf/_mmproj_mapping.py Adds mmproj→ONNX mapping functions for the new Qwen/GLM projector families.
src/mobius/integrations/gguf/_mmproj_mapping_test.py Adds tests for the new mapping functions and deepstack/speaker boundary behavior.
src/mobius/integrations/gguf/_docs.py Updates generated docs to include standalone graph roles/routes and evidence types.
src/mobius/integrations/gguf/_docs_test.py Adjusts doc size constraint to account for the expanded projector matrix.
src/mobius/integrations/gguf/init.py Exposes build_mmproj_from_gguf in the GGUF integration public API.
src/mobius/components/_qwen3_vl_vision.py Adds configurable GELU approximation for merger/deepstack parity with llama.cpp.
src/mobius/components/_glm4v_vision.py Introduces a GLM4V packed vision encoder + downsampler + gated projector component.
src/mobius/components/_gguf_audio_projectors.py Adds reusable GGUF Whisper/Qwen/GLM audio projector components used by sidecars.
src/mobius/components/init.py Exports new GGUF audio projector components and the GLM4V vision model.
docs/api/build_from_gguf.md Updates the support matrix and documents build_mmproj_from_gguf standalone behavior.

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

Comment thread src/mobius/integrations/gguf/_mmproj.py Resolved
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing f494a75 → 4b03d27

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 and others added 4 commits August 28, 2026 09:28
Separate paired multimodal builders from role-explicit standalone sidecar builders. Add modality-aware closure validation, source evidence and quarantined companion contracts, plus reusable vision and speaker projector tasks.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Implement exact standalone vision, audio, and speaker encoder graphs for glm4v, glma, qwen2.5o, qwen2a, qwen3a, qwen3vl_merger, and qwen3tts_spkenc.

Add route-specific tensor mappings, closure and qtype guards, immutable evidence, processor ABI contracts, independent numerical parity, and executable coverage. Preserve the advisory-only downstream runtime policy established by #688.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Preserve Qwen3 audio processor masks and valid feature lengths, compact padding-derived rows, and publish the exact graph ABI.

Validate all seven routes' consumed metadata types, ranges, finite values, enums, and geometry before tensor closure so malformed sidecars fail closed.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: e45c53d8-129d-461b-86fc-8ed79d816efe
Signed-off-by: Justin Chu <[email protected]>
Expose Qwen3 ASR input_features_mask as processor-native INT32, prove direct processor-to-ORT feeds, and cast only inside the graph for length arithmetic.

Scope clip.use_silu to actual consumers, route it into Qwen3-VL transformer FFNs, preserve merger GELU semantics, and avoid duplicate standalone preflight scans.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: e45c53d8-129d-461b-86fc-8ed79d816efe
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchuby-gguf-projector-routes branch from 5524d5d to 4b03d27 Compare August 28, 2026 16:38
@justinchuby
justinchuby merged commit a1ea520 into main Aug 28, 2026
16 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-gguf-projector-routes branch August 28, 2026 16:41
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve the canonical multi-output audio task from PR #690, remove the duplicate replayed task, and regenerate shared registry census and documentation after promoting the OCR routes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f96aa7b0-95a6-473f-a875-5883767c2a24
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve the canonical multi-output audio task from PR #690, remove the duplicate replayed task, and regenerate shared registry census and documentation after promoting the OCR routes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f96aa7b0-95a6-473f-a875-5883767c2a24
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve the canonical multi-output audio task from PR #690, remove the duplicate replayed task, and regenerate shared registry census and documentation after promoting the OCR routes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f96aa7b0-95a6-473f-a875-5883767c2a24
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve the canonical multi-output audio task from PR #690, remove the duplicate replayed task, and regenerate shared registry census and documentation after promoting the OCR routes.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f96aa7b0-95a6-473f-a875-5883767c2a24
Signed-off-by: Justin Chu <[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