[Paper Review] S$^{3}$: Increasing GPU Utilization during Generative Inference for Higher Throughput
S3 predicts output sequence lengths to batch and schedule generative inference, increasing GPU utilization and throughput for Transformer-based LLMs while handling mispredictions.
Generating texts with a large language model (LLM) consumes massive amounts of memory. Apart from the already-large model parameters, the key/value (KV) cache that holds information about previous tokens in a sequence can grow to be even larger than the model itself. This problem is exacerbated in one of the current LLM serving frameworks which reserves the maximum sequence length of memory for the KV cache to guarantee generating a complete sequence as they do not know the output sequence length. This restricts us to use a smaller batch size leading to lower GPU utilization and above all, lower throughput. We argue that designing a system with a priori knowledge of the output sequence can mitigate this problem. To this end, we propose S$^{3}$, which predicts the output sequence length, schedules generation queries based on the prediction to increase device resource utilization and throughput, and handle mispredictions. Our proposed method achieves 6.49$ imes$ throughput over those systems that assume the worst case for the output sequence length.
Motivation & Objective
- Motivate memory-bounded GPU utilization issues in autoregressive LLM inference due to KV cache growth.
- Propose a sequence-length prediction and scheduling framework (S3) to boost throughput under latency SLOs.
- Develop mechanisms to handle mispredictions and maintain reliability without compromising model integrity.
- Demonstrate throughput improvements over baseline systems across multiple model scales.
Proposed method
- Fine-tune a DistilBERT-based predictor to classify output sequence lengths into 10 buckets with high accuracy (e.g., 98.61% on Alpaca).
- Implement a length-aware scheduler that batches requests using a bin-packing style with a single HBM capacity constraint and selective batching inspired by ORCA.
- Use a supervisor to detect mispredictions, preempt overlong KV caches, relocate data, and retrain the predictor online.
- Integrate the predictor, scheduler, and supervisor on FasterTransformer to maximize throughput while respecting memory constraints.
- Pipeline partitioning of large models across GPUs to enable higher batch sizes and maintain throughput.
![Figure 1 : Latency versus throughput trade-off among different models (left) and the number of GPUs (right, distributing GPT-3 to 6, 8, and 10 GPUs) when generating 60 tokens, inspired by FlexGen [ 6 ] . The markers in the lines represent batch sizes, from 1 to the maximum batch size that can be loa](https://ar5iv.labs.arxiv.org/html/2306.06000/assets/x1.png)
Experimental results
Research questions
- RQ1Can predicting output sequence length increase achievable batch size without exceeding GPU HBM capacity?
- RQ2How does length-aware scheduling impact throughput and latency under online (SLO) and offline scenarios?
- RQ3What is the overhead and robustness of the supervisor in handling mispredictions and memory fragmentation?
Key findings
- S3 achieves up to 6.49× throughput improvement over systems assuming worst-case output length.
- In online scenarios with a latency SLO of 0.1875 seconds per token, S3 generates up to 6.49× more sequences than ORCA while respecting the same SLO.
- S3 can match Oracle (perfect predictor) within 9.34%–40.52% depending on model size, despite not knowing exact output lengths a priori.
- Using 6 GPUs with S3 yields nearly identical throughput to a vanilla system with 10 GPUs, improving cost-efficiency.
- The predictor achieves high accuracy (98.61% on Alpaca for bucket prediction) with negligible predictor latency (3.7 ms).
- Overhead and misprediction penalties are small (average 11% of generation time) and amortized over longer generations.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.