Heterogeneous Tiered Storage and Dual-GPU Collaboration: Optimizing Ultra-Large MoE Inference

    This article explains how to run a 2.8-trillion-parameter MoE model on two GPUs with only 48GB of combined VRAM by using tiered storage and workload division. It covers the memory wall and expert sparsity challenges, a layered architecture combining GPU compute, RAM disk, and non-volatile persistent memory, plus key implementation details such as hotness-aware shard placement, asynchronous prefetching, per-tensor quantization, and observability. Experimental results show roughly 41% faster token generation and 26% faster prompt evaluation, and the article concludes with an optimization roadmap and a practical checklist for teams running ultra-large MoE models on limited hardware.

    Heterogeneous Tiered Storage and Dual-GPU Collaboration: Optimizing Ultra-Large MoE Inference

    In ultra-large model inference, the tension between parameter scale and VRAM capacity is often more pressing than raw compute shortage. This is especially true for Mixture-of-Experts (MoE) models: the total parameter count can be enormous, yet each token activates only a small number of experts, producing a pattern of “massive total parameters, sparse per-step computation.” The core engineering problem is how to orchestrate attention computation, expert routing, and expert tensor reads into a stable pipeline under limited VRAM, limited host memory, and limited interconnect bandwidth. This article examines a public experiment: with two GPUs totaling 48GB of VRAM, a 2.8-trillion-parameter MoE model is run through tiered storage and workload division, achieving simultaneous improvements in token generation speed and prompt evaluation speed.

    1. Background: The VRAM Wall and Expert Sparsity in Ultra-Large MoE Models

    The model has roughly 2.8 trillion parameters. Stored at 16-bit precision, the full parameter set would theoretically occupy about 5.6TB. It contains 896 experts, with 16 experts activated per token (2 of which are shared experts), corresponding to roughly 104 billion activated parameters. One point must be made clear: activated parameters do not equal VRAM usage. Even computing only the activated portion involves tensors far larger than 48GB of VRAM. Moreover, routing dynamically selects different experts for different tokens, making expert tensor access highly sparse and uneven.

    Therefore, simply placing “whatever layers fit” onto the GPU is not a complete answer. Attention is compute-dense and well suited to GPUs. Routed expert tensors, by contrast, are large and dynamically accessed; cramming them all into VRAM would cause constant swapping. A more sensible approach is to dedicate the GPU to compute-intensive paths such as attention, keep routed expert tensors on the host side, reduce hot-expert read latency through tiered storage, and hide cold-expert read overhead behind asynchronous prefetching.

    2. Architecture: Dual GPUs, Tiered Storage, and Workload Division

    The configuration in the public experiment: two GPUs totaling 48GB of VRAM, which accounts for only about 5.5% of the roughly 865GB of model shards. The model is divided into 94 shards; 45 of them (about 414GB) are placed in a RAM disk built on a memory-backed temporary filesystem, while the remaining shards stay on non-volatile persistent memory. Routed expert tensors reside on the CPU side, while the GPU handles attention computation. Compared with the previous setup where everything lived on non-volatile persistent memory, the new setup improves generation speed by about 41% and prompt evaluation by about 26%.

    The key insight of this architecture is not “squeezing the model into VRAM,” but “placing data with different access characteristics at the right tier.” The RAM disk has limited capacity but low access latency, making it suitable for hot shards, shared experts, or recently and frequently routed expert tensors. Non-volatile persistent memory offers larger capacity and data persistence across power cycles, making it suitable for cold shards and long-tail experts. Although GPU VRAM accounts for a small fraction of the total, it carries the compute-intensive attention path, so a modest amount of VRAM translates into significant end-to-end gains.

    3. Key Implementation Details: Sharding, Prefetching, Scheduling, and Precision

    1. Hotness-aware shard placement. Shards should not be split mechanically by file order. Placement should consider routing statistics, per-layer differences, and shared-expert access frequency. Shared experts participate in nearly every token and should go to the low-latency tier or remain pinned in cache; frequently routed experts can go into the RAM disk; long-tail experts stay on non-volatile memory. During a warm-up phase, the routing distribution over a batch of requests can be recorded and used to adjust shard placement, with a capacity watermark to prevent cold shards from crowding the RAM disk.

    2. Asynchronous prefetching and the compute pipeline. Once a token enters routing, the system should determine the required experts as early as possible and advance other computable work while expert tensors are being read. Asynchronous prefetching, batched aggregation, and overlapping compute with reads can hide part of the storage latency. For consecutive requests, an expert cache with a replacement policy reduces redundant reads. For sudden routing imbalances, per-expert concurrency should be capped to avoid a single expert becoming a hotspot.

    3. Precision strategy and quality evaluation. Storing all parameters at 16-bit precision would require about 5.6TB, yet the actual experiment loaded about 865GB of model shards—indicating that deployment necessarily involves shard organization, precision choices, or partial parameter handling. Further optimization can assign quantization precision per tensor: keep higher precision for numerically sensitive shared experts and attention-related tensors, and apply more aggressive quantization to long-tail experts. A quality evaluation set should be maintained to ensure quantization gains do not come at the cost of noticeable degradation.

    4. Stability and observability. A RAM disk is volatile storage, so hot shards must be rebuilt after a cold start. Startup warm-up, capacity monitoring, and out-of-memory protection should be designed in. Monitoring metrics should at least include generation speed, prompt evaluation speed, expert cache hit rate, host memory bandwidth, GPU utilization, and shard read latency. Only by breaking “speed improvement” down to specific bottlenecks can you decide whether to optimize routing, storage, or interconnect next.

    4. Performance Results and Bottleneck Analysis

    The experiment shows that the new configuration reaches 3.11 tokens per second for generation and 16.8 tokens per second for prompt evaluation—about 41% and 26% improvements, respectively, over the pure non-volatile memory setup. The earlier estimate placed GPU-accelerated speed at 2–4 tokens per second, and the measured results fall within that range. Prompt evaluation can process more input tokens in parallel, so it benefits more from prefetching and batching. Generation advances token by token with stronger serial dependencies between routing and expert reads, so its improvement is relatively smaller.

    Notably, the 48GB of VRAM across two GPUs is only 5.5% of the roughly 865GB of model shards, yet it yields clear speedups—evidence that the bottleneck is not purely VRAM capacity but the coordination between attention computation and expert tensor reads. If the GPU idles waiting for host-side expert tensors, or if RAM disk bandwidth is saturated by hotspot experts, adding more VRAM would not scale linearly. Instead, improving shard hotness profiling, prefetch depth, and expert batching may reduce end-to-end latency more directly.

    5. Optimization Roadmap and Practical Checklist

    Future optimization can proceed along several directions: first, build a routing hotness profile and dynamically adjust shard distribution between the RAM disk and non-volatile memory; second, pin shared and high-frequency experts in a resident cache while prefetching long-tail experts on demand; third, customize quantization precision by tensor sensitivity, paired with quality regression testing; fourth, fuse small operators and reduce host-device round trips; fifth, complete monitoring and alerting to track cache hit rates, read latency, and causes of GPU idle time.

    The following configuration sketch illustrates the tiering and workload-division concept only:

    1. placement:
    2. model_shards: 94
    3. hot_shards_in_ramdisk: 45 # ~414GB, selected by access hotness
    4. cold_shards_in_nvmem: 49
    5. shared_experts_cache: true
    6. compute:
    7. attention: gpu
    8. expert_tensor: cpu
    9. prefetch: async
    10. quantization: per_tensor
    11. runtime:
    12. metrics:
    13. - tokens_per_sec
    14. - prompt_eval_per_sec
    15. - expert_cache_hit_rate
    16. - host_mem_bw
    17. - gpu_util

    Overall, the value of this practice lies in reframing “insufficient VRAM” as “a tiering and scheduling problem”: the GPU handles attention, the CPU side hosts routed expert tensors, the RAM disk absorbs hot shards, and non-volatile memory provides the large-capacity foundation. For teams that need to run ultra-large MoE models on limited hardware, the right path is to first identify the real bottlenecks in attention, expert reads, and routing scheduling—and then improve throughput step by step through hotness-aware sharding, asynchronous prefetching, and customized quantization—rather than chasing VRAM capacity or single-point compute alone.