TL;DR
Increasing batch sizes in Large Language Model (LLM) serving eventually hits a strict "throughput plateau" where adding more requests increases latency without improving token throughput. This paper demonstrates that this bottleneck is caused by DRAM bandwidth saturation in attention kernels during the decode phase, driven by the total active context length rather than batch size alone. To solve this, the authors introduce SLIM, a lightweight performance model that accurately predicts this saturation point, allowing their Batching Configuration Advisor (BCA) to reclaim up to 55 GB of wasted GPU memory.
What Problem Does This Paper Address?
To maximize efficiency and serve LLMs cost-effectively, providers group multiple user requests together via batching. In theory, larger batches mean better hardware utilization. In practice, however, systems hit a deployment-dependent "throughput plateau": past a certain point, increasing the batch size yields diminishing throughput returns while causing request latency and memory consumption to skyrocket.
While previous literature conceptually attributed this behavior to High Bandwidth Memory (HBM)/DRAM limitations, nobody had performed a rigorous, kernel-level hardware characterization to explain why or precisely when this saturation occurs. Without accurate performance models, operators often over-provision GPU memory for Key-Value (KV) caches, leaving massive amounts of expensive hardware memory underutilized.
Methods
The authors tackle this problem through a combination of low-level hardware profiling and semi-analytical modeling:
- GPU Kernel Profiling: Using NVIDIA Nsight Systems and Nsight Compute on Hopper H100 GPUs, the authors isolated the prefill and decode phases across varying batch sizes, input lengths, and output lengths to track metrics like Tensor Core activity, Streaming Multiprocessor (SM) issue rates, and cache hit rates.
- SLIM (Saturation-Aware Lightweight Performance Model): The authors developed a semi-analytical model that predicts end-to-end latency and throughput. Instead of relying on brute-force data fitting, SLIM uses the structural physics of the Transformer architecture (e.g., how KV cache memory traffic scales quadratically with output token length) combined with a tiny set of empirical calibration points to capture hardware-specific constraints.
- BCA (Batching Configuration Advisor): Powered by SLIM, this offline framework automatically identifies the "knee point" of the throughput curve. It selects the highest-throughput batch size cap that satisfies a user-defined latency Service Level Objective (SLO) while minimizing memory footprint.
Datasets
The paper evaluates its approaches using two primary workload types:
- Synthetic Workloads: Custom-generated prompts designed to independently scale batch sizes, input lengths, and output lengths, allowing the authors to isolate specific performance variables.
- ShareGPT Dataset: A cleaned version of real-world user prompts used to test SLIM and BCA under realistic, highly heterogeneous distributions of input and output token lengths.
Key Insights and Ideas
- Active Context is the Real Culprit: Throughput saturation isn't merely a function of batch size. It is driven by the active context—the total number of tokens (prompt tokens + already generated tokens) currently managed across the entire batch.
- The Attention Bottleneck: As the active context grows, matrix multiplication kernels (GEMMs) scale efficiently and achieve higher hardware utilization. However, attention kernels exhibit a nearly constant arithmetic intensity. This means every added token demands a proportional increase in memory traffic, quickly slamming into the DRAM bandwidth ceiling while leaving the GPU's actual compute units (Tensor Cores) idling at under 30% utilization.
- Abysmal Cache Locality: During the decode phase, L1/TEX cache hit rates drop below 1%, and L2 hit rates never exceed 7%. Because the attention mechanism must scan a constantly growing KV cache at every step, it cannot exploit temporal reuse, forcing the GPU to repeatedly stream gigabytes of data directly from DRAM.
Key Results
- Superior Generalization: When tested on completely unseen models and sequence lengths, SLIM outperformed state-of-the-art baselines (like LLMVisor), reducing the Mean Absolute Percentage Error (MAPE) by an average of 79.3%.
- Massive Memory Savings: By preventing systems from operating deep within the inefficient throughput plateau, BCA identified up to 55 GB of GPU memory allocation that could be safely avoided for OPT models with negligible impact on throughput.
- Faster Profiling: Because SLIM only requires a few sparse data points to map out the hardware's performance curve, BCA reduced the required offline profiling time by 43.85% compared to an exhaustive configuration search.
Limitations and Future Work
- Tensor Parallelism Scaling: SLIM currently treats multi-GPU setups uniformly and does not explicitly model inter-GPU communication overhead. As a result, it tends to overestimate the performance gap when scaling up to massive models like Qwen-72B sharded across four GPUs.
- Evolving LLM Optimizations: The current formulation targets standard decoder-only autoregressive inference. To remain highly accurate for state-of-the-art serving frameworks, SLIM will need to be updated and recalibrated to account for advanced optimizations like quantized KV caches, speculative decoding, and prefix caching.
Summary updated