Running a Trillion-Parameter LLM on CPU Memory Without a GPU: A Practical Guide

    This article examines a home-lab experiment that loaded and ran a 2.8-trillion-parameter large language model on a CPU-only platform using discontinued server-grade persistent memory. It explains how persistent memory works, why capacity-first architectures become necessary at this scale, how quantization affects model size and speed, and which inference mechanisms matter. Readers will find performance comparisons, a reproducible evaluation checklist, and a transferable methodology for capacity planning and tuning.

    1. Background: A “No-GPU” Inference Experiment

    A developer recently shared a home-lab project in which a large language model with roughly 2.8 trillion parameters was loaded and run on a CPU-only platform with no discrete GPU, using discontinued server-grade persistent memory. The project was not intended to be production-ready. Instead, it tested a long-overlooked question: when a model is far larger than the memory of any single GPU, can a capacity-first memory system replace a bandwidth-first GPU memory system?

    From an engineering perspective, the value of this kind of experiment is not that it ran at all, but that it puts the bottlenecks of large-model inference back on the table: capacity, bandwidth, latency, quantization error, and software scheduling all constrain one another. Understanding how they interact is more useful than remembering a single benchmark result.

    2. Technical Foundation: What Persistent Memory Actually Is

    Persistent memory is a class of non-volatile storage media that sits between DRAM and flash. It comes in the form of memory modules inserted into server memory slots and is addressed directly by the CPU’s memory controller. As a result, it offers random access close to that of memory while retaining data after a power loss. A single module typically has a much larger capacity than a DRAM module of the same generation, making it suitable for datasets that are too large to fit but still accessed frequently.

    Two common operating modes on the platform have a major impact on inference:

    • App Direct mode: DRAM and persistent memory appear as two separate address spaces. Software must explicitly decide which tier holds each piece of data. The access path is the shortest, but the program must be aware of the tiering.
    • Memory Mode: Persistent memory is presented as a larger pool of “memory,” and DRAM is reduced to a hardware-managed cache. Programs need no modification, but whether a given access hits the cache significantly changes effective bandwidth.

    In the experiment, the developer first ran in direct-access mode and got an initial generation speed of about 0.85 tokens per second. Then DAX (direct access) was disabled so that frequently accessed data would automatically land in the DRAM cache, and the speed rose to about 1.50 tokens per second. This comparison shows that in capacity-constrained scenarios, cache hit rate often determines end-to-end throughput more than the peak bandwidth of the media itself.

    3. Why Trillion-Parameter Models Require a Capacity-First Architecture

    A 2.8-trillion-parameter model still occupies hundreds of gigabytes even with 1-bit quantization, and the footprint grows further with 3-bit quantization. No consumer or data-center GPU has enough memory to hold it, and splitting the model across multiple cards introduces communication overhead and complexity.

    That leaves three possible paths:

    1. Add more GPU memory: costs rise sharply and are limited by per-machine slot counts and topology;
    2. Use large-capacity memory with CPU inference: ample capacity and low cost, but limited bandwidth and parallelism;
    3. Hybrid tiering: hot data stays on high-bandwidth media, cold data stays on high-capacity media, and a framework or cache policy handles scheduling.

    The experiment chose the second path and borrowed part of the third. That is where its engineering significance lies: proving capacity feasibility at very low cost, then using a cache policy to recover some throughput.

    4. Quantization: Making “It Fits” the Starting Point

    Quantization is a general technique for mapping weights from high-precision floating point to a lower-bit representation. Fewer bits mean a smaller footprint and less memory pressure, but higher precision loss and higher dequantization overhead. In the experiment, 1-bit quantization combined with model compression produced the smallest footprint and a speed of about 0.85 tokens per second; 3-bit quantization produced a larger footprint and a speed of about 0.75 tokens per second, with 50,000 tokens taking roughly 18.5 hours to generate.

    A pair of rules of thumb can be used for capacity estimation:

    1. weight size ≈ parameter count × bytes per parameter
    2. available inference time ≈ target token count ÷ tokens per second

    The point is that quantization is not simply “lower is better.” The right choice sits at the intersection of the capacity limit, the quality limit, and the latency limit.

    5. Inference Framework and Execution Path

    The experiment ran a general open-source inference framework on a CPU backend. Its core mechanisms include:

    • Memory-mapped loading: avoids reading hundreds of gigabytes of weights into the process address space at once, paging them in on demand;
    • Tiered tensor placement: assigns attention and feed-forward layers to different media based on access frequency;
    • Batching and KV cache management: controls the extra memory that context length consumes;
    • Thread and NUMA affinity: a 40-core processor needs memory nodes bound to threads to reduce cross-node access.

    The following tiered-placement pseudocode is illustrative only and does not refer to any specific implementation:

    1. # Pseudocode: place weights by access frequency
    2. hot_layers = model.layers[:8] # frequently accessed, placed on high-bandwidth media
    3. cold_layers = model.layers[8:] # rarely accessed, placed on high-capacity media
    4. place(hot_layers, tier="fast")
    5. place(cold_layers, tier="large")
    6. enable_cache(target="fast", policy="lru")

    6. Performance Analysis: What 0.85 to 1.50 Tokens per Second Tells Us

    Going from 0.85 to 1.50 tokens per second is an improvement of about 76%, and it did not come from faster media. It came from better utilization of effective bandwidth. With DAX disabled, frequently accessed data was taken over by the hardware cache, cross-media accesses dropped, and latency-sensitive memory operations were absorbed. The practical lessons are:

    • optimize data locality before changing media;
    • track observable metrics such as cache hit rate and the share of cross-node accesses;
    • continuously collect throughput, memory watermarks, and temperature through monitoring, alerting, and logging services to close the tuning loop.

    7. A Reproducible Evaluation Checklist

    1. Define the capacity limit: is the quantized weight size below total available memory?
    2. Define the latency limit: what is the minimum acceptable tokens per second for the target scenario?
    3. Choose the mode: use direct access when the program must be tier-aware, and memory mode when zero code changes are required.
    4. Bind the topology: verify the processor’s memory nodes and slot layout.
    5. Establish a baseline: record load time, time to first token, and steady-state throughput.
    6. Tune one variable at a time to avoid ambiguous attribution.

    8. The Cloud Perspective: Turning the Experiment into an Operable Design

    To reproduce or productize this on the cloud, general-purpose capabilities can be combined: object storage to hold model weights and versions, a container platform to spin up CPU inference instances elastically, a message queue to smooth request spikes, and logging plus monitoring and alerting to build observability. General cloud infrastructure from Baidu AI Cloud can also host this kind of capacity-first inference architecture, helping teams find a balance between cost and throughput.

    9. Conclusion

    Running a trillion-parameter model without a GPU is essentially an open lesson on how to trade capacity against bandwidth. Its conclusion is plain but important: once model size exceeds the limit of a single GPU’s memory, persistent memory and tiered caching offer a low-cost viable path, while quantization, cache policy, and topology affinity are the variables that determine the actual experience. For developers, the real takeaway is not a particular speed number but a transferable methodology for capacity planning and tuning.