Dual-GPU Expansion for Trillion-Parameter MoE Local Inference: Practical Performance Tuning
This article examines a self-reported local deployment case in which a 2.8-trillion-parameter Mixture-of-Experts model was accelerated by adding two consumer GPUs and placing part of the model shards in a tmpfs memory filesystem. It covers model size, memory tiering, GPU selection, low-bit quantization, expert-routing bottlenecks, benchmarking, and practical engineering considerations. The case reports decode speed increasing from about 2.2 tokens/s to 3.11 tokens/s and prompt evaluation speed increasing from about 13.3 tokens/s to 16.8 tokens/s.
1. Introduction: Trillion-Parameter MoE Local Inference Is Not Limited by Compute Alone
The focus of large-model deployment has shifted from raw parameter count to inference throughput, deployment cost, and local usability. Mixture-of-Experts (MoE) architectures are particularly suitable for this scenario: total parameters can be pushed to the trillion level, but only a small number of experts are activated for each token, so per-token compute does not necessarily grow linearly with total parameter count.
The problem is that MoE reduces computation, but it does not reduce the requirement to keep weights resident. To ensure that each routing decision can directly hit the intended expert, model shards usually need to remain resident in local storage or memory. If shards are frequently swapped between disk and memory, latency can degrade sharply. This is the core difficulty of running extremely large MoE models locally: the system must solve capacity, bandwidth, and scheduling at the same time.
A recent self-reported personal server upgrade offers a useful engineering reference. The author added two consumer GPUs and placed some model shards in a memory filesystem. Decode speed increased from about 2.2 tokens/s to 3.11 tokens/s, an improvement of about 41%. Prompt evaluation speed increased from about 13.3 tokens/s to 16.8 tokens/s, an improvement of about 26%. The figures come from the case author’s public description and should be treated as an engineering case study rather than an independently audited benchmark.
2. Experiment Profile: Model Size, File Layout, and Hardware Boundaries
2.1 Model Scale: Activation Ratio of a Trillion-Parameter MoE
According to the case author, the key model parameters are as follows:
- Total parameter count: about 2.8 trillion
- Expert count: 896 experts, with 16 experts activated per token, including 2 shared experts
- Activated parameter count: about 104 billion
- Activation ratio: about 104 billion / 2.8 trillion ≈ 3.7%
- If all parameters were stored at 16-bit precision, the model would require about 5.6 TB
This means that computational sparsity in MoE does not imply storage sparsity. Even if each token activates less than 4% of the parameters, the system still needs data paths for all experts that may be activated.
2.2 Model Files and Storage Layout
In this case, the model was split into 94 shards with a total size of about 865 GB. The upgrade placed 45 shards, totaling about 414 GB, into a tmpfs memory filesystem. The remaining 49 shards stayed on persistent memory. Two RTX 3090 GPUs provide 48 GB of VRAM in total, only about 5.5% of the total model file size.
From the 5.6 TB estimate at 16-bit precision and the actual 865 GB file size, the effective precision can be estimated as follows:
865 GB × 8 ÷ 2.8 trillion ≈ 2.47 bits per parameter
This indicates that the file has undergone obvious low-bit quantization. Because the public material does not disclose per-tensor bit widths, grouping methods, or calibration datasets, this article treats the figure only as a statement from the case author and does not infer a specific quantization implementation.
2.3 Before and After: GPUs Do Not Directly Increase System Memory
A common misconception is that adding GPUs directly increases system memory. In this case, the speedup came from a combination of compute allocation and data-placement changes, not from a single hardware upgrade.
A simplified comparison is shown below:
| Item | Before: persistent-memory-only setup | After: dual-GPU plus memory-filesystem setup |
|---|---|---|
| GPU configuration | Little or no independent GPU acceleration | Two RTX 3090 GPUs, 48 GB total VRAM |
| Main data placement | Most model shards rely on persistent memory | 45 shards, about 414 GB, in a memory filesystem; the rest remain on persistent memory |
| Decode speed | About 2.2 tokens/s, inferred from the reported speedup | 3.11 tokens/s |
| Prompt evaluation speed | About 13.3 tokens/s, inferred from the reported speedup | 16.8 tokens/s |
Therefore, a more accurate description is that the upgraded setup introduced or increased memory-filesystem capacity while allowing the GPUs to handle more compute-intensive work. The GPUs improve the compute path, while the memory filesystem changes the data-hit layer. The final benefit comes from the combination.
2.4 Terminology: Persistent Memory, Memory Disk, and tmpfs Are Not the Same
These approaches involve several concepts that are easy to confuse:
- Optane Persistent Memory: Usually refers to persistent memory media such as Optane Persistent Memory. It requires CPU and motherboard support. It is not the same as an ordinary memory disk and cannot always be used as standard DRAM on all platforms.
- tmpfs memory filesystem: A filesystem that resides in memory, typically backed by system memory or page cache. Data is volatile and is lost when power is removed.
- Memory disk: Narrowly, this can refer to tmpfs, ramfs, or other memory-emulated block devices. Whether it truly expands usable system memory depends on memory mapping, page cache, physical memory reservation, and operating-system accounting.
- Memory mapping: Mapping files into a process address space can reduce explicit copies, but the first access may still trigger page faults and reads from disk or persistent memory.
The claim that a memory disk expands available system memory should not be interpreted as creating physical memory from nothing. A safer interpretation is that the platform may expose a larger addressable space through persistent-memory mapping, large-capacity physical memory, tmpfs, or hybrid memory modes. Reproduction requires confirming memory topology, capacity reporting, and power-loss risk.
2.5 GPU Selection: VRAM Capacity Is Not the Only Concern
When consumer GPUs are used in local inference servers, the following checks matter beyond VRAM capacity:
- PCIe lanes and bandwidth: Whether both GPUs receive adequate x16 or x8 links and whether chipset bifurcation limits them
- Power delivery: Whether the PSU wattage, PCIe power connectors, and cable count are sufficient
- Cooling and airflow: Whether sustained inference workloads cause thermal throttling
- Driver and CUDA compatibility: Whether GPU drivers, CUDA, and inference framework versions are compatible
- Memory topology: Whether NUMA, Resizable BAR, and Above 4G Decoding are configured appropriately
- Operating-system limits: Whether the consumer platform supports large-memory, persistent-memory, or large memory-filesystem configurations
These factors are more important than the VRAM-to-model-size ratio when determining whether a dual-GPU setup can run stably.
3. Core Design: Compute on the GPU, Capacity on the CPU Side
3.1 Different Tensors Have Different Resource Characteristics
In Transformer inference, different tensors have very different resource demands:
- Attention, normalization, and shared-expert tensors: Used at every layer or for every token; compute-intensive with regular memory access, suitable for GPUs
- Routed-expert tensors: Very large in number, but only a few are activated per token; access is relatively random and per-token compute is small
- KV cache: Grows with context length and is constrained by VRAM capacity and bandwidth
- Embedding and output vocabulary layers: May consume significant bandwidth at certain stages and also need attention
A natural division is therefore to run attention and shared-expert computation on the GPU while keeping routed-expert weights in large-capacity memory or persistent memory on the CPU side. The GPU handles highly parallel computation, while the CPU side handles large-capacity storage.
3.2 Why 5.5% VRAM Usage Still Helps
By capacity alone, 48 GB of VRAM is a small fraction of an 865 GB model. But MoE inference benefits do not depend only on VRAM utilization; they depend on whether the bottleneck path is improved.
Adding GPUs can provide three kinds of benefits:
- Higher attention throughput: Attention and shared experts can reside in VRAM, moving dense matrix operations from the CPU to parallel dual-GPU execution.
- Hot expert residency and KV-cache space: VRAM can hold a small number of frequently accessed experts or KV cache, reducing host-side reads.
- Redistributed memory budget: The upgrade may introduce larger memory-filesystem or memory-mapped capacity, allowing more shards to enter a faster access tier.
This explains why meaningful speedup is possible even when VRAM covers only a small fraction of the model. The goal is not to fit the entire model into VRAM, but to let the hottest and most compute-intensive paths run first.
3.3 Does a Memory Disk Slow Inference Down?
A memory disk does not necessarily slow inference, but it can add three kinds of overhead:
- tmpfs access still goes through the kernel filesystem, page cache, and address mapping
- Memory filesystems consume physical memory, reducing space available for page cache and other processes
- Small random reads can amplify scheduling and page-fault overhead
If host physical memory is limited, relying too heavily on a memory filesystem may lead to memory oversubscription, process termination, or reduced throughput. A safer approach is to reserve sufficient memory for the system, monitor available memory and swap usage, and avoid expanding tmpfs while inference load is high.
4. Memory Tiering: How Three Media Cooperate
The case effectively forms a tiered structure: GPU VRAM — host memory/memory filesystem — persistent memory.
| Tier | Typical medium | Capacity in this case | Access characteristics | Contents |
|---|---|---|---|---|
| Tier 1 | GPU VRAM | 48 GB | High bandwidth, low latency | Attention, shared experts, hot experts, KV cache |
| Tier 2 | Host memory + tmpfs | 45 shards, about 414 GB | Relatively high bandwidth, but affected by memory-filesystem overhead | Frequently accessed routed experts |
| Tier 3 | Optane persistent memory | Remaining 49 shards | Bandwidth lower than DRAM, higher than ordinary mechanical disks | Infrequently accessed routed experts |
Each tier serves a different purpose: GPU VRAM determines compute speed, host memory affects the hit rate of random expert reads, and persistent memory determines the total capacity ceiling. What matters for decode speed is not whether one tier is large enough, but whether hot data resides in the right tier.
4.1 Why 414 GB of Shards Yields a Relatively Large Benefit
By simple arithmetic, the share of parameters moved into the memory filesystem is about 414 ÷ 865 ≈ 47.9%. But MoE inference is not an average read pattern: routing often concentrates on a small number of hot experts. If the shards in the memory filesystem happen to cover these hot experts, the benefit can exceed the raw proportion.
A simplified model is as follows:
- tmpfs bandwidth is B2
- persistent-memory bandwidth is B1 = B2 / r, where r is the bandwidth discount of persistent memory relative to the memory filesystem
- a fraction f of the parameters read for each token hits the memory filesystem
- ignoring attention and fixed overhead, the per-token time ratio is approximately:
T_new / T_old ≈ (1 − f) + f / r
If f is 47.9% and r is 2, the theoretical speedup is about 22%. The measured 41% is higher than this estimate. Possible reasons include a higher hit rate for hot experts, lower effective bandwidth for small random reads on persistent memory, and additional gains from GPU parallel computation.
4.2 Shard Granularity Affects Random-Read Efficiency
The case splits the model into 94 shards, averaging about 9.2 GB per shard. Shard design must balance two types of overhead:
- If shards are too large, experts needed for one routing decision may be spread across multiple shards, increasing wasted reads.
- If shards are too small, indexing, mapping, and scheduling overhead increases, and memory management becomes more fragmented.
A better design aligns shard boundaries with expert boundaries or packs experts into groups. Router layers, shared layers, and attention layers can be placed independently. The goal is to let one access fetch the required data as directly as possible.
5. Low-Bit Quantization: Fitting a 5.6 TB Model into One Machine
5.1 Bit Width Determines Both Capacity and Bandwidth
The actual model file is about 865 GB, equivalent to about 2.47 bits per parameter, indicating that low-bit quantization has already been applied. Bit width affects two things:
- Whether the model can fit locally
- How many bytes must be moved for each token
Based on about 104 billion activated parameters, the theoretical read volumes at different bit widths are as follows:
| Bytes per parameter | Activated data per token | Bandwidth needed for 3.11 tokens/s decode | Bandwidth needed for 16.8 tokens/s prefill |
|---|---|---|---|
| 2 bytes, about 16-bit | About 208 GB | About 647 GB/s | About 3,494 GB/s |
| 1 byte, about 8-bit | About 104 GB | About 324 GB/s | About 1,747 GB/s |
| 0.3125 bytes, about 2.5-bit | About 32.5 GB | About 101 GB/s | About 546 GB/s |
These are theoretical estimates for continuous reads. They do not include KV cache, scheduling overhead, routing misses, or framework synchronization costs.
Two conclusions are clear:
- Without quantization, 16-bit weights are unlikely to run stably on a consumer platform.
- Even with low-bit quantization, decode speed is still limited by memory bandwidth, and simply adding compute does not necessarily produce linear improvement.
5.2 What a Prefill-to-Decode Ratio of about 5.4 Indicates
Prefill is usually compute-intensive and often has higher throughput than decode. In this case, however:
16.8 ÷ 3.11 ≈ 5.4
The gap is not large. This suggests that decode may not be limited by GPU compute capacity but by the data path used to read experts. The GPU may be waiting for expert data from the CPU side, leading to underutilization.
To verify this, monitor the following:
- Whether GPU utilization remains below capacity for long periods
- Whether CPU-side expert-read bandwidth approaches memory limits
- Whether hot-expert hits are concentrated
- Whether expert access follows a long-tail distribution
- Whether KV cache consumes VRAM bandwidth
- Whether routing or scheduling introduces synchronization stalls
6. Reusable Engineering Methods: From Quantization to Deployment
6.1 Quantization Strategy: From Uniform Bit Width to Tensor-Specific Precision
Low-bit quantization is not about forcing all parameters to the same precision. A more practical approach is layered handling:
- Attention projections, normalization parameters, embedding layers, and output layers are numerically sensitive and can retain higher precision.
- Routed-expert weights are large and read frequently, making them the main compression target.
- Shared experts are used for every token and can retain higher precision to avoid stretching the bottleneck path.
- Group quantization: a common approach is to use groups of 128 weights, with scale factors and zero points.
- Calibration data: calibrating on real task distributions is more stable than using random samples only.
Quantization benefits can be estimated with a simplified formula:
Per-token decode time ≈ activated parameters × average bit width ÷ 8 ÷ effective bandwidth + attention computation time + fixed overhead
This formula does not replace measurement, but it shows that decode latency is mainly driven by activated parameters × average bit width ÷ effective bandwidth, not by total parameter count.
6.2 Checklist for Slow Prefill
If the symptom is “decode is acceptable, but prefill is slow,” check the following:
- Scheduling overhead: are routing, weight loading, and synchronization operations amplified per token?
- Memory-access bottleneck: does KV cache hit the VRAM bandwidth limit early?
- CPU-side expert reads: are they serialized or blocked?
- Framework support: can the inference framework handle hybrid GPU compute and CPU-side experts?
- Advanced features: are asynchronous prefetching, batched reads, and hot-expert residency enabled?
- Test consistency: are prompt lengths and sampling parameters kept identical?
Possible mitigations include dedicated prefetch threads, grouped batched reads by expert, keeping hot experts resident in VRAM, and switching to an inference execution path better suited to hybrid placement.
6.3 Deployment Mode Shapes Hardware Strategy
Different scenarios should not use the same hardware plan:
- Offline batch processing: latency requirements are lower; consumer GPUs plus large-capacity memory can be suitable.
- Single-machine shared inference pool: concurrency, queuing, VRAM reuse, and memory oversubscription risk need attention.
- Online API service: focus on first-token latency, throughput stability, scaling, and monitoring alerts.
- Cloud deployment: a generic architecture such as object storage + container platform + monitoring/alerting can separate model distribution, service execution, and performance measurement, reducing single-machine operational burden.
7. Evaluation and Reproduction: Making Data Comparable and Trustworthy
When reproducing similar experiments, fix the following variables:
- Prompt length
- Generation length
- Sampling parameters
- Concurrency level
- VRAM and memory usage
- Model shard placement
- Quantization bit width, group size, and calibration set
- Inference engine version and launch parameters
- GPU model, driver version, and CUDA version
- PCIe topology, power supply, and cooling conditions
Reports should at least include:
- Decode speed in tokens/s
- Prompt evaluation speed in tokens/s
- P50/P95 latency
- Memory-filesystem hit rate
- Expert access distribution
- GPU utilization
- CPU-side expert-read bandwidth
- Hardware and software version list
Without these details, a single “percentage improvement” figure makes it difficult to tell whether the optimization came from VRAM, the memory filesystem, quantization, or framework scheduling.
8. Limitations and Outlook
The limitations of this approach are also clear:
- High hardware threshold: large-capacity memory, persistent memory, and consumer GPUs can be costly together.
- Complex engineering adaptation: low-bit quantization, expert caching, and shard alignment all require customization.
- Limited reproducibility: the case does not disclose full quantization bit widths, grouping strategy, or routing distribution.
- Power and cooling pressure: sustained dual-GPU operation requires attention to electricity costs and chassis airflow.
- Memory-filesystem risk: tmpfs is volatile, and reloading nearly 100 GB of shards takes time.
For individual developers or small teams, a more pragmatic path is as follows:
- First validate feasibility with low-bit quantization and CPU/GPU hybrid inference.
- Then evaluate whether dual GPUs, large-capacity memory, or persistent memory are necessary.
- For scenarios with hard latency or concurrency requirements, prefer cloud-hosted inference or specialized inference services.
9. Conclusion: Optimize the Bottleneck Tier, Not Blindly Add Hardware
The core lesson from this case is that local inference for trillion-parameter MoE models is not a simple “add a GPU and it gets faster” problem. It requires balancing capacity, bandwidth, and cost.
The value of dual-GPU expansion is not just 48 GB of additional VRAM. It allows attention computation, hot experts, and KV cache to move to a faster path. The memory filesystem improves the hit rate for frequently accessed experts. Low-bit quantization makes it possible to fit the model on a single machine.
During evaluation, look at both decode and prefill speeds. Before optimizing, identify whether the bottleneck lies in the GPU, memory, persistent memory, or scheduling layer. Only when hot data is placed in the right tier can dual-GPU expansion, memory filesystems, and quantization strategies turn into stable gains.
