Persistent Memory Instead of VRAM: Running Trillion-Parameter LLMs on Pure CPU
This article explains how to run trillion-parameter LLM inference on a CPU-only server by using persistent memory as the capacity layer. It covers the memory wall behind trillion-parameter models, hardware setup and hot/warm/cold memory tiering, App Direct mode and data placement, quantization and capacity estimates, real throughput and suitable workloads, cooling and engineering risks, and a practical deployment checklist. The approach is slow but cost-controlled, making it fit for offline batch processing rather than online serving.
1. The Memory Wall Behind Trillion-Parameter Models
Once models reach the trillion-parameter scale, the first barrier to inference is no longer compute but capacity. Even with extremely aggressive quantization, weights and runtime caches still require hundreds of gigabytes of usable memory. Stacking traditional memory modules to reach that capacity is prohibitively expensive during periods of rising memory prices, while the VRAM capacity and per-unit cost of high-end accelerators impose a hard constraint as well.
The industry approach is to decouple capacity from bandwidth: use large-capacity, low-cost, non-volatile persistent memory as the capacity layer, and reserve the limited high-speed VRAM or DRAM for hot data. This makes a CPU-only offline inference path, with weights hosted on persistent memory, feasible.
2. Hardware Setup and Memory Tiering
A typical configuration includes a multi-core server-grade processor (around 40 cores), several large-capacity persistent memory modules (128GB to 512GB per module), and a small amount of traditional memory as a volatile workspace. Persistent memory is interconnected at the same frequency as the processor’s memory controller, capacity can be scaled on demand, and the cost per unit of capacity is significantly lower than that of traditional memory of the same size.
Recommended tiering principles:
- Hot tier: the few tensors required by the current attention step and active KV cache shards, placed in traditional memory.
- Warm tier: weight blocks streamed in layer by layer, placed in persistent memory.
- Cold tier: intermediate results that can be recomputed, not resident in memory.
Illustrative data placement logic (pseudocode, expressing only the tiering idea):
# Weights are chunked by layer; block location is decided by the placement policyplacement = {"hot": dram, "warm": pmem, "cold": None}for layer in model.layers:w = placement["warm"].load(layer.weight_block) # Read blocks from persistent memoryx = forward_layer(x, w) # Computation is done on the CPU sideplacement["cold"].drop(layer.activation) # Intermediate results are not kept resident
3. App Direct Mode and Data Placement
Persistent memory is typically used in two ways. Memory Mode transparently treats persistent memory as an extension of volatile memory, which is invisible to software but offers weak control. App Direct mode maps persistent memory as an independent persistent address region, letting the application explicitly decide which tier tensors reside in.
For inference, the value of App Direct lies in control: residency can be decided at layer or tensor granularity, preventing hot data from being swapped out, and read-only weights can be made into reusable mapped regions to reduce repeated loading. The cost is that the application must be aware of NUMA topology and address space, which increases engineering complexity and usually requires coordinated changes to the memory allocator and the inference runtime.
4. Quantization and Capacity Estimation
Capacity demand is mainly determined by “parameter count × bytes per parameter + runtime overhead.” For trillion-scale parameters:
- 1-bit quantization: about 1 trillion × 0.125 bytes ≈ 125GB of weights; with runtime and caches, the total can still be kept within hundreds of gigabytes.
- 3-bit quantization: about 1 trillion × 0.375 bytes ≈ 375GB of weights, with capacity and bandwidth pressure rising together.
Lower bit widths save capacity but increase precision loss and dequantization overhead; higher bit widths reduce speed. Selection should use the minimum acceptable precision for the task as the constraint and determine the quantization scheme in reverse.
5. Performance and Applicability Boundaries
CPU-only inference with persistent memory typically runs at less than one token per second: about 0.85 tokens/sec at 1-bit and about 0.75 tokens/sec at 3-bit. A task generating 50,000 tokens takes more than ten hours. This metric is meaningless for real-time conversation, but for “no-rush” tasks such as overnight offline batch processing, data labeling, document summarization and archiving, and evaluation regression, it still offers a clear cost advantage.
Further engineering optimizations are possible: layer-wise pipelined prefetching, mapping read-only weights as shared regions, limiting concurrency to 1 and reusing the same KV cache, and slicing long tasks into checkpoint-resumable jobs.
6. Cooling and Engineering Risks (Not Optional)
High-capacity persistent memory draws substantial power and generates considerable heat at full load, and that heat conducts to adjacent memory slots. In practice, active cooling is required: a high-power turbine fan blowing directly onto the memory area is a common approach. Insufficient cooling can overheat and damage neighboring ordinary memory modules, and in severe cases damage slots and the motherboard. The deployment checklist should therefore specify: airflow design, temperature monitoring and alerts, a per-machine capacity limit, and an acceptance order of “stress-test cooling before loading the model.”
7. Deployment Checklist
- First estimate capacity and precision to determine the quantization bit width and target throughput.
- Choose App Direct mode and plan the tiered placement strategy.
- Design active cooling and temperature alerts, and run long-duration full-load stress tests.
- Position the system for offline batch processing, with a task queue, logging service, and monitoring alerts.
- If elasticity and operations-free deployment are needed, evaluate a combination of a general-purpose cloud container platform, object storage, and a message queue to decouple model files from tasks and spin up compute on demand.
Conclusion: When VRAM and memory costs become the bottleneck, using persistent memory as the capacity layer and pure CPU for offline inference is a cost-controlled engineering path. Its price is extremely slow speed and demanding cooling requirements, making it suitable for “slow but cheap” batch processing rather than online services.
