Pushing CPU Speech Synthesis to the Wall: Extreme Inference Tuning under Serverless Architecture and Billing
Organizations: Paxa Labs
Abstract
Instance-billed serverless platforms charge for CPU and memory over the lifetime of a warm instance, making idle inference state a direct serving cost. We present billing-aware neural text-to-speech (TTS) serving on serverless CPUs, optimizing CPU-seconds and GB-seconds rather than throughput or latency alone. Conventional runtimes are poorly suited to this setting: per-request parallelism causes CPU contention under concurrency, while warm instances retain gigabytes of billable inference and page-cache state. We address these costs with request-sized concurrent inference, which bounds per-request CPU parallelism, and a reclaimable instance lifecycle, which releases inference state and page-cache memory after idle periods while retaining the server process and compile cache. On Kokoro-82M, our system achieves 2.71 audio-seconds per CPU-second versus 0.89 with ONNX Runtime defaults and reduces cost per audio-hour from 0.0153, a 4.1x reduction. Idle billed memory falls from 8.7 GB to 1.33 GB, while restoration reaches first audio in 2.2 s versus 7.7 s for a PyTorch cold start. Under bursty traffic, lifecycle reclamation is essential for translating inference efficiency into lower serverless cost.
Figures & tables
| audio-s/CPU-s | first audio p50/p90 | warm-idle MB | cold start s | restore s | ,\downarrow$ | |
|---|---|---|---|---|---|---|
| PyTorch eager | 0.66 | 2.46/8.0 | 8659 | 7.7 | – | 0.0631 |
| ONNX Runtime default | 0.89 | 0.94/4.9 | 3969 | 5.8 | – | 0.0468 |
| ONNX Runtime sized | 1.36 | 2.36/8.4 | 3958 | 5.7 | – | 0.0306 |
| OpenVINO default | 1.35 | 1.26/ 2.6 | 5250 | 6.9 | – | 0.0309 |
| OpenVINO sized | 2.71 | 0.69 /4.2 | 12097 | 7.4 | – | 0.0154 |
| This work | 2.71 | 0.94/4.2 | 1331 | 6.2 | 2.2 | 0.0153 |
| Configuration | eff. | first p50 s | idle MB | cold s | restore s | \downarrow$ |
|---|---|---|---|---|---|---|
| OpenVINO defaults | 1.35 | 1.26 | 5250 | 6.9 | – | 0.0309 |
| + sized threads, 4 streams | 2.31 | 0.56 | 8684 | 6.7 | – | 0.0180 |
| + compile cache | 2.33 | 0.64 | 7490 | 5.4 | – | 0.0179 |
| + 8 streams | 2.71 | 0.69 | 12097 | 7.1 | – | 0.0154 |
| + idle release (this work) | 2.71 | 0.94 | 1331 | 6.2 | 2.2 | 0.0153 |
Cost-Aware Inference
Cost-aware inference allocates models, computation, and serving resources to meet quality goals at lower latency, energy use, and monetary cost.
See all 280 papers