Brief AI
›

LLM: Continuous Processing Limits Vacant GPU Slots

Research·Tom Levy·

LLM: Continuous Processing Limits Vacant GPU Slots

LLM: Continuous Processing Limits Vacant GPU Slots
Key Takeaways
1Continuous processing replaces completed requests at each iteration.
2Pagination allocates the KV cache in fixed blocks as needed.
3TTFT includes queuing and pre-filling.
Why it matters : these mechanisms aim to reduce wait times while increasing the throughput of LLM services.

Continuous request processing replaces completed requests with those waiting on a GPU at each iteration of the model. This service management is accompanied by memory and decoding techniques aimed at reducing wait times and increasing throughput.

Renewing Requests and Sharing Prefixes

In a static batch, the longest request delays the renewal of the group. If three requests require a few dozen tokens while another demands hundreds, the slots freed by the shorter requests remain unused. Scheduling at each iteration avoids this collective waiting.

Long prompts can also penalize users whose responses are already in progress. Fragmented processing imposes a fixed token budget for each iteration: priority is given to the ongoing decoding, followed by the use of the remaining budget for a portion of the incoming prompt. This prevents a single prompt from monopolizing the iteration and extends the interval between tokens served to other users.

Sharing can also pertain to the beginning of requests. When requests start with identical tokens, their cached blocks are reusable: a long system instruction or a common document then requires only initial processing.

GPU Memory and Computation Limits

Training prioritizes the volume of tokens that a set of machines absorbs over several days; the service must manage the wait of users sharing the same resources. A transformer builds its response token by token. However, pre-filling processes the entire prompt in parallel and provides the initial token; decoding continues the generation, with each step depending on the previous tokens.

The roofline graph distinguishes hardware limits based on the number of operations performed per byte read. On the left, its slope represents the bandwidth ceiling: cores wait for data; on the right, its plateau corresponds to the maximum computation, with arithmetic units occupied. Their junction constitutes the peak point. Decoding falls into the first case: each weight is read for a multiply-add operation, and the maximum of a single stream corresponds to the bandwidth divided by the model size expressed in bytes.

Pre-filling is on the computation side, with a read serving thousands of tokens. Grouping decodings also increases the work done per byte: the weights read serve multiple users, up to the computation ceiling. Quantization acts differently, reducing the bits per weight. It associates floating-point values with a range of integers using a scaling factor, reapplied to usage; a weight on 4 bits occupies about a quarter of the volume needed on 16 bits.

The evening letterFree · 7 pm

The AI brief the pros read every evening

The 7 best AI stories, the essentials in 5 min. Free.

Included when you join: our pick of the best AI guides & comparisons.

Choose your rhythm

Free · No spam · Unsubscribe in 1 click

Speculative decoding exploits another property: checking multiple tokens mobilizes approximately the same weight reading as producing one. A smaller model proposes a short sequence. The larger model then examines this proposal in a single pass.

The KV Cache Occupies Part of Memory

Attention requires, during decoding, the keys and values associated with all previous tokens. Storing them in a KV cache avoids recalculating the same values. This storage includes, for each token, a key vector and a value vector in each layer and each key-value head.

Its volume depends on the layers, key-value heads, their dimensions, numerical precision, and the total number of tokens in active sequences. Weights and workspace of the execution engine also occupy GPU memory: the remaining space limits the total number of tokens that can be hosted. Grouped request attention, called GQA, reduces this need by sharing a key-value head among several request heads. With four request heads for one key-value head, the cache occupies only a quarter of the size.

Reserving capacity upfront corresponding to the maximum sequence wastes space, as the length of responses is unpredictable. Cache pagination replaces this reservation with fixed-size blocks. Their allocation occurs as generation progresses.

Measuring Throughput and Response Times

A service can display high throughput while allowing several seconds to pass before the first word. Throughput totals the tokens or completed requests each second, across all users. TTFT measures the delay preceding the initial token, including queue and pre-filling. TPOT then describes the average spacing of tokens.

For an output containing N tokens, the total wait is expressed as TTFT + TPOT × (N − 1). Goodput, or throughput meeting latency targets, only considers requests that comply with set thresholds, particularly for TTFT and TPOT. Over a period T, it corresponds to N_good / T, where N_good denotes the compliant requests.

The P95 and P99 percentiles make visible the slowdowns masked by an average for both TTFT and TPOT. The definitions of these indicators vary slightly depending on the measurement tools. Therefore, their comparison assumes verifying the conventions of the inference engine used.

Brief AI — AI news in French

The essentials of artificial intelligence news, decoded and explained every day.