Repository navigation
Add PocketTTS Small with streaming and acoustic batching - #1194
Merged
Merged
Conversation
0xShug0
force-pushed
the
feature/pocket-tts-small
branch
from
November 4, 2026 04:35
a48406d to
cf423d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds English PocketTTS Small 18M, 7M, and 2M checkpoints, including ReFL variants, as an independent
pocket_tts_smallfamily. Supports offline/streaming TTS, reference-audio cloning, predefined/exported voice states, and offline acoustic batching through the existing C++ batch-session API. CLI multi-text requests remain sequential; acoustic batching is not yet exposed in the main CLI or WebUI.Ordinary GGML requests use the same acoustic runtime with batch size 1. Text conditioning and waveform decoding remain per request. Frequently used graphs are session-owned and reused. Offline waveform decoding defaults to bounded four-frame causal blocks on every backend; streaming emits one latent frame (80 ms of audio) per event. Both acoustic and Mimi state reset at each independent text-chunk boundary.
Attention defaults to
auto, KV storage tof32;attentionandkv_cache_typeare independent explicit controls. Native CPU flow resolves automatic attention to eager and requires F32 KV; it is available withENGINE_ENABLE_NEON=ON. Six GGUF packages are defined underaudio-cpp/audio.cpp-gguf/PocketTTS-Small-GGUF, with documentation, routing/README/license entries and model validation tools.Shared changes are additive: batched RoPE with independent row positions, and a configurable transformer GELU approximation retaining ExactErf for existing callers. Original PocketTTS code and GGML kernels are unchanged.
Performance versus official Python
RTX 5090, F32 weights, eight CPU threads, seed 42 per utterance. Eight English requests (seven distinct passages), 150–480 characters, with one full excluded warmup pass followed by one measured pass. Runs were sequential. C++ uses the current default
autoattention (resolved flash), F32 KV, and bounded offline decoder. RTF is measured generation wall time divided by generated audio duration; lower is faster.CPU 18M: Python RTF 0.11985, audio.cpp 0.04615; peak RAM 1,266 → 622 MiB.
Memory is whole-process peak including loading and warmup: per-process GPU usage and host high-water RSS, sampled every 20 ms. Bounded decoding trades some GPU throughput for lower memory than the optional full-utterance graph. These memory comparisons do not apply to arbitrary larger-block/full-decoder settings.
Python: Kyutai
pocket-ttscommit4cc5753319ceddc5cbf70598d9011f1f22858ba0; checkpoints:kyutai/pocket-ttsrevisiondb04f0e653473e5c7333c69686ac92b7460b0c1d.Streaming
Same eight-case corpus, threads, weights and seed. TTFA is timestamped at the first nonempty audio event through the same application streaming runner used by CLI/server. Initial model/voice preparation is excluded. First-request TTFA includes graph initialization; warm TTFA is the mean of the eight requests after the excluded full warmup pass. First-request figures do not guarantee a cold shader/disk cache. These are GGML results; optional native CPU flow was not part of this streaming campaign.
Streaming peak VRAM: CUDA 18M/7M/2M/18M-ReFL 837/771/741/837 MiB; Vulkan 18M/7M/2M 201/121/92 MiB. Every request emitted incremental audio, and concatenating events exactly reproduced the final WAV.
Validation and lifecycle
Whisper Small greedy English WER on the 338-word corpus:
This is a limited English corpus, not a general quality benchmark. Normal sampled outputs need not be byte-identical to Python.