Skip to content

Let ASR VAD chunking load any built-in VAD family - #1096

Merged
0xShug0 merged 2 commits into
0xShug0:mainfrom
Etherll:vad-loader
Oct 26, 2026
Merged

0xShug0 merged 2 commits into
0xShug0:mainfrom
Etherll:vad-loader

Conversation

@Etherll

@Etherll Etherll commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

ASR models that plan chunks with audio_chunk_mode=vad hard-coded silero_vad::load_silero_vad_model, so <family>.vad_model_path could only name Silero weights. This PR adds runtime::load_vad_model(), which loads any VAD family built into the binary, and uses it in the seven ASR models that hard-coded Silero. Defaults are unchanged: every model still points at assets/framework/models/silero_vad.

This was split out of #1095 (Earshot VAD), and the two PRs do not depend on each other. With both merged, Earshot works as an ASR chunking VAD, e.g. --session-option parakeet_tdt.vad_model_path=assets/framework/models/earshot_vad.

What changed

  • src/framework/runtime/registry.cpp and registry.h: a default_loaders() refactor, shared with make_default_registry, plus load_vad_model():

    • Only loaders that advertise offline VAD are considered, so a wrong path never loads a large non-VAD model first.
    • With a family hint, the matching VAD loader is used. An unknown hint fails and lists the built VAD families.
    • For a weight file, a loader whose inspection uses exactly that file wins. Spec-backed package loaders resolve a file to its folder, so without this a different package next to the file could claim it.
    • A directory goes to the first VAD loader that accepts it.
    • A path no VAD loader claims is loaded as Silero, as before (e.g. Silero weights under another file name), after checking that the file holds Silero tensors. Otherwise the error lists the VAD families built into the binary instead of a Silero tensor error.
    • Loaders are called directly, so the host's load trace and progress bracket are left alone (the same as the old direct Silero call).
  • The seven models that now use it: moonshine_asr, qwen3_asr, vibevoice_asr, granite5asr, parakeet_tdt, lfm2_audio and sense_asr. Each change is a one-line swap of the loader call; sense_asr/session.h drops a now-unused forward declaration. gigaam_asr already loaded its VAD through the registry and is unchanged.

  • Option descriptions in those models' loaders and model_specs/*.json now say "any built-in VAD family; default Silero VAD". Only description strings change.

  • tests/unittests/test_vad_loader.cpp (vad_loader_test) covers:

    • the bundled Silero and MarbleNet models, from a directory, a file and a family hint;
    • a renamed Silero file;
    • a Silero file next to a PulseVAD package, both under its canonical name and renamed;
    • rejection of a non-model file, a non-VAD directory, a missing path, an unknown hint, and weights of a VAD family that isn't built in.

    Against the version without the exact-file rule and the Silero tensor check, sibling_package_does_not_claim_file and rejections fail.

Validation

Platform Result
Windows 11, MSVC 19.44, build_windows.ps1 -Preset windows-cpu-release -RunTests (custom set: the seven ASR models, gigaam_asr, firered_vad, pulsevad) vad_loader_test and audio_chunking_test pass. 2 other tests fail: lfm2_audio_assets_test and disk_expert_weight_store_test. They run no VAD code and pass on Linux.
WSL Ubuntu 24.04, gcc 13, Debug, full model set, ENGINE_BUILD_TESTS=ON, full ctest All tests pass
This branch merged with #1095 Merges without conflicts. vad_loader_test, earshot_vad_test and audio_chunking_test pass.

tools/check_loader_catalog_sync.py --self-test and tools/check_loader_catalog_sync.py both pass.

End to end

The model was Moonshine Streaming tiny Q8_0 on CPU, with audio_chunk_mode=vad on a 10 min file.

moonshine_asr.vad_model_path Result
default (assets/framework/models/silero_vad) 1279 words; Silero pass 1.5 s
assets/framework/models/earshot_vad (with #1095) 1336 words; Earshot pass 39 ms
…/earshot_vad.safetensors (with #1095) Same as the folder
Earshot weights, in a build without earshot_vad Error naming the built VAD families: no VAD model built into this binary can load … (built VAD families: silero_vad, marblenet_vad, firered_vad, pulsevad; loading it as Silero VAD failed: the file has no Silero VAD tensors)

With #1095, Parakeet TDT 0.6B v3 Q8_0 on CUDA (Colab L4) ran on 23.7 min of LibriSpeech test-clean: six chapters, each joined into one file with pauses and light noise.

Chunking WER ASR wall s
Fixed 30 s 28.5% 18.6
VAD, silero_vad 26.7% 27.6
VAD, earshot_vad 25.7% 21.1

The absolute WER is high for every row because of how the long-form files were built; compare the rows with each other. These runs used the first version of this helper, before the exact-file rule; a directory path such as assets/framework/models/earshot_vad takes the same route in both. On an RTX 5090, the VAD pass over 10 min of 5 dB SNR audio took 79 ms with Earshot and 4.9 s with Silero.

Known limitations

  • granite5asr still runs VAD only when vad_model_path names a regular file. That behaviour is unchanged.

Etherll and others added 2 commits October 25, 2026 20:29
ASR models that plan chunks with audio_chunk_mode=vad hard-coded the Silero
loader, so <family>.vad_model_path could only name Silero weights. Add
runtime::load_vad_model() and use it in moonshine_asr, qwen3_asr,
vibevoice_asr, granite5asr, parakeet_tdt, lfm2_audio and sense_asr.

- Only loaders that advertise offline VAD are considered, so a wrong path
  never loads a large non-VAD model first.
- For a weight file, the loader that uses exactly that file wins over a
  package loader that resolves the file to its folder.
- A path no VAD loader claims is still loaded as Silero (e.g. Silero weights
  under another name), after checking it holds Silero tensors; otherwise the
  error lists the VAD families built into the binary.
- Loaders are called directly, leaving the host's load trace and progress
  bracket alone.

Defaults are unchanged. Adds vad_loader_test.
@0xShug0

0xShug0 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Fixed two things:

  1. Standalone VAD loading: PulseVAD and FireRed worked directly but failed inside ASR because the helper couldn’t find their embedded specs. It now uses the VAD’s path when looking up its contract.
  2. Code boundary: The shared registry checked for Silero’s stft_conv.weight tensor. That check now lives in Silero’s asset loader.

@0xShug0
0xShug0 merged commit 483da3d into 0xShug0:main Oct 26, 2026
7 checks passed
@0xShug0

0xShug0 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

@Etherll PR merged! Thanks!

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