Skip to content

Add standalone GGUF audio projector routes - #696

Merged
justinchuby merged 7 commits into
mainfrom
justinchuby-add-audio-projector-cohort
Aug 28, 2026
Merged

justinchuby merged 7 commits into
mainfrom
justinchuby-add-audio-projector-cohort

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • add exact standalone GGUF routes for granite_speech, lfm2a, mimo_audio, musicflamingo, parakeet, ultravox, voxtral, and pockettts_spkenc
  • preserve route-specific sample/channel/frame processor ABIs and reusable Whisper, Conformer/FastConformer, MiMo RVQ/local-transformer, Granite Speech, and PocketTTS speaker graphs
  • enforce suffix-exact tensor closure, immutable evidence/fingerprint isolation, and float-only fail-closed loading (including rejection of the available packed Q8 Voxtral artifact)
  • keep PocketTTS as a framewise speaker_encoder, quarantine generated-audio roles, and emit advisory-only onnx-genai/ORT GenAI contracts without fabricating runnable decoder configuration
  • reuse the merged role-aware task/builder foundation and Meralion audio union from main; duplicated foundation/task implementations were removed during semantic replay

Validation

  • focused audio/registry/task/advisory export suites: 471 passed
  • final focused regression: 204 passed
  • broad non-integration suite: 9,404 passed, 64 skipped, 1 subtest
  • lint/format and generated GGUF docs clean
  • changed route code has no new mypy diagnostics; direct shared-file mypy still follows imports into existing baseline errors
  • medium final diff review clean
  • immutable artifact evidence: four compatible float sidecars accepted; packed Voxtral Q8 and vision-only Parakeet candidates fail closed; source-only MiMo/PocketTTS evidence remains test-only
  • no GGUF, safetensors, or binary payloads retained

Base: 9d5e75b010cffa81c039b65f8586afa65c25b59a

justinchuby and others added 4 commits August 28, 2026 10:59
Implement exact standalone ONNX routes for Granite Speech, LFM2 Audio, MiMo Audio, Music Flamingo, Parakeet, Ultravox, Voxtral, and PocketTTS speaker encoding. Preserve route-specific waveform or feature ABIs, suffix-exact tensor closure, float-only fail-closed loading, generated-audio quarantine, and speaker-role isolation.

Add test-only immutable evidence pins plus graph execution and independent numerical parity coverage for every route, and regenerate the GGUF support census.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Align every real float sidecar tensor with one graph parameter, reject overlong or packed inputs before execution, preserve companion fingerprint isolation, and document processor sample/frame ABIs. Keep PocketTTS framewise conditioning under a speaker-specific output and capture Granite Speech feature layers before its midpoint CTC injection.

Add full mapping closure, reduced-precision boundary, public dispatch, immutable evidence, and regression coverage; make all changed production paths pass mypy.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Record graph-derived output widths and exact pinned header metadata in test-only evidence, persist processor/runtime/qtype metadata on standalone ONNX components, and cover public dispatch, quantization reports, frame-limit failures, and full tensor-to-parameter alignment.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Reuse the merged role-aware audio and speaker tasks, retain the Meralion union, tighten MiMo companion closure, and register immutable audio evidence in the shared registry. Export standalone audio and speaker packages through advisory runtime contracts without fabricating ORT GenAI decoder configuration.

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 28, 2026 18:18
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 9d5e75b → 240f4f7

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

This PR adds standalone GGUF audio-sidecar (mmproj) support by implementing exact per-route audio projector graphs (including speaker encoder), wiring them into the GGUF projector registry/mapping and build entry points, and exporting advisory-only runtime metadata for onnx-genai / ORT GenAI (without fabricating a runnable decoder config).

Changes:

  • Implement reusable standalone audio/speaker sidecar graph modules for multiple projector types (Ultravox/Voxtral/MusicFlamingo, LFM2-Audio, Parakeet, Granite Speech, MiMo audio, PocketTTS speaker encoder).
  • Promote these routes in the GGUF mmproj registry and provide suffix-exact tensor mapping + quantization/fingerprint reporting for standalone audio projectors.
  • Add focused tests + evidence fixtures and update docs/exports to explicitly mark standalone sidecars as advisory for current runtimes.

Reviewed changes

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

Show a summary per file
File Description
tests/data/gguf_audio_projector_evidence.json Adds pinned evidence records for standalone audio projector routes/artifacts.
src/mobius/tasks/_gguf_projector.py Allows configurable output name for the speaker-encoder sidecar task wrapper.
src/mobius/models/gguf_audio_projector.py Implements the standalone audio/speaker projector graph families and route-specific processor ABIs.
src/mobius/models/gguf_audio_projector_test.py Adds extensive unit coverage for graph build, tensor mapping closure, execution sanity, and component parity.
src/mobius/integrations/ort_genai/auto_export.py Emits advisory-only runtime_compatibility for standalone GGUF audio/speaker sidecars (no genai_config.json).
src/mobius/integrations/onnx_genai/auto_export.py Emits advisory-only component contracts for standalone GGUF audio/speaker sidecars.
src/mobius/integrations/gguf/_route_census_test.py Updates expected route census category counts after promoting audio projector routes.
src/mobius/integrations/gguf/_mmproj.py Adds standalone audio projector build path enhancements (mapping, transforms, metadata, quantization report).
src/mobius/integrations/gguf/_mmproj_registry.py Defines supported standalone audio projector specs, metadata/tensor closure requirements, and artifact pins.
src/mobius/integrations/gguf/_mmproj_registry_test.py Updates registry importability expectations for newly supported audio projector specs.
src/mobius/integrations/gguf/_mmproj_mapping.py Adds exact tensor-name mapping for standalone audio projector routes into ONNX initializer names.
src/mobius/integrations/gguf/_docs.py Notes that standalone projector graphs persist processor ABI/output width/runtime warning.
src/mobius/integrations/gguf/_audio_projector_test.py Adds standalone audio projector mapping/preflight/quantization/evidence tests.
src/mobius/integrations/gguf/init.py Exposes build_audio_projector_from_gguf as a public API entry point.
docs/api/build_from_gguf.md Updates capability counts and documents standalone projector metadata persistence.

💡 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 9d5e75b → 240f4f7

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 3 commits August 28, 2026 11:28
Right-pad odd MiMo encoder lengths before stride-two downsampling, repeat the final RVQ embedding when completing partial local-attention groups, and reject empty grouped input. Require standalone projector presence metadata to be the literal boolean true instead of accepting truthy values.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Reject non-positive or non-divisible standalone audio attention metadata before deriving head dimensions or transforming PocketTTS rotary projection rows.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Centralize standalone audio head-dimension validation and invoke it before ArchitectureConfig or projector graph construction, while retaining the weight-loader guard.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit 82e3122 into main Aug 28, 2026
16 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-add-audio-projector-cohort branch August 28, 2026 18:39
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve PR #696 standalone audio routes while restoring the OCR registry order, completed route census, and generated support documentation.

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
## Summary

- Preserve proven GGUF model and runtime/config components when an
authoritative tokenizer route is deferred or blocked.
- Emit exactly one structured tokenizer warning with route, blocker
category, evidence ID, exact recorded reason, impact, and remediation;
never publish unverified tokenizer assets.
- Persist generic component `support_status`, `export_status`, and
`runtime_validation_status` in `export_report.json`.
- Keep architecture, config, tensor closure, graph, qtype, source
identity, I/O, malformed known metadata, and unexpected failures
fail-closed.

## Final blocker evidence

- **Tokenizer field closure:** Complete and incomplete paths accept only
exact consumed/extension allowlists plus `tokenizer.chat_template.*`.
Unknown/near-miss fields defer as
`unsupported-tokenizer-metadata-fields`; malformed known fields remain
fatal even when unknown fields coexist.
- **Incomplete tokenizer safety:** Present model/`pre`, embedded JSON,
RWKV, token list, types/scores/merges, special IDs, booleans,
suppress/charsmap, and chat templates validate before downgrade.
Tokenless special IDs fail; only `mask_token_id` on recognized
masked-diffusion architectures is left to the graph contract.
- **MTP tokenizer safety:** Deferred/blocked MTP routes never copy or
pass through unevidenced tokenizer repositories. Only runtime evidence
or validated embedded materialization writes tokenizer assets; faithful
runtime config remains exported.
- **Reuse metadata lifecycle:** The rollback journal always
manages/removes stale draft, export, and quantization reports across
sidecar variants. Failed reruns restore the complete prior graph/report
set.
- **Final-byte runtime identity:** Evidence matching occurs after final
export/compatibility/MTP status bytes. Pre-report evidence is explicitly
legacy/non-validating until regenerated final-package hashes exist.
- **Atomic publication:** Report-bearing normal saves use sibling
staging and atomic no-replace publication;
graph/report/draft/permission/concurrent-destination failures leave no
stale output. MTP status and reuse remain non-duplicated transactional
surfaces.

## Validation

- Final MTP/tokenizer regressions: **116 passed, 15 deselected**.
- #696 audio-projector affected gate: **428 passed, 453 deselected**.
- Final broad serial suite on exact base: **9,471 passed, 64 skipped, 12
deselected, 1 subtest passed**.
- Generated GGUF docs, full initialized `lintrunner`, and diff check:
clean.
- New disposition/runtime modules: targeted mypy clean.
- Broad mypy exact-base comparison: branch **3,768** vs base **3,804**
existing diagnostics; **0 normalized new errors**.
- Multiple independent medium-effort reviews completed; final MTP/mask
review reported no findings.
- GitHub review threads: **1 total, 0 unresolved**.

## Publication preflight

- Clean worktree and matching remote head.
- Session artifacts: **0 bytes retained**. Completed exact-base mypy
worktrees/logs were deleted; no downloaded GGUF/ONNX/package payloads or
scratch caches remain.
- Lease push completed after conflict-free semantic rebase onto #696.
- All commits contain `Signed-off-by` and required Copilot
`Co-authored-by` trailers. GPG signing was unavailable because `gpg` is
not installed.
- CI is intentionally not monitored and this PR is not being merged by
this session.

## Exact revisions

- Base: `82e31222c9dbc08d2ea825fd6265498f0f594019`
- Head: `960beeddec616d10d83f5bebe0ecd157a64ff199`

---------

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
Preserve PR #696 standalone audio routes while restoring the OCR registry order, completed route census, and generated support documentation.

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
## Summary

- Add exact target/draft GGUF pair construction with separate cache
namespaces, target hidden-state outputs, shared embedding/LM-head
bridges, atomic package publication, and self-verifying graph
identities.
- Add a direct ONNX Runtime greedy coordinator for DFlash and EAGLE3
with accepted-prefix verification, target/draft cache rollback,
compressed-vocabulary remapping, strict output-capacity bounds, and
target-only baseline comparison.
- Add a separate test-only direct ORT oracle that imports neither
`DraftPairRunner` nor production transition helpers, derives
target-layer/remap/block/mask contracts from raw immutable GGUF
metadata, and compares production behavior against independently
recorded transitions.
- Make EAGLE3 consume real draft-owned embeddings, normalize
GGUF/HuggingFace hidden-state indices correctly, and preserve
fully-owned cross-width variants.
- Semantically rebase onto exact current `main` at
`d68f66418096e0fe9a073764b819d6898de314de`, integrating #696, #693, and
#691 while retaining shared MTP cache/publication/status infrastructure
without duplication.
- Keep higher-level runtime compatibility advisory; no production
revision pin or downstream runtime gate is added.

## Immutable evidence

Evidence is bound in
`testdata/evidence/gguf_draft_runtime_evidence.json` (13,293,887,389
bytes total, below the 16 GiB cap), including
artifact/config/tokenizer/source/graph/package/runtime hashes. Separate
SHA-256-bound independent traces record every proposal ID/remapped token
and proposal-logit digest, posterior/accepted prefix/correction, target
verification/replay logits and tokens, target/draft cache lengths and
tensor digests before/tentative/committed/replay states, final cache
states, exact counters, and the explicit batch-size-one reorder
disposition.

- **DFlash:** `Qwen/Qwen3-4B-GGUF@bc640142...` +
`AtomicChat/Qwen3-4B-DFlash-GGUF@b53c7de6...`; 32/32 direct-ORT greedy
tokens equal target-only, 18/75 proposals accepted, 3 multi-token
rounds, 5 rejected-suffix rollbacks. Independent full-tensor Q8 source
comparison: cosine `0.999879`, relative L2 `0.005406`.
- **EAGLE3:** `Qwen/Qwen3-8B-GGUF@7c41481f...` +
`williamliao/Qwen3-8B-EAGLE3-Speculator-GGUF@44480ff4...`; 32/32
direct-ORT greedy tokens equal target-only, 20/43 proposals accepted, 7
multi-token rounds, 10 rejected-suffix rollbacks. Independent pinned
llama.cpp conversion matches all 15 tensor names, qtypes, shapes, and
values exactly.
- Pinned llama.cpp additionally exercised the real acceptance loops with
49/114 DFlash and 45/85 EAGLE3 accepted tokens.
- Four mutations now alter execution before validation: wrong
mapping/order is fed through target verification, draft-cache corruption
is threaded into the next round, and target rollback corruption is
replayed against full committed history. Each fails its distinct
semantic invariant.

Target Q4_K/Q6_K imports truthfully report lossy INT4 affine block-32
repacking; target-only and speculative comparisons use the same repacked
target graph. Every target replay starts from an empty cache and
rebuilds the complete prompt plus committed token history. Quantized
batched verification and full-history replay can differ numerically, so
both states are bound and maximum absolute differences are recorded
(DFlash `1.967625`, EAGLE3 `0.912386`) while replay argmax tokens must
match exactly. Draft replay likewise reconstructs the complete committed
history from empty state.

Production DFlash uses target-only tail generation when fewer than one
fixed block remains; EAGLE3 caps each final proposal width to `remaining
- 1`. Parametric tests prove target sessions, caches, and counters never
process beyond requested `max_new_tokens` for remaining capacity 1
through width+1. The reference coordinator is batch-size 1 and
truthfully reports beam/reorder unsupported. Higher-level execution
remains `runtime_unvalidated` without gating export.

## Validation

- Final exact-main broad non-integration suite: 9,668 passed, 64
skipped, 1 subtest passed.
- Final affected draft+MTP+CLI/evidence/docs/census suite: 302 passed, 2
real-artifact probes skipped by opt-in.
- Both immutable real-artifact probes were rerun after the three blocker
fixes; all eight execution-mutating discriminator runs failed at their
expected semantic invariants.
- Pinned Ruff format/lint, generated GGUF docs, and focused isolated
mypy passed. `_config_mapping.py` retains three unrelated pre-existing
mypy errors outside the DFlash change.
- Final medium review specifically verified execution-mutating
discriminators, complete empty-cache target replay, bounded final-round
production behavior, DFlash mask metadata propagation, and semantic
#693/#691 conflict resolution; no significant findings remain.

No CI monitoring or merge is requested.

---------

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