Running Trillion-Parameter LLMs on Persistent Memory When VRAM Runs Out
This article explains how to run trillion-parameter large language models when GPU memory capacity becomes the primary bottleneck. It covers why persistent memory suits read-only model weights, a typical hardware setup, the critical cooling and motherboard-melting risks, measured inference performance, and engineering practices for capacity planning, data tiering, and asynchronous task orchestration. It also outlines which workloads fit this approach and which do not.
Running Trillion-Parameter LLMs on Persistent Memory When VRAM Runs Out
1. The Problem: Trillion-Parameter Models Hit the VRAM Wall
As large language models scale from hundreds of billions to trillions of parameters, the primary bottleneck for inference deployment has shifted from compute to capacity. A top-tier model with roughly 2.8 trillion parameters needs about 610GB of available memory just to hold its weights, even after aggressive quantization. No single consumer or workstation GPU comes close to that capacity, and multi-GPU setups add communication overhead, topology constraints, and runaway costs.
With memory prices continuing to climb, building 600GB or more from conventional DDR4/DDR5 modules is extremely expensive. Motherboard slot counts, per-module capacity limits, power delivery, and cooling all become hard constraints. This has brought renewed attention to an alternative: using persistent memory on server platforms as a second memory pool to hold model weights at a fraction of the cost of the same capacity in DRAM.
This is not a casual “the GPU is too small, so let’s make do with system memory” trick. It is an engineering trade-off with clear boundaries: trading a large drop in inference throughput for an extreme capacity-cost advantage.
2. Capacity First: Why Persistent Memory Fits Model Weights
Persistent memory is a storage tier between DRAM and flash. It supports byte addressing, sits directly on the memory bus, offers high capacity density and low cost per unit of capacity, and retains data after power loss. There are two typical ways to use it:
- Memory Mode: Transparent to the layer above. Persistent memory acts as an extension of DRAM, doubling capacity while performance is limited by media latency.
- App Direct Mode: Persistent memory is mapped as a separate persistent region, and the operating system and runtime can explicitly control whether data resides in DRAM or persistent memory.
App Direct mode is more valuable for very large models. Weights are read-only, loaded once, and accessed in a relatively predictable pattern, which makes them well suited to a persistent memory region. High-frequency read/write structures such as the KV cache, temporary activations, and sampling buffers should stay in DRAM. This tiering of “weights down, hot data up” is what makes the whole approach work.
A simplified illustration of the tiering (pseudocode that only expresses the data placement strategy and does not target any specific framework API):
# Conceptual illustration: weights in the persistent memory region, hot data in DRAMweights = load_weights_to_pmem(path, region="pmem") # read-only, large, sequential/block accesskv_cache = alloc_in_dram(max_seq_len * layers * kv_dim) # high-frequency read/writefor token in stream:logits = forward(weights, kv_cache, token) # weights streamed from persistent memorykv_cache.append(token)
3. Hardware: One Multi-Core CPU Plus Large-Capacity Persistent Memory
The typical hardware configuration for this approach is not complicated:
- Processor: A single multi-core server-grade CPU (for example, a 40-core-class third-generation Xeon Scalable processor). Core count determines the number of memory channels and the capacity for concurrent reads.
- Memory side: Multiple large-capacity persistent memory modules (128GB to 512GB per module), with all memory channels populated to maximize bandwidth.
- Motherboard and power: A server motherboard that supports persistent memory, with power headroom reserved for full-load consumption.
- Cooling: The most easily overlooked and most fatal component, covered separately below.
On the software side, the setup relies on runtimes and quantized inference frameworks that support persistent memory, exposing the weight region to compute cores through memory mapping and streaming it on demand.
4. The Biggest Pitfall: Heat and Motherboard Melting Risk
Persistent memory draws substantial power at full load and generates a remarkable amount of heat. Practitioners repeatedly stress that active cooling is a hard requirement and cannot be skipped. In tested deployments, two high-speed turbine fans were pointed directly at the memory module area. Without that forced cooling, the heat released by persistent memory is enough to cook adjacent ordinary memory modules and, in severe cases, melt the motherboard slots outright.
At minimum, an engineering setup should include:
- A dedicated airflow path for the memory area to avoid recirculating hot air;
- Temperature monitoring linked to throttling or load-reduction policies, with threshold alerts;
- No extended full-load operation in an open test-bench configuration;
- Physical separation between ordinary memory modules and persistent memory to avoid thermal coupling.
5. Inference Performance: Slow, but With Clear Use Cases
The measured numbers are straightforward: about 0.85 tokens per second at 1-bit quantization, dropping to about 0.75 tokens per second at 3-bit quantization. Generating a 50,000-token task can take more than 13 hours.
These figures point to two conclusions:
- Real-time conversation is not viable: Interactive scenarios have requirements for both first-token latency and throughput, and this approach does not match them at all.
- Offline batch processing is viable: Tasks that do not depend on timeliness, such as overnight batch jobs, long-document summarization, data-labeling preprocessing, offline evaluation, and corpus cleaning, can be completed at very low cost by trading compute for time.
The cost logic is also clear: at the same capacity, used persistent memory often costs only a fraction of ordinary memory. Turning “can’t afford the VRAM” into “wait a few more hours” is a practical solution for budget-sensitive teams whose tasks can run asynchronously.
6. Engineering Recommendations
- Calculate capacity first:
weight bytes = parameter count × bytes per parameter. At 1-bit quantization, that is roughly 0.125 bytes per parameter, or about 350GB for 2.8 trillion parameters. Adding runtime overhead and caches, reserving more than 600GB is reasonable. - Tier strictly: Push read-only weights down and keep hot data in DRAM. Do not place the KV cache on the slow media.
- Treat cooling as a functional requirement: Airflow paths, fan speeds, and temperature alerts belong in the deployment checklist.
- Orchestrate tasks asynchronously: Use a message or task queue to handle long-running jobs, pair it with object storage for inputs and outputs, and track progress and temperature with monitoring and alerts.
- Define the non-applicable scenarios: Do not use this approach for online services, low-latency interaction, or high-concurrency inference.
7. The Cloud Equivalent
If you would rather not build a cluster with heavy hardware, aggressive cooling, and slow inference, the cloud can replicate it by combining general-purpose capabilities: a container platform to host the inference runtime, object storage for models and datasets, a message queue for task decoupling, log and monitoring services for observability, and on-demand elastic scaling to control cost. Baidu AI Cloud offers corresponding product categories for these general-purpose capabilities, and you can choose an online or offline form based on your latency requirements.
8. Conclusion
Running trillion-parameter models on persistent memory is essentially an exchange between capacity cost and time cost. It is not for everyone, but in scenarios where VRAM is expensive and tasks can run asynchronously, it is a proven low-cost path. What is worth remembering is not the 0.85 tokens per second, but two engineering conclusions: capacity can be pushed down, hot data must stay up; cooling is not optional but a hard prerequisite.
