How to Run Trillion-Parameter Models on Persistent Memory When GPU Memory Is Not Enough

    This article explains how to use persistent memory as a byte-addressable expansion layer when a trillion-parameter model no longer fits in GPU memory or conventional DRAM. It covers why capacity, rather than compute, becomes the primary constraint under extreme quantization, how to design an explicit memory tier that keeps hot weights and part of the KV cache in high-bandwidth memory while cold layer weights stay in persistent memory, and the deployment constraints around capacity planning, effective bandwidth, active cooling, and power stability. It also sets realistic performance expectations for offline workloads and outlines how to evaluate the approach using cost per unit of capacity and latency per token.

    1. The Real Bottleneck at Trillion-Parameter Scale Is Capacity

    Once a model reaches the trillion-parameter range, the binding constraint on inference shifts quickly from “is there enough compute” to “can the parameters even be loaded.” Even with aggressive quantization that compresses each parameter to 1 to 3 bits, the weights can still occupy hundreds of gigabytes, far beyond the normal configuration of a single GPU’s memory or mainstream memory slots. At that point, the first engineering question is not throughput but the ratio of capacity to cost.

    There are two conventional paths. One is to keep stacking high-bandwidth GPU memory, where the price per unit of capacity is extremely high. The other is to add high-capacity memory modules, which are equally expensive during periods of rising memory prices. A third path is to treat storage-class memory, which offers large capacity and low cost but only moderate bandwidth and latency, as an addressable memory expansion layer, trading capacity for time.

    2. How It Works: Persistent Memory as a Slow Memory Tier

    Persistent memory, or storage-class memory, is byte-addressable, retains data across power loss, and can be mapped into a separate memory region through a direct access mode, leaving the software to decide which tier each tensor lives in. A typical inference layout looks like this:

    • Hot data (the current layer’s weights, part of the KV cache) resides in high-bandwidth memory.
    • Cold data (the remaining layer weights) resides in persistent memory.
    • The runtime swaps data in and out on demand, forming an explicit memory hierarchy.

    The following is illustrative pseudocode that only conveys the idea of tiered access:

    1. for layer in model.layers:
    2. if layer.is_hot:
    3. w = hbm.load(layer) # high-bandwidth tier
    4. else:
    5. w = pmem.mmap_read(layer) # byte-addressable expansion tier
    6. out = matmul(x, w)

    The key point is that the capacity bottleneck is flattened into a latency problem, and a latency problem can be tolerated with offline batch processing.

    3. Deployment Essentials: The Triangle of Capacity, Bandwidth, and Cooling

    1. Capacity planning. Estimate the total weight size from the quantization bit width first, then reserve room for the KV cache and runtime overhead. A margin of 10% to 20% is usually needed, otherwise long contexts will overflow.
    2. Bandwidth expectations. The effective bandwidth of the expansion tier is clearly lower than that of high-bandwidth memory, so per-token latency rises significantly. Throughput figures should not be compared directly against an all-GPU-memory setup.
    3. Cooling design. A fully loaded high-capacity expansion memory draws substantial power and requires active air cooling. If cooling is insufficient, heat conducts into adjacent memory and slots, which in extreme cases damages the hardware. A common practice is to mount a high-airflow turbine fan blowing directly at the memory area and to monitor temperature thresholds.
    4. Power and stability. Sustained full-load inference is a continuous heavy workload, so verify power headroom and chassis airflow to avoid throttling and device dropouts.

    4. Performance Limits: Translating Speed into Business Feasibility

    Under extreme quantization, generation speed for this kind of setup is often on the order of less than one token per second, and it drops further as precision increases. Generating a long text of tens of thousands of tokens may take more than ten hours. The conclusion is clear:

    • Not suitable for latency-sensitive scenarios such as real-time conversation or online customer service.
    • Suitable for tasks with no time constraints, such as overnight offline batch processing, data cleaning, long-document summarization, and evaluation regression runs.

    5. Cost Trade-offs and Engineering Recommendations

    Evaluate the approach with two metrics, cost per unit of capacity and latency per token, rather than the memory unit price alone. If the workload tolerates hour-level latency, running a trillion-parameter model on a low-cost, high-capacity memory tier is often more economical than purchasing high-bandwidth GPU memory. If elasticity and zero operational overhead are required, a combination of general-purpose cloud container platforms, object storage, and message queues is also an option: keep the model weights in object storage, launch inference jobs on the container platform, queue tasks with a message queue, and observe temperature, latency, and failure rates through log services and monitoring alerts.

    6. Conclusion

    Insufficient GPU memory is not a dead end. The essence is to convert a capacity problem into a latency problem and then absorb that latency through the choice of workload. Master four things, memory tiering, quantization compression, active cooling, and offline batch processing, and you can run very large parameter models within a limited budget while keeping hardware risk within an acceptable range.