Skip to content

perf(kokoro): reduce CPU inference time and graph memory - #1355

Merged
0xShug0 merged 1 commit into
mainfrom
perf/kokoro-execution
Nov 21, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
perf/kokoro-execution

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

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.

Backend / package Main RTF Updated RTF Peak memory, main → updated
CPU / Q8 0.21081 0.15564 RAM: 2,114 → 1,831 MiB
CPU / BF16 0.21275 0.15436 RAM: 2,080 → 1,720 MiB
CUDA / Q8 0.02106 0.02073 VRAM: 2,536 → 2,182 MiB
CUDA / BF16 0.02126 0.02098 VRAM: 2,558 → 2,184 MiB
Vulkan / Q8 0.02647 0.02579 VRAM: 2,038 → 1,676 MiB
Vulkan / BF16 0.02622 0.02496 VRAM: 2,056 → 1,693 MiB

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

  • Allocator-only outputs and native PL-BERT outputs match main bit-for-bit across all three backends.
  • Full-path waveform cosine is at least 0.999594, with unchanged output durations.
  • All 18 checked outputs have 0% ASR WER across the two packages and three backends.
  • Repeated requests, changed-shape/seed reuse and unload/reload checks pass, restoring identical output for the original request.
  • Debug build passes.

@0xShug0
0xShug0 merged commit 11aeb8d into main Nov 21, 2026
7 checks passed
@0xShug0
0xShug0 deleted the perf/kokoro-execution branch November 21, 2026 00:08
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.

1 participant