Dual 24GB GPUs Accelerate 2.8 Trillion-Parameter MoE Inference by 41%
A practical heterogeneous inference design combines two consumer GPUs with DRAM and persistent memory to run a 2.8-trillion-parameter Mixture-of-Experts model locally. By assigning attention computation to 48GB of GPU memory and hosting expert weights across DRAM and persistent memory, the system increases generation speed from approximately 2.2 to 3.11 tokens per second, while prompt evaluation reaches 16.8 tokens per second. This article explains the storage, bandwidth, device-placement, and tiered-memory decisions behind the improvement.
Accelerating a 2.8-Trillion-Parameter MoE Model with Dual Consumer GPUs: An Engineering Case Study in Heterogeneous Inference
1. Background: The Reality of Running Extremely Large Models Locally
Mixture-of-Experts (MoE) architectures have become a common approach for building extremely large language models. The central idea is to divide the model into many expert subnetworks while activating only a small subset of them for each token. This keeps the total parameter count extremely high while limiting the computation required for any individual inference step.
The model discussed here has 2.8 trillion parameters and contains 896 experts. Each token activates 16 experts, including two shared experts, resulting in approximately 104 billion active parameters per token. If all parameters were stored in 16-bit floating-point format, the model weights alone would require approximately 5.6 TB of storage—far beyond the memory capacity of any single consumer GPU, or even a small number of them.
For local inference, developers therefore need to coordinate heterogeneous storage and heterogeneous compute. GPU memory handles latency-sensitive computation, while system memory and persistent memory accommodate the much larger weight set.
A recent upgrade by a server enthusiast illustrates this approach. After adding two consumer GPUs with 24GB of VRAM each to an existing persistent-memory-only configuration, generation speed increased from approximately 2.2 tokens per second to 3.11 tokens per second—an improvement of about 41%. Prompt evaluation reached 16.8 tokens per second, an improvement of approximately 26%. The following sections examine the engineering decisions behind these results.
2. Estimating Storage Requirements: Calculate the Budget First
Before selecting hardware or deployment settings, it is important to quantify storage and bandwidth requirements. At 16-bit precision, the model size can be estimated as follows:
2.8e12 parameters × 2 bytes per parameter ≈ 5.6 TB
In practice, quantization is typically used to reduce the footprint. The quantized version used in the experiment was approximately 865GB and was split into 94 shards. About 414GB of the model could be placed in volatile memory.
These figures highlight a basic fact: quantization is the first step that turns an entirely impractical deployment into a barely feasible one. Common approaches reduce weights from 16-bit to 8-bit, 4-bit, or lower precision. Each reduction in precision approximately halves storage and bandwidth requirements, at the cost of a controllable loss in accuracy.
This leads to the first engineering principle:
Determine the total storage and bandwidth budget of the target hardware first, then select the quantization level and sharding strategy. Do not choose a model first and only later consider how to fit it into the system.
3. Heterogeneous Work Allocation: GPUs for Attention, CPUs for Experts
The most notable design choice is how the computation is divided between the GPUs and CPUs.
GPU side — 48GB of total VRAM: The GPUs handle attention computation. Attention layers contain relatively fewer parameters, but their computation is dense and their memory-access patterns are comparatively regular. This makes them a good match for the high parallelism of GPUs and their limited memory capacity. The 48GB of VRAM represents only about 5.5% of the total model-file size, yet it provides a significant acceleration effect. This is a practical example of putting expensive resources where they have the greatest impact.
CPU side: The CPUs handle the feed-forward computation for routed expert tensors. MoE expert weights are extremely large, and only a small number of experts are activated for each token. The primary bottleneck is therefore often weight-read bandwidth rather than raw compute throughput. Keeping this workload on the CPU side, backed by large-capacity DRAM and persistent memory, is a reasonable trade-off.
The underlying principle is to assign work according to the balance between compute density and memory bandwidth. GPUs, which offer high compute throughput but limited capacity, handle compute-intensive modules. The CPU memory hierarchy, which offers much greater capacity, handles bandwidth-sensitive expert weights.
4. Tiered Storage: Hot and Cold Data Across DRAM and Persistent Memory
The second major change was the introduction of a tiered storage layout. In the original configuration, all model shards were stored on persistent memory. In the upgraded system, 45 of the 94 shards—approximately 414GB in total—were moved to a tmpfs RAM disk, while the remaining shards stayed on persistent memory.
The principle is straightforward: DRAM generally provides substantially higher read bandwidth than persistent memory. Although persistent memory is much faster than conventional storage in many workloads, it still has a significant bandwidth gap compared with DRAM.
During MoE inference, the system must repeatedly load the weights of the selected experts as it generates each token. Weight access therefore becomes a serial, per-token bottleneck. Moving frequently accessed hot shards, such as tensors associated with shared experts and frequently selected routed experts, to DRAM can directly reduce the waiting time for each token.
A general tiering strategy can be summarized as follows:
- Tier 1 — VRAM: Attention weights, the KV cache, and other data that are highly sensitive to latency.
- Tier 2 — DRAM or
tmpfs: Expert weights accessed on every token or at a high frequency. - Tier 3 — Persistent memory or high-speed SSD: Less frequently accessed cold expert weights.
tmpfs capacity is limited by the amount of physical memory available, and its contents are lost after a reboot. The cost of reloading the model must therefore be considered operationally. Persistent memory provides a compromise between capacity, cost, and persistence, making it suitable as the backing tier.
5. Performance Analysis and Optimization Opportunities
The measured generation speed was 3.11 tokens per second, within the experimenter’s expected range of 2–4 tokens per second. This suggests that a bandwidth-based performance model can provide a useful estimate.
A simplified approximation is:
Theoretical generation speed ≈ effective memory bandwidth÷ active parameters per token× bytes per parameter
Assuming approximately 104 billion active parameters and an average of roughly one byte per parameter after quantization, each generated token requires reading around 100GB of weight data. If the combined effective bandwidth of DRAM and persistent memory is approximately 300–400GB/s, the theoretical generation rate is close to three tokens per second, which is consistent with the measured result.
Several optimization directions remain available:
Custom quantization: Use different precision levels for different tensors. Experts that are more sensitive to precision can retain a higher bit width, while more redundant experts can be compressed more aggressively. This can improve effective bandwidth utilization without increasing the overall model size.
Expert-frequency-driven sharding: Track how often each expert is activated during real inference and dynamically adjust the distribution of hot and cold shards between DRAM and persistent memory.
Prefetching and pipelining: Use routing results to anticipate which experts may be activated in the next layer. Their weights can be prefetched while attention computation is underway, helping hide memory-access latency.
Prompt-evaluation parallelism: Prompt evaluation naturally supports batch parallelism, which can improve GPU utilization. This also helps explain why the measured prompt-evaluation speed of 16.8 tokens per second is substantially higher than the generation speed.
6. Lessons for Developers
The value of this experiment does not lie in reproducing one particular machine. Its broader value is that it validates a transferable methodology:
- Use bandwidth estimates to set performance targets.
- Use heterogeneous task allocation to define the system architecture.
- Use hot and cold data tiering to determine weight placement.
For teams seeking to run very large MoE models within a limited budget, the same principles can also apply in cloud environments. For example, general cloud capabilities such as object storage, container platforms, and monitoring and alerting services provided by Baidu AI Cloud can be combined to build flexible model-loading and inference-scheduling workflows, helping balance cost and performance for a particular workload.
The barrier to running extremely large models is continuing to fall through engineering techniques. Understanding the bottleneck, making deliberate quantization decisions, and optimizing the storage hierarchy are practical strategies for both individual developers and enterprise teams.
