Trillion-Parameter MoE Inference on Two Consumer GPUs: A VRAM-Constrained Tuning Guide
This article examines a documented build that runs the full weights of a 2.8-trillion-parameter open-source MoE model on a persistent-memory host with two 24GB consumer GPUs. It breaks the case down across architecture, measured data, methodology, cloud adaptation, and pitfalls: a three-tier store of VRAM, tmpfs, and persistent memory; why decode throughput is governed by bandwidth rather than GPU peak compute; how copying 45 of 94 hot expert shards (~414GB) into tmpfs produced roughly 41% faster generation and 26% faster prefill; and the practical guidance — tiered placement by routing heat, custom quantization by tensor sensitivity, monitoring, and rollback paths — needed to reproduce the result.
Trillion-Parameter MoE Inference on Two Consumer GPUs: A VRAM-Constrained Tuning Guide
1. What Happened: A Dual-GPU Build Running a 2.8T-Parameter MoE Model
For memory-constrained LLM deployment, persistent-memory AI hosts are becoming a low-cost route for individual server hobbyists and small teams that want to experiment with very large parameter counts. In late November, a hobbyist published the results of a “second-generation persistent-memory AI host” upgrade: by adding two 24GB consumer GPUs on top of an existing persistent-memory setup, the machine successfully loaded the full weights of a 2.8-trillion-parameter open-source MoE model.
The headline numbers of this configuration:
- Generation speed: 3.11 tokens/s
- Prompt evaluation speed: 16.8 tokens/s
- Relative improvement: about 41% faster generation and about 26% faster prompt evaluation versus the previous persistent-memory-only setup
- VRAM usage: 48GB across the two GPUs, roughly 5.5% of the 865GB model files
This was not simply “adding GPUs.” It was a combined optimization of the storage hierarchy, the compute split, and quantization. Two changes carry the design:
- Where the weights live: 45 of the 94 shards — about 414GB of routed-expert shards — were copied from persistent memory into a tmpfs filesystem backed by system RAM. The remaining shards stayed on persistent memory.
- Who does the math: the GPUs handle attention; routed-expert tensors stay in the CPU-side memory hierarchy and are computed there.
What follows is therefore a fairly typical case study of memory-constrained inference for a very large MoE model. The rest of this article dissects it across five dimensions — architecture, data, methodology, cloud deployment, and pitfalls — to extract engineering lessons that generalize.
2. The Problem: Three Constraints on Trillion-Parameter MoE Inference
2.1 Sparse activation: 3.7% of the compute, but every weight must be addressable
The model has 896 experts, and each token typically activates 16 of them, including 2 shared experts. That works out to roughly 104 billion active parameters per token — about 3.7% of the full parameter set.
This produces a classic tension: the compute looks cheap, but the memory footprint does not shrink.
On one hand, each token touches less than 4% of the parameters. On the other, 100% of the parameters must remain addressable. Route to a single expert that is not loaded or not reachable and inference stops. Furthermore, different tokens route to different expert combinations, so expert-weight access is highly random and cannot rely on the sequential reads that keep cache hit rates high in dense models.
As a result, the MoE bottleneck is usually not arithmetic throughput but three questions:
- Which memory tier holds the weights;
- At what precision they are stored;
- How efficiently the activated experts can be read at runtime.
In practice, weights that every token must pass through — attention, shared experts — belong on the fastest tier. Routed experts should be placed in tiers according to routing heat.
2.2 Bandwidth sets the pace: decode is a memory-bound phase
LLM inference generally splits into two phases:
- Prompt evaluation (prefill): hundreds or thousands of tokens processed in parallel, with high arithmetic intensity;
- Token-by-token generation (decode): each token involves relatively small matrix operations but must read the weights that token activates, making it a textbook memory-bound phase.
For batch size 1 and single-request generation, the relationship can be approximated as:
time per token ≈ weight bytes that must be moved per token ÷ effective read bandwidthgeneration speed ≈ effective read bandwidth ÷ weight bytes that must be moved per token
When weights are spread across VRAM, RAM disk, and persistent memory, effective bandwidth is further shaped by routing randomness, cache hits, the bandwidth gap between media, and framework scheduling. In engineering terms, a harmonic mean of per-tier bandwidths gives a rough estimate, but measurements are mandatory.
To be clear: 3.11 tokens/s is not a universal ceiling for all scenarios. It comes from one specific model, batch size 1, one specific routing distribution, one specific memory bandwidth, one specific quantization format, and one specific framework schedule. The formula is better suited to identifying optimization directions than to replacing measurement.
The optimization directions follow directly:
- Raise effective read bandwidth;
- Reduce the weight bytes moved per token;
- Improve hit rates for hot shards;
- Cut the bandwidth loss caused by random access.
2.3 Capacity vs. precision: from 5.6TB to 865GB through quantization
At 16-bit precision, 2.8 trillion parameters would require roughly 5.6TB. The actual deployment is about 865GB of model files split into 94 shards, averaging roughly 9.2GB each. A quick conversion:
865GB × 8 ÷ 2.8 trillion ≈ 2.47 bits/parameter
So the model’s average bit width across all parameters is about 2.5 bits. Typically the routed-expert weights dominate model size and are the main target for quantization compression, while sensitivity-heavy components — attention, shared experts, embeddings, lm_head — may retain higher precision.
Without quantization, a deployment like this would struggle to fit on an ordinary server. Low-bit quantization is effectively the precondition for running trillion-parameter MoE models on consumer-grade or quasi-enterprise hardware.
3. Architecture: A Three-Tier Store of VRAM → RAM Disk → Persistent Memory
After the upgrade, the machine presents a clean three-tier storage structure:
| Tier | Medium | Capacity | What it holds | Primary role |
|---|---|---|---|---|
| L1 | GPU VRAM | 48GB, ~5.5% of the model files | Attention computation | Carries the high-frequency compute every token must pass through, at the highest available memory bandwidth |
| L2 | tmpfs RAM-backed filesystem | 414GB, 45/94 shards | Copied hot routed-expert shards | Uses system memory bandwidth to accelerate frequently accessed expert weights |
| L3 | Persistent memory | ~451GB remaining | 49/94 routed-expert shards | Holds the full set of expert weights with large capacity and byte-addressability |
Architecturally, the design follows the idea of “large and slow as the fallback, large and fast for the hot set,” which is in line with the common industry practice of running very large MoE models on high-memory accelerators by keeping attention layers in VRAM and offloading expert layers to host memory. The differences here are:
- Host memory consists of both ordinary system RAM and persistent memory;
- Some hot shards are additionally replicated into tmpfs, forming an extra high-speed tier;
- The GPU does not compute routed experts, so it avoids repeatedly moving multi-gigabyte expert weights across PCIe.
One distinction needs to be made explicit: the 414GB of hot shards were copied from persistent memory into tmpfs within the CPU-side memory hierarchy. This should not be misreported as 414GB of GPU cross-device transfer. Some implementations do place attention-related weights, activation tensors, or other intermediate data in the GPU, and the measurement convention should be stated clearly. In this case, it is reasonable to record roughly on the order of 45GB of GPU-side attention weights and working set — but that figure must not be conflated with the 414GB of expert shards.
Diagram: three tiers and the data flow
┌──────────────────────────────┐│ L1 GPU VRAM: 48GB │ ← attention (every token passes through)└──────────────┬───────────────┘│ attention output (tensor, KB–MB scale)┌──────────────▼───────────────────────────────────────────────┐│ CPU-side memory hierarchy ││ ┌────────────────────────┐ ┌──────────────────────────┐ ││ │ L2 tmpfs RAM disk 414GB│ │ L3 persistent memory │ ││ │ 45/94 expert shards │ │ ~451GB, 49/94 shards │ ││ └───────────┬────────────┘ └────────────┬─────────────┘ ││ └──────────┬────────────────┘ ││ ▼ ││ route → read the 16 activated experts → compute → merge │└─────────────────────────────────────────────────────────────┘
The key payoff of this design: the GPU handles only attention and never computes routed experts, so it does not need to shuttle multi-gigabyte expert weights across PCIe over and over. Once hot expert shards have been replicated into the CPU memory hierarchy, runtime behavior depends on memory bandwidth and random-read efficiency rather than cross-device transfer efficiency.
4. Reading the Numbers: What Drives the Gains
4.1 Before and after
The original write-up did not publish a complete set of absolute figures for the old configuration. To make the magnitude easier to grasp, the baseline numbers in the table below are back-calculated from the new results and the stated improvement percentages and should be treated as estimates; the generation and prompt-evaluation figures for the new setup are measured values.
| Metric | Old: everything on persistent memory | New: some shards on tmpfs | Improvement | Data nature |
|---|---|---|---|---|
| Generation speed | ~2.2 tokens/s | 3.11 tokens/s | ~41% | New measured, old derived |
| Prompt evaluation speed | ~13.3 tokens/s | 16.8 tokens/s | ~26% | New measured, old derived |
A note on sourcing: the original write-up did not fully disclose links, the model name, the license, or detailed measurement scripts. Anyone reproducing this kind of experiment should record the model version, quantization format, shard size, measurement tooling, and context length to keep results verifiable.
4.2 Why decode benefits more
The larger gain in the generation phase traces back to MoE routing. Each token reads the 16 experts it activates rather than scanning all 896 sequentially. Those activated experts are scattered across shards, so whenever a hot shard is served from tmpfs, its read latency drops.
In the old setup, all expert shards lived on persistent memory with higher read latency. Moving 45 hot shards to tmpfs means each token can benefit from a faster read path for those high-frequency experts. Because decode repeats this process once per generated token, the benefit compounds token by token.
Prefill behaves differently. It processes many tokens in parallel, so arithmetic volume is higher and sensitivity to per-token memory latency is comparatively lower — hence a smaller speedup than decode.
It is also worth noting that the builder had estimated post-GPU speeds in the 2–4 tokens/s range before testing, and the measured 3.11 tokens/s falls inside that window. That reinforces the point: in trillion-scale MoE single-request generation, the bottleneck is memory latency and bandwidth, not raw GPU compute.
4.3 What it feels like in practice
Using the derived baseline speeds, the before-and-after experience looks roughly like this:
- Prompt processing: a prompt of about 4,000 tokens took roughly 5 minutes before and about 4 minutes after;
- Text generation: 1,000 generated tokens took roughly 7.5 minutes before and about 5.4 minutes after;
- Interactive feel: with attention now on the GPU, the first token usually appears sooner after typing; the dominant wait is still prompt evaluation, which is more noticeable with long prompts.
4.4 Where the next speedup could come from
If further optimization is on the table, custom quantization is one of the most direct levers, since the weight bytes moved per token depend directly on precision. At constant bandwidth, pushing the average bit width of expert weights lower should raise generation speed by roughly the same proportion.
In a single-request scenario, however, simply adding VRAM has limited effect. What determines speed remains “how much is read per token, and how fast” — not peak GPU compute.
5. A Reusable Methodology
5.1 Answer four questions before you start
Do the weights fit?
Compare VRAM, system memory, tmpfs capacity, and persistent-memory capacity to confirm the quantized full weights fit, with headroom left for the KV cache, the operating system, and the inference process.How much is read per token?
Estimate the active parameter count and the average bit width. In this case, roughly 104 billion parameters activate per token, and the actual bytes read depend on the activated expert tensors and how precision is distributed.How fast is the read?
Estimate sustained bandwidth for VRAM, system memory, tmpfs, and persistent memory, then reason about effective bandwidth in light of routing randomness. Theory must yield to measurement.Who does the compute?
Decide what stays on the GPU and what is computed on the CPU side. The goal is to minimize cross-device transfers and large random reads. Here, expert shards stayed in the CPU memory hierarchy and the GPU handled only attention.
5.2 Tiered placement: decide by routing heat, shard size, and memory headroom
Tiered placement is not just “put more data on faster media.” It should be driven by the hot set. A workable approach: first measure per-shard routing frequency, then fill tiers in order — shards that do not fit in VRAM go to tmpfs first, and anything tmpfs cannot hold falls back to persistent memory.
# Illustrative shard placement policy; not a specific tool's API# hot_rate: how often this shard is accessed in routing stats, typically in 0..1# size_gb: shard size in GB# HOT_THRESHOLD: hot-shard cutoff, tunable from measured hit rate and memory budget# system_memory_budget(): tmpfs capacity budget in GB# remaining_mem: capacity currently available for tmpfs, in GBshards = load_routing_stats(model)shards.sort(key=lambda s: s.hot_rate, reverse=True)plan = {"gpu": [], "tmpfs": [], "pmem": []}remaining_mem = system_memory_budget()for s in shards:if s.hot_rate >= HOT_THRESHOLD and s.size_gb <= remaining_mem:plan["tmpfs"].append(s) # hot shards go to the RAM disk firstremaining_mem -= s.size_gbelse:plan["pmem"].append(s) # everything else falls back to persistent memoryapply_placement(plan) # the runtime applies the actual placement
In this case, moving 45 of 94 shards into tmpfs produced about 41% faster generation and about 26% faster prompt evaluation. The investment was roughly 414GB of RAM-disk capacity plus a one-time copy. That says the gain came from prioritizing the hot set, not from simply enlarging the fast tier.
5.3 Minimum reproduction checklist
To reproduce a similar experiment, record at least:
- Model name, version, and license;
- Quantization format and bit width per tensor class;
- Actual size of each of the 94 shards;
- tmpfs capacity and mount options;
- Persistent-memory model, read/write bandwidth, and latency;
- GPU model, VRAM capacity, and driver version;
- Inference framework, scheduling parameters, and batch size;
- Prompt length, context length, and generation length;
- The measurement convention used for generation and prompt-evaluation speeds.
Without these, results are case references only and should not be generalized across all models and hardware.
5.4 Custom quantization: allocate bit width by tensor sensitivity
The general principle: the closer a tensor sits to the final output, and the more certain it is to be touched by every token, the more precision it should keep. Routed-expert weights take up the most space and therefore offer the most room for compression.
In practice, four steps:
- Use the current quantization error as a baseline and evaluate quality deltas per tensor class before and after quantization;
- Define candidate bit widths per tensor class — for example, attention at 16 bits, experts chosen in the 2–4 bit range;
- Search for the best combination under the constraint that total size stays within the memory budget, minimizing quality loss;
- Run regression checks against a fixed evaluation set before going live.
5.5 Monitoring and tuning: keep the gains sustainable
Worth watching continuously:
- Weight bytes moved per token;
- Per-shard hit rate;
- Remaining tmpfs capacity;
- Bandwidth utilization per medium;
- The ratio of generation speed to prompt-evaluation speed;
- Time to first token and long-output stability.
Also keep in mind that tmpfs consumes system memory, so headroom must be reserved for the operating system, the inference process, and the KV cache — otherwise you risk paging or an OOM kill. After changing shard placement or quantization bit widths, check output quality and speed together so that speed is not bought at the cost of usability.
6. From One Machine to the Cloud
The same thinking carries over to cloud environments. Teams typically combine capabilities like these:
- Heterogeneous compute: GPU instances with ample VRAM for attention and the KV cache, large-memory instances for routed-expert computation;
- Storage services: object storage for model files and versioning, elastic block storage or high-performance file storage for low-latency data disks;
- Container platform: unified orchestration of inference services to enable canary releases and elastic scaling;
- Monitoring, alerting, and logging: continuous tracking of tokens/s, VRAM and memory watermarks, tmpfs hit rate, and request latency.
For resource selection, do not look at the GPU model alone. Build a complete picture:
- Start with the total size after quantization, and whether hot shards can fit into a high-speed memory tier;
- Then look at per-token read bandwidth, routing randomness, and concurrent request volume;
- Finally, weigh object storage, block storage, persistent memory, network transfer, and elasticity costs together.
Before launch, establish a quantitative evaluation baseline covering at least:
- Generation speed and time to first token;
- VRAM and memory occupancy;
- Behavior at different context lengths;
- Output quality before and after quantization;
- Latency jitter and throughput under concurrency.
Production differs from a local experiment. Locally you can run one machine per model; in production you must account for contention under concurrency, instance isolation, rolling updates, and failure rollback. It is worth defining a rollback policy for tmpfs warm-up failures, abnormal hit rates, or latency regressions: once a critical metric crosses its threshold, fall back automatically to the persistent-memory-only setup and raise an alert so the service stays available.
7. Pitfall Checklist
- tmpfs is not persistent storage: data in a RAM-backed filesystem is lost on power loss or reboot, so it must be fully reconstructible from persistent memory or object storage. Warm it automatically at boot.
- Loading the full set takes time: copying roughly 414GB of hot shards takes a while, during which the service may be unavailable. Prefer rolling updates or double-buffered warm-up in production.
- Quantization damage accumulates: low-bit quantization can amplify errors over multi-step generation, so watch long-form consistency, numeric reasoning, and instruction following closely.
- Routing hotspots drift: when input distributions or use cases change, the hot set changes too, so placement needs periodic re-measurement.
- Do not add GPUs blindly: single-request generation is bound by memory bandwidth. When VRAM is nearly saturated, adding VRAM capacity or improving memory bandwidth may beat adding more GPUs.
- Gains are scenario-specific: the ~41% improvement comes from one model, one configuration, and one workload. Re-measure before moving to other models rather than reusing the number directly.
- Prepare a rollback path: if tmpfs warm-up fails, hit rates are low, or latency degrades, fall back to the persistent-memory-only setup automatically and record logs and alerts.
8. Takeaways
This experiment validates a pragmatic path: on VRAM-constrained consumer hardware, tiered storage, hot-shard replication, and quantization compression make it possible to run a 2.8-trillion-parameter MoE model.
Three conclusions stand out:
- Tiered storage works: GPU VRAM handles attention, tmpfs holds 45 hot expert shards, and persistent memory backs the rest.
- Hot-set prioritization is what pays: about 41% faster generation and about 26% faster prompt evaluation. The win comes not from simply adding capacity, but from making frequent accesses hit faster media.
- For very large MoE models, the first question is where the weights live and at what precision — storage architecture, quantization strategy, and routing access patterns often matter more than raw compute.
For teams deploying large models with limited resources, this offers a concrete engineering reference. As custom quantization, dynamic routing caches, and more mature VRAM/memory co-scheduling continue to advance, the inference barrier for trillion-parameter MoE models should keep falling.
