Local Deployment of Large MoE Models on 8 GPUs: A Practical VRAM Planning Guide

    This article explains how to plan GPU memory for deploying large MoE models locally on an 8-GPU server. It corrects the common mistake of estimating VRAM from activated parameters, breaks memory usage into four budgets, compares tensor parallelism and expert parallelism, discusses where to place conditional memory, and provides a pre-launch checklist for stable inference under concurrency.

    1. First, a Common Misconception: Activated Parameters Are Not VRAM Usage

    When building an internal AI assistant, a coding assistant for developers, or a model API service, the most common planning mistake is estimating VRAM requirements from the number of parameters activated per token. Take a very large MoE model as an example: its backbone has about 552B parameters, with another roughly 196B conditional memory (Engram) parameters. During prefill, about 8B parameters are activated per token; during decode, about 16B. Seeing “8B/16B” and assuming a single consumer GPU can run it is a typical misjudgment.

    The reason is that activated parameters only describe the scale of the path that actually flows through a single forward pass, while what must remain resident in VRAM is the full stored copy of all weights (including experts that are not activated), the KV cache, the runtime workspace, and communication buffers. Sparse activation reduces compute and bandwidth pressure, not the cost of keeping weights resident.

    VRAM usage can be abstracted into four budgets:

    1. TotalVRAM ≈ W_main + W_engram_access + KV_cache + Workspace/Comm
    • W_main: backbone weights (including all expert weights), most affected by the quantization scheme;
    • W_engram_access: the access space for conditional memory, depending on the placement strategy (VRAM / host memory / tiered);
    • KV_cache: proportional to concurrency, context length, number of layers, and number of KV heads;
    • Workspace/Comm: temporary operator tensors, AllReduce/AllToAll buffers, CUDA context, and so on.

    Public configurations have shown a VRAM budget of about 614GB as a planning reference for a certain loading method, which illustrates exactly this point: the real requirement is the sum of the four items above, and it fluctuates with quantization, placement, and service parameters rather than being a fixed constant.

    2. 8 GPUs Are Not One 768GB “Large VRAM” Block

    The combined nominal capacity of a single machine with 8 cards (such as 8×96GB or 8×72GB professional cards) may look ample, but it consists of 8 independent address spaces. Cross-card access must go through high-speed interconnects, whose bandwidth and latency characteristics are on a completely different level from local memory access. So having enough capacity only solves “it fits”; it does not solve “it runs fast.”

    Three real constraints determine deployment efficiency:

    1. Balance: whether experts and layers are evenly distributed across cards. If one card carries too many hot experts, it becomes a long-tail bottleneck while the other cards idle waiting.
    2. Communication efficiency: TP relies on frequent synchronization and is extremely sensitive to interconnect bandwidth; EP relies on data reordering after routing, so its communication pattern is more irregular.
    3. Fragmentation and watermark: the KV cache grows dynamically; if the reservation is insufficient, it triggers preemption or request queuing, showing up as severe P99 latency jitter.

    3. TP and EP: Two Orthogonal Partitioning Dimensions

    Tensor parallelism (TP) splits the large matrix operations of a single layer horizontally across multiple cards. Each card holds a weight shard and cooperates to complete one operator. The advantage is a significant reduction in per-card weight and activation pressure, making it suitable for large dense layers such as attention and FFN; the cost is that synchronization is required after every operator, with high communication frequency, so the TP degree usually should not exceed what the high-speed interconnect within a single machine can stably support.

    Expert parallelism (EP) targets the expert networks of MoE, placing entire experts on different cards. Each token hits only a few experts after routing, which produces the cross-card exchange of “send the token to the card where the expert lives, then bring the result back.” EP’s VRAM benefit is direct, but it introduces the risk of load imbalance and routing jitter.

    The two can be combined. A typical approach is: TP handles low-latency partitioning of the dense part, and EP handles capacity partitioning of the sparse experts. The values must align with the inference framework implementation, the model file layout, and the server topology; there is no universal optimum. A schematic configuration skeleton:

    1. parallel:
    2. tp_size: 4 # dense layer partitioning, constrained by intra-card interconnect capability
    3. ep_size: 2 # expert sharding, watch routing balance
    4. world_size: 8 # tp_size * ep_size must match the number of cards
    5. kv_cache:
    6. max_seq_len: 32768
    7. max_concurrency: 64
    8. dtype: bf16

    4. Conditional Memory Placement: The Dividing Line in VRAM Architecture

    The access pattern of Engram-style conditional memory differs from that of backbone weights: it is more like “a large table retrieved on demand” than something that “fully participates in multiply-accumulate at every step.” Therefore, some implementations choose to place it in host memory, with GPU VRAM serving the backbone weights and runtime cache first.

    The benefit is giving the scarce VRAM to the parts that genuinely need high bandwidth; the cost is introducing host-to-device transfer latency, which must be smoothed out through prefetching, caching hot entries, and batched retrieval. If extremely stable latency is the goal and VRAM is plentiful, tiered placement is also an option: hot data stays in VRAM, cold data stays in host memory.

    5. How Planning Differs Between Two 8-GPU Setups

    • 8×96GB platform: relatively ample VRAM, able to support a higher TP degree and longer context, with a more comfortable KV cache budget, suitable for API services with higher concurrency.
    • 8×72GB platform: tighter VRAM, more reliant on quantized weights, more aggressive Engram placement in host memory, and stricter concurrency limits, suitable for medium-concurrency scenarios such as internal assistants.

    The recommended planning steps are fixed: first measure the actual on-disk and post-load weight footprint → then estimate the KV cache based on the target context and concurrency → reserve 10%–15% for workspace and communication buffers → finally calibrate with real load testing, rather than back-calculating from theoretical parameter counts.

    6. Pre-Launch Checklist

    1. Are weights and expert distribution balanced, and is there a single-card hotspot?
    2. Has communication become a bottleneck, and does the TP/EP combination match the topology?
    3. Are the KV cache watermark and preemption rate within an acceptable range?
    4. Is the Engram placement strategy consistent with the business latency target?
    5. Is unified logging and monitoring with alerts in place, with baselines established for first-token latency, throughput, and VRAM watermark?
    6. Are model files, runtime images, and configurations version-controlled through an artifact repository to guarantee rollback?

    In enterprise deployment scenarios, designing the four VRAM budgets, the two parallelism strategies, and the placement strategy as a whole, and running operations and elasticity on general-purpose cloud infrastructure such as Baidu AI Cloud (for example, container platforms, object storage, and monitoring with alerts), is what avoids resource waste while keeping inference services stable and predictable under concurrency pressure.