Dual GPUs and Persistent Memory: Local Inference for a 2.8T-Parameter MoE Model

    This article examines how to run a 2.8-trillion-parameter MoE model locally using two GPUs, persistent memory, and a DRAM-backed tmpfs. It covers the main constraints—VRAM capacity, memory bandwidth, and PMem latency—along with hardware layering, the GPU/CPU compute split, measured generation and prompt-evaluation speeds, and an unverified bandwidth bottleneck. It also outlines mixed-precision storage, prefetching/scheduling, and PCIe/NUMA affinity as untested optimization directions.

    Background: What a 2.8-Trillion-Parameter Model Must Overcome Locally

    Mixture-of-experts (MoE) models control per-token computation through sparse activation. In one 2.8-trillion-parameter example, the model has 896 routed experts and 2 shared experts, activates 16 experts per token, and has about 104 billion activated parameters. Compute is determined by activated parameters, but storage footprint is determined by all parameters. At 16-bit precision (2 bytes per parameter), the full parameter set is about 5.6TB, far beyond the conventional memory and VRAM of a single server.

    Individual developers and small teams running such models locally generally face three constraints:

    1. VRAM capacity: two flagship consumer GPUs total 48GB.
    2. Memory bandwidth: during decoding, each generated token requires reading many parameters, and speed is mainly limited by CPU memory channel count and frequency.
    3. Persistent memory latency: a single machine can have large capacity, but access latency is clearly higher than DRAM and VRAM.

    Deploying a 2.8-trillion-parameter MoE model locally requires specific hardware, and generation speed is limited by CPU memory access. The following sections break down these three constraints one by one.

    Hardware Layering: What Goes on Each Type of Media

    The setup uses two GPUs, persistent memory (PMem), and a tmpfs memory disk built from DRAM. A single PMem module can reach hundreds of GB; in a dual-socket server configuration, total capacity can cover a model subset of more than 400GB. tmpfs turns part of DRAM into a file system, with read speeds close to memory.

    The original article mentions 94 shards totaling 414GB, with 45 shards placed in tmpfs. However, this number differs by about 13.5× from the 5.6TB estimate at 16-bit precision. The original does not state whether 414GB corresponds to the full model, a subset, or a quantized volume, nor does it give the size of each shard. Therefore, this article does not use 414GB for any proportional calculations. For planning, use the actual size of the model files you use and estimate with the following formula:

    Model size ≈ total parameters × bytes per parameter (2 bytes for 16-bit, 1 byte for 8-bit, about 0.5 bytes for 4-bit)

    The layering strategy is: frequently accessed attention weights and shared experts go on low-latency media, while routed experts go on persistent memory, which has larger capacity but higher latency. Each token activates only 16 experts out of 896, so most experts can remain on slower media. This judgment depends on the storage system being able to handle bursty random reads.

    Plan tmpfs capacity with the following formula:

    tmpfs limit ≤ total physical DRAM − OS and other services − safety margin

    Set the safety margin to no less than 10% to 20% of total DRAM, and continuously monitor available memory and swap. Pages in tmpfs may be swapped out to swap; once swapping occurs, read latency rises noticeably and performance becomes unstable.

    Compute Split: GPUs Handle Attention, CPUs Handle Routed Experts

    The two GPUs total 48GB of VRAM. Whether the model size is calculated as 5.6TB or as the original article’s 414GB, VRAM can hold only a small portion of the weights. At 5.6TB, VRAM is about 0.9%; at 414GB, it is about 11.6%. Therefore, the GPUs cannot hold all weights. The setup places only QKV projections and attention score computation on the GPUs, while the feed-forward networks of routed experts still execute on the CPU side.

    This split is based on three considerations. Attention-layer parameters account for a small share but are compute-intensive, making them suitable for GPU parallel processing. Routed experts have a large parameter count, but each token uses only a small number of experts, so the CPU together with persistent memory can perform sparse reads and computation. In addition, the original does not state whether the 48GB of VRAM includes KV cache, activations, and framework overhead. The VRAM actually available for weights will be less than 48GB.

    Measured Results: 3.11 token/s Generation Speed

    Under the original test conditions, prompt evaluation speed was 16.8 token/s and generation speed was 3.11 token/s. During generation, the average time per token was about 322 ms.

    The original states that compared with a pure persistent-memory setup, generation speed improved by about 41% and prompt evaluation speed by about 26%. The original does not provide baseline values. The table below back-calculates the baseline from these two ratios; the results are inferred values, not data measured in the original article.

    Metric This setup (measured in the original) Pure PMem baseline (inferred)
    Generation speed 3.11 token/s About 2.2 token/s (3.11 ÷ 1.41)
    Prompt evaluation speed 16.8 token/s About 13.3 token/s (16.8 ÷ 1.26)

    The original does not specify hardware models, batch size, context length, quantization precision, or measurement scripts, so these numbers are observations under specific conditions. They should not be treated as expected performance before reproducing them on your own machine. When reproducing, at minimum record: GPU model and VRAM, CPU model and memory channel count, PMem model and operating mode, tmpfs capacity, batch size, context length, quantization precision, and the version of the measurement script.

    Performance Bottleneck: An Unverified Hypothesis

    The original article believes that a large amount of VRAM is idle while CPU-side memory bandwidth may be close to saturation. This hypothesis is reasonable, but the original does not measure memory bandwidth utilization, so it has not been verified. To confirm it, collect the following metrics:

    • GPU utilization (nvidia-smi dmon or DCGM)
    • System memory bandwidth (Intel PCM, perf, or similar tools)
    • PMem read bandwidth and latency
    • Swap usage and OOM records (dmesg, /proc/vmstat)

    Routed experts reside on PMem, whose read bandwidth is lower than DRAM; even with asynchronous prefetching, it is difficult to fully hide the latency. In addition, the setup uses 16-bit precision, so memory traffic is higher than with 8-bit or 4-bit quantization.

    The following three optimization directions have not been validated in this setup and are only potential ideas:

    1. Mixed-precision storage: keep shared experts at high precision and lower the precision of cold experts to reduce footprint and bandwidth demand.
    2. Prefetching and scheduling: predict which experts the next token may activate based on attention weights, and move weights from PMem to the memory disk or VRAM in advance. Prefetch hit rate needs to be measured separately.
    3. PCIe and NUMA affinity: shortening the CPU-side access path.