Latency vs. Throughput: Dynamic Batching's Trade-off

While dynamic batching significantly improves overall throughput, it can sometimes introduce a slight increase in average request latency due to the waiting period for batch formation, a trade-off often acceptable for high-volume inference.

The top 3

  1. Quantifying Latency vs. Throughput in Dynamic Batching: Dynamic batching significantly boosts throughput, but often at a measurable latency cost. For instance, a Triton DenseNet ONNX benchmark showed throughput nearly doubling from 167.5 to 323.1 inferences/sec, while 99th-percentile latency almost tripled from 12.7 ms to 35.8 ms.
  2. Latency-First vs. Throughput-First: Optimal Dynamic Batching Scenarios: Real-time AI applications like conversational AI or autonomous driving prioritize low latency, using dynamic batching with tighter constraints. Conversely, offline tasks such as document summarization or large-scale data labeling emphasize maximizing throughput, where higher latency is more tolerable.
  3. Key Controls for Dynamic Batching's Latency-Throughput Balance: The primary levers for tuning dynamic batching are the maximum batch size and the timeout window. A shorter timeout prioritizes lower latency but may underutilize the GPU, while a longer timeout aims for higher throughput by allowing fuller batches, at the expense of increased queueing delay.

Sources

Open the full topic