Deploying Sparse MoE LLMs on 8 GPUs: Architecture, Parallelism, and Capacity Planning

    Activated parameters in a sparse MoE model are not the same as VRAM use. This article explains how to plan an 8-GPU deployment by budgeting full weights, conditional-memory access, KV cache, and runtime buffers, then combining tensor and expert parallelism with peak and safety-margin checks.

    Deploying Sparse MoE LLMs on 8 GPUs: Architecture, Parallelism, and Capacity Planning

    1. Start with the architecture: activated parameters are not VRAM use

    Sparse MoE models often combine a backbone network with a conditional memory module. Using one public technical configuration as a reference: backbone parameters are about 552B and conditional memory parameters are about 196B. Per-token activated parameters are about 8B in prefill and about 16B in decode. A common mistake is to treat those activated-parameter figures as the VRAM needed for the full model weights. They only describe how many parameters a single token actually uses on its compute path.

    Even though each token is routed to only some experts, every expert weight still has to be loaded, addressed, and scheduled on demand. Conditional memory works in a similar way. It may be accessed through indexes, caches, shards, or tiered storage, but a full deployment still needs address space, mapping tables, and swap buffers. Local capacity planning therefore cannot be “8B or 16B activated parameters times bytes per parameter.” Model it in four parts: full weights, memory access, KV cache, and runtime workspace.

    A complete deployment usually needs four resource budgets:

    1. Backbone weights: attention layers, routing layers, shared feed-forward layers, and all expert weights. Even if one token activates only some experts, the full weight set must remain accessible.
    2. Conditional-memory access space: memory-parameter shards, index structures, cache regions, and possible swap buffers. Placement strongly affects both VRAM and latency.
    3. KV cache: the main elastic cost for long-context serving. It scales with concurrency, context length, layer count, KV head count, and precision.
    4. Inference workspace and communication buffers: temporary tensors, routing sort buffers, expert dispatch and combine, collective-communication buffers, fragmentation headroom, and failure-recovery margin.

    For mixed-precision or quantized weights, public material has cited about 614GB of VRAM as a planning reference for one specific loading method. Treat that number as a budget for that loading method, not as a fixed requirement for every precision and every parallel strategy. Actual demand changes with memory placement, quantization granularity, serving concurrency, context length, and communication-buffer policy.

    2. The 8-GPU capacity boundary: total the budget before choosing parallelism

    The first step on an 8-GPU node is a capacity check, not a parallelism choice. If each GPU has M GB of usable VRAM, total VRAM is 8M GB. At 80GB per GPU, that is about 640GB; at 96GB per GPU, about 768GB. The 614GB reference leaves only about 26GB on a 640GB node, roughly 4 percent. That remainder must cover workspace, communication buffers, fragmentation, and peak spikes, so it is often too tight in practice.

    Plan in this order: total budget, per-GPU split, peaks, then margin.

    • Total: weight bytes + memory-access space + KV cache budget + runtime buffers ≤ 8 × usable VRAM per GPU.
    • Split: after TP/EP sharding, check that the largest shard on each GPU is balanced. Total VRAM can be enough while one GPU still runs out.
    • Peaks: estimate prefill and decode separately. Prefill is dominated by compute and temporary activations; decode is dominated by KV cache growth and expert-routing traffic.
    • Margin: keep at least 10%–15% of total VRAM as safety margin. Raise that further if you use tiered memory or dynamic batching.

    A first-pass capacity check can look like this:

    1. Inputs:
    2. W_main = backbone weight bytes
    3. W_mem = conditional-memory access-space bytes
    4. KV_req = KV cache bytes per request
    5. batch = target concurrency
    6. WS = runtime workspace and communication-buffer bytes
    7. M_card = usable VRAM per GPU
    8. N_card = 8
    9. safety = safety-margin ratio
    10. total_demand = W_main + W_mem + KV_req * batch + WS
    11. total_capacity = M_card * N_card * (1 - safety)
    12. if total_demand > total_capacity:
    13. first reduce batch, shorten context, increase quantization, or enable tiered memory
    14. else:
    15. proceed to TP/EP shard-balance checks

    3. Split the work between TP and EP

    Tensor parallelism (TP) splits matrix compute inside a layer across GPUs. It reduces per-GPU weights and temporary activations. Expert parallelism (EP) places different experts on different GPUs and is better suited to a large expert-weight footprint. They do not solve the same problem.

    In an MoE model, attention and shared layers in the backbone usually depend more on TP; expert layers fit EP better. When there are many experts and each expert is large, EP can cut per-GPU expert weight sharply, but it adds all-to-all expert dispatch and combine traffic. TP adds collective communication at many layers. On an 8-GPU node with high intra-node bandwidth, a TP/EP mix is usually practical. If interconnect bandwidth is limited, reduce the parallel dimensions that communicate often, and keep high-traffic paths inside the node.

    A practical order is:

    1. Set EP degree from expert count and per-GPU capacity so expert shards stay within the per-GPU limit.
    2. Use TP on attention and shared feed-forward layers to control per-layer temporary activations.
    3. Compare communication in prefill and decode. Prefill is compute-heavy with large batches, so TP traffic can dominate. Decode is more sensitive to KV cache and routing traffic.
    4. Place conditional memory separately: keep hot data in VRAM and colder data in host memory or remote storage, as a tiered access path.

    Higher TP or EP is not automatically better. More parallelism reduces per-GPU weights but adds communication, synchronization, and scheduling cost. The goal on 8 GPUs is to keep weight shards, KV cache, and communication buffers inside a safe range at the same time, not to minimize per-GPU weights alone.

    4. KV cache and runtime buffers: the costs most often undercounted

    KV cache is usually estimated as layers × KV head dimension × sequence length × concurrency × bytes per element × 2 (K and V). Grouped-query attention uses fewer KV heads than query heads, which shrinks the cache, but long context and high concurrency still grow it quickly. Plan both average and peak context lengths, and leave room for dynamic batching.

    Runtime buffers include routing sorts, expert dispatch and combine, temporary activations, communication buckets, VRAM fragmentation, and recovery margin. MoE routing is data-dependent, so expert load can be uneven across requests and spike on a few GPUs. Besides static capacity, watch expert balance and communication peaks. If a subset of GPUs hits VRAM or bandwidth first, adjust expert placement, cap batch size, or use finer-grained capacity scheduling.

    5. Acceptance: from “it loads” to “it serves steadily”

    Check deployment in three layers:

    • Load: full weights and memory space load, no single-GPU OOM, shards are balanced.
    • Function: prefill and decode paths are correct, routing is stable, and long context does not fail.
    • Service: at the target concurrency and context length, VRAM margin, latency, throughput, and communication peaks are acceptable.

    When tuning, usually reduce concurrency and peak context first, then adjust quantization and memory tiering, and increase parallelism last. More parallelism adds communication complexity and may not fix KV cache or fragmentation.

    6. Conclusion

    Deploying a sparse MoE model on 8 local GPUs is not about memorizing one VRAM number. It is a method: architecture, resources, parallelism, peaks, and margin. Activated parameters describe the compute path only. Full weights, conditional-memory access space, KV cache, and runtime buffers must be estimated separately. Use TP and EP together according to layer type and expert layout, and keep enough safety margin on the 8-GPU total. A plan is reusable and stable only when capacity math, shard balance, and serving peaks are all part of acceptance.