Skip to content

Add offline VibeVoice ASR support - #730

Open
justinchuby wants to merge 10 commits into
mainfrom
justinchuby-vibevoice-offline-asr
Open

Add offline VibeVoice ASR support#730
justinchuby wants to merge 10 commits into
mainfrom
justinchuby-vibevoice-offline-asr

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • Add a fail-closed VibeVoiceForASRTraining route for microsoft/VibeVoice-ASR, pinned by default to d0c9efdb8d614685062c04425d91e01b6f37d944 and kept distinct from VibeVoice TTS and streaming ASR.
  • Export a truthful five-stage offline package: acoustic encoder, semantic encoder, connectors, embedding replacement, and cached Qwen2 decoder. Host orchestration owns source-compatible normalization, chunk/cache handling, per-utterance terminal frames, deterministic acoustic sampling, fixed ASR prompting, and diarization JSON parsing.
  • Add raw-config loading, complete checkpoint tensor classification, source/processor/parity tests, ONNX Runtime GenAI advisory metadata (not a false runnable OGA config), and Mermaid documentation/catalog coverage.

Validation

  • Requested non-integration suite, alignment/coverage gates, targeted ASR/TTS tests, lint, and no-weights staged export.
  • Final independent exact-head Terra review: no significant issues.

Runtime limitation

L4/L5 real-weight transcription and diarization are deliberately not claimed: the official BF16 checkpoint is approximately 8.67B parameters and no suitable GPU was available. The documentation records the CUDA/BF16 workflow required for that validation.

justinchuby and others added 10 commits September 4, 2026 09:24
Add fail-closed routing, staged ASR graphs, host processor contract, and source-backed coverage for microsoft/VibeVoice-ASR.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Preserve final speech frames, require an unambiguous architecture, and build the source-compatible prompt and token layout.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Preserve source prompt branches and clipping behavior while restoring the VibeVoice TTS fixture in weight alignment coverage.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Match source clipping epsilon behavior and retain already aligned ASR parameters for direct package loading.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Carry final-chunk state into each encoder convolution and use JSON-aware diarization extraction for source-style assistant responses.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Treat the strict dataclass validation exception as optional so all Transformers builds remain compatible with supported Hub releases.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Keep both normal and raw Transformers config loading compatible with older supported huggingface_hub releases.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Emit the source tokenizer’s object-reference speech tokens and keep architecture validation compatible with older Hub releases.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Render source-owned Qwen turns directly so compatible base tokenizers cannot inject an extra system prompt.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Preserve terminal-frame semantics for variable-length batches and pin default ASR builds to the validated checkpoint revision.

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 September 4, 2026 18:23
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 8c38c06f166a78

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.

Comment thread docs/vibevoice-asr.md

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to model docstring so it shows up in docs site

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.

🟡 Changes recommended

The new arch-validation test uses a huggingface_hub.hf_hub_download(local_dir=...) call that can break the same older Hub environments the PR explicitly targets for compatibility.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds first-class support for exporting and validating the original offline VibeVoice-ASR checkpoint as a staged ONNX package (dual cached waveform encoders → connectors → embedding replacement → cached Qwen2 decoder), plus host-side orchestration and ONNX Runtime GenAI advisory artifacts. This extends Mobius’ speech model coverage while keeping ASR routing fail-closed and distinct from VibeVoice TTS / streaming ASR.

Changes:

  • Introduces VibeVoiceASRForConditionalGeneration, VibeVoiceASRConfig, and VibeVoiceASRTask to export the five-stage offline ASR pipeline.
  • Adds host contracts (VibeVoiceASRProcessor, VibeVoiceASRHost) and ORT GenAI export outputs (preprocessor_config.json + advisory compatibility metadata).
  • Updates Transformers builder/config loading to pin the ASR revision by default and to dispatch VibeVoice architectures explicitly (fail-closed), with expanded synthetic + arch-validation tests and documentation.
File summaries
File Description
tests/weight_alignment_test.py Adds checkpoint-index census + routing coverage for the pinned VibeVoice-ASR tensor set.
tests/model_coverage_test.py Documents why L4/L5 real-weight coverage is not claimed for the large BF16 checkpoint.
tests/build_graph/speech_test.py Registers expected component topology for vibevoice-asr graph builds.
tests/arch_validation_test.py Makes HF config loading tolerant of older Hub installs and adds coverage for that path.
tests/_test_configs.py Adds a tiny VibeVoiceForASRTraining config for fast graph-level validation.
src/mobius/tasks/_vibevoice_asr.py New task exporting the five offline ASR ONNX components and cache ABI.
src/mobius/tasks/init.py Exposes and registers the new vibevoice-asr task.
src/mobius/models/vibevoice.py Extends tokenizer encoder conv stack to support a final-chunk flag for source-equivalent padding.
src/mobius/models/vibevoice_asr.py New staged offline ASR model + weight routing for both original and converted namespaces.
src/mobius/models/vibevoice_asr_test.py Synthetic parity tests vs pinned Transformers VibeVoice-ASR implementation.
src/mobius/models/init.py Exports VibeVoiceASRForConditionalGeneration from the models package.
src/mobius/integrations/vibevoice_asr.py New host-side orchestration: normalization, chunk/cache handling, prompting, diarization parsing.
src/mobius/integrations/vibevoice_asr_test.py Unit tests for processor/host behavior and deterministic orchestration contracts.
src/mobius/integrations/transformers/_config_resolver.py Makes strict Hub error handling tolerant of older huggingface_hub layouts.
src/mobius/integrations/transformers/_config_resolver_test.py Adds test coverage for Hub installs missing the errors module.
src/mobius/integrations/transformers/_builder.py Pins microsoft/VibeVoice-ASR revision by default and enforces explicit VibeVoice architecture dispatch.
src/mobius/integrations/transformers/_builder_test.py Adds fail-closed dispatch tests and validates pinned ASR raw-config build path.
src/mobius/integrations/onnx_genai/auto_export.py Detects VibeVoice-ASR packages and writes processor + advisory runtime contracts.
src/mobius/integrations/onnx_genai/auto_export_test.py Verifies ORT GenAI export emits processor contract + advisory compatibility for ASR.
src/mobius/_registry.py Registers VibeVoiceForASRTraining as a distinct fallback architecture key and pins its test model id/revision.
src/mobius/_configs/vibevoice_asr.py New config extraction for offline ASR (dual tokenizers + Qwen2 decoder) with validation.
src/mobius/_configs/init.py Exposes VibeVoiceASRConfig from the configs package.
docs/vibevoice-asr.md New documentation for staged offline ASR package boundaries, host contract, and evidence levels.
docs/model-catalog.md Adds catalog entry linking VibeVoiceForASRTraining to the offline ASR docs.
Review details
  • Files reviewed: 24/24 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment on lines +183 to +188
index_path = hf_hub_download(
"microsoft/VibeVoice-ASR",
filename="model.safetensors.index.json",
revision="d0c9efdb8d614685062c04425d91e01b6f37d944",
local_dir=tmp_path,
)
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 8c38c06f166a78

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)

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