Running Trillion-Parameter LLMs on CPUs with Persistent Memory: A Practical Guide to Capacity Tiering, Cooling, and Offline Throughput

    This article explains how to run trillion-parameter LLM inference on a CPU-only node by using persistent memory (PMem) as the capacity tier. It covers why capacity, not compute, is the first bottleneck at this scale; how to map weights to DRAM versus PMem in App Direct mode; reference hardware selection and memory channel population rules; the cooling constraints that determine long-term stability; real quantization and throughput numbers; and how to turn slow inference into an operable offline pipeline, along with a risk checklist and rollout recommendations.

    1. The Starting Point: Trillion-Parameter Models Push Capacity Anxiety to the Extreme

    Once a model crosses into the trillion-parameter range, the first barrier to inference is no longer compute but capacity. Even after aggressive quantization, a model of this size still needs roughly 610GB of high-speed storage to be loaded in full. The conventional approach is to stack VRAM across high-end accelerators, but VRAM is limited in capacity, expensive per unit, and constrained in how far it can scale by slots and topology. The alternative is to build the same capacity out of large memory modules, which is equally hard to afford during a period of rising memory prices.

    That is what makes a different but effective approach worth considering: use discontinued, cheap second-hand persistent memory (PMem) as the capacity tier, paired with a single multi-core server processor, to build a CPU-only inference node. Its purpose is explicit: it does not chase interactive speed, only the ability to run and to run cheaply.

    2. Capacity Tiering: Put the Model in the Right Storage Layer

    Understanding this design starts with a storage-tier view. Data access during inference is clearly split by temperature: the bulk of the weights is “warm” data, the KV cache and intermediate activations are “hot” data, and temporary results and logs are “cold” data. Persistent memory sits between DRAM and local flash, offering byte addressing, cacheline-granularity access, and persistence across power loss, which makes it a good fit for the weight body.

    In App Direct mode, persistent memory is mapped as an independent persistent address space, and software can explicitly control which tier a tensor lands on. Illustrative pseudocode:

    1. # Pseudocode: assign weight storage location per layer
    2. for layer in model.layers:
    3. if layer.is_hot: # hot layers such as attention
    4. layer.weights = alloc(DRAM)
    5. else: # large, colder layers such as FFN
    6. layer.weights = alloc(PMem_APP_DIRECT)

    The key point is explicit placement rather than automatic paging. Relying on operating system paging introduces latency jitter into the inference critical path, whereas explicit allocation makes the developer responsible for the physical location of every layer and makes later latency profiling easier.

    3. Hardware Build and Selection Logic

    A reproducible reference configuration has three parts: a server-class processor with roughly 40 cores, providing ample memory and PCIe channels; multiple large-capacity persistent memory modules (individual module capacities in the 128GB to 512GB range, released alongside server platforms around 2020); and a chassis airflow design that does not rely on passive cooling, which is unacceptable here.

    What is easy to overlook during selection is the memory channel population rule. Persistent memory is sensitive to channel count and slot order, and installing modules in the wrong positions significantly reduces effective bandwidth. So the second step is never to buy more modules, but to consult the platform’s memory population table and ensure symmetric population.

    4. Cooling: The Real Hard Constraint

    Persistent memory draws considerable power at full load, and the heat is concentrated and not easily carried away by the chassis’s default airflow. In practice, two 12W-class turbine fans blowing directly onto the memory area is a common setup. Without active cooling, high temperatures conduct to neighboring modules and slots, and in extreme cases can damage ordinary memory or deform and disable a slot.

    Three engineering recommendations follow: first, give the memory area its own dedicated airflow path so it does not compete with the CPU cooler for air; second, collect memory temperature in monitoring rather than watching CPU temperature alone; third, define a temperature threshold that triggers throttling or shutdown. Cooling is not optional; it is the precondition for this design to run over the long term.

    5. Quantization and the Real Inference Performance Level

    Measured results set a sober expectation: at 1-bit quantization, inference runs at roughly 0.85 tokens per second, and at 3-bit quantization it drops to roughly 0.75 tokens per second. Generating 50,000 tokens takes more than 13 hours.

    The reason behind this is bandwidth, not compute. A trillion parameters still means reading hundreds of gigabytes even at 1-bit quantization, and persistent memory read bandwidth is far below that of VRAM; every token generated requires a full pass over the weights, so speed is locked by bandwidth. Higher precision is actually slower because dequantization and more frequent memory access add overhead to the critical path.

    The conclusion is direct: interactive conversation is not viable, but overnight offline batch processing is highly cost-effective. Suitable scenarios include large-scale corpus annotation, offline summarization, batch scoring of evaluation sets, and data cleaning and synthesis.

    6. Turning It into an Operable Offline Pipeline

    For slow inference to produce value, throughput has to be built up through engineering:

    • Queue the work: use a message queue to take on offline tasks, split by token budget, and avoid long-tail blocking.
    • Objectify the results: write outputs to object storage, and record metadata and progress in a logging service so jobs can resume from a checkpoint.
    • Observability: use monitoring and alerting to watch three core metrics: memory temperature, per-token latency, and queue backlog.
    • Elastic top-up: temporary bursts can rent general-purpose compute on a container platform, while the steady state is still handled by the low-cost nodes.

    If you would rather not handle the underlying operations, the relevant general capabilities from Baidu AI Cloud (container platform, object storage, message queue, monitoring and alerting) can serve as the hosting layer, letting you focus on the model and data side.

    7. Risk Checklist and Rollout Recommendations

    There are four main risks: hardware aging (the lifespan of second-hand discontinued modules is uncertain), cooling failure, single points of failure (a CPU-only node has no redundancy), and uncontrollable speed leading to delivery delays. The corresponding recommendations are: validate with a small batch before scaling up, provide redundant cooling with more than two fans, make tasks idempotent with retries, and set delivery SLAs measured in hours rather than seconds.

    To sum up: when VRAM becomes the bottleneck, capacity can buy time at a cheaper tier. This CPU-only plus persistent memory design is not elegant, but it genuinely turns a model that could not run into deliverable offline capacity, as long as you are willing to pay for cooling and patience.