HotCarbon 2026

Energy Characterization of KV Cache Offloading Under Agentic Workloads

Gilbert Mao (Georgia Institute of Technology), Ruiyang Zhou (Georgia Institute of Technology)

This transcript was made by AI. The open source speech recognition model Whisper (large-v3-turbo) transcribed the recording with faster-whisper. Names and technical terms were checked against the paper, but it can still contain mistakes. The recording is the reference.

0:00 Our next presentation was also prepared with a video. This is from Gilbert Mao from the Georgia Institute of Technology. So the topic is about kind of teaching us how to understand the energy associated with KV cache offloading. All righty. Good morning, everyone. My name is Gilbert, and I'm a master's student at Georgia Tech. I'm very excited to share and talk about the work today. On the energy side to KV cache offloading, specifically for agentic workloads.

0:38 So I guess to start, it goes without saying that LLM serving is very expensive in terms of energy. And energy is now a key serving constraint. As models and context windows scale, infrastructure hits power and thermal ceilings before compute ceilings. However, the KV cache is a key component to the serving process as it stores the per token attention state for every active request and grows linearly with context length. So you can imagine what that does to agentic workloads where we get these massive context windows. Offloading the KV cache was originally created to increase throughput. But today we're asking if it's also an energy feature in addition to a throughput feature. And if so, by how much exactly? So before we dive in, I think it's important that we understand why we're looking at agentic workflows.

1:34 So on the left, we have a single question and answer, which is about a few hundred tokens. It's the single shot workload, and the moment it's done, the memory is released. Now on the right is what an agentic workload looks like, where we have a real agent session from one of our traces. It's 35 turns of a model performing office work. So every response that it writes, every tool result that it sort of reads, gets added to the context and in turn carried over to the next turn. And the memory never resets and climbs to about 50,000 tokens. So these are sort of the workflows that we are starting to see more and more. And by Anthropic's own measurements, the share of task delegation of agentic workflows went from 27% to 39% in about eight months.

2:30 So it's this type of workload, agentic workflows, that is going to keep the KV cache full. And that's sort of the energy side that we want to study. So just a quick overview for those who haven't seen a lot of LLM serving, maybe. Basically, generating a response from an LLM happens in two phases. The first is pre-fill, where the model reads your entire prompt at once. That saturates the GPU's compute units, and the power climbs towards the card's thermal limit. The second phase is decode. So now the model writes the answer one token at a time, and each new token only has to read back the state of everything before it. So this part is limited by memory bandwidth and not so much compute. So the power draw is going to be lower, but it's going to be sustained.

3:25 And in the case of agentic workloads, sometimes it's going to be over like thousands of steps. And the thing that keeps decoding cheap is the KV cache, which is the stored history. So the model never re-reads the conversation from scratch to writing the next word. So without it, generation would probably be impractical. You would have to sort of recompute everything on GPUs again in order to get your next token.

3:53 So the KV cache lives in a fixed size pool on the GPU. Whatever is left after loading in the model weights is for the KV cache. As soon as our context windows start to get larger, maybe concurrent requests start to increase, that causes this pool to fill. And there's a certain point where the scheduler has no choice but to make room for more requests. And in order to do so, it needs to evict some of its current running requests. So this is what we call preemption. And the question is, what happens to this request and its blocks once it's about to get preempted? And here are the two conditions of our sort of study. We have offloading off where the evicted request's cache state is simply dropped.

4:46 And when it's time to resume, the engine recomputes everything. So it reruns the entire prefill from scratch at peak power. With offloading on, the engine quietly copies the state out to host memory during the entire time the request is running. So when the request needs to get preempted, it'll transfer these requests over to the CPU via this bus. And when it comes time for the request to resume, we don't recompute everything. We'll simply reload these blocks that we previously copied over to the CPU. So both of these conditions still come during preemption. And the only difference is the cost of recovery. So we're already starting to build some intuition that on one hand, we have this round trip where we are copying over blocks and we are reloading them.

5:41 And on the other hand, we have to utilize our GPUs to recompute everything from scratch. Now, everything that I've just talked about only happens if this pool actually fills. So that brings me to the sort of central design decision, which was how to manufacture this sort of pressure, honestly, on hardware that we could run hundreds of times. So we did not serve on a 70 billion parameter model. We served on an 8 billion one. And we had to shrink its memory budget until the proportions matched what actually happens in production. So, for example, let's say there's a real deployment of a 70B model. That's about 70 gigabytes of weights per GPU. So at vLLM's default memory budget, that leaves you roughly half weights, half kv cache pool.

6:36 So in our setup, we take the same engine and cut its budget from 90% of the card down to 22%. But the split lands in the same place, about half weights and half pool. So essentially, we shrink the budget, we keep the split. And once the split matches, the pressure that sort of happens, it sort of happens in the same way. A production pool only holds a couple of long sessions before it's oversubscribed and it starts to preempt. So ours does the exact same thing. When we start to prescribe two to six concurrent requests, we start to see preemptions. So it's the same event, it's just that we are triggering it in a different way.

7:24 So this brings me to our experimental pipeline. Starting from the left in the top right picture, we have our inputs, which are our traces. One from Office work, one from coding. And then we also have this third condition that I set as the control, which is the office workload rerun at a looser memory limit. And it just serves as a check to make sure that we are properly tracking the pressure and not just one specific setting. And then moving on, we have our hardware config, which is an H200 chip. And we run Llama 3.1 8B on vLLM. Then we have our concurrency dial, which we vary from two concurrent requests all the way to six concurrent requests in order to change up how much pressure the system is going through.

8:19 Then every offloading off versus on comparison runs back to back to back to make sure that factors like the room, the cooling, or the individual card can sort of factor in to the difference in energy. We decode greedily, which fixes the output length identical across the pair. So when we compare energy per token, the denominator doesn't move, which is the number of tokens. And then for the on conditions, we also experiment with different sizes of buffers. And then moving on, we have our meters, which track the GPU energy and also the CPU DRAM energy. And finally, we have our metric, which we calculate like this. So if we go to the bottom left, so every run that we do starts from a cold server, and we measure the idle draw for 30 seconds.

9:19 We then warm it up, and then we measure a real window with the counters read at each end. We take the GPU energy over that window and subtract the idle baseline because we care about the marginal cost of the work. And then we divide by the number of output tokens. So that's what we call marginal joules per token. And we compare this value between the off and on versions, and the reduction is what I will designate as our delta energy. And then we run each thing three times. Then arguably, the most important thing is how we're accurately replaying the traces provided by Applied Compute. So the traces given to us are actually just token counts and production timing. So how long each prompt was, how long each response was, and how long each tool call took, but not the actual text because it's withheld for privacy.

10:18 So in turn, we generate synthetic data to send instead. So we generate content from the model's own vocabulary at the exact recorded lengths, and we prefix a shared system prompt the way production does. And we replay the session turn-by-turn with the real tool call timing. But again, the KV cache, the scheduler, and the preemption logic doesn't matter sort of what tokens we're sending them. They only run to the lengths, the structure, and the timing.

10:52 So after running our experiment set, we plotted the delta energy against the P95 utilization. By P95, I mean how full the pool gets in its busiest moments, so the level it exceeds only 5% of the time. So we see that below this about 90% threshold, offloading doesn't save you much, and it's all within noise. But above this 90%, it's a different world. We get 14% to 32% energy savings on every run. And I think it's important to note that this 90% threshold, it is a number specific to our hardware, our model, and our workload. So the portable finding is not the exact number, but the fact that there is a threshold that exists for energy savings to be extracted. And another thing to note is that this is all for GPU energy, as we found that the CPU and DRAM energy statistically was indistinguishable between the off and the on runs.

11:54 Then for our next finding, we see that energy and throughput improve together. And they move together because they come from one cause. So when you stop recomputing evicted requests, you free up those compute cycles that recomputation was burning. That's throughput. And you stop drawing the power those cycles cost, which is the energy. So it's one mechanism, and it has two benefits. So below this threshold, throughput is flat. It's within about 2%, which tells us that the copy everything sort of process in the background isn't costing us anything while it waits. So it's cheap enough not to matter, but it starts paying off right at that threshold. So this is a figure just to show that we can really attribute the energy savings to this avoiding recomputation.

12:51 So vLLM keeps an internal counter of where pre-filled tokens come from. So they're either freshly computed, served from the cache, or reloaded from the offload buffer. And it's a software counter, so it has nothing to do with the power meter. So with offloading off, under pressure, the freshly computed fraction balloons at this office condition. So 21% of all prompt tokens are being computed from scratch over and over again, so as evicted requests keep redoing their work. But when we turn the offloading on, that same fraction drops to about 3%, as you see. So this is exactly where we are saving our energy.

13:33 We saw two really interesting failure modes when we were running our experiments. And the first one was having too small of a buffer. Essentially what happens is if you have too small of a buffer, a cache block could get evicted from that buffer before the session comes back for it, if the session needs to preempt more things. Because a tool call could take longer than the block survives. So it's important to size the buffer so that a block outlives the slowest tool calls in the workflow. And for us, that happened to be 32 gigabytes. And afterwards, the benefit plateaus. The second interesting thing that we saw was a throughput collapse at a high pressure and large buffer circumstance. So every single collapsed run had zero preemptions, the GPU power would drop, and also output would drop.

14:26 And for now, we think it's because of the number of preemptions that's overrunning the scheduler. Basically, the scheduler and the offload machinery share the same loop. But if we have too many requests running on the scheduler, that sort of floods the IO and blocks the scheduler from doing its job. We bundle all of our learnings into a framework that future operators can use. The first is locating that region where the energy savings switch on, that activation threshold. So pushing your KV cache utilization past that. The second is selecting a buffer size past your own workload's slowest tool call latency. Third is implementing a buffer cap as a safeguard on serving engines that are prone to collapse. And lastly, using preemption rates as the leading indicator for failure and also for success in order to gather solid metrics.