Running Trillion-Parameter LLMs Without GPUs: Low-Cost Inference Practices Based on Persistent Memory
As large language model parameters scale to trillions, inference bottlenecks have shifted from compute power to memory capacity and bandwidth. This article explores a low-cost inference practice that successfully loaded and ran a 2.8-trillion-parameter model without GPUs, relying solely on multi-core server processors and large-capacity persistent memory (PMEM). It systematically breaks down the architectural principles, memory access modes, quantization strategies, and system-level optimizations involved, offering developers a comprehensive methodology for heterogeneous memory inference.
1. Background: When Memory Capacity Becomes the First Bottleneck for LLM Inference
As the parameter scale of large language models (LLMs) climbs from billions to trillions, the core conflict in inference deployment has shifted from “compute power” to “memory capacity and bandwidth.” Acceleration solutions based on consumer or data center GPUs typically offer only tens to a hundred GB of memory, whereas an uncompressed trillion-parameter model may require terabytes (TB) of space just for weights. Even with multi-GPU parallelism, costs can quickly become prohibitive for average developers.
A recent home lab experiment sparked widespread discussion in the tech community: without any GPUs, a developer successfully loaded and ran an open-source LLM with approximately 2.8 trillion parameters using only an old platform with a multi-core server processor and large-capacity persistent memory, completing token generation. Although the speed was not fast, this route verified the feasibility of “trading bandwidth for capacity and storage for GPU memory.” This article systematically breaks down the architectural principles, performance bottlenecks, and optimization paths of this solution from a general technical perspective, omitting specific product attributes.
2. Hardware Foundation: The Role of Persistent Memory in Inference Scenarios
Persistent Memory (PMEM) is a hardware form based on non-volatile storage media that can be plugged directly into memory slots and accessed by the processor in a manner similar to traditional memory. In terms of capacity, it sits between DRAM and solid-state drives (SSDs). A single PMEM module can reach 128GB, 256GB, or even 512GB, and combining multiple modules can easily build a memory space of several TB.
In heterogeneous memory inference scenarios, the value of PMEM is reflected in three aspects:
- Capacity advantage: This is the decisive factor. Even with aggressive quantization, a trillion-parameter model still requires hundreds of GB or more for weights. Ordinary server DRAM cannot accommodate this, and PMEM perfectly fills the gap.
- Byte-addressability: Unlike SSDs, which must be read and written in blocks, PMEM supports byte addressing. The inference framework can load model weights like ordinary memory without additional storage stack overhead.
- Generational cost advantage: As relevant product lines are discontinued, prices for this hardware on the second-hand market have dropped significantly, making it an economical choice for individuals to build ultra-large memory pools in a lab.
The trade-offs are also obvious: PMEM read latency is higher than DRAM, bandwidth is significantly lower than GPU memory, and write endurance is limited. This determines that it is suitable for “read-intensive, write-sparse” inference scenarios, rather than training.
3. Memory Access Modes: Choosing Between App Direct and DAX
To involve PMEM in inference, it is crucial to understand its operating modes. Common industry modes fall into two categories:
Memory Mode: DRAM serves as a cache for PMEM, and the operating system only sees a large memory pool backed by PMEM. The advantage is transparency and no need for code modification; the disadvantage is that the cache hit rate is controlled by hardware and is unpredictable.
App Direct Mode: DRAM and PMEM are presented to the software as two independent address spaces. Developers can explicitly decide where to place data. The community experiment adopted this mode because the weight loading path for LLM inference is fully controllable—mapping model weights explicitly to the PMEM region while keeping hot data like intermediate activations and attention cache in DRAM, thereby achieving predictable performance.
Under App Direct Mode, there is another key switch: Direct Access (DAX). When DAX is enabled, the application reads and writes PMEM directly, bypassing the OS page cache. When DAX is disabled, PMEM is mounted as a block device or a regular file system, and read data passes through the DRAM page cache. An interesting finding in the experiment was that after disabling DAX, the generation speed actually increased from about 0.85 tokens per second to about 1.5 tokens per second, nearly doubling. This is because frequently accessed weight fragments are cached in DRAM. This reveals a general rule: for workloads with repetitive access patterns, letting hot data settle on faster media is often more important than pursuing the “shortest access path.”
4. Model Quantization: The Prerequisite for Fitting Trillion Parameters
Even with several TB of PMEM, an original-precision trillion-parameter model is still too large to carry; quantization is a necessary step. By reducing the bit-width of weight values (e.g., compressing from 16-bit floating point to 1-4 bit integers), quantization drastically reduces the model size while sacrificing some accuracy within an acceptable range.
Two sets of data from the experiment are representative:
- 1-bit quantization: The model size is compressed to the extreme. The initial speed was about 0.85 tokens/s, which reached about 1.5 tokens/s after page cache optimization. Although the accuracy loss is obvious, it verified the usability under extreme compression.
- 3-bit quantization: Better accuracy, but larger weight size exacerbates PMEM bandwidth pressure. The speed actually dropped to about 0.75 tokens/s, taking about 18.5 hours to generate 50,000 tokens.
This comparison illustrates a counter-intuitive phenomenon: in bandwidth-limited heterogeneous memory systems, lower quantization bit-widths not only save space but also directly save bandwidth, potentially resulting in faster end-to-end speeds. This differs from the experience in GPU inference, where “low-bit quantization mainly saves GPU memory but has limited speed improvement,” because the bottleneck here is data movement rather than computation.
When choosing quantization strategies, developers are advised to follow these steps:
- Estimate the ratio of the model weight size to the available memory capacity to determine the upper limit of the quantization bit-width.
- Within the acceptable accuracy range, prioritize lower bit-widths to gain bandwidth benefits.
- For layers sensitive to accuracy (such as the output layer and attention projection layers), a mixed-precision quantization strategy can be adopted to retain higher bit-widths.
5. Inference Framework and System-Level Tuning
At the software level, the experiment used a widely adopted local CPU inference framework from the community. Such frameworks typically support loading model weights via memory mapping (mmap), meaning weights are paged in from the storage medium on demand rather than loaded all at once. This mechanism aligns naturally with PMEM: during inference, only the weights involved in the current computation layer are actually read, and cold data remains in PMEM.
To squeeze the performance out of this architecture, the following system-level optimizations can be applied:
- Thread and core binding: The number of cores on a multi-core server processor (40 cores in the experiment) determines parallelism. Based on the memory controller topology, inference threads should be bound to NUMA nodes close to the PMEM slots to reduce cross-node access latency.
- HugePages: Enabling transparent or explicit HugePages can reduce the number of page table entries and page fault overhead, which is especially critical for TB-scale address spaces.
- Read-ahead strategy tuning: Model weights are usually accessed in layer order. Increasing the read-ahead window at the block device level can saturate bandwidth utilization.
- Context length control: The attention key-value cache grows linearly with the context. When memory resources are tight, the context window should be reasonably limited to avoid squeezing the weight cache space.
6. A Rational View: What It Can and Cannot Do
It must be clearly understood that the positioning of this solution is “proof of concept” rather than “production-ready.” A speed of 1 to 2 tokens per second means generating a single sentence takes tens of seconds, and long-text tasks take hours, making it entirely unsuitable for interactive applications. The scenarios it truly fits include offline batch text processing, exploratory research on model behavior, comparative validation of quantization effects, and low-cost observation of the internal mechanisms of ultra-large models.
For production environments requiring stable throughput and low latency, a more realistic path is to rely on professional cloud computing services. For example, cloud service providers like Baidu AI Cloud offer GPU instances, model inference services, object storage, and monitoring capabilities, allowing developers to obtain elastic computing power on demand and avoid sunk costs in hardware procurement and maintenance. The home lab solution and the cloud solution are not mutually exclusive—the former is suitable for technical verification and algorithm pre-research, while the latter is suitable for scaled deployment. Combining the two often yields the best return on investment.
7. Conclusion
The experiment of running a trillion-parameter model without GPUs is essentially an engineering response to the “memory wall” problem: providing capacity through PMEM, reducing bandwidth demand through extreme quantization, and extracting cache value through fine-grained memory mode management. It tells us that the boundaries of LLM inference are not entirely defined by GPUs; a profound understanding of the hardware hierarchy can also open up new possibilities. For developers, mastering the general methodology of heterogeneous memory architecture, quantization principles, and system tuning will be a long-term beneficial technical asset, whether ultimately deployed in a local lab environment or a cloud production environment.
