Scaling Shapley Energy Attribution to Large LLM Batches
Qi Luo, Ziwen Wang, Kunlin Li, Changxi Liu, Yun Chen
Abstract
LLM services have become essential infrastructure for applications such as chat assistants and coding agents. Service providers need to attribute resource consumption to individual requests for purposes such as billing. Among these resources, energy is a key metric for assessing the cost of serving each request. However, serving engines batch requests together, and GPUs report only aggregate energy consumption. Providers typically estimate each request's share in proportion to its token consumption, but this approach can produce substantially unfair estimates. The Shapley value provides a principled solution to fair energy allocation, but computing it directly requires 2N-1 GPU runs for N requests, which is infeasible for large batches. To address this problem, we propose StepSplit. Across GPU generations, we observe that the energy consumed by each inference step, a forward pass over a batch, consists of a shared energy, largely due to reading model weights, and a request-specific energy. We derive a closed-form Shapley value: each request is charged its own energy plus an equal part of the shared energy of every step in which it participates. A microbenchmark of 2.5-17.8 minutes calibrates both parts of the step energy once per model and GPU configuration. Under static batching, StepSplit uses this closed form in a single pass over the scheduler log. Under continuous batching, removing a request can change how the remaining requests are batched, so StepSplit adds a correction to the closed form, computed by replaying the scheduler on a CPU. We evaluate StepSplit against Shapley values measured using 529,513 GPU runs. Under static batching with batch sizes of 8-256, StepSplit achieves an L1 error of 0.4-4.3%, compared with 13.4-61.3% for token-proportional allocation. Under continuous batching with 8-128 requests, the corresponding errors are 0.5-6.4% and 20.6-71.7%.
Create a lesson
Related papers
GARDEN: Efficient GPU-Accelerated Billion-Scale GNN Training via Caching-Sampling-Batching Co-Design
Shared title terminology · Qingrui Zhu, Lei Liu, Yushu Cai et al.
Energy-Efficient Reinforcement Learning for Large Language Models
Shared title terminology · Rahul Sharma, Nitin Vegesna, Yanxin Zhang
Characterizing Serverless Workloads: A Large-Scale Analysis of Function-as-a-Service Platforms
Shared title terminology · Saman Akbari, Yassine Lazreg, Mohammadreza Malekabbasi et al.
FenixWalk: Adaptive Sampling for Large-Scale Dynamic Graphs on Heterogeneous Architectures
Shared title terminology · Pinhuan Wang, Jianian Fu, Jie Zhang et al.
AscMLA: Unlocking FP4 Efficiency for Long-Context MLA Decoding through Asymmetric Scaling
Shared title terminology · Zechun Zhou, Zhiyong Zheng, Xiaomin Zhang et al.
Matching Architecture to Workload: Comparing RISC-V Parallel Accelerators for Energy-Efficient Embedded Computing
Shared title terminology · Luca Colombo, Luigi Ghionda, Amirhossein Kiamarzi et al.