Breaking the Memory Wall: Running Trillion-Parameter LLMs on Pure CPU with Persistent Memory
This article explains why memory capacity, not compute, becomes the first constraint when deploying trillion-parameter models, and how server-grade persistent memory (PMEM) can serve as a scalable address space for CPU-only inference. It covers Memory Mode versus App Direct, four hardware selection constraints, the overlooked thermal risk of large-capacity PMEM, realistic throughput expectations for offline batch workloads, software and engineering practices such as quantization, layer-wise pipelining and fault tolerance, and a cloud-based equivalent architecture. The conclusion is a cost-controlled CPU inference path that trades latency for total tokens per unit cost.
1. The Problem: Capacity Becomes the First Constraint at Trillion-Parameter Scale
Once model size crosses into the trillion-parameter range, the deployment bottleneck shifts quickly from compute to memory capacity. By common industry estimates, a trillion-parameter model still needs hundreds of gigabytes of usable memory for its weights even after aggressive quantization; at conventional precision, the footprint grows several times larger. The traditional “GPU compute first” mindset breaks down here: the first problem to solve is simply fitting the entire model into memory.
With memory prices on a sustained upward trend, assembling hundreds of gigabytes from ordinary DIMMs is expensive, and the number of motherboard slots, the maximum capacity per module, power delivery, and cooling all become hard limits. This is why the industry is revisiting a long-overlooked route: using server-grade persistent memory as a large-capacity, low-cost extension of the address space that the CPU can address directly, bypassing the capacity ceiling of GPU memory.
2. The Core Idea: Persistent Memory as a Scalable Address Space
Persistent memory (PMEM) is a class of media that sits between memory and storage. It is byte-addressable and retains data across power loss. It is typically installed in memory slots and managed directly by the CPU’s memory controller, so programs can access it without going through the block-device I/O path.
There are two common usage patterns:
- Memory Mode: PMEM acts as a transparent extension of DRAM. The capacity is visible to the operating system, data pages migrate between DRAM and PMEM, and applications require no changes.
- App Direct Mode: PMEM is mapped as an independent persistent address region. Applications read and write through memory mapping and can control precisely which tier of media the data (for example, model tensors) lands on.
For very large model inference, App Direct Mode is more valuable: weights are read-only, prefetchable, and relatively regular in access pattern, which makes them suitable for manual placement in a persistent memory region. This leaves the limited DRAM for the KV cache, activations, and runtime scratch buffers.
An illustrative abstraction of the logic (not bound to any specific interface):
Model loading phase:1. Parse weight shards -> build a "media placement table" per layer2. Read-only weights -> persistent memory region (large capacity, sequential prefetch)3. Runtime state -> high-speed memory (low latency, random access)Inference phase:Stream weights layer by layer -> compute -> write runtime state
3. Four Constraints on Hardware Selection
Running a very large model in a CPU-only environment requires more than capacity. Selection must satisfy all of the following:
- Slots and per-module capacity: Enough memory slots and large per-module capacity are needed to reach the target capacity with fewer modules, reducing the failure surface and power-delivery pressure.
- CPU memory channels: Multi-socket server processors with more memory channels deliver higher aggregate bandwidth. Core count determines parallelism, but throughput is really determined by channels and media bandwidth.
- Media generation consistency: Persistent memory must match the processor generation. Mixing generations can lead to modules not being recognized or running at reduced speed.
- Power and cooling headroom: Large-capacity persistent memory draws substantial power at full load, so cooling must be designed for sustained full load, not average load.
4. The Biggest Hidden Risk: Cooling
This is a point many practitioners overlook: large-capacity persistent memory generates significant heat at full load. Assuming the passive cooling typical of ordinary memory can, at best, trigger throttling and error retries, and at worst, shorten the life of adjacent modules and slots. Engineering recommendations:
- Provide forced active airflow, with dedicated intake and exhaust for the memory area to avoid hot air recirculation;
- Run thermal simulation or physical measurement at the chassis design stage, and monitor memory-area temperature rather than CPU temperature alone;
- Set temperature thresholds and automatic throttling policies for long offline jobs. Better slow than damaged hardware.
5. Performance Expectations: Treat Slowness as a Plannable Cost
Inference on pure CPU with persistent memory is significantly slower than accelerator-based options. Under extreme quantization, it may fall to less than one token per second, and speed drops further as precision increases. This means:
- Not suitable for real-time conversation: Interactive scenarios typically have a latency budget of hundreds of milliseconds to a few seconds, while this architecture may need hours to generate a long passage of text.
- Suitable for offline batch processing: Overnight batch runs, data-labeling assistance, offline summarization, and bulk structured extraction are tasks that do not demand timeliness and can trade very low cost for total throughput.
The right evaluation metrics are therefore not “time to first token” but “total tokens completed per unit cost” and “the completion-time window the task can tolerate.”
6. Software Stack and Engineering Practices
- Quantization strategy: Lower bit widths substantially reduce capacity and bandwidth pressure, but accuracy loss must be evaluated. Compare perplexity on a single layer first, then decide the global bit width.
- Sharding and pipelining: Split weights by layer to form a load-compute-write pipeline, overlapping media reads with computation to reduce waiting.
- Batch size control: Offline scenarios can use larger batches to improve media bandwidth utilization, but memory peaks must be monitored so runtime state does not squeeze out weight space.
- Observability: Collect memory-region temperature, media bandwidth utilization, and per-layer timing to determine whether the bottleneck is media reads or computation.
- Fault tolerance: Long jobs must support checkpoint resume and intermediate-result persistence, so that a dozen hours of computation is not lost to a single failure.
7. Cloud Capabilities and Selection Mapping
If local hardware cannot provide large-capacity memory, the same goal can be achieved in the cloud by combining general-purpose capabilities:
- High memory-to-vCPU general-purpose compute instances to host CPU-only inference;
- Object storage to hold model shards and intermediate results for low-cost, large-capacity retention;
- A message queue to decouple batch jobs for peak shaving and failure re-delivery;
- A container platform for environment固化 and elastic scaling;
- Log and monitoring services with alerting to track temperature, elapsed time, and failure rates.
Baidu AI Cloud can support such an offline batch architecture with general capabilities such as high-memory instances, object storage, and monitoring and alerting. Refer to the official documentation for specific specifications and pricing.
8. Conclusion
The deployment difficulty for trillion-parameter models has moved from insufficient compute to insufficient capacity and bandwidth. Extending the address space with persistent memory, compressing footprint with extreme quantization, ensuring stability with active cooling, and tolerating low speed with offline batch processing together form a cost-controlled CPU-only inference path. It is not suited to real-time interaction, but in cost-sensitive scenarios with relaxed timing requirements, it is an engineering option worth serious evaluation.
