TL;DR
BucketServe is a novel bucket-based dynamic batching framework designed to optimize Large Language Model (LLM) inference serving. By grouping incoming requests into size-homogeneous "buckets" based on sequence length, it minimizes memory-wasting padding and dynamically adjusts batch sizes in real time to maximize throughput while strictly avoiding out-of-memory (OOM) errors.
What Problem Does This Paper Address?
Deploying LLMs at scale is incredibly resource-intensive and latency-sensitive. A major bottleneck in current serving systems is the massive variance in request lengths—some users ask for a quick definition (short sequence), while others upload entire research papers for summarization (long sequence).
When traditional systems batch these diverse requests together, they must "pad" shorter requests with empty tokens to match the longest request in the batch. This results in severe GPU memory fragmentation and wasted compute. Furthermore, modern disaggregated serving architectures separate the compute-heavy prefill phase (processing the prompt) from the memory-bandwidth-bound decoding phase (generating tokens sequentially). Managing scheduling and batching across these two distinct phases without causing head-of-line blocking or service level objective (SLO) violations remains a significant challenge.
Methods
BucketServe introduces a three-tier architecture featuring an intelligent middleware layer that sits between the user gateway and the GPU hardware:
- Request Bucketing Manager: Instead of processing requests first-come, first-served into a single batch, BucketServe groups them into size-homogeneous buckets based on sequence length.
- Adaptive Bucket Splitting and Merging: Under high workloads, if a bucket contains a highly skewed distribution of sequence lengths, the system uses an efficient interval bisection algorithm to split the bucket, further reducing padding. Conversely, under low-load scenarios, it merges buckets back together to minimize scheduling overhead.
- Dynamic Batching Controller: This component calculates the maximum safe batch size in real time based on strict GPU memory constraints, ensuring the Key-Value (KV) cache never triggers an OOM error.
- Phase-Aware Scheduling: It pairs bucket-based scheduling for the prefill phase with continuous batching for the decoding phase, utilizing high-bandwidth NVLink to transfer the KV cache between specialized prefill and decoding GPU instances.
Datasets
The authors evaluated BucketServe using two contrasting benchmarking datasets to simulate highly heterogeneous real-world workloads:
- Stanford Alpaca: Represents short-sequence workloads, featuring an average input length of 83.7 tokens.
- LongBench: Represents ultra-long sequence workloads (e.g., text summarization), featuring a median input length of 41,417 tokens.
- Mixed Workload: A hybrid configuration combining randomly sampled requests from both datasets to create a challenging long-tail distribution.
Key Insights and Ideas
- Homogeneity is Key for Prefill: The prefill phase benefits immensely from large, uniform batches because it can maximize parallel GPU utilization. By isolating long prompts from short prompts into distinct buckets, short requests are no longer held hostage by the massive padding requirements of longer ones.
- Lightweight Approximations Win in Production: While calculating the mathematically perfect bucket boundary using conditional expectations is computationally expensive, the authors found that a simple interval bisection approach provides an excellent approximation with negligible algorithmic overhead (<1% of total execution time).
Key Results
Evaluated on a cluster of 4× NVIDIA A100 (40GB) GPUs using Llama2-13B, BucketServe demonstrated substantial performance gains over state-of-the-art baselines like UELLM and DistServe:
- Throughput Boost: BucketServe outperformed UELLM by up to 3.58× and DistServe by 1.31× in throughput under heavy, mixed workloads.
- Higher GPU Utilization: Dynamic batching successfully pushed average decoding GPU utilization up to 81.66%, compared to 67.88% for DistServe and 60.86% for UELLM.
- Superior SLO Attainment: At a strict 80% SLO attainment level, BucketServe handled 1.93× more request load than DistServe on mixed datasets and achieved a 1.975× higher system load capacity compared to UELLM.
Limitations and Future Work
While BucketServe excels in optimizing request orchestration, its current evaluation is limited to a single-node cluster setup. The authors note that extending this framework to multi-node clusters will introduce new challenges in distributed memory management and network communication. Consequently, their future work will focus on exploring multi-level load balancing strategies to maintain these efficiency gains across distributed, multi-node environments.
Summary updated