Skip to content

Fix PocketTTS streaming quality and speed up PocketTTS decoders - #1291

Merged
0xShug0 merged 2 commits into
mainfrom
fix/pocket-tts-streaming-quality
Nov 14, 2026
Merged

0xShug0 merged 2 commits into
mainfrom
fix/pocket-tts-streaming-quality

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Fix PocketTTS streaming audio quality and reduce decoder overhead

Closes #1289.

PocketTTS streaming could reuse Mimi cache storage before the cache update finished, corrupting decoder history. It also retained Mimi state across independent text chunks. The decoder now updates its cache inside the graph and resets at each text-chunk boundary.

CUDA ELU activations now run inside the existing convolution graphs instead of host loops. Graphs remain session-owned and cached. No framework, GGML kernel, weight precision, sampling option or public API changes are included.

CUDA performance

RTX 5090, published English BF16 package, eight threads. Warmed main → PR → PR → main, with three measured requests per workload per block. TTFA is measured at the client’s first audio event.

Workload Main RTF PR RTF Generation-time reduction Main TTFA PR TTFA
Single chunk, 4.64 s audio 0.04134 0.02708 34.5% 10.67 ms 9.20 ms
Multiple chunks, 15.76 s audio 0.04144 0.02709 34.6% 12.73 ms 11.23 ms

Maximum sampled process peak VRAM was 1,334 MiB for both main and PR, sampled every 20 ms.

Correctness and other backends

  • Single-chunk streaming/offline waveform cosine improved from 0.520247 to 0.999764. The optimized CUDA decoder has 0.9999999 cosine against the initial correctness fix.
  • Normal CUDA offline output is byte-identical to main.
  • A streaming request → different chunked request → original request sequence produced byte-identical PCM for the repeated request.
  • PocketTTS Small already preserves cache lifetimes and resets between text chunks. This PR also moves its CUDA ELU activations into the existing convolution graphs, retaining host ELU on CPU/Vulkan.

Short warmed CPU/Vulkan checks showed no large performance regression:

Backend Main RTF PR RTF
CPU 0.21108 0.21162
Vulkan 0.06262 0.05760

CPU output was byte-identical to main. Corrected Vulkan streaming output matched its offline reference at 0.999991 cosine. These are short checks, not extensive performance validation.

PocketTTS Small

Published F32 packages, RTX 5090, eight threads, warmed main → PR → PR → main with three measured requests per workload per block.

Variant Main single-chunk RTF PR single-chunk RTF Time reduction Main multi-chunk RTF PR multi-chunk RTF Time reduction
2M 0.01935 0.01468 24.1% 0.01841 0.01386 24.7%
7M 0.02655 0.01986 25.2% 0.02576 0.01922 25.4%
18M 0.02813 0.02216 21.2% 0.02801 0.02184 22.0%
2M ReFL 0.01938 0.01466 24.3% 0.01855 0.01434 22.7%
7M ReFL 0.02688 0.02022 24.8% 0.02572 0.01974 23.3%
18M ReFL 0.02751 0.02081 24.4% 0.02704 0.02078 23.2%

Process peak VRAM was unchanged: 1,294 MiB for 2M, 1,336 MiB for 7M and 1,432 MiB for 18M, including ReFL variants. TTFA was unchanged or improved.

All 24 offline/streaming waveform comparisons passed with minimum cosine 0.99999997. Another 36 comparisons with matching request histories passed at the same level. Short→long→short reuse already changes repeated outputs on main; the PR matches main under the same history rather than introducing a new difference.

Short warmed 18M CPU/Vulkan checks produced byte-identical outputs. CPU RTF was 0.06801 → 0.06898; Vulkan RTF was 0.05353 → 0.05091. These are targeted checks, not broad backend performance claims.

@0xShug0
0xShug0 merged commit b5286a8 into main Nov 14, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/pocket-tts-streaming-quality branch November 14, 2026 22:13
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.

Pocket TTS streaming bad sound quality

1 participant