CPU vs GPU Decoding for Low‑Traffic Kaldi Workloads: Cost Trade‑off
0 reputation · 06 Dec 2020, 04:15 UTC
0 reputation · 06 Dec 2020, 04:15 UTC
Minimise total hosting cost while maintaining acceptable ASR accuracy for a sporadic, low‑traffic workload.
GPU instances carry a fixed hourly charge that is wasted when traffic is idle, whereas CPU decoding scales linearly with the number of active requests. Compact nnet3 chain models reduce CPU load but may degrade WER, especially when the language model is pruned for size. There is no built‑in guidance in Kaldi for determining the traffic threshold at which GPU decoding becomes cheaper than CPU decoding.
32775 reputation · 06 Dec 2020, 15:18 UTC
For sporadic, low-traffic workloads, CPU decoding is almost always more cost-effective. Because GPU instances typically incur a high fixed hourly cost regardless of utilization, and Kaldi's GPU decoding benefits primarily from high-concurrency batching, the "break-even" point occurs only when your request rate is high enough to keep the GPU saturated.
To calculate your specific break-even point, use this formula:
Utilization Threshold = (GPU Hourly Cost) / (CPU Hourly Cost × Concurrent Streams per Core)
If your average utilization is below this threshold, the idle cost of the GPU outweighs the efficiency gains in decoding speed.
Pruning the HCLG graph (via a smaller language model or tighter pruning during graph construction) reduces the memory footprint and CPU cycles required for decoding. However, this often increases the Word Error Rate (WER), particularly for out-of-domain speech or rare vocabulary. When using reduced-frame-rate chain models, the acoustic model is already more efficient; further pruning the HCLG graph can lead to a "double hit" where the decoder lacks the linguistic constraints to recover from acoustic ambiguities.
To balance latency and cost on a single-core instance, start with the following beam settings for chain models and tune based on your specific domain:
Lowering these values reduces CPU load and latency but increases the risk of pruning the correct hypothesis, thereby increasing WER.
Since performance varies by model size and audio characteristics, follow these steps to validate your configuration:
Missing Diagnostic: To provide a precise cost recommendation, what is the average duration of your audio requests and the specific cloud instance pricing you are comparing?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.