Running Trillion-Parameter LLMs Without GPUs: CPU and Persistent Memory Inference

    This article examines a GPU-free inference approach for trillion-parameter language models using persistent memory and multi-core CPUs. It covers the memory-capacity bottleneck, persistent memory operating modes, quantization choices, the software stack, measured token rates, performance bottlenecks, engineering tuning suggestions, and the scenarios where this approach is practical.

    Running Trillion-Parameter LLMs Without GPUs: CPU and Persistent Memory Inference

    1. Background: The “VRAM Wall” in LLM Inference

    In recent years, the parameter scale of open-source large language models has climbed rapidly, moving from tens of billions of parameters into the trillion-parameter era. This jump creates a very practical engineering problem: model weights no longer fit in VRAM.

    Take a model with 2.8 trillion parameters as an example. Even with the most aggressive 1-bit quantization, the weights alone require about 350 GB of storage. With common 4-bit quantization, they require more than 1.4 TB. Consumer GPUs typically have only 16 GB to 24 GB of VRAM per card, and even high-end data-center accelerators mostly remain around 80 GB per card. Running such a model purely on GPUs often requires building a multi-GPU parallel cluster, and both hardware procurement cost and operational complexity put this out of reach for individual developers and small teams.

    This leads to a counterintuitive but noteworthy idea: if VRAM cannot hold the model, can inference run without GPUs at all, using large amounts of memory—including non-volatile persistent memory—together with multi-core CPUs? A developer in an online technical community recently completed an instructive home-lab experiment: on a server without a discrete GPU, using a discontinued first-generation non-volatile persistent memory product, the developer successfully ran inference for a 2.8-trillion-parameter model. This article breaks down the technical principles and engineering trade-offs of that approach.

    2. Core Hardware: What Persistent Memory Is and Why It Can Replace VRAM

    2.1 The Technical Role of Persistent Memory

    This type of non-volatile persistent memory is a storage medium positioned between traditional DRAM and solid-state drives. Physically, it looks much like a server memory module and plugs directly into the motherboard’s memory slots. A single module can provide 128 GB, 256 GB, or even 512 GB, far exceeding the per-module capacity limit of ordinary DRAM. With multiple modules installed, a system can easily obtain several terabytes of “memory space”—exactly what is needed to hold a trillion-parameter model.

    Its core characteristics include:

    • Byte-addressable: the CPU can read and write it directly byte by byte, much like ordinary memory, rather than accessing it in blocks (pages) as with an SSD;
    • Non-volatile: data is retained after power loss, so model weights can be loaded once and remain resident for a long time;
    • High capacity and low cost: cost per unit capacity is significantly lower than DRAM and closer to SSD pricing.

    The trade-offs are also clear: read latency is higher than DRAM—several times higher—and write bandwidth and endurance are limited. This means it is better suited to read-intensive, sequential-access workloads—and LLM inference is exactly a typical “read-only weights, sequential traversal” scenario, making it a natural fit.

    2.2 Choosing Between Two Operating Modes

    Persistent memory usually supports two typical operating modes:

    1. Memory Mode: DRAM acts as a cache layer for persistent memory, the total memory capacity seen by the operating system equals the persistent memory capacity, and hot/cold data scheduling is handled automatically by hardware;
    2. App Direct Mode: DRAM and persistent memory appear as two independent address spaces at the software level, and applications can explicitly decide which data goes where.

    The experiment used App Direct mode. The advantage of this mode is controllability: developers can place model weights in persistent memory while keeping hot data such as the KV cache and intermediate activations in DRAM, enabling fine-grained memory tiering.

    3. Software Stack and Quantization Strategy

    3.1 Choosing an Inference Engine

    For running large models in a pure CPU environment, the common industry approach is to use lightweight inference frameworks implemented in C/C++. These frameworks are deeply optimized for CPU instruction sets such as AVX2, AVX-512, and AMX, support multiple quantization formats, and can flexibly specify how model shards are mapped across different storage media. Combined with the operating system’s memory-mapping (mmap) mechanism, weight files can be read from persistent memory on demand rather than loading everything into DRAM at once.

    3.2 Quantization: Fitting 2.8 Trillion Parameters into Memory

    Quantization is the prerequisite for making this approach viable. Parameter scale and quantization bit width directly determine memory usage:

    Quantization bit width Estimated space required for 2.8 trillion parameters
    FP16 (16-bit) About 5.6 TB
    8-bit About 2.8 TB
    3-bit About 1.05 TB
    1-bit About 350 GB

    As the table shows, only with 1-bit or extremely low-bit quantization can the model possibly fit entirely into a few 512 GB persistent memory modules. The idea behind 1-bit quantization is to compress weights to values close to ternary or even binary, while using group scaling factors to retain as much information as possible. Although precision is lossy, for very large models the actual performance after low-bit quantization is often better than that of smaller models compressed to the same degree—this is the theoretical basis for the “large model + aggressive quantization” route.

    4. Measured Performance and Bottleneck Analysis

    The experimental data candidly reveals the current state of this approach: it runs, but it is very slow.

    • With 1-bit quantization and weights read directly from persistent memory, the initial generation speed was about 0.85 tokens per second;
    • After disabling Direct Access (DAX) and letting the operating system use DRAM as file page cache, frequently used data could be cached and accelerated, raising the speed to 1.5 tokens per second;
    • With 3-bit quantization—where the weight volume is larger and more bytes must be read—the speed dropped to 0.75 tokens per second, and generating 50,000 tokens took about 18.5 hours.

    These numbers support several key conclusions:

    First, the bottleneck is memory bandwidth, not compute. Each autoregressive generation step must traverse all weights once, so the amount of computation is relatively fixed. What really determines speed is “how many bytes per second can be read from the storage medium.” Persistent memory has lower bandwidth and higher latency than DRAM, and is far weaker than VRAM, so token speed is firmly capped.

    Second, the DRAM caching strategy is critical. Disabling DAX and using page cache nearly doubled the speed. This shows that even a limited amount of DRAM can significantly offset the latency disadvantage of persistent memory, as long as the cache hits frequently accessed weight shards—for example, attention-layer parameters that are read repeatedly.

    Third, quantization bit width involves a speed-quality trade-off. Lower bit width means less data to move per step and higher throughput, but excessively low bit width hurts generation quality. Although 1.5 tokens per second is only suitable for offline batch processing, asynchronous generation, and similar scenarios, it is already “the lowest-cost entry point affordable on personal hardware.”

    5. Engineering Tuning Suggestions

    If you want to reproduce or improve this approach in a similar environment, the following practices are worth considering:

    1. Configure NUMA affinity properly: on multi-socket servers, bind inference threads to the CPU socket that owns the target memory node to avoid latency amplification from cross-node access;
    2. Use mmap and readahead strategies: read weights layer by layer during inference, enable the filesystem’s readahead mechanism, and pipeline I/O with computation;
    3. Place data in tiers: keep the KV cache, sampling temperature parameters, and intermediate tensors in DRAM; place embeddings and the main body of weights in persistent memory; when available, use high-speed NVMe SSD as a second-level spillover tier;
    4. Prefer MoE architecture models: mixture-of-experts models activate only some experts at each step, so the weights actually involved in computation are far smaller than the total parameter count, making them much friendlier to memory bandwidth;
    5. Amortize cost with batch inference: for offline tasks, group multiple requests into a batch so weights are read once and serve multiple requests, greatly improving effective throughput.

    6. Conclusion and Outlook

    The significance of this experiment is not the number “1.5 tokens per second” itself, but the fact that it validates an overlooked technical path: when VRAM capacity becomes the biggest barrier to LLM adoption, a combination of non-volatile memory and multi-core CPUs can serve as a low-cost fallback. It is suitable for scenarios that are not sensitive to real-time performance—overnight batch generation, offline data labeling and preprocessing, model behavior research, and so on.

    Of course, for enterprise scenarios that require stable throughput and production-grade SLAs, a more realistic choice remains elastic compute and managed inference services provided by cloud platforms. Baidu AI Cloud, for example, offers general cloud capabilities for LLM inference and training—such as GPU compute instances, object storage, container platforms, and monitoring/alerting—that can scale on demand. This can spare teams the high upfront investment of purchasing hardware and building clusters, allowing them to focus on business logic itself. Low-cost local experimentation and cloud-based production deployment are not contradictory: the former lowers the barrier to exploration, while the latter ensures deployment efficiency. Combining the two is the complete picture of LLM engineering.