CPU-Only Trillion-Parameter Model Inference with Persistent Memory: A Practical Guide
Learn how to assess, size, and deploy a persistent-memory system for offline CPU-only inference with trillion-parameter models. This guide covers capacity planning, hardware compatibility, Linux deployment, memory placement, cooling, and the limitations of reported performance figures.
1. Decide Whether This Approach Fits Your Workload
For this CPU-only approach, the first constraint is usually memory capacity rather than compute. If the model weights fit in memory and the workload can tolerate slow output, the setup may be viable. For low-latency interactive chat, use a GPU cluster or a cloud inference service instead.
A quick suitability check:
- Suitable: Offline batch processing, data cleaning, synthetic text generation, model behavior validation, and quantization research.
- Suitable: Budget-constrained workloads that can run overnight or over a weekend.
- Not suitable: Real-time chat, low-latency APIs, or high-concurrency production services.
- Not suitable: Production environments that cannot tolerate hardware failures or require long-term manufacturer warranty coverage.
2. Estimate Capacity: Weights First, Then Overhead
Estimate model weight storage with:
Weight storage (GB) ≈ Parameters (billions) × Bits per parameter ÷ 8
Using this formula, a one-trillion-parameter model—1,000 billion parameters—requires approximately 125 GB at 1-bit quantization or 375 GB at 3-bit quantization.
Total capacity must also cover the KV cache, activation buffers, and inference framework overhead. The KV cache can be estimated as:
KV cache (bytes) ≈ 2 × Number of layers × Number of KV heads× Head dimension × Context length × Bytes per element
Actual model files are often larger than the theoretical weight size. Embedding layers, output layers, and some attention layers may retain higher precision, while quantization formats also store scaling parameters.
Use the actual quantized file size as your baseline. Reserve at least 20% additional capacity, and measure memory usage with the real model files before deployment.
3. Choose Hardware and Compare Costs
Persistent memory, or PMem, is a class of storage media positioned between DRAM and SSDs. CPUs can access it directly at byte granularity, and individual modules typically offer more capacity than conventional DRAM modules. Intel Optane persistent memory has been discontinued, so available units are largely used hardware or remaining inventory.
Check at least the following before purchasing:
- Whether the CPU generation and PMem generation are compatible. Use modules from the same series within a system rather than mixing series.
- The number of PMem slots and maximum module capacity supported by the motherboard.
- Module operating-temperature specifications and power consumption.
- Availability of the required management tools and firmware versions.
Do not estimate costs from general impressions. Record the supplier, purchase date, unit price, and capacity, then calculate the price per GB and compare it with DRAM prices at the same time.
Used hardware often lacks an official warranty, so run compatibility and stability tests after installation. If the cost difference is small, conventional DRAM or a simpler setup may be a better choice.
4. Deploy on Linux
The following procedure assumes Linux. Record the kernel, ndctl, ipmctl, and inference framework versions in your deployment documentation.
Step 1: Verify Hardware Detection
ipmctl show -dimmipmctl show -memoryresources
Step 2: Configure App Direct Mode
Set persistent memory to App Direct mode in the BIOS, save the configuration, and reboot.
You can also configure the target mode with ipmctl. Changing the memory mode clears data on PMem, so confirm that nothing needs to be preserved before proceeding:
ipmctl create -goal PersistentMemoryType=AppDirect
Step 3: Create a Namespace and Mount a DAX-Enabled Filesystem
Use the region identifier reported by ndctl list -R. Formatting destroys data, so verify the target device before running these commands:
ndctl list -Rndctl create-namespace -m fsdax -r region0mkfs.ext4 /dev/pmem0mkdir -p /mnt/pmem0mount -o dax /dev/pmem0 /mnt/pmem0
After mounting, run mount | grep pmem0 and confirm that the mount options include dax.
Step 4: Place Weights on PMem and Check Loading Behavior
Copy the quantized model weights to the mount point and confirm that the inference framework loads them using mmap.
PMem commonly appears as a separate NUMA node with no CPUs. Model weights should remain on PMem through DAX mappings, while the KV cache and activation buffers should stay on DRAM nodes wherever possible.
If the inference framework supports separate memory-node settings for these allocations, use them. Otherwise, bind execution to the CPU node with numactl, then inspect actual memory placement in the next step.
numactl --cpunodebind=<CPU_NODE> <INFERENCE_PROGRAM> --model /mnt/pmem0/<MODEL_FILE> --threads <THREAD_COUNT>
Step 5: Inspect Actual Memory Placement
Once inference is running, check where memory is allocated and confirm that placement matches your expectations:
numastat -p $(pgrep -n <PROCESS_NAME>)
5. Manage Cooling and Monitor Temperatures
Persistent memory generates heat during sustained reads. Under full load, airflow design matters more than simply adding fans.
- Provide a dedicated airflow path through the memory area so that air passes over the PMem modules. Add directed cooling if necessary.
- Record sensor readings periodically during operation:
ipmctl show -sensor
- Follow the manufacturer’s operating-temperature limit and leave a safety margin. If temperatures approach that limit, or if you observe throttling, errors, or modules dropping offline, reduce the load and inspect airflow before continuing extended operation.
- Monitor neighboring DRAM modules and the surrounding motherboard area as well. Excessive temperatures can affect system stability. The risk of physical damage depends on the chassis layout, module model, and operating duration; it cannot be generalized.
6. Measure Performance and Estimate Runtime
The source material reports approximately 0.85 tokens per second at 1-bit quantization and 0.75 tokens per second at 3-bit quantization. However, it does not specify the CPU model, memory bandwidth, context length, batch size, or quantization tool. Treat these figures only as rough indications of performance, not as predictions for your own hardware.
Token generation speed is primarily constrained by memory bandwidth. Benchmark with a fixed prompt and fixed output length, and record:
- CPU model and core count.
- PMem and DRAM memory-channel configuration.
- Model and quantization format.
- Context length.
- Thread count.
- Whether the measurement includes model loading.
At 0.75–0.85 tokens per second, generating 50,000 tokens takes approximately 16–18.5 hours, excluding model loading and scheduling overhead. That runtime may be acceptable for an overnight offline workload.
