TL;DR
Serving large language models (LLMs) burns massive amounts of electricity, and simply throttling GPU clock speeds down isn't always the greenest—or safest—move. AdaptShift is an iteration-level GPU frequency controller that dynamically picks the most energy-efficient clock speed under latency limits, while factoring in the real-world delay it takes for a frequency change to actually kick in. Integrated into SGLang, it cuts GPU energy by up to 40.2% compared to NVIDIA's default settings.
What Problem Does This Paper Address?
Interactive LLM serving has strict latency Service-Level Objectives (SLOs): Time-to-First-Token (TTFT) and Time-per-Output-Token (TPOT). To save energy, operators can scale down GPU streaming multiprocessor (SM) frequencies. However, existing frequency controllers run into two major walls:
- Lowest isn't always greenest: Lowering frequency reduces instantaneous power draw, but it also stretches out execution time. Below a certain load-dependent sweet spot, total energy per request actually increases.
- Clock changes aren't instant: Issuing a frequency command via software doesn't affect GPU kernels immediately. These "transition effective times" span tens of milliseconds—comparable to an entire decode iteration—meaning a downshift might only take effect after the workload has already shifted.
Methods
AdaptShift is implemented in SGLang and operates at the granularity of each forward iteration using three coordinated modules:
- Iteration Latency Predictor (ILP): Instead of training a monolithic predictor for every new LLM, ILP trains random-forest regressors offline for shared GPU kernels (GEMM, prefill/decode attention, collective communication) and stores them in fast lookup tables. At runtime, it composes these kernel predictions to estimate iteration latency across all candidate frequencies in ~55–61 µs.
- Dual-Objective Frequency Selector (DFS): DFS translates request-level TTFT/TPOT SLOs into an iteration-level latency budget (tightening the budget when the waiting queue grows). Among SLO-feasible frequencies, DFS estimates both busy execution energy and "locked-idle" energy (power burned between kernels and iterations) to pick the energy-optimal frequency.
- Adjustment Decision Maker (ADM): ADM treats upshifts and downshifts asymmetrically. Upshifts happen immediately to protect latency SLOs. For downshifts, ADM estimates how long the target frequency band will persist and uses an offline-measured empirical cumulative distribution function (CDF) of transition times to check if the downshift will take effect fast enough to actually save energy.
Datasets
The authors evaluate AdaptShift using the first 2,000 requests from two production conversation traces:
- Microsoft Azure Conversation trace: 0–12 QPS (average 4.71 QPS), with input lengths of 2–7,930 tokens and output lengths of 12–1,000 tokens.
- Alibaba Qwen-Bailian trace: 0–10 QPS (average 3.40 QPS), with input lengths of 66–18,177 tokens and output lengths of 2–4,216 tokens.
Replay rates are scaled by a deployment-specific factor $r$ to match the serving capacity of different GPUs and models.
Key Insights and Ideas
- The U-shaped energy curve shifts with load: At low request rates ($\le 3$ QPS), lower frequencies save energy. Above 3 QPS, energy per request forms a U-shape—on an NVIDIA H20 GPU, the energy-optimal frequency climbs from 690 MHz at 3 QPS to roughly 1,140 MHz at 8 QPS.
- Transition delays have long tails: Median downshift effective times are 9.46 ms on H20, 10.62 ms on A40, and 22.94 ms on GB200, with long tails reaching tens or hundreds of milliseconds. Relying on median values underestimates SLO risks for upshifts and overestimates energy savings for downshifts.
- Idle power matters: Modeling only busy GPU execution misses the energy burned while the GPU sits locked at a high frequency waiting between iterations. Accounting for locked-idle energy is essential for picking the true energy-optimal frequency.
Key Results
AdaptShift was evaluated on NVIDIA A40, H20, and GB200 GPUs across dense models (Qwen3-8B, 14B, 32B) and a Mixture-of-Experts (MoE) model (DeepSeek-V4-Flash), covering both colocated serving and prefill–decode (PD) disaggregation:
- Energy & Efficiency: Saves 20.0%–40.2% GPU energy (up to 1.67× output tokens per joule, TPJ) over NVIDIA's default frequency management, and achieves up to 1.41× TPJ over
throttLL'eMandGreenLLM. - SLO Protection: Reduces TTFT and TPOT SLO violation rates by up to 2.67× and 22.5× compared to
throttLL'eMandGreenLLM, keeping both under 3% on dense traces while maintaining 96.8%–100% of default goodput. - Low Overhead: Adds just 0.288–1.745 ms per iteration (1.02%–4.86% of iteration time), overlapped asynchronously on the CPU.
Limitations and Future Work
- Per-GPU Profiling: Kernel-level predictors do not generalize across GPU architectures and must be profiled offline for each GPU type (taking ~1.5 hours per GPU).
- MoE Routing Fluctuations: For MoE models, ILP estimates expert-token load using cumulative averages, which captures persistent routing imbalances but overlooks iteration-level fluctuations.
- Future Directions: The authors plan to extend AdaptShift to additional GPU architectures, backends, and parallel configurations, while exploring broader control policies.
Summary updated