Local MoE Model Deployment: GPU Memory Requirements and Multi-GPU Configuration

    Learn how to estimate GPU memory for a 2.8-trillion-parameter MoE model, verify its 1.56 TB checkpoint, and choose between single-node, multi-node, and CPU-offloaded inference. This guide covers weight storage, KV cache sizing, parallelism strategies, and inference configuration trade-offs.

    1. Start with the Resource Requirements

    According to the public model card, the model has approximately 2.8 trillion total parameters, with around 104 billion parameters activated per token. Its weights occupy roughly 1.56 TB across 96 safetensors shards.

    The model-specific figures in this guide come from the model card. Before deploying, verify them against the repository’s config.json and model.safetensors.index.json.

    This guide explains how to estimate GPU memory requirements, assess single-node versus multi-node deployment, and validate downloaded weights.

    2. MoE Architecture: Active Parameters Drive Compute, Total Parameters Drive Memory

    The model uses a sparse Mixture-of-Experts (MoE) architecture with approximately:

    • 896 routed experts, with 16 selected by the router for each token, plus 2 shared experts for common computation.
    • 93 Transformer layers.
    • An active-parameter ratio of 104B / 2.8T ≈ 3.7%.

    The key distinction is that compute requirements depend on activated parameters, while weight storage and memory planning depend on total parameters.

    During inference, the router cannot know in advance which experts the next token will select. Expert weights therefore need to remain in GPU memory or be transferred into it quickly. Deployment budgets must account for the full weight footprint, not just the 104B active parameters.

    3. Weight Storage: What Does 1.56 TB Imply About Precision?

    Dividing 1.56 TB by 2.8 trillion parameters gives approximately 0.56 bytes per parameter, or about 4.5 bits per parameter.

    This average is consistent with a mixed-precision checkpoint: most expert weights use low-bit quantization, while critical components such as attention and embeddings may retain higher precision. Check the model card and configuration files for the actual precision breakdown.

    The following table compares storage formats at the same parameter count:

    Storage format Bytes per parameter Approximate weight size
    BF16 2 5.6 TB
    Uniform FP8 1 2.8 TB
    Uniform 4-bit 0.5 1.4 TB, excluding quantization scales and other metadata
    Official mixed-precision checkpoint Approximately 0.56 1.56 TB

    A BF16 deployment is therefore impractical for most teams. The official checkpoint is already compressed; load it using its supported format rather than estimating its memory footprint as if it were uniformly FP8 or 4-bit.

    Downloading and Verifying the Checkpoint

    With 96 shards, each file averages roughly 16 GB. For a reliable download:

    1. Record the repository source and version or commit hash. Confirm that any mirror matches the official source.
    2. Use a download tool that supports concurrent transfers and resuming interrupted downloads.
    3. Verify each shard’s SHA-256 hash against the repository’s published checksums.
    4. Confirm that there are 96 shards and that the total size is approximately 1.56 TB.
    5. Before loading, check key configuration fields, including layer and expert counts. Stop if they do not match.

    If loading fails with tensor-dimension or data errors, an incomplete shard may be responsible. Recheck shard integrity before investigating configuration issues.

    Safetensors supports memory-mapped, on-demand reads, which can help reduce loading time. This does not mean inference requires less GPU memory: expert weights still need to be resident or transferred efficiently when needed.

    4. GPU Memory Sizing: Account for More Than Weights

    Total GPU memory requirements can be estimated as:

    Required GPU memory ≈ weights + KV cache + activations and temporary buffers + communication buffers + framework overhead

    For conventional attention, the KV cache estimate is:

    KV cache ≈ 2 × number of layers × number of KV heads × head dimension × sequence length × concurrent sequences × bytes per element

    If the model uses a compressed attention architecture such as MLA, replace this calculation with one based on the actual structure in the configuration.

    Long contexts and high concurrency can increase KV cache usage substantially. It is often the factor that limits serving capacity.

    Using a 1.56 TB weight footprint, the following configurations illustrate the capacity trade-offs:

    Configuration Approximate total GPU memory Weight footprint Assessment
    Single node, 8 × 80 GB 640 GB 1.56 TB Weights do not fit entirely in GPU memory; substantial host-memory offloading is required
    Single node, 8 × 141 GB 1.13 TB 1.56 TB Still requires offloading, or further compression followed by accuracy evaluation
    Two nodes, 16 × 141 GB 2.26 TB 1.56 TB After framework and activation overhead, remaining capacity can support KV cache and communication buffers

    An eight-GPU configuration is therefore a starting point for making the model run, not a comfortable capacity target. A single eight-GPU node can run quantized inference with offloading, but stable production throughput generally calls for multi-node deployment—or accepting lower concurrency.

    5. Without a Large GPU Cluster: Host-Memory Offloading

    Research and low-concurrency workloads can use GPUs for computation while keeping weights in host memory:

    • Host memory must accommodate the 1.56 TB checkpoint, or the weights must be repacked according to the chosen quantization format.
    • As each layer executes, only the activated experts are transferred to the GPU.
    • Frequently used experts can be cached in GPU memory to improve hit rates.
    • Generation speed depends on host-memory bandwidth, PCIe bandwidth, and expert-cache hit rates. Benchmark on your own hardware; performance is typically substantially lower than with fully GPU-resident weights.

    This approach is suited to offline evaluation and data synthesis rather than online serving.

    6. Inference Engines and Parallelism Configuration

    Choosing a Parallelism Strategy

    • Tensor parallelism (TP): Splits attention heads and linear layers across GPUs. The TP degree must divide the attention-head count, and each GPU must have enough memory for its weight partition and KV cache.
    • Expert parallelism (EP): Distributes routed experts across GPUs. It relies on all-to-all communication and is highly sensitive to interconnect bandwidth. NVLink or InfiniBand environments are recommended.
    • Pipeline parallelism (PP): Reduces per-GPU weight requirements, but introduces pipeline bubbles and increases latency.

    The number of checkpoint shards does not determine the parallelism degree. That choice depends on attention-head count, expert count, per-GPU memory, interconnect bandwidth, and the offloading strategy.

    Quantization and Throughput

    On Hopper and newer GPU architectures, FP8 inference throughput may approach twice that of BF16. Actual gains depend on batch size, sequence length, and benchmarking methodology, so test with your own workload.

    Prefix caching can be particularly useful for multi-turn agent workloads, where requests repeatedly share long system prompts.

    Example Startup Configuration

    1. # Illustrative only: argument names vary by inference engine.
    2. # Refer to the documentation for your chosen engine.
    3. serve_args = {
    4. "model_path": "/models/moe-2p8t",
    5. "tensor_parallel_size": 8, # Must divide the attention-head count;
    6. # each GPU must fit its weights and KV cache.
    7. "quantization": "auto", # Match the checkpoint's actual format;
    8. # do not quantize it again.
    9. "max_model_len": 32768, # Start with a shorter context;
    10. # KV cache grows linearly with length.
    11. "gpu_memory_utilization": 0.90, # Leave room for framework overhead,
    12. # activations, and communication.
    13. "enable_prefix_caching": True,
    14. }

    After startup, begin validation with a short context and a small batch.