SEP model BS-RoFormer source separation ( a voice extraction from the source ) #114
SEP model BS-RoFormer source separation ( a voice extraction from the source ) #114mirek190 wants to merge 2 commits into
Conversation
|
Pushed follow-up commit What changed
PerformanceBackend: CUDA 12.4, NVIDIA GeForce RTX 3090, 24 GB. Input: 8.0-second stereo 44.1 kHz WAV, 352,800 output frames.
The quality-oriented default is therefore about 45.5% lower latency / 1.84x faster than the pre-change CUDA route. Resident-server per-request results:
Both server-returned WAV artifacts ( Parity and quality
The last row is why lower overlap remains opt-in rather than becoming the default. Commands usedBuild: .\scripts\build_windows.ps1 -Target audiocpp_cli -Jobs 16
.\scripts\build_windows.ps1 -Target audiocpp_server -Jobs 16Default quality route: .\build\windows-cuda-release\bin\audiocpp_cli.exe `
--task sep --family bs_roformer `
--model ..\models\BS-RoFormer-ep368_Q8\BS-RoFormer-ep368_Q8.gguf `
--backend cuda `
--audio ..\outputs\bs_roformer_benchmark\input_8s.wav `
--out-dir ..\outputs\bs_roformer_benchmark\optimized_final `
--logOptional single-pass route: .\build\windows-cuda-release\bin\audiocpp_cli.exe `
--task sep --family bs_roformer `
--model ..\models\BS-RoFormer-ep368_Q8\BS-RoFormer-ep368_Q8.gguf `
--backend cuda `
--audio ..\outputs\bs_roformer_benchmark\input_8s.wav `
--out-dir ..\outputs\bs_roformer_benchmark\overlap1_final `
--session-option bs_roformer.num_overlap=1 `
--logCPU fallback: .\build\windows-cuda-release\bin\audiocpp_cli.exe `
--task sep --family bs_roformer `
--model ..\models\BS-RoFormer-ep368_Q8\BS-RoFormer-ep368_Q8.gguf `
--backend cpu --threads 16 `
--audio ..\outputs\bs_roformer_benchmark\input_8s.wav `
--out-dir ..\outputs\bs_roformer_benchmark\cpu_fallback `
--session-option bs_roformer.num_overlap=1 `
--logThe CPU fallback completed in 20,463.9 ms. Experiments not retained
|
Sure ;) But that as you know is not a real model. |
|
@mirek190 I could definitely use a hand. I’ll let you know. |
I checked that already and think it is not worth it to add it currently to audio.cpp. GPT_SoVITS has already built frameworks around that model all-in-one so is working ...more or less ;) I think first we should make stable audio.cpp first then adding new functionalities like GPT_SoVITS But is worth to add asr models which GPT_SoVITS is using as well. |
|
@mirek190 I thought you were a fun of retro models :) No worries. GPT_SoVITS model is just for completeness. If I remember correctly Fun-ASR has their official GGML impls. Two models I’m planning to add to the core framework are WordVoice and the Zipformer-based models such as Kroko-ASR. WordVoice brings novel capabilities, while Kroko-ASR could introduce a new set of reusable building blocks. Let me know if you’re interested in working on either of them. |
|
OK I check that tomorrow |
Summary
Model BS_roformer
https://github.com/lucidrains/BS-RoFormer
Adds native BS-RoFormer vocal source separation beside the existing
htdemucsandmel_band_roformerfamilies. ( in my opinion BS-RoFormer is doing the best work to separate a voice from my experience )The tested checkpoint is Viperx
model_bs_roformer_ep_368_sdr_12.9628.ckpt. It follows the Band-SplitRoFormer architecture from ByteDance AI Labs as implemented by
lucidrains/BS-RoFormer;audio-separatorwas used as the executable Pythonparity reference.
Implementation
bs_roformerofflinesepfamily immediately besideHTDemucs and Mel-Band RoFormer in the framework registry
infrastructure while adding BS-specific:
freqs_per_bandsvocalsandinstrumentalstems; instrumental is derived asmixture minus vocals
config.jsonin a standalone GGUFtests/bs_roformerHTDemucs and Mel-Band RoFormer
visible Separate action directly to the separation handler, avoiding a
stalled two-stage Gradio callback chain
English/Chinese WebUI documentation
Reproduction
Reference checkpoint conversion
Q8 GGUF conversion
Generated local artifacts:
models\BS-RoFormer-ep368\model.safetensors: 639,103,376 bytesmodels\BS-RoFormer-ep368_Q8\BS-RoFormer-ep368_Q8.gguf: 172,532,256 bytesvocals.wavandinstrumental.wavWindows CUDA build
CLI
The converted SafeTensors package was also tested:
Server
The server was started with a CUDA/offline
sepmodel entry whose path wasmodels\BS-RoFormer-ep368_Q8\BS-RoFormer-ep368_Q8.gguf, then exercised with:{ "model": "bs-roformer-q8", "request": { "audio": "E:\\path\\to\\input_8s.wav" } }against
POST /v1/tasks/run. It returned both named stems. Their SHA-256hashes were exactly equal to the CLI-generated WAVs.
WebUI
The browser test selected Source separation → bs-roformer, uploaded the
same 8-second WAV, and used the visible Separate action. The WebUI-managed
server loaded the standalone GGUF and displayed two playable/downloadable
tracks. A full-page result screenshot was retained locally as
outputs\bs_roformer_webui_test.png.Parity and performance
Test system:
20-second test
Exact-frame 8-second test
Both paths produced exactly 352,800 frames.
The Q8 result is therefore numerically and perceptually nearly identical to
the native F32 result for the tested checkpoint while reducing the weight
file to about 27% of its original size.
The lower short-input Python waveform cosine comes from the different
edge/chunk-overlap policy of the complete
audio-separatorinference path;the exact frame count and high log-mel similarity provide the more useful
parity evidence for this test.
Request timings
session.wall_ms)RSS and peak VRAM were not instrumented for this run.
Known limitations
directly and derives instrumental from the mixture.
The WebUI normalizes supported uploads before sending them to the server.
performance-tested in this contribution.
should be parity-tested before being declared compatible.
The GGUF model is here
https://huggingface.co/mirek190/audio.cpp/tree/main/vocal%20separation%20models