Skip to content

Improve Voice Isolator performance, streaming reuse and WebUI/WebGPU support - #1358

Merged
0xShug0 merged 4 commits into
mainfrom
perf/voice-isolator-approx-erf
Nov 21, 2026
Merged

0xShug0 merged 4 commits into
mainfrom
perf/voice-isolator-approx-erf

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Voice Isolator now uses approximate-erf GELU on CPU, reuses streaming graphs between requests, runs in browser WASM64 + WebGPU, and appears in WebUI downloads and Enhancement / denoising Studio.

  • CPU ApproxErf selection is model-local; other backends retain exact GELU.
  • Streaming requests reset cached state instead of rebuilding graphs. Inactive-stream guards remain, timing includes initial setup, and buffers remain session-owned until unload.
  • WebGPU uses existing decomposed Mamba operations and the framework's flash-attention lowering with materialized Q/K/V. CUDA/HIP, Vulkan and CPU graph selection is unchanged. The Metal-specific register16 override is removed in favor of default lowering.
  • Both offline and realtime F32 packages are available in the UI with audio-only controls. Includes the rebuilt embedded UI bundle and updated WebGPU validation report.
  • No GGML changes or new kernels.

CPU performance

ApproxErf comparison: 10.77-second speech, native BF16 weights, eight threads, Ryzen 9 7900X. Sequential warmed A→B→B→A, six measured requests per variant and mode.

Path Exact GELU RTF ApproxErf RTF Request-time reduction
Offline 1.559 1.397 10.4%
Streaming 1.224 1.124 8.1%

Float-WAV cosine was 0.99999996 offline and 0.99999987 streaming.

Browser WebGPU

RTX 5090, Chrome WASM64, Debug build, published F32 GGUFs, one model thread. Offline averages three requests after warmup; streaming is the first request, including graph/shader setup. Peak VRAM is the dedicated Chrome GPU-process peak.

Path Audio Request time RTF Peak VRAM
Offline, warmed 10.77 s 1.738 s 0.1614 905 MiB
Streaming 10.77 s 4.820 s 0.4475 835 MiB

The short Python fixtures passed existing sample-error bounds. Offline speech repeats were byte-identical after shape changes. Streaming speech cosine against Python FP32 was 0.99924; maximum sample error was 0.04590. A 46-second stream completed with bounded-cache rollover. Repeated streaming requests within one browser session were not tested; streaming timing does not measure browser playback TTFA.

Validation

  • Streaming-reuse A/B outputs were byte-identical on CUDA, Vulkan and CPU. Covered repeated requests, short/long/short reuse, a 46-second CUDA stream crossing cache rollover/rebase, sample-rate changes and unload/reload.
  • Framework-session checks passed against Python fixtures on those backends, including interrupted-stream reset, inactive-stream rejection, error recovery and session recreation.
  • Streaming graphs allocate once per session and rebuild after unload/reload. Observed peak VRAM was approximately 1,380 MiB on CUDA and 906 MiB on Vulkan; unload releases cached graph/state memory.
  • Controlled warmed CUDA timing was effectively unchanged: 556→554 ms for 10.77-second speech.
  • Fresh current-code Vulkan runs completed offline and streaming: RTF 0.0585 and 0.1183, respectively. Both produced finite, correctly sized 48 kHz output with cosine above 0.9999999 against saved CUDA output.
  • Mocked-API UI checks verified package selection, GGUF load targets and audio-only requests. Svelte checks passed; Debug native and browser builds passed.
  • Metal was not tested locally.

@0xShug0 0xShug0 changed the title Improve Voice Isolator CPU performance, streaming reuse and WebUI support Improve Voice Isolator performance, streaming reuse and WebUI/WebGPU support Nov 21, 2026
@0xShug0
0xShug0 merged commit ef8dc7a into main Nov 21, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/voice-isolator-approx-erf branch November 21, 2026 03:31
@0xShug0

0xShug0 commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

@Etherll This follow-up PR uses GELU ApproxErf in the model and adds WebGPU support. The initial port aborts on the Mac M4, and this PR fixes the abort. However, currently only streaming works, while offline inference produces NaNs. Working on the fix...

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.

1 participant