Repository navigation
CPU usage not staying at 100% while generating? #1489
Replies: 1 comment 5 replies
|
Yes, that's expected. Kokoro and KittenTTS 2 Mini run the phonemizer, predictor and decoder one after another. The ggml graphs can use 20 threads, but some of the work between them is serial, such as noise generation and preparing the spectrum. The decoder graph is also rebuilt when the frame count changes. That fits the swings you see. Pocket TTS Small computes one small graph per latent frame, and each result feeds the next, so frames can't run in parallel. Threads also sync between ops. My guess, which I haven't measured, is that P-cores end up waiting for E-cores and syncing 20 threads costs more than it gains. The code doesn't explain the exact 30%. I'd compare RTF (generation time / audio length, lower is better) instead of CPU %, because waiting threads can spin and look busy. Try Set OMP_NUM_THREADS=8 taskset -c "$(cat /sys/devices/cpu_core/cpus)" \
./audiocpp_server --config server.jsonMore threads aren't always faster. In #1364, on another user's laptop with 16 logical cores, native Kokoro ran at 2.74x real time with 12 threads and 2.46x with 16 (higher is better there). |


Yes, that's expected.
threadssets how many threads each compute graph can use, but it doesn't keep them busy. I read the v0.9.7 code but haven't benchmarked a 265K. Your 20 reaches all three models, and I found no lower cap for Pocket TTS Small.Kokoro and KittenTTS 2 Mini run the phonemizer, predictor and decoder one after another. The ggml graphs can use 20 threads, but some of the work between them is serial, such as noise generation and preparing the spectrum. The decoder graph is also rebuilt when the frame count changes. That fits the swings you see.
Pocket TTS Small computes one small graph per latent frame, and each result feeds the next, so frames can't run in parallel. Threads …