feat(kokoro): add multilingual GGUF synthesis and optimized CPU inference - #496
Conversation
|
@mirek190 Bro you’re moving too fast 😄 I haven’t even rebased or cleaned up the code yet. That implementation is from pre-release 0.1 and is pretty messy... |
|
Give me some time...Wrapping up vibevoice asr streaming 7B now, and also a bunch of ggml kernel changes and framework refactor will be tested and merged next |
It WAS messy ;) |
No problem |
|
I even tried to impl g2p in kokoro, while the better way (for now) is just like inflect and sanoTTS that load espeak during runtime... |
Currently is working this way Kokoro text So we should implement eSpeak-ng to audiocpp and use it to other models if they need it ( like sanoTTS, inflect_v2TTS or korokoTTS ) |
|
I have already good eSpeak-ng implementation |
Great, thanks! |
Kokoro CPU, CUDA, and Vulkan performanceI ran the same seven-request resident-session benchmark across all three backends and both standalone GGUF precisions. Test system: Ryzen 9 7950X3D, RTX 3090 24 GB, Windows Release builds,
The first Vulkan Q8 process on an empty driver cache took 4.090 s for the first short request while compiling pipelines; the next fresh process took 0.202 s. I report that one-time driver setup separately rather than mixing it into resident inference. All ten retained CUDA/Vulkan WAVs were valid and non-silent, with mean volume between -26.8 and -26.9 dB. These results describe this machine and driver stack and should not be treated as general backend rankings. |
|
Ready to merge |
|
@mirek190 Merged! No issue found during rutime validaiton. RTF ~0.2 on AMD Ryzen 9 7900X. I will do some follow-ups to remove the old |
sure |
Summary
Add the Kokoro 82M integration to main with optimized CPU inference, standalone multilingual Q8/BF16 GGUF packages, and the shared eSpeak-ng phonemizer introduced in #502.
Kokoro is registered through the current selectable-model CMake system and generated runtime registry. It can be included in normal CLI/server builds or selected with
AUDIOCPP_MODEL_SET=customandAUDIOCPP_MODELS=kokoro_tts.Model and package support
These are locally prepared Kokoro packages; arbitrary third-party GGUF layouts are not supported. See preparation and usage instructions. Very long inputs and Japanese/Chinese normalization edge cases still need broader coverage.
Shared eSpeak integration
Kokoro now calls
engine::audio::EspeakPhonemizerinstead of maintaining a separate eSpeak runtime. Initialization, voice selection, returned-buffer copying, and runtime switching share the process-wide mutex used by SanoTTS and Inflect v2. Kokoro retains its caret-tied IPA mode, punctuation restoration, and phoneme-to-token mapping.With
AUDIOCPP_STATIC_ESPEAK=ON, CLI and server use statically linked eSpeak and automatically discoverespeak-ng-data.binbeside their executable. Data extraction uses the shared cache from #502. The default dynamic build remains supported.AUDIOCPP_ESPEAK_LIBRARYretains explicit library selection and the model-local data default.AUDIOCPP_ESPEAK_DATAcan select an unpacked data directory or a shared.bin/.ggufdata package. Japanese retains its separate MeCab dependency andAUDIOCPP_MECAB_LIBRARYoverride.Static eSpeak is opt-in and retains the distribution requirements documented in the shared component.
CPU performance
Previously measured on Windows, Ryzen 9 7950X3D, 8 CPU threads, MSVC Release
/arch:AVX512, F32 Kokoro,af_heart, seed 1234. Optimized results are the mean of two quiet runs. Timings exclude initial model load/session preparation and WAV writing. These measurements predate this shared-eSpeak migration and were not rerun as new performance claims.All seven F32 benchmark WAVs matched the original baseline byte-for-byte. This is not a claim that quantized Q8/BF16 output matches F32 bit-for-bit.
Validation after integration with main
kokoro_tts; CLI and server link successfully through the new model selection system.The earlier multilingual GGUF validation produced non-silent 24 kHz audio for all 18 language/precision combinations. Current local validation is Windows CPU; this change does not claim new CUDA/Vulkan or Linux/macOS runtime coverage.