Skip to content

Add browser WebGPU support - #1162

Merged
0xShug0 merged 1 commit into
mainfrom
feature/webgpu-browser
Nov 2, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
feature/webgpu-browser

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

This runs the existing C++ CLI and model runtimes inside a browser Web Worker, loading GGUFs from user-selected files and returning playable/downloadable outputs. It builds on the merged WebGPU kernels (#1159) and native integration (#1160).

  • Add opt-in Emscripten CLI configuration for WASM32/WASM64, JSPI and worker/pthread startup. The example supports GGUFs, sidecars, resource directories, input WAVs and generated audio/text/separation outputs.
  • Use bounded browser file reads and read-only WORKERFS mounts for inputs over 2 GiB. Add the size-type conversions required for WASM32 compilation and explicitly reject external-process workflows in the browser.
  • Cross-compile static eSpeak while reusing native-generated phonemizer data. Forward the parent's C/C++ and Debug flags into the child build so WASM64, SIMD and pthread settings match. Native flag forwarding remains unchanged.
  • Consolidate WebGPU build instructions into docs/build/webgpu.md, using generic commands and placeholders. Include the explicit Kokoro WASM32 arena settings used in validation. Put the 26-model historical results in docs/reports/webgpu_browser_validation.md, and add README backend badges and build information.

No GGML kernel changes, model implementation changes or new model timing instrumentation are included.

Validation used existing Debug build caches and sequential browser runs on RTX 5090 / Chrome 150:

  • WASM32 and WASM64 builds and browser --version checks passed.
  • PocketTTS with a voice sidecar, Kokoro with eSpeak data, and Qwen3-TTS with a GGUF over 2 GiB generated finite, nonconstant WAVs in real browser WebGPU.
  • After correcting eSpeak flag forwarding, the WASM64 static-eSpeak application linked successfully. The child C/C++ and Debug flags matched the parent exactly, and Kokoro browser generation passed with that build.
  • JavaScript/shell/JSON syntax, relative documentation links and whitespace checks passed. Published documentation excludes private paths, Conda environments and unpublished artifact references.

The report distinguishes historical performance observations from the integration smokes. Its measurements span development builds; Moonshine/Cohere timings used instrumentation deliberately excluded here. TTS ASR checks are not universally exact, and full waveform parity, cross-browser compatibility and a complete performance regression sweep are not claimed. WASM address-space limits and browser GPU buffer limits apply independently.

Browser WebGPU performance

Historical sequential measurements on RTX 5090, NVIDIA driver 595.84, Chrome 150, Emscripten 6.0.13, using Debug (-O3 -g), WASM SIMD, --backend webgpu, --threads 1 and --log. Some cases used pthreads for asynchronous prefetch.

RTF below 1 means faster than real time. Request time excludes model loading and WASM initialization, but includes first-request graph/shader work. Peak VRAM is the dedicated Chrome GPU process's observed NVML peak during loading/inference, sampled nominally every 20 ms; it includes approximately 32–34 MiB of baseline and may miss short peaks. WASM is the address width, not a GPU-memory allowance.

Model Task GGUF format Input Audio seconds Request seconds RTF Peak VRAM (MiB) WASM
Irodori-TTS Small MF TTS Q8_0 205 chars 41.800 4.766 0.1140 3581.3 32
Irodori-TTS Small RF TTS Q8_0 205 chars 41.800 13.736 0.3286 3708.9 32
Kokoro-82M TTS Q8_0 245 chars 15.075 1.086 0.0720 1811.0 32
Magpie Multilingual TTS Q8_0 245 chars 13.375 50.691 3.7901 1457.2 32
Ming3-TTS-0.5B TTS Q8_0 245 chars 12.500 20.262 1.6210 1385.1 32
MOSS-TTS Nano TTS Q8_0 245 chars 14.000 15.075 1.0768 561.6 32
OmniVoice TTS Q8_0 245 chars 15.000 5.027 0.3351 1776.1 32
PocketTTS TTS Q8_0 245 chars 11.600 2.062 0.1778 735.4 32
Qwen3-TTS 1.7B CustomVoice TTS Q8_0 245 chars 18.080 21.590 1.1941 3827.7 64
Supertonic 3 TTS F32/I64 (Q8-labelled) 245 chars 16.023 0.687 0.0429 502.7 32
VibeVoice 1.5B TTS Q8_0 256 chars 13.200 21.878 1.6574 4501.0 64
VoxCPM-0.5B TTS Q8_0 245 chars 15.360 15.783 1.0276 2432.9 32
Cohere Transcribe ASR Q4_0 40 s audio 40.000 1.548 0.0387 2138.8 32
Fun-ASR Nano ASR Q8_0 40 s audio 40.000 2.609 0.0652 1795.4 32
GigaAM Multilingual Large ASR F16 40 s audio 40.000 0.329 0.0082 1216.2 32
Moonshine Streaming Medium ASR Q8_0 40 s audio 40.000 1.628 0.0407 730.2 32
MOSS Transcribe Diarize ASR Q4_K 40 s audio 40.000 4.748 0.1187 1642.2 32
Nemotron-3.5-ASR-Streaming-0.6B ASR Q8_0 40 s audio 40.000 32.524 0.8131 1111.0 32
OWSM-CTC-v4-1B ASR Q8_0 40 s audio 40.000 1.115 0.0279 2891.5 32
Parakeet-TDT-0.6B-v3 ASR Q8_0 40 s audio 40.000 1.742 0.0436 2079.5 32
Qwen3-ASR-0.6B ASR Q8_0 40 s audio 40.000 2.334 0.0584 2359.9 32
SenseVoice-Small ASR Q8_0 40 s audio 40.000 0.425 0.0106 369.3 32
Qwen3 forced aligner ALIGN Q8_0 40 s audio 40.000 0.365 0.0091 1978.7 32
BS-RoFormer SEP Q8_0 40 s audio 40.000 37.927 0.9482 2133.7 32
HTDemucs SEP Q8_0 40 s audio 40.000 1.689 0.0422 502.0 32
YuE2 GEN Q4_0 + F16 VAE Instrumental; 1,500-token cap 59.999 37.021 0.6170 3014.4 64

These are single-request observations spanning development builds, not a fresh benchmark of this final commit, a warmed-throughput result, or a before/after speedup comparison. Moonshine/Cohere timings used development-only instrumentation excluded from this PR. Several WASM32 cases used reduced host arenas; Irodori used codec chunks of 256 steps. YuE2 used eight NAR steps, a 1,500 semantic-token cap, cot=off and tiled VAE decoding. See the full report for configuration and output-validation limits.

This was referenced Nov 2, 2026
@0xShug0
0xShug0 merged commit 611131c into main Nov 2, 2026
7 checks passed
@0xShug0
0xShug0 deleted the feature/webgpu-browser branch November 2, 2026 01:35
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