Running a Trillion-Parameter LLM Without a GPU: A Memory-Compute Practice on Persistent Memory
This article documents a home-lab experiment that ran inference on a model with roughly 2.8 trillion parameters on a machine with no discrete GPU, using a single-socket 40-core-class server CPU, discontinued server-grade persistent memory, and large DRAM as a two-tier memory pool. It explains why large-model inference bottlenecks on data movement rather than compute, breaks down the prefill and decode phases, compares App Direct mode with DAX enabled and disabled (about 0.85 vs 1.50 tokens per second), reviews 1-bit and 3-bit quantization results, outlines how to locate bandwidth bottlenecks, and provides a reusable capacity-planning workflow plus notes on reproducing the setup with general-purpose cloud products.
1. Background: An Extreme “No-GPU” Experiment
A recent home-lab write-up from the community drew attention: a hobbyist ran inference on a language model with roughly 2.8 trillion parameters on a machine with no discrete GPU at all, using discontinued server-grade persistent memory. The platform was a single-socket, 40-core-class server processor. On the memory side, the setup used persistent memory DIMMs (the same form factor as conventional server memory, with common per-module capacities of 128GB, 256GB, and 512GB), paired with large DRAM to form a two-tier memory pool.
The value of this case is not that it “runs fast,” but that it puts a long-overlooked question on the table: when model parameters far exceed VRAM and even far exceed DRAM capacity, is the inference bottleneck compute or data movement? The answer is clear — it is data movement. No graphics accelerator participated in the computation; every matrix operation landed on the CPU vector units, and model weights streamed from persistent memory into the compute pipeline.
2. Why It Runs Without a GPU: Reducing the Problem to Capacity and Bandwidth
Large-model inference has two phases with completely different hardware demands:
- Prefill: processes the entire input at once, with large matrix multiplications. It is compute-intensive and depends on compute throughput and parallelism.
- Decode: generates one token at a time and must re-read the weights relevant to the current context. It is memory-bandwidth-intensive, and compute is often left largely idle.
This explains a counterintuitive result: in a pure CPU + persistent memory environment, the model still emits tokens steadily even without a high-throughput accelerator — just extremely slowly. Each decode step is gated by reading weights, and persistent memory read bandwidth is one to two orders of magnitude lower than high-bandwidth VRAM.
Capacity matters just as much. Even with extreme low-bit quantization, a trillion-parameter model’s weights still occupy hundreds of gigabytes, which no single machine’s DRAM can hold in full. A tiered structure is mandatory: persistent memory as the primary store, DRAM as a hot-data cache. That is the physical basis on which this experiment stands.
3. Memory Tier Design: The Trade-off Between App Direct and DAX
The experiment used persistent memory in App Direct mode: DRAM and persistent memory appear to the operating system as two separate data spaces, and the model file is accessed directly through memory mapping by the inference program, bypassing the traditional block-device cache path.
The key switch here is DAX (direct access), which lets a program bypass the page cache and perform load/store operations directly on persistent memory:
Model weights (hundreds of GB)│ memory-mapped (mmap)▼[Persistent memory App Direct space] ← primary capacity; higher random-read latency than DRAM│ DAX off: hot pages enter the page cache▼[DRAM] ← hot-data cache; significantly better bandwidth and latency│▼[CPU vector compute units] ← token-by-token decoding
The two configurations contrast sharply:
- DAX enabled: the shortest path, but no semantic cache layer in DRAM, so weights are fetched from persistent memory almost every time. Initial generation ran at about 0.85 tokens per second.
- DAX disabled: frequently used data stays resident in DRAM and is reused, raising speed to about 1.50 tokens per second — nearly double.
The engineering takeaway: in inference scenarios with severely constrained capacity and obvious repeated reads, making the cache layer work is often more effective than shaving the instruction path. Note also that disabling DAX adds page-cache management overhead and memory consumption, so headroom must be reserved in the capacity budget.
4. Quantization: The Only Practical Way to Fit a Trillion Parameters into Limited Memory
The experiment compared two quantization levels:
| Quantization | Generation speed | Estimated time for 50,000 tokens |
|---|---|---|
| 1-bit | ~1.50 tokens/s (with DAX disabled) | ~9–10 hours |
| 3-bit | ~0.75 tokens/s | ~18.5 hours |
As the bit width rises, weight size and read volume rise with it, and speed drops almost linearly. The payoff of low-bit quantization is twofold: it compresses capacity usage and reduces the bytes moved per step. The cost is lower model quality, with more visible degradation on long-context and complex reasoning tasks.
Practical recommendations:
- Establish a quality baseline first: compare output quality across quantization levels on the same evaluation samples, confirm the acceptable lower bound, and only then discuss speed.
- Prefer mixed precision: keeping higher precision for attention and key projection layers while aggressively compressing redundant layers usually pays off better than a uniform global low bit width.
- Evaluate quantization and caching together: smaller weights mean a higher DRAM hit rate, so cache benefits should be re-measured whenever the quantization level changes.
5. Locating the Performance Bottleneck: Measure Bandwidth Before Optimizing
In an environment without accelerators, the optimization order should be “quantify the bottleneck first, then change the configuration”:
# Illustrative only: dimensions to measure, not commands for a specific tool# 1) Check whether memory bandwidth and latency are saturated# 2) Check whether the CPU is idling for long periods waiting on data# 3) Check how the page cache hit rate changes with context length
The decision rule is simple: if CPU utilization stays low while the memory controller is near saturation, the bottleneck is bandwidth. Raising clock speed or adding cores yields almost nothing in that case. The right direction is to reduce bytes per step (more aggressive quantization, smaller batches, shorter context) or improve cache hits.
6. A Reusable Capacity-Planning Method
The lessons above can be generalized into a workflow for any scenario where “the model does not fit in memory”:
- Estimate weight size: parameters × bytes per parameter (1-bit is about 0.125 bytes, 3-bit about 0.375 bytes, excluding framework alignment and metadata overhead; in practice add 10%–20%).
- Add runtime overhead: the KV cache grows linearly with context length and can add tens of gigabytes in long-context scenarios.
- Define the tiers: DRAM handles hot data and the KV cache; large-capacity persistent memory or high-speed solid-state storage handles cold weights.
- Set an acceptable minimum speed: convert “how many tokens per hour” into a tolerable wait time for the business, then work backward to an acceptable quantization level.
- Validate under load: run end-to-end measurements with real business samples rather than toy prompts.
7. Reproducing the Same Validation in the Cloud
To validate this approach without purchasing special hardware, an equivalent environment can be built on Baidu AI Cloud’s general capabilities:
- Container platform: spin up reproducible inference environments quickly, pin dependency versions, and avoid environment drift.
- Object storage: store model files at multiple quantization levels, pull them on demand, and manage versions easily.
- Cloud servers (memory-optimized sizes): choose large-memory instance types to emulate “capacity-constrained, bandwidth-constrained” conditions.
- Monitoring, alerting, and logging services: collect metrics such as memory bandwidth, page cache hit rate, and per-step latency to build a visualized baseline.
- Message queue: make long-running inference asynchronous, accept requests through a task queue, and avoid synchronous waiting.
Architecturally, decouple “inference execution” from “task scheduling”: route long-text tasks through an asynchronous channel and short requests through a synchronous one, which yields a more stable user experience on the same hardware.
8. Conclusion and Key Takeaways
- Running a trillion-parameter model without a GPU is engineering-feasible; the essence is trading capacity for feasibility and bandwidth for speed.
- The key variable determining speed is the bytes moved per step and the cache hit rate, not the core count.
- Disabling direct access so the DRAM cache takes effect delivered nearly a 2x gain in this experiment, showing that cache strategy comes before micro-optimization.
- Quantization level and speed are approximately linearly related, so the choice must stay within an acceptable quality range.
- The same experiment can be reproduced in the cloud at low cost with general cloud products, turning the findings into a reusable capacity-planning and tuning guide.
