Eight-GPU Deployment and Memory Planning for Large Mixture-of-Experts Models

    This article explains how to plan eight-GPU local deployment of large mixture-of-experts (MoE) models. It covers capacity, compute, and communication constraints; how to separate total parameters from the actual execution path; how to build a memory budget for weights, conditional memory, KV cache, and runtime buffers; how tensor parallelism and expert parallelism trade off; and how to validate loading, correctness, and production load.

    1. The core constraint of eight-GPU deployment: capacity, compute, and communication must all hold

    Local deployment of large mixture-of-experts models is first a systems problem, then a model-loading problem. Whether eight GPUs can host a model depends on three conditions at once: each GPU can hold its assigned weights and runtime state; compute can be distributed reasonably evenly; and data exchange between devices is not the dominant bottleneck.

    Two misjudgments are especially common.

    The first is treating “parameters activated per token” as “parameters that must be loaded.” Sparse routing reduces how many experts participate in a given computation, but different inputs may hit different experts. If the deployment keeps experts resident in GPU memory, those expert weights still need reserved space.

    The second is treating eight GPUs as one shared memory pool. Typically each GPU has independent memory; cross-device access requires explicit communication or runtime coordination. Enough aggregate capacity only shows that a placement might exist. It does not prove a sharding plan is feasible, and it does not guarantee inference efficiency.

    Planning should therefore follow: confirm model structure → build a resource ledger → choose a parallelism strategy → verify communication → run service load tests.

    2. Start from model structure: parameter scale vs. the actual execution path

    2.1 Why MoE can cut compute without necessarily cutting storage

    An MoE stack usually includes shared compute, a router, and many expert modules. For a token, the router selects some experts; the rest do not run that token’s work.

    Distinguish three notions:

    • Total parameters: all parameters in the model; this mainly drives weight storage.
    • Activated parameters: parameters on a given execution path; this mainly describes compute sparsity.
    • Actual compute and communication cost: also depends on sequence length, batch size, operator implementation, routing distribution, and interconnect.

    Fewer activated parameters does not mean inference cost drops by the same factor. If experts sit on different GPUs, matrix work may shrink while token dispatch and result gather add communication.

    Parameter counts, activation sizes, and memory budgets in source materials are tied to specific models and implementations. A generic plan should not reuse those numbers as capacity proof for other models. Recalculate from actual weight files, tensor dtypes, and runtime load results.

    2.2 Prefill and decode have different bottlenecks

    Prefill processes many input tokens at once and tends to produce large matmuls. Long inputs also add attention compute and cache writes.

    Decode repeats generation steps. At small batch sizes, weight access, cache reads, communication sync, and kernel launch can dominate.

    The same parallel layout can behave differently in the two stages. Testing only short inputs or only average throughput often misrepresents production behavior.

    3. Build a memory ledger, not just a weight-file size

    A complete deployment should budget weights, conditional memory, KV cache, and runtime workspace plus communication buffers separately.

    3.1 Backbone and expert weights

    A first-order estimate:

    Weight footprint ≈ sum over parameter groups of (parameter count × average bytes per parameter)

    For mixed precision or quantized weights, do not multiply total parameters by a single byte width. Some tensors may stay in higher precision; quantization may add scales, group metadata, and other auxiliaries.

    After load you may also see layout transforms, padding, or extra copies. Distinguish on-disk size, resident GPU memory after load, and peak memory during load.

    3.2 Conditional memory and lookup-style state

    If the model has conditional memory or lookup modules, decide where that access space lives. Do not assume the same placement as other weights.

    Common options:

    • Fully resident on GPU: fewer cross-tier accesses, higher memory cost.
    • Host memory with transfer or caching.
    • Tiered storage, keeping hot content on faster tiers.

    These are design options, not guarantees that every model or runtime supports them. Confirm operators, indexing, and cache management.

    Access pattern matters: low average traffic does not imply low tail latency. Cache misses or bursty access can jitter generation latency.

    3.3 KV cache

    KV cache stores attention history and typically grows with active sequences and accumulated tokens. For standard attention, a first budget is:

    KV cache bytes ≈ 2 × layers × total cached tokens × KV heads × head dim × bytes per element

    The factor 2 is keys and values; total cached tokens is the sum of cache lengths over active sequences.

    The formula does not cover every attention design. Compressed cache, sliding windows, or other layouts need real tensor shapes.

    Whether KV cache shrinks in proportion to tensor-parallel degree is also not universal. Some setups shard; others replicate. Check per-GPU allocation.

    3.4 Runtime workspace and communication buffers

    Inference may allocate intermediate activations, expert routing indices, token-reorder buffers, collective-communication buffers, and allocator metadata. Some optimizations keep extra memory.

    Treat per-GPU peak as:

    Per-GPU peak = resident weights + resident conditional memory + KV cache + workspace and comm buffers + other runtime overhead

    Check load-time peaks separately. Fitting at steady state does not mean loading will stay under capacity.

    4. Tensor parallelism: split compute tensors, pay for synchronization

    Tensor parallelism (TP) splits tensors or matmuls in a layer across GPUs.

    It reduces per-device weight and compute for shared modules and large matmuls. After the split, devices usually need all-gather, reduce, or other collectives before the next layer.

    When choosing TP, check:

    1. Whether tensor dims split cleanly. Too fine a split can starve per-GPU compute.
    2. What remains replicated. Routers, norms, and other small modules may not shrink with TP.
    3. Whether sync is on the critical path. Frequent sync can cap decode speed.
    4. Whether interconnect matches the traffic. Eight GPUs with the same memory can still differ by topology.

    Larger TP is not always better. It is a trade among capacity, compute efficiency, and sync cost.

    5. Expert parallelism: place experts and manage token traffic

    Expert parallelism (EP) places different experts on different GPUs or groups. After routing, tokens go to the expert’s device; results return or merge.

    This spreads expert weights but creates two issues.

    5.1 Equal expert weights ≠ equal runtime load

    Even with the same expert count per GPU, requests may prefer some experts, leaving some GPUs busy and others idle.

    Watch:

    • expert weight occupancy per GPU;
    • tokens received per expert;
    • compute time per device;
    • wait time caused by the slowest device.

    You may adjust placement or scheduling within what the runtime allows. Do not arbitrarily change routing semantics, or outputs may change.

    5.2 Token dispatch can become the bottleneck

    EP usually exchanges tokens across devices. Cost depends on bytes, message count, routing sparsity, comm scheduling, and topology.

    At small decode batches, launch and sync overhead can dominate; at larger prefill batches, link throughput may dominate. Judge EP by measuring both stages, not GPU compute utilization alone.

    6. Combining TP and EP on eight GPUs

    TP splits compute tensors; EP assigns experts. They can be combined, but group layout depends on the runtime.

    For example, shared modules may use a larger TP group while experts are spread across devices; or several devices may jointly host a set of experts. Whether those layouts exist, and how communication is organized, must be confirmed in the actual implementation.

    Do not treat “TP degree × EP degree must equal 8” as a universal rule. Some runtimes use orthogonal parallel groups; some use different grouping per module; some still replicate.

    Draw a device-to-module map first: which GPU holds which shared weights, experts, cache, and comm buffers. Then discuss degrees.

    Include topology. Eight GPUs may sit in different interconnect domains; some traffic may even go via the host. High-frequency groups should match low-latency, high-bandwidth links, but you still need measurements.

    7. Capacity must be judged per GPU, with headroom for service load

    An eight-GPU plan should answer:

    • Is there a reasonable placement for all weights and state?
    • Does the most crowded GPU still have runtime headroom?
    • Under target concurrency and context length, is cache growth controllable?

    If one GPU holds more shared modules, experts, or output-related weights, it can OOM while others still have free memory.

    Hundreds-of-GB memory figures in source material are better read as budget examples for a specific load config, not a fixed deployment threshold. Precision, conditional-memory placement, cache length, and concurrency all change demand.

    Record per GPU: resident occupancy, steady-state peak, load peak, and remaining space. Set explicit business limits for max context and concurrent requests so you do not exhaust memory before you can throttle the service.

    8. From successful load to stable serving

    Step 1: Confirm config and runtime support

    Check model structure, weight precision, expert count, attention config, and how conditional memory is accessed. Then confirm supported parallel layouts, quantization, and cache management.

    Step 2: Validate load and output correctness

    Run short inputs and small batches. Record per-GPU load peak and resident occupancy and look for imbalance. After parallel or quantization changes, use a fixed test set to check output quality and task metrics.

    Step 3: Scale load one axis at a time

    Increase input length, output length, concurrency, and batch size separately, changing few variables each time, so you can separate weight capacity, cache growth, and communication bottlenecks.

    Step 4: Record service metrics

    At least: time to first token, per-token decode latency, request completion time, throughput, per-GPU memory peak, communication wait, and failure rate. Beyond averages, watch high-percentile latency for routing hotspots, cache misses, and bursty traffic.

    Step 5: Endurance and failure tests

    Check long-running memory growth, whether cache is released after cancellations, interaction of mixed long/short requests, and whether the service queues or rejects as designed at resource limits.

    Successful load and a short run are only the start. Deployment is complete when the service stays predictable under the agreed load.

    9. Conclusion: four ledgers for eight-GPU feasibility

    Eight-GPU MoE deployment needs a weight ledger, a state ledger, a compute ledger, and a communication ledger.

    Weights answer how the model is sharded; state answers how conditional memory and KV cache grow; compute answers whether load is balanced across stages; communication answers whether TP sync and EP dispatch stay acceptable.

    Activated-parameter count describes sparsity of the compute path; it does not replace a full memory budget. Aggregate eight-GPU memory describes an upper bound; it does not replace per-GPU placement. Parallelism describes work division; it does not replace production load tests. Keep those boundaries distinct so you can move from “fits in theory” to “runs stably in practice.”