LLM Inference Without a GPU: How Memory-Based Computing Enables Trillion-Parameter Models
This article examines a home-lab experiment that ran a 2.8-trillion-parameter language model on a single-socket, 40-core server with no discrete GPU, using high-capacity persistent memory alongside DRAM. It explains why CPU inference is feasible, how much memory trillion-parameter models require under low-bit quantization, the performance difference between App Direct and cache/memory-mapped access modes, and a practical tuning checklist covering thread and NUMA binding, huge pages, batching, tiered placement, and monitoring. It also outlines when memory-optimized cloud instances fit, and concludes that memory-based inference is best suited to low-cost offline workloads rather than interactive online serving.
1. Background: A GPU-Free Home Lab Experiment
A developer shared a home-lab experiment in a community forum: on a machine with no discrete GPU at all, they loaded and ran a language model with roughly 2.8 trillion parameters using discontinued high-capacity persistent memory modules. The setup ran on a single-socket, 40-core server-class CPU platform. On the memory side, large-capacity persistent memory modules were exposed as two separate address spaces alongside DRAM using App Direct mode, and the inference engine was a widely used CPU inference framework.
The value of this case is not that it simply “worked.” It exposes the cost structure of large-model deployment very clearly: once VRAM capacity is no longer the constraint, the real bottleneck shifts quickly to the matching relationship among memory capacity, memory bandwidth, and compute throughput.
2. Why Inference Works Without a GPU
LLM inference can be split into two stages with very different hardware demands.
- Prefill: processes the entire input at once. It is compute-intensive, with high matrix-multiplication parallelism, and is sensitive to both compute and bandwidth.
- Decode: generates tokens autoregressively, one token per step. It is memory-access-intensive, and nearly every step requires re-reading the weights associated with the current layer.
The essence of the decode stage is “trading bandwidth for time.” This explains why inference can still run without an accelerator: as long as memory capacity can hold the model and bandwidth can keep supplying data, the CPU can emit tokens step by step, just slowly. In other words, going GPU-free is not impossible; it trades “smooth interaction” for “acceptable offline throughput.”
3. The Capacity Ledger: How Much Memory Trillion-Parameter Models Need
Taking 1-bit-level ultra-low-bit quantization as an example, the theoretical weight size of 2.8 trillion parameters is on the order of about 0.35TB; with 3-bit quantization, the size rises to around 1TB. Adding the KV cache, runtime alignment, and framework overhead, the actual resident memory requirement goes higher still.
This leads to a clear engineering conclusion:
- A single machine’s DRAM usually cannot hold it, so large-capacity persistent memory must be introduced as a “secondary memory pool.”
- The value of persistent memory is capacity and cost, not latency; designing it as “slow memory” rather than a “fast disk” avoids pitfalls.
- Capacity planning must leave headroom; otherwise, once paging is triggered, throughput drops off a cliff.
An illustrative capacity estimation logic:
Weight size ≈ parameter count × bytes per parameterKV cache ≈ 2 × layers × hidden dimension × sequence length × batch size × precision bytesMinimum memory ≈ weight size + KV cache + runtime overhead (reserve 10%~20% recommended)
4. Two Memory Access Modes and Their Differences
Persistent memory typically offers two usage modes with a major impact on performance:
- App Direct mode: DRAM and persistent memory are two independent data spaces, and software explicitly decides which side data resides on. The advantage is control and predictability; the drawback is that when all weights land on the slow side, the bandwidth disadvantage is amplified.
- Cache/memory-mapped mode: persistent memory acts as an extended cache for DRAM, with hot data automatically residing on the fast side. The advantage is no program changes are needed; the drawback is that the hit rate depends on access locality, while weight access in LLM decoding is close to a full scan, so the hit rate is naturally low.
A key observation from the experiment was exactly this: after disabling the direct-access feature and letting frequently used data benefit from the DRAM cache, generation speed rose from about 0.85 tokens per second to about 1.50 tokens per second, nearly doubling. This shows that for memory-access-intensive workloads, “keeping hot data close to the compute units” is more effective than “piling on more slow capacity.”
5. Quantization: Reducing Bandwidth Pressure
Quantization is the first-principles approach for this kind of deployment, because it directly determines the number of bytes that must be moved per decode step.
- 1-bit-level quantization: the highest compression ratio, measured at about 0.85 tokens/second initially and about 1.50 tokens/second after tuning.
- 3-bit quantization: more stable quality, but higher size and bandwidth pressure, measured at only about 0.75 tokens/second; generating 50,000 tokens takes about 18.5 hours.
The engineering trade-off is straightforward: ultra-low-bit quantization buys “it runs” and “faster,” at the cost of precision loss and potential quality degradation; slightly higher bits buy quality at the cost of lower throughput. Production environments should compare before and after quantization on a small evaluation set, rather than looking only at size.
6. A Tuning Checklist to Squeeze Out Throughput
- Thread and NUMA binding: bind compute threads to the node on the same side as the memory channel to avoid cross-node access.
- Huge pages and memory mapping: reduce address-translation overhead and improve sequential-read bandwidth utilization.
- Batching and sequence length: in the decode stage, batch size has limited impact on throughput and instead amplifies KV cache pressure, so use it cautiously.
- Tiered placement strategy: place high-frequency layers or index structures on the fast side and the rest on the slow side.
- Monitoring first: continuously observe memory bandwidth, cache hits, and paging, and drive parameter tuning with data.
7. The Cloud Perspective: When to Use Memory-Optimized Instances
Reproducing a similar approach in the cloud usually maps to the “memory-optimized” instance category, combined with object storage for model weight distribution and logging and monitoring services for observability. General-purpose capabilities offered by vendors such as Baidu AI Cloud can help teams complete offline batch processing, evaluation, and data preprocessing in scenarios without accelerators. But it must be clear: interactive, high-concurrency online services should still be handled by accelerated compute resources; the memory-based approach is positioned for low-cost offline inference and feasibility validation.
8. Conclusion and Recommendations
The real lesson from this experiment is that the first constraint in large-model deployment is often not compute, but “data movement.” When memory capacity is sufficient and bandwidth and caching strategies are well tuned, trillion-parameter models can run stably in a GPU-free environment; but a speed of 1 to 2 tokens per second is only suitable for offline tasks. The recommended path is three steps: first do capacity and quantization estimation, then tune memory access mode and caching, and finally use monitoring data to decide whether to upgrade to accelerated resources.
