[KongchangAI]
· 4 min read· 2,121 words

Breaking the AI Memory Wall: Five Stacked Memory Utilization Strategies

Breaking the AI Memory Wall: Five Stacked Memory Utilization Strategies

NVIDIA breaks down five strategies—from quantization and expert distribution to cross-server context reuse—to break through the AI memory wall.

The article addresses the "memory wall" in AI inference: HBM has limited capacity but extremely high bandwidth, so fast memory can't hold enough and memory that can hold enough isn't fast enough. NVIDIA proposes five complementary strategies: NVFP4 quantization compresses weights to 4 bits with shared FP8 scaling factors; WideEP and NVLink spread MoE experts across GPUs; Dynamo supports prefill/decode disaggregation and prefix cache reuse with NIXL for cross-node transfer; Vera CPU shortens context idle windows via faster tool calls and host memory offloading; and CMX uses a flash storage layer for cross-server context reuse, reporting up to 5x token throughput and energy efficiency in long-context scenarios.

AI models are increasingly memory-hungry, and that's no secret. But where exactly does "not enough memory" bottleneck? In NVIDIA's "Inside the Architecture" series, Nate Dwarika breaks down five ways to get more value out of AI memory—from compressing weights to reusing context across servers—forming a clear memory optimization path.

The Nature of the Memory Wall: Dual Constraints of HBM Capacity and Bandwidth

AI needs memory to hold model weights and the context being processed. The longer the conversation and the more requests, the greater the pressure on GPU high-bandwidth memory (HBM). HBM stores data that the GPU is actively processing and can read/write large amounts of data at extremely high speed, but its capacity is limited.

The challenge is satisfying both capacity and bandwidth simultaneously: enough space to hold data, and enough bandwidth to move it. When HBM runs out, data can be moved to host memory (CPU system RAM), local SSDs, or shared storage—but retrieving that data takes time.

This constitutes the core contradiction of the "memory wall"—fast memory can't hold enough, and memory that can hold enough isn't fast enough.

Evolution of 16-bit formats like FP16 and BF16

HBM (High Bandwidth Memory) is DRAM stacked inside the GPU package, connected to the GPU core via a silicon interposer, providing bandwidth far exceeding traditional VRAM. Current flagship GPUs' HBM bandwidth can reach several TB/s, with capacities ranging from tens of GB to over a hundred GB. The key characteristic of HBM is its physical location—it sits right next to the GPU die, so access latency is extremely low and bandwidth extremely high, but constrained by package size and cost, capacity cannot scale elastically like system memory. When model weights, KV cache, and activations compete for HBM simultaneously, the capacity bottleneck forces data to shuttle back and forth between HBM and host memory, and since PCIe or NVLink-C2C bandwidth is far lower than HBM, the shuttling itself becomes a performance penalty. Understanding HBM's "close and fast but small" nature is the premise for understanding why all subsequent optimization strategies revolve around "reducing data resident in HBM."

Fifth Strategy: NVFP4 Quantization, Compressing Weights to 4 Bits

The patterns learned during model training are encoded as parameters, and at inference time the storage of these weights consumes a large amount of GPU memory, squeezing the space for context and concurrent requests. Quantization means making weights take up less space while maintaining acceptable performance.

Analogous to compressing photos on social media: after compression they load faster and take less storage, but details are lost, and over-compression makes them blurry. Quantization does something similar to model weights—representing values with fewer bits. AI workloads have evolved from FP32 (32-bit) to FP16/BF16 (16-bit), then to FP8 (8-bit), and NVFP4 goes further down to just 4 bits per value.

4 bits sounds like very little space, but the key is that these values don't work alone: each group of 16 values shares an FP8 scaling factor. Back to the photo analogy: when shooting on a sunny day, the brightness difference between sky and shade is huge, and when compressing you want to preserve detail in both—scaling is like applying separate brightness adjustments to different regions of the photo. MXFP4 uses larger groups and coarser scaling, easily losing subtle differences; NVFP4 uses smaller groups and finer control, preserving more original information.

Published DeepSeq results show that across 7 evaluations NVFP4 achieves accuracy close to FP8 while using fewer bits per weight. The Kimi example demonstrates that the same number of weights requires significantly less space under NVFP4. When the model and inference software support it, KV cache can also be stored in NVFP4, freeing up space for longer conversations and more concurrent requests.

KV cache is a buffer that stores attention Key and Value tensors in autoregressive inference. When generating each new token, the model needs to perform attention computation with the K, V of all previous tokens; without caching, the K, V of historical tokens would need to be recomputed at each step, with cost growing quadratically with conversation length. KV cache therefore becomes one of the main sources of HBM usage in long-context inference: for a 70B parameter model, 32K context, and batch size 8, the KV cache can easily exceed tens of GB at FP16 precision. Storing KV cache in NVFP4 means supporting longer conversation history or larger concurrent batches under the same HBM capacity, but note that the impact of quantizing KV cache on attention accuracy is typically more sensitive than quantizing weights, requiring calibration of scaling factors to balance compression rate and generation quality.

Even with quantized weights, they can still occupy a large amount of GPU memory. Models with Mixture-of-Experts (MoE) architecture contain parameter groups called "experts" internally; when each token passes through, a router selects a subset of experts to process it—not all experts need to be activated for each token, but all expert weights still need to be stored.

If experts are crammed into a few GPUs, they occupy space that could otherwise be used for context and concurrent requests. Spreading experts across more GPUs means each GPU stores only a small portion of expert weights. Tokens routed to the same expert can be processed together, and grouped GEMM kernels can efficiently perform these expert-specific matrix multiplications.

The cost is communication: activations must be sent to the GPUs holding the selected experts, and outputs returned and merged. NVLink provides high-bandwidth connections for these exchanges. Each GPU still has its own HBM, and the benefit depends on whether the gains from spreading experts and reusing weights outweigh the extra communication overhead.

WideEP and NVLink spread experts across multiple GPUs

Mixture-of-Experts (MoE) architecture replaces the single feed-forward network of a traditional Transformer with multiple parallel "expert" sub-networks; each token is scored by a router and only the Top-K experts are activated (typically K=1 or 2). This allows the total parameter count to be far larger than the parameters actually used in a single forward pass—for example, a model with 671B total parameters might activate only about 37B per inference. The memory challenge of MoE is that although computation is sparse, all expert weights must reside somewhere in case the router selects them. WideEP (Wide Expert Parallelism) distributes experts across as many GPUs as possible, so each card only needs to carry a small portion of experts, freeing HBM for KV cache and concurrent requests. The cost is that tokens need to be routed across GPUs, and NVLink's high bandwidth and low latency are the key infrastructure that keeps this "all-to-all" communication from becoming a bottleneck.

Third Strategy: NVIDIA Dynamo, Reusing Already-Computed Context

Rather than recomputing the same context, reuse what has already been stored. NVIDIA Dynamo is a distributed inference serving framework that supports disaggregated inference: the prefill phase and the generation (decode) phase are handled by different worker nodes, with KV cache passed between them.

Dynamo also coordinates reuse of already-computed context. Different requests may share the same prefix, such as system prompts or tool definitions. KV cache stores intermediate attention states, and when there is a matching prefix and compatible cache state, it can be reused directly without recomputation.

This context doesn't have to stay in GPU memory all the time. Depending on the engine and configuration, it can be kept in host memory or storage. The engine manages local offloading; KVCR (KvCacheRunner) can use router hints to retrieve cached context from another worker node, and NIXL provides the data transfer layer.

NIXL provides the data transfer layer

Prefill/decode disaggregation is an important architectural pattern in modern inference serving. The prefill phase processes the entire input prompt in parallel and is compute-intensive; the decode phase generates tokens autoregressively one by one and is memory-bandwidth-intensive. The two have different preferences for hardware resources, and running them together on the same GPU leads to resource contention and reduced utilization. Disaggregated inference assigns the two phases to different worker node pools, each running with optimal batch configuration, connected via cross-node KV cache transfer. NIXL (NVIDIA Inference Xfer Library) is a point-to-point data transfer layer designed for this, supporting asynchronous movement between GPU memory, host memory, and storage, enabling KV cache to flow efficiently between prefill and decode nodes without CPU copies or serialization.

Second Strategy: NVIDIA Vera CPU, Shortening the Idle Window of Tool Calls

When an agent pauses to run a tool, its context may sit idle in GPU memory, occupying space that other requests could use. The Vera CPU plays two roles here: running agent tools in a standalone Vera CPU rack, or working as the host CPU for Rubin GPUs.

First, the CPU rack. Agents need to run code or use tools for the model to continue, and during the wait the KV cache still occupies GPU memory. Vera's Olympus core has a 10-wide instruction decode engine, decoding up to 10 CPU instructions per cycle to prepare for execution—this is CPU instruction decoding, whereas LLM decoding generates tokens. Branch prediction (including a neural predictor) helps keep the instruction stream supplied when code branches.

The faster the CPU-side tool work completes, the sooner the model can resume, shortening the context's idle time, reducing the pressure to move or evict it, and lowering the risk of recomputing it later. Requests complete faster, and their GPU memory is released sooner.

In Vera-Rubin-NVL72, Vera acts as the host CPU, with NVLink-C2C providing coherent access between host memory and GPU memory. Serving software configured with KV cache offloading can move context to host memory, freeing HBM for immediate work and retrieving it when needed. It's like moving things from your desk to a nearby shelf—still at hand, but retrieving takes time. Serving software weighs the cost of moving and restoring context against the benefit compared with keeping it in HBM or rebuilding it.

First Strategy: NVIDIA CMX, Reusing Context Across Servers

What if another server needs this context? If there's no cache on the second server, all the work has to be redone. It's like editing a document on a desktop and then switching to a laptop—the file exists only on one machine and you can't continue; a shared network drive lets both computers access the same location.

CMX applies a similar idea to inference context: any server can retrieve stored context into its local KV cache, expanding effective memory capacity while balancing cost and performance. It is a flash-based storage layer connected via Ethernet, driven by NVIDIA BlueField 4 STX storage processors, serving a pod of interconnected compute systems. In the memory hierarchy, it sits at a new G3.5 context layer between node-local SSDs and traditional shared storage.

Cache state still needs to match the model's requirements, and servers need to be authorized to use it. The serving stack can bring context into CPU or GPU memory ahead of time. NVIDIA reports that for long-context and agent workloads, with CMX-optimized data paths, tokens per second can be up to 5x that of traditional storage, with energy efficiency up to 5x higher.

CMX enables cross-server context reuse

How the Five Strategies Work Together

These five methods cover different layers of memory optimization: NVFP4 reduces the footprint of weights and KV cache, WideEP and NVLink spread experts across multiple GPUs, Dynamo reuses already-computed context, Vera CPU shortens the idle window of tool calls and leverages host memory, and CMX extends reuse across servers.

In summary, improving AI memory utilization depends on three things: what to store, where to store it, and how much existing work can be reused. These five approaches are not mutually exclusive; in real deployments they are often combined, finding balance across the storage hierarchy and compute nodes.

One-line Summary

NVIDIA breaks down five strategies—from quantization and expert distribution to cross-server context reuse—to break through the AI memory wall.

Paragraph Summary

The article addresses the "memory wall" problem in AI inference, pointing out that HBM has limited capacity but extremely high bandwidth—fast memory can't hold enough, and memory that can hold enough isn't fast enough—constituting the core contradiction. NVIDIA proposes five complementary strategies: NVFP4 quantization compresses weights to 4 bits with shared FP8 scaling factors, achieving accuracy close to FP8; WideEP and NVLink spread MoE experts across multiple GPUs, trading communication for capacity; Dynamo supports prefill/decode disaggregation and prefix cache reuse, with NIXL handling cross-node transfer; Vera CPU shortens the context idle window by accelerating tool calls and host memory offloading; and CMX uses a flash storage layer to achieve cross-server context reuse, reporting up to 5x token throughput and energy efficiency gains in long-context scenarios. Together they answer the three questions of what to store, where to store it, and how much to reuse.

#AI memory wall#NVIDIA#NVFP4#HBM#KV cache#WideEP#NVLink#NVIDIA Dynamo#Vera CPU#CMX
Share:

Related articles