KV cache allocation in static-graph NPU serving

Offloading context to the host tier immediately frees accelerator capacity, but sluggish restoration during traffic bursts forces recomputations that ultimately reduce processing throughput and deplete memory. In Play, Available NPU Memory rises from 54 to 79 at step 15 when increasing the offload threshold. These illustrative values demonstrate how balancing eviction against transfer bandwidth preserves operational headroom across multi-model agent workloads.

Machinations diagram of KV Cache Allocation in Static-Graph NPU Serving: Available NPU Memory, Host KV Memory, Offload Threshold Lever, Restoration Bandwidth Lever, Context Offloader, Restoration Sink, NPU Allocation SinkMachinations diagram of KV Cache Allocation in Static-Graph NPU Serving: Available NPU Memory, Host KV Memory, Offload Threshold Lever, Restoration Bandwidth Lever, Context Offloader, Restoration Sink, NPU Allocation Sink
Open this diagram in the Community

Key takeaways

  • Doubling the Offload Threshold Lever from 6 to 12 gigabytes per step raises Available NPU Memory to 79 gigabytes at step 15 compared to 54 gigabytes in the baseline.
  • Halving the Restoration Bandwidth Lever from 4 to 2 gigabytes per step reduces Available NPU Memory to 33 gigabytes at step 15.
  • Available NPU Memory diverges early when offloading changes, showing a separation at step 1 between 61 gigabytes and 67 gigabytes.
  • Restoration bandwidth constraints emerge late in this model, maintaining identical values through step 2 before dropping below the baseline at step 3.

Does offloading cache free more memory than restoration consumes?

System architects planning multi-agent inference workloads must choose between evicting key-value cache tokens to system memory or recalculating them later when incoming prompts surge. In this playable model, shifting the offload rate to 12 gigabytes per step leaves Available NPU Memory at an illustrative 79 gigabytes at step 15, compared to 54 gigabytes in the baseline setting. Halving the restoration rate to 2 gigabytes per step drives that outcome down to 33 gigabytes.

These figures represent an illustrative scenario rather than real device specifications. Balancing accelerator space against memory transfer channels determines whether a serving pipeline retains head room for new tasks or chokes on recomputation.

How do offload thresholds and restoration bandwidth shift memory levels?

The Offload Threshold Lever sets how many gigabytes of cached states move from accelerator memory to host storage each cycle. In the baseline setting, this control starts at 6 gigabytes per step and leaves Available NPU Memory at 54 gigabytes at step 15. Raising the lever to 12 gigabytes per step increases the remaining pool to 79 gigabytes at step 15.

Early in the Play, the higher offload setting produces immediate expansion. At step 1 the stock holds 67 gigabytes instead of 61 gigabytes. By step 5 it expands to 87 gigabytes instead of 63 gigabytes, widening the margin before later demands draw down the pool.

The Restoration Bandwidth Lever controls the transfer rate for retrieving saved tokens from host memory back into active execution. Its baseline value sits at 4 gigabytes per step, which finishes at step 15 with 54 gigabytes of Available NPU Memory. Lowering this rate to 2 gigabytes per step causes the stock to drop to 33 gigabytes at step 15.

Both settings track closely across early moments. At step 1 the value is 61 gigabytes under both paths, and step 2 registers 62 gigabytes for each. The paths split later, where step 8 reaches 57 gigabytes under the lower setting instead of 63 gigabytes in the baseline, illustrating that transfer bottlenecks compound over extended execution.

How does context movement flow through the serving model?

This playable model links two primary holding pools to balance task throughput. Available NPU Memory tracks unallocated accelerator room, which starts at an illustrative 60 gigabytes. Host KV Memory holds offloaded states in main memory, starting at 10 gigabytes.

Incoming multi-agent tasks consume space through the NPU Allocation Sink at a steady rate. The Context Offloader continuously frees accelerator memory by shifting inactive states into Host KV Memory at the rate dictated by the offload lever. Meanwhile, the Restoration Sink pulls tokens back from host memory into active execution as governed by the bandwidth lever.

When offloading outpaces allocation, accelerator head room climbs. If the restoration channel lacks adequate capacity, tokens linger in host storage and subsequent pipeline demands draw down Available NPU Memory faster than it can recover.

What do these model results mean for workload management?

The results show that aggressive context offloading creates rapid, substantial expansion of available execution space in this model. Raising the eviction threshold provides immediate relief against early memory exhaustion during multi-agent bursts.

Restoration limits show their penalties gradually rather than instantly. A restricted transfer pipe allows host memory to back up, eventually dragging down accelerator room across longer sequences. Operators balancing these levers in this model must evaluate offload aggressiveness first to prevent early exhaustion, while ensuring restoration capacity remains high enough to prevent delayed collapses.

What does the model leave out?

This model relies on specific structural bounds and simplifications. Each step of Play represents an exact duration of 100 milliseconds of serving runtime. Incoming agent tasks generate new tokens at a perfectly constant flow rather than fluctuating naturally over time.

The model contains fixed connection pathways between two isolated pools and fixed rates set by dials. Real systems are more complicated than any model, but the simplified structure isolates how transfer capacity interacts directly with storage thresholds.

Where does the topic come from?

This playable model was inspired by the paper titled Recompute or Restore? Host-Tier KV for Multi-Model Agent Workflows on a Static-Graph NPU Serving Stack, published on arXiv on 13 November 2026. The values and scenarios explored throughout this essay reflect the model's own illustrative scenario.

Can you test alternative cache allocation settings?

You can explore these dynamics yourself by testing the levers in the playable model. Try adjusting the Offload Threshold Lever to 3 or 9 gigabytes per step, or observe how the Restoration Bandwidth Lever behaves at 6 or 8 gigabytes per step under sustained load.

The parts of the model

The question it asks: How does managing host-tier key-value (KV) cache eviction versus recomputation affect the pool of available accelerator memory during multi-model agent execution?

Available NPU Memory · Pool
Tracks unallocated fast accelerator memory in gigabytes available for multi-agent execution.
Host KV Memory · Pool
Stores offloaded key-value cache tokens residing in host system RAM.
Offload Threshold Lever · Lever
Sets the rate of context offloading from accelerator to host memory in gigabytes per step.
Restoration Bandwidth Lever · Lever
Sets the PCIe bandwidth rate for restoring cached tokens from host memory in gigabytes per step.
Context Offloader · Source
Frees accelerator memory by evicting cached context tokens into host memory.
Restoration Sink · Sink
Consumes restored context tokens back into active model execution.
NPU Allocation Sink · Sink
Drains available accelerator memory as incoming multi-agent tasks allocate context tokens.

Assumptions and limits

  • One step of Play represents 100 milliseconds of serving runtime.
  • Numeric capacity and bandwidth values are illustrative.
  • Incoming agent tasks generate a constant rate of context tokens requiring allocation.
  • Available NPU Memory is drained by NPU Allocation Flow and replenished when states move to Host KV Memory via Context Offload Flow.

A teaching model with illustrative values; each Play is a scenario, not a forecast.

Sources

Thank you to arXiv for use of its open access interoperability.

About this model

Machinations makes these models with AI from a public source, and each one is a teaching scenario: its numbers are illustrative values chosen for the model, not measurements or forecasts. You can open this diagram in the Community to remix it and change it.

Share this model
Browse Economic Zeitgeist