Skip to content

New Community Model: Voice Isolator v1 (Inworld) - #1343

Merged
0xShug0 merged 4 commits into
0xShug0:mainfrom
Etherll:Etherll/voice-isolator
Nov 21, 2026
Merged

0xShug0 merged 4 commits into
0xShug0:mainfrom
Etherll:Etherll/voice-isolator

Conversation

@Etherll

@Etherll Etherll commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds voice_isolator, a community port of Inworld's Voice Isolator v1 (Apache-2.0 weights). It is a 48 kHz speech isolation model for the s2s task: it keeps the foreground voice and removes background sound. The release has two checkpoints that share one network. The offline checkpoint is two-sided and renders a recording in overlapping 12 s windows. The realtime checkpoint is causal and streams with a look-ahead of 0, 2 or 4 frames (62.7 ms algorithmic latency at the default 2).

Reworked after review:

  • The model is now a community family under src/community_models/voice_isolator/ with model spec v1 and a spec-backed loader. Nothing touches builtin_audio_utils any more.
  • The test fixtures are gone from the branch. tests/voice_isolator/make_fixtures.py writes them from the Python package.
  • The branch has no ggml changes and builds on main by itself. GELU stays ExactErf; I will add the ApproxErf opt-in here once ggml-cpu: speed up Mamba-1 and quantized-V flash attention; add an opt-in GELU erf approximation #1342 is merged.

Implementation

  • Domain code (config.cpp, spectral.cpp, attention_window.cpp): config parsing, band layout, STFT framing, render windows and the ring attention window. None of it depends on ggml; it sits behind a Backbone interface.
  • Network (network.cpp): the ggml graphs. The streaming graphs for each block size and the rebase graph share one core::PreparedGraph workspace, and stream state lives in its persistent storage.
  • Streaming attention cache: a head-major ring, so a push never moves cached keys. Every 4096 frames (41 s) the cached keys are rotated back to keep their rotary positions small. Storage can be F32, F16, Q8_0, Q5_0 or Q4_0; the default is Q8_0 on CPU and F16 elsewhere.
  • Session and loader (session.cpp): RuntimeSessionBase with offline and streaming s2s. Input at any sample rate and channel count is mixed to mono and resampled to 48 kHz, in streaming too. With the model directory as --model, streaming loads the realtime checkpoint and offline loads the offline one; a checkpoint file or a GGUF as --model selects that checkpoint.
  • Weights: BF16 by default on CPUs with AVX512-BF16, F32 elsewhere.

Framework additions

Both are new code; no existing function changes.

  • Mamba1Module (mamba_modules.h): one mamba_ssm layer, with optional convolution and scan state carried between calls for streaming. CPU, Vulkan and Metal use ggml's fused Mamba-1 ops; CUDA and HIP use the existing scan and convolution ops.
  • core::cpu_backend_has_feature: reports whether the CPU kernels behind a backend were built with a named feature such as AVX512_BF16. It asks the CPU backend through the registry, so it works with GGML_BACKEND_DL.

Build

cmake -S . -B build/vi -DCMAKE_BUILD_TYPE=Release -DAUDIOCPP_MODEL_SET=custom -DAUDIOCPP_MODELS=voice_isolator \
  -DENGINE_BUILD_TESTS=ON -DENGINE_BUILD_MODEL_TESTS=ON -DENGINE_BUILD_WARMBENCH=ON   # add -DENGINE_ENABLE_CUDA=ON or -DENGINE_ENABLE_VULKAN=ON
cmake --build build/vi -j --target audiocpp_cli voice_isolator_domain_test test_voice_isolator_reference voice_isolator_warm_bench

Run

python tools/model_manager_v2.py install voice_isolator_realtime_f32 --models-root models
python tools/model_manager_v2.py install voice_isolator_offline_f32 --models-root models

build/vi/bin/audiocpp_cli --task s2s --family voice_isolator --model models/voice-isolator-GGUF/voice-isolator-offline-f32.gguf \
  --backend cpu --threads 16 --audio noisy.wav --out isolated.wav
build/vi/bin/audiocpp_cli --task s2s --family voice_isolator --model models/voice-isolator-GGUF/voice-isolator-realtime-f32.gguf --mode streaming \
  --backend cpu --threads 16 --audio noisy.wav --out isolated.wav

Download packages

  • voice_isolator_realtime_f32 (default) and voice_isolator_offline_f32: self-contained F32 GGUFs (233 MB and 256 MB) from Etherll/voice-isolator-GGUF, pinned to a revision. tests/voice_isolator/convert_gguf.py makes them. Both install into models/voice-isolator-GGUF; a GGUF holds one checkpoint, so the file is passed as --model.
  • voice_isolator_safetensors: both checkpoints from inworld/voice-isolator at the pinned revision.

I installed all three into an empty models root with model_manager_v2.py install and ran the CLI from the result. The CLI output from each installed GGUF is identical, byte for byte, to the output from its safetensors file. tools/check_loader_catalog_sync.py passes. If you would rather host the files on audio-cpp/audio.cpp-gguf, I will switch the spec.

Parity

test_voice_isolator_reference compares the offline and streaming outputs with inworld.voice_isolation 1.0.0 on a fixed synthetic signal: uneven push sizes, the three look-aheads, a 20 s stream past the attention window, stream reset and offline windows. Largest sample difference from the reference:

Backend Offline Stream
CPU, F32 weights and cache 1.5e-7 2.1e-7
CPU, defaults (BF16 weights, Q8_0 cache) 1.4e-4 1.5e-4
CUDA (RTX 5090) 1.0e-4 1.5e-4
Vulkan (RTX 5090) 3.5e-4 1.8e-4

The test's limits are 2e-3 on the largest difference and 2e-4 on the mean. It passes on all three backends.

Performance

AMD Ryzen 9 9950X3D (AVX512-BF16), 16 threads, and RTX 5090, idle machine. Real-time factor (RTF, lower is faster) from voice_isolator_warm_bench, best of 3, default cache and 4-frame blocks.

CPU, on main's kernels:

Case F32 weights BF16 weights Push p50 / p95 (BF16)
Offline, 8 s clip 0.63 0.60
Offline, 30 s clip 0.83 0.77
Stream, 100 ms pushes 0.82 0.76 78 / 87 ms
Stream, 40 ms pushes 0.81 0.76 31 / 35 ms
Stream, 10 ms pushes 1.21 1.02 10.7 / 11.9 ms
Stream, 100 ms pushes, 10-frame blocks 0.69 0.64 66 / 73 ms

A 10 ms push runs one frame per graph and does not keep up with real time on CPU, so the session asks the CLI for chunks of block_frames frames (40 ms by default). With #1342 the same build runs at 0.42 offline (30 s, BF16), 0.51 with 40 ms pushes and 0.77 with 10 ms pushes.

GPU (F32 weights, F16 cache):

Case CUDA Vulkan CUDA push p50 / p95
Offline, 8 s clip 0.017 0.038
Offline, 30 s clip 0.021 0.047
Stream, 100 ms pushes 0.050 0.23 4.9 / 5.8 ms
Stream, 40 ms pushes 0.046 0.22 1.7 / 3.0 ms
Stream, 10 ms pushes 0.14 0.43 1.4 / 1.4 ms
Stream, 100 ms pushes, 10-frame blocks 0.025 0.080 2.4 / 2.7 ms

Through the CLI path runner (tools/audiocpp_cli/run_audiocpp_cli_path_tests.py --cases tests/voice_isolator/cli_cases.json), one session per case:

Case CPU CUDA
Offline, 14 s clip, three requests 14.1 / 13.7 / 13.7 s 0.63 / 0.35 / 0.36 s
Offline, 418 s recording 326 s (RTF 0.78) 7.9 s (RTF 0.019)
Streaming, 14 s clip 10.3 s (RTF 0.73)
Peak RSS, offline 14 s / 418 s / streaming 857 MB / 1.1 GB / 430 MB 854 MB / 1.1 GB / 704 MB
Peak VRAM, offline 14 s / 418 s / streaming 1496 / 1496 / 1382 MB

VRAM is the same after three short requests and after the 418 s recording. The 14 s clip is the offline worst case on CPU: it is a little longer than one 12 s window, so it costs two.

Testing

  • voice_isolator_domain_test runs under ctest without a checkpoint: config parsing, band layout, STFT round trips, the attention window and the offline window plan.
  • test_voice_isolator_reference passes on CPU, CUDA and Vulkan (table above).
  • CLI, offline and streaming, on CPU, CUDA and Vulkan, from the model directory and from a GGUF, with mono and stereo input at 24 kHz. On CPU I also ran it from a single checkpoint file, and checked that bad option values, an untrained look-ahead and the offline checkpoint in streaming mode are refused with an error that names the problem.
  • Full CPU ctest on this branch at fe6d1535: two tests do not pass, and both fail the same way on main. lfm3_audio_blocks_test does not compile, and granite_speech5_b1_units_test fails in its own string handling. The branch is now rebased on 11aeb8d4; I rebuilt and re-ran the domain test and the CPU parity test there.

Known limitations

  • Not tested on Metal or ARM; I have no hardware for them. Vulkan was tested on an NVIDIA GPU only.
  • CUDA and HIP have no kernels for the fused Mamba-1 ops and use the older scan and convolution ops.
  • CPU streaming needs chunks of 40 ms or more to stay under real time until ggml-cpu: speed up Mamba-1 and quantized-V flash attention; add an opt-in GELU erf approximation #1342 is merged.
  • The realtime checkpoint attends to the last 12 s of audio; older context is not used.
  • Output is mono 48 kHz.
  • No WebUI catalog entry yet.

@0xShug0

0xShug0 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

@Etherll Thanks for the PR! Please move the model to the community models section. builtin_audio_utils is a workaround for a legacy design. The initial release included some built-in denoising functions intended to serve as internal helpers for applications using audio.cpp as a library. However, this turned out to be a poor abstraction, as users wanted to access these functions directly rather than only through the library's internal APIs. (#460)

Also, please remove the test fixtures. You can add/keep the script for producing the fixtures. After the next release, I'll do some test cleanup to remove unnecessary or unreachable tests and fixtures from the repo to keep its size under control.

Mamba1Module builds one mamba_ssm layer: in_proj, the causal depthwise
convolution with SiLU, the selective scan with its D skip and gate, and
out_proj. It can carry the convolution and scan state between calls for
streaming. CPU, Vulkan and Metal use ggml's fused Mamba-1 ops; CUDA and HIP
use the existing scan and convolution ops.

core::cpu_backend_has_feature reports whether the CPU kernels behind a
backend were built with a named feature such as AVX512_BF16.

Both are new; no existing function changes.
@Etherll
Etherll force-pushed the Etherll/voice-isolator branch from f1814d5 to ffaffb8 Compare November 21, 2026 00:38
@Etherll Etherll changed the title Add Inworld Voice Isolator v1 as a 48 kHz built-in denoise utility New Community Model: Voice Isolator v1 (Inworld) Nov 21, 2026
@Etherll

Etherll commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, and for the background on builtin_audio_utils. Both points are done:

  • The model is now a community family, voice_isolator, with model spec v1 and a spec-backed loader. The branch no longer touches builtin_audio_utils.
  • The fixtures are removed. tests/voice_isolator/make_fixtures.py writes them from the Python package, and the parity test takes the fixture directory as an argument.

The branch builds on main without #1342 and uses exact GELU. I also ran it on Vulkan this time, and the description has the parity and timing numbers for CPU, CUDA and Vulkan.

One thing I need your call on: check_loader_catalog_sync.py wants the default package to be a GGUF, and no prebuilt GGUF is hosted yet, so that check fails for now. The converter is in the PR and I have both files built (233 MB realtime, 256 MB offline). Should I upload them to a repository of my own, or would you rather host them on audio-cpp/audio.cpp-gguf? I'll update the spec either way.

@Etherll

Etherll commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Uploading the GGUF rn

A 48 kHz voice isolation model with an offline checkpoint and a causal
realtime checkpoint that share one network. The voice_isolator family runs
the s2s task offline and streaming through a spec-backed loader. It reads
the released safetensors files, or a GGUF made by
tests/voice_isolator/convert_gguf.py.
The domain test runs under ctest without a checkpoint. The reference test
compares offline and streaming output with fixtures that make_fixtures.py
writes from the Python package; the fixtures stay outside the repository.
Model page, the audio tools and README rows, and the license entry.
@Etherll
Etherll force-pushed the Etherll/voice-isolator branch from ffaffb8 to 79b83a0 Compare November 21, 2026 00:51
@Etherll

Etherll commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Quick update: I went ahead and uploaded the two GGUFs to Etherll/voice-isolator-GGUF so CI isn't blocked on the question above. The spec now has voice_isolator_realtime_f32 as the default package and voice_isolator_offline_f32 next to it, both pinned to a revision, and check_loader_catalog_sync.py passes.

If you'd rather have them on audio-cpp/audio.cpp-gguf, just say so and I'll switch the spec over.

@0xShug0

0xShug0 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

@Etherll Thanks for the quick updates! Hosting the models on your HF repo is fine. I actually prefer to see more repos hosting audio.cpp-compatible models. I've decided to include this model in the next release, so if there are any other issues, I'll just make changes directly to the PRs.

@0xShug0
0xShug0 merged commit b468762 into 0xShug0:main Nov 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new model Request for new model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants