Repository navigation
Add standalone GGUF audio projector routes - #696
Conversation
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]>
Performance Comparison
|
There was a problem hiding this comment.
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.
🏗️ Architecture Diff
No architecture changes detected. ✅ Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed) |
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]>
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]>
## 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]>
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]>
## 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]>
Summary
granite_speech,lfm2a,mimo_audio,musicflamingo,parakeet,ultravox,voxtral, andpockettts_spkencspeaker_encoder, quarantine generated-audio roles, and emit advisory-only onnx-genai/ORT GenAI contracts without fabricating runnable decoder configurationmain; duplicated foundation/task implementations were removed during semantic replayValidation
Base:
9d5e75b010cffa81c039b65f8586afa65c25b59a