Skip to content

AI Inference Is Turning Memory Capacity, Latency and Data Movement Into System Design Constraints

Published
Author
Kushal Koolwal
Reads
718

KV cache reduces repeated computation but increases memory demand. Serving systems must coordinate capacity, bandwidth, latency, power and cost around each workload.

AI Inference Is Turning Memory Capacity, Latency and Data Movement Into System Design Constraints

AI inference is making memory a system design problem. Accelerators can deliver more compute, but that capacity is useful only when models and inference data reach them within the workload’s limits for latency, power and cost. As services support longer contexts and more simultaneous requests, the key question is how to coordinate compute, memory, interconnect and software.

Bandwidth remains part of the constraint, but it doesn’t describe the whole job. A system also needs room for models, intermediate data, application context and inference state. Moving data takes time and power; placing it farther from an accelerator can increase latency. Adding memory capacity helps only when the system can access that capacity without congestion or service delays.

Usable capacity depends on access

The memory wall has long described the gap between processor performance and the rate at which memory can supply data. AI makes that gap more consequential: an accelerator waiting for data cannot put its full compute capacity to work.

Memory choices involve trade-offs. High-bandwidth memory close to an accelerator offers high bandwidth, while capacity, power and cost impose constraints. Larger-capacity memory may cost less, but may not offer the same bandwidth or latency. Moving data between tiers can extend effective capacity while consuming time, energy and interconnect bandwidth.

That makes installed capacity an incomplete measure. Data in a lower tier may be available in principle but too slow or costly to reach within an application’s service-level objective. For a given workload, useful capacity is the amount the system can access within its latency, bandwidth and power limits.

Fig. 1: AI scaling turns the memory wall into a system-level trade-off among bandwidth, capacity, latency, power, cost and utilization.

Inference makes memory demand ongoing

Training builds or updates a model. Inference repeatedly serves prompts, generated tokens, agent actions and application interactions, so its resource demands accrue as users and workloads arrive. Different services also have different priorities: a conversational assistant may need low latency, while a batch workload may focus on utilization. An enterprise assistant may handle substantial proprietary context, and an agent may retain information across several steps.

There’s no single balance of bandwidth, capacity, latency, power and cost that fits all of these cases. The serving architecture needs to reflect the workload and its performance targets.

KV cache trades recomputation for data movement

Transformer attention generates key and value representations for tokens in a sequence. During later decoding steps, the system can reuse those representations instead of recalculating earlier states. This KV cache reduces repeated computation, but the saved compute comes with a larger memory footprint and more data to manage.

Longer context windows increase the cache needed for each sequence. Higher concurrency multiplies the requirement across active requests. An optimization that cuts recomputation can therefore increase pressure on memory capacity and data movement.

Fig. 2: Reusing computed states reduces repeated work, while longer contexts and more concurrent requests increase the data that must be stored and accessed.

KV state changes over the course of inference. It is created during prefill, accessed repeatedly during decode, and may be kept for reuse. A serving system may move, replicate, compress or evict that state, with each choice affecting capacity, bandwidth, latency and control requirements.

That makes cache management a data-lifecycle problem as well as an allocation problem. Moving KV state to a lower-cost tier can free space nearby, but the benefit depends on whether it outweighs transfer latency, energy use and bandwidth demand. If access misses the application’s service target, the move may cost more than it saves. Every transfer needs a workload-specific reason.

Choose tiers around the workload

Frequently accessed data may justify staying close to compute, especially for latency-sensitive services. Long-context applications may place more weight on capacity. Agent workloads can need state that lasts longer and gets reused; large consumer services may focus on throughput, utilization and cost per token.

A memory hierarchy can serve these different needs by placing data according to how often it is accessed and how much delay it can tolerate. The goal is to coordinate the tiers so that capacity farther from compute is useful without imposing more movement or waiting than the workload can absorb.

Measure performance beyond bandwidth

Bandwidth alone can hide poor response times. High aggregate throughput doesn’t guarantee acceptable time to first token, inter-token latency or tail latency when traffic creates congestion. Capacity determines how much state can remain accessible, while power and utilization help show whether the system can deliver that access efficiently.

Measures such as tokens per watt or tokens per dollar can be more informative when considered alongside latency targets. The design question is which combination of compute, memory, interconnect and software can provide predictable performance within the available power and cost envelope.

More tiers require coordination

High-bandwidth memory can serve data near accelerators; larger-capacity tiers can hold more state, and expansion or pooling can extend capacity beyond an accelerator’s local memory. Software can place, reuse, compress, move or discard KV state to suit a workload. Each addition also creates decisions about placement, transfer, coordination and reliability.

Transferring data may be more efficient than recomputing it, but transfers can compete for bandwidth. Replicating state can avoid recomputation while using capacity in multiple places. Pooling can improve utilization when contention and quality of service remain controlled. The value comes from coordinating those choices across the system, rather than maximizing a single memory specification.

The constraint will shift with each workload

Higher-bandwidth memory, greater capacity, faster interconnects, compression and cache management can relieve specific limits. They don’t remove the need to manage data movement. Longer contexts, greater concurrency, multimodal models and more capable agents will keep changing where memory pressure appears, making hardware and software decisions closely linked.

For inference infrastructure, scaling depends on where data resides, when it moves and whether moving it beats recomputation. The practical test is whether distributed memory resources translate into predictable performance for the workload being served.

Source: Kushal Koolwal · semiengineering.com

Related reading