Thursday, December 3, 2026 | London 10°C · Drizzle
DailyGlimpse

AI

Boosting LLM Inference: How Asynchronous Batching Eliminates GPU Idle Time

H200 GPU pricing poses a challenge: $5 an hour, but $120 a day demands constant use via continuous batching.

Hugging Face Blog 2 min read

Boosting LLM Inference: How Asynchronous Batching Eliminates GPU Idle Time

The H200 GPU costs about $5 per hour on Inference Endpoints — cheap for an hour, but $120 for a day. To justify that cost, the GPU must be kept busy constantly. Continuous batching improves utilization by eliminating padding waste, but it still suffers from a second inefficiency: it is synchronous. The CPU and GPU take turns, leading to idle gaps that can waste nearly a quarter of total runtime. Asynchronous batching fixes this by running CPU batch preparation in parallel with GPU computation, ensuring the GPU stays productive 100% of the time.

Synchronous Batching

In naive synchronous batching, the CPU prepares a new batch — selecting requests, updating the KV cache table, evicting finished requests, and admitting new ones — then transfers inputs to the GPU. The GPU runs the forward pass and samples a new token for each request. Results are sent back to the CPU, and the cycle repeats. During these steps, the CPU and GPU never work concurrently. Profiling an 8B model generating 8K tokens with a batch size of 32 shows the two always alternate. Total generation time was 300.6 seconds, with the GPU idle for 24% of that time waiting for the CPU. Eliminating CPU overhead would reduce generation to 228 seconds — a free 24% speedup — without any kernel or model changes.

Creating Concurrency

To achieve concurrent CPU and GPU execution, we use CUDA streams. A stream is an ordered queue of GPU operations. Operations within the same stream are sequential; operations in different streams can run concurrently. By separating batch preparation (CPU) and model compute (GPU) into different streams, both can work simultaneously.

React