TL;DR
OrbitFlow is an adaptive, fine-grained Key-Value (KV) cache management system designed to keep long-context LLM serving within strict latency budgets (SLOs). By using a lightweight optimization solver to customize offloading plans per request and per layer, it eliminates communication bottlenecks, boosting SLO attainment by up to 66% and throughput by up to 3.3×.
What Problem Does This Paper Address?
As Large Language Models (LLMs) expand their context windows to handle tens of thousands or even millions of tokens, the memory required to store the intermediate states of a conversation—the KV cache—explodes. For instance, a single 1M-token request on a LLaMA3-70B model demands a staggering 320 GB of memory just for its KV cache.
To serve these models without running out of expensive GPU memory, systems resort to KV offloading, moving parts of the cache to host CPU memory and fetching them back over PCIe when needed. However, existing offloading methods apply a uniform, static strategy: they offload the exact same layers for every single request in a batch.
The authors identify two fatal flaws in this uniform approach:
- Token-Dimension Drift: As a sequence grows during generation, the time it takes to transfer the KV cache over PCIe increases much faster than the GPU computation time. A static plan that perfectly hid transfer times at 2K tokens will cause massive stalls at 16K tokens.
- Batch-Dimension Mismatch: Under continuous batching, a single batch contains requests at completely different stages of generation. Forcing a short, newly arrived request to follow the same aggressive offloading schedule as a massive, long-context request introduces unnecessary transfer overheads, causing severe latency spikes and violating per-token Service Level Objectives (SLOs).
Methods
OrbitFlow introduces a fine-grained, adaptive approach that treats each request-layer combination as an independent placement choice. It operates as a closed-loop control system with three core components:
- Solver-Based Placement Planner: Instead of uniform offloading, OrbitFlow models KV cache placement as an Integer Linear Programming (ILP) problem. It finds a customized, per-request layer placement matrix that minimizes batch latency while respecting GPU memory limits. To keep solver overhead negligible, the search space is intelligently pruned to symmetric, distance-driven patterns for each request.
- Adaptive Controller: This component monitors execution. It re-invokes the ILP solver only when necessary—such as when a new request joins/leaves the batch or when actual execution times deviate from the profile. It uses a self-determined "decode window" ($\Delta$) to safely skip optimization steps when latency margins are healthy.
- SLO-Aware Token-Deposit: LLM applications typically stream tokens to users at a fixed target rate (e.g., matching reading speed). OrbitFlow exploits this by buffering tokens generated during fast, early decoding steps into a CPU-resident FIFO queue. This accumulates a "latency margin" reserve that is systematically spent to mask later PCIe transfer stalls from the user.
- Pause-Resume Fallback: When the system is severely oversubscribed and no feasible placement can satisfy the SLO, OrbitFlow proactively pauses the request with the largest memory footprint. Crucially, it evicts its KV blocks on-demand and layer-by-layer rather than performing an expensive all-or-nothing memory dump, making the subsequent resume step highly efficient.
Datasets
The system was evaluated using synthetic workloads constructed by sampling real-world multi-turn conversations from the ShareGPT dataset. To emulate realistic production environments, request arrivals were modeled using a Poisson distribution with varying arrival rates and burstiness scales.
Key Insights and Ideas
- Breaking Batch Uniformity is Essential: Treating requests in a batch as a homogenous unit forces short requests to pay the latency tax of long-context requests. Fine-grained, request-wise cache isolation allows systems to maximize compute-communication overlap.
- Harvesting the Latency Margin: Tokens generated faster than the user's reading speed are a wasted resource if delivered instantly. Treating early generation speedups as a bankable "latency margin" allows systems to smoothly ride out transient hardware bottlenecks.
- On-Demand Eviction Beats Reactive Preemption: Traditional systems reactively preempt requests when memory is completely exhausted, dropping their entire state. Proactively pausing memory-heavy requests before saturation and evicting blocks layer-by-layer preserves GPU headroom and minimizes the cost of resuming them later.
Key Results
The authors integrated OrbitFlow into vLLM (v0.6.6) and evaluated it against state-of-the-art baselines like DeepSpeed-Inference and FlexGen using LLaMA3-8B and LLaMA3-70B models.
- SLO Attainment: OrbitFlow improved Time-Per-Output-Token (TPOT) and Time-Between-Tokens (TBT) SLO attainment by 62% and 66%, respectively, under demanding workloads.
- Tail Latency: It reduced the 95th percentile (P95) TBT latency by 38% and significantly flattened extreme tail latencies (P99).
- Throughput: OrbitFlow achieved up to 3.3× higher throughput compared to DeepSpeed-Inference by efficiently packing requests and maximizing GPU memory utilization.
- Low Overhead: Thanks to search-space pruning and running the solver one step ahead on a separate thread, the Placement Planner accounts for just 0.02% of total execution time.
Limitations and Future Work
Currently, OrbitFlow's distributed inference extension is validated for single-node, multi-GPU setups using Tensor Parallelism (TP), where a single master worker broadcasts placement plans. The authors acknowledge that extending OrbitFlow to multi-node clusters utilizing Pipeline Parallelism (PP) or Data Parallelism (DP) remains future work, as slower inter-node interconnects will introduce more complex communication constraints.
Summary updated