Repository navigation
perf(kokoro): reduce CPU inference time and graph memory - #1355
Merged
Merged
Conversation
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.
Kokoro CPU inference uses the available BLAS backend for eligible F32 generator work and reuses the existing phase-based upsampling path. PL-BERT now reuses intermediate storage, and predictor pooling uses the framework depthwise-transpose module instead of a dense convolution with mostly zero weights.
All changes are model-local. Existing execution-plan selection is preserved; native mixed-precision PL-BERT retains its CPU arithmetic.
Performance
Warmed comparison against main on Ryzen 9 7900X (8 threads) and RTX 5090, using native Q8/BF16 packages. Cases cover short speech, a paragraph and actual multi-chunk generation. Q8 uses A→B→B→A with 12 measured requests per revision/backend; BF16 uses 6. Loading and shape warmup are excluded from timing. Memory figures are process peaks.
CPU RTF decreases by 26–27%. Short-request CPU streaming TTFA decreases from 981 to 802 ms. GPU timing differences are small; the principal GPU benefit is reduced VRAM. CUDA Q8 host RAM increases by approximately 37 MiB.
At 495 tokens, PL-BERT's intermediate allocation decreases from 1,485 to 19.4 MiB on CPU, CUDA and Vulkan.
Validation