Trillion-Parameter CPU-Only Inference: Cost Reduction and Cooling Practices with Large Memory

    Trillion-parameter model inference is primarily bottlenecked by memory capacity rather than raw compute power. This article explores a CPU-only inference architecture that utilizes large-capacity non-volatile persistent memory to store model weights, achieving significant cost savings for offline workloads. It covers hardware and software designs for tiered memory placement, the impact of quantization, performance boundaries, and the critical but often underestimated aspects of thermal management and hardware reliability. Finally, it provides a comprehensive deployment checklist and best practices for implementing this approach for offline batch processing.

    1. Background: Why CPU-Only Solutions Are Back in Focus

    The barrier to inference for trillion-parameter models is first memory capacity, not compute power. Even after high-ratio compression and quantization, the combined footprint of weights, quantization metadata, runtime caches, activations, and KV Cache can still require hundreds of gigabytes to roughly 0.6TB of available memory. Stacking this entirely with conventional volatile memory is prohibitively expensive, while relying on high-end accelerators often hits the hard constraint of VRAM capacity.

    Consequently, a “trade bandwidth for capacity, trade time for cost” approach has begun to gain traction among technical practitioners: utilizing large-capacity non-volatile persistent memory modules to store weights, running inference purely on CPUs, and keeping hot data and runtime caches in conventional DRAM. The core value here is not high performance, but low cost per unit of capacity, the ability to host ultra-large models, and suitability for latency-insensitive offline tasks.

    The technical essence of this approach is straightforward: the model decoding phase is a classic memory-bandwidth-bound workload, requiring a massive read of weights for every token generated. While persistent memory offers a clear capacity advantage, its bandwidth and latency are generally inferior to conventional DRAM, which leads to a significant drop in system throughput. It is well-suited for overnight batch processing, offline summarization, data cleaning, and model evaluation, but not for real-time conversational AI or high-concurrency online services.

    2. Architecture: Tiered Placement of “Cold Weights” and “Hot Data”

    A practical CPU-only LLM inference system requires a tiered design across both hardware and software layers.

    On the hardware side, this typically involves a server-grade processor with dozens of cores, paired with large-capacity persistent memory modules, while retaining a certain amount of conventional DRAM as a hot data cache. Because persistent memory draws significant power and generates considerable heat under full load, it is imperative to configure high-static-pressure active cooling, proper airflow channels, and temperature monitoring. While modules with capacities reaching hundreds of gigabytes per stick reduce the number of populated slots, they also introduce risks of single points of failure and localized hotspots. These must be managed through redundancy, threshold-based alerts, and thermal throttling protection.

    On the software side, the key is to manage model weights, KV Cache, activations, and temporary buffers separately:

    • Model weights are placed in the directly mapped region of the persistent memory, utilizing per-layer or per-block memory mapping to avoid loading everything into conventional DRAM at once.
    • KV Cache and activations are kept in conventional DRAM to minimize random access on the persistent memory.
    • Weight reads are sequentialized and prefetched to maximize the use of continuous bandwidth.
    • NUMA binding, huge pages, and thread affinity are utilized to reduce cross-node memory accesses.
    • Offline tasks are scheduled via queues to prevent multiple jobs from simultaneously contending for memory bandwidth.

    Below is a pseudo-configuration illustrating the deployment concept. It does not correspond to any specific product interface:

    1. # Pseudo configuration: illustrating tiered placement and protection strategies
    2. model:
    3. quant: int1 # or int3, requires inference operator support
    4. weight_backend: persistent_mem_mmap
    5. max_parallel: 40
    6. memory:
    7. hot_cache: dram
    8. weight_region: persistent_direct_map
    9. huge_page: true
    10. numa_policy: interleave
    11. runtime:
    12. max_batch: 1
    13. prefill_chunk: 256
    14. kv_cache: dram
    15. guard:
    16. mem_temp_limit_c: 85
    17. throttle_on_high_temp: true

    3. Quantization and Performance Boundaries: What Sub-1 Token/s Means

    To fit a trillion-parameter model into a few hundred gigabytes of memory, quantization is essentially mandatory. 1-bit or 3-bit quantization significantly reduces the weight footprint but introduces de-quantization overhead, insufficient operator support, and precision loss. With ultra-low-bit quantization, if dedicated operators are missing at runtime, the CPU may spend a large amount of time unpacking and converting formats, meaning actual throughput might not scale linearly with the reduced model size.

    Based on public practices, inference speeds for such systems typically hover in the sub-1 token/s range: around 0.8 token/s for 1-bit quantization, and potentially lower for 3-bit. Generating tens of thousands of tokens might take over a dozen hours. While this is meaningless for real-time chat, it can be highly cost-effective for latency-insensitive offline batch processing.

    The focus of performance optimization is not minimizing single-token latency, but rather maximizing the throughput of the entire batch:

    1. Control batch size. Pure CPU memory bandwidth is limited; an oversized batch amplifies cache contention. For offline scenarios, prioritize single-request serial execution or small batches.
    2. Chunked prefill. The prefill phase for long contexts can be executed in chunks to reduce peak memory usage.
    3. Weight memory mapping. Load weights by layer to avoid copying the entire weight set into conventional DRAM.
    4. NUMA affinity. Keep compute threads and the memory they access on the same node to reduce cross-node bandwidth overhead.
    5. Monitor bandwidth utilization. If bandwidth is already saturated, adding more threads yields diminishing returns; efforts should shift to reducing unnecessary read/write operations.

    4. Cooling and Reliability: The Most Underestimated Risks

    Large-capacity persistent memory modules consume considerable power under heavy loads, leading to concentrated heat generation. Without active cooling, high temperatures not only affect their own lifespan and stability but can also bake adjacent conventional memory modules, potentially damaging the motherboard slots in severe cases. Therefore, active cooling is a hard requirement that cannot be skipped.

    It is recommended to establish protections in the following areas:

    • Configure independent airflow channels and high-static-pressure fans for the persistent memory zones.
    • Place temperature sensors near the modules and set up tiered alerts and frequency-reduction thresholds.
    • Monitor the temperature of adjacent memory and motherboard slots.
    • Conduct regular full-load stress tests, observing temperature curves and error-correction (ECC) counts.
    • Verify compatibility, firmware, lifespan, and mixed-insertion stability for decommissioned or second-hand modules.
    • Clearly define power-fail consistency and recovery strategies for data involving persistent semantics.

    Monitoring metrics should include at least: memory temperature, power consumption, ECC counts, bandwidth utilization, NUMA hit rate, inference queue wait time, and failure retry counts. Any temperature anomaly should trigger load reduction or shutdown rather than continuing to “hard run.”

    5. Cost Model and Use Cases

    The cost of this solution is not just the memory modules; it includes the server-grade CPU, motherboard, cooling, power supply, rack space, and operations and maintenance (O&M) labor. Decommissioned or second-hand large-capacity persistent memory may cost only a fraction of conventional memory per gigabyte, but it carries risks regarding compatibility, lifespan, and warranty. Enterprises should factor failure rates and spare parts costs into the Total Cost of Ownership (TCO) rather than just looking at the procurement unit price.

    Applicable scenarios include: offline batch inference, low-frequency model evaluation, data cleaning, offline long-document summarization, and non-real-time agent tasks. Non-applicable scenarios include: online low-latency chat, high-concurrency APIs, and real-time long-context interactions. For teams requiring online elastic scaling, similar models can be deployed to cloud compute instances with large memory and high bandwidth—such as memory-optimized general instances on Baidu AI Cloud—to gain elastic scaling and managed O&M. Single-node persistent memory is better suited as an offline batch processing node.

    6. Deployment Checklist and Best Practices

    Before deployment, it is advisable to verify the following checklist item by item:

    1. Capacity estimation: Weight size × quantization factor + KV Cache + activations + temporary buffers + a 20%–50% margin.
    2. Quantization validation: Evaluate precision loss using representative samples and confirm that inference operators support the target bit-width.
    3. Memory tiering: Place weights in the persistent memory mapped region and hot data in conventional DRAM to avoid frequent page swapping.
    4. NUMA and huge pages: Bind threads to memory nodes and enable huge pages to reduce page table overhead.
    5. Cooling design: Independent airflow channels, temperature sensors, alerting, and throttling protection.
    6. Grayscale stress testing: Validate with a smaller model first, then gradually scale up parameters, logging temperature, bandwidth, and throughput.
    7. Task scheduling: Queue offline tasks and limit concurrency to avoid multi-task contention for memory bandwidth.
    8. Reliability contingency plans: Spare parts, recovery procedures, power-fail consistency, and data verification.

    Conclusion: Running trillion-parameter models on pure CPUs with large-capacity persistent memory is a technical solution with clear boundaries. It trades extremely low per-capacity cost for runnability, but the cost is low throughput, demanding cooling requirements, and complex O&M. Positioning it as offline batch processing infrastructure rather than an online inference service is the only way to leverage its cost-effectiveness. Ignoring cooling and reliability will likely offset the memory cost savings with hardware failures and downtime losses.