8-GPU Local Deployment for Large Models: Memory Planning and Resource Allocation

    This article explains why total VRAM alone does not determine whether a large MoE model can be deployed on 8 GPUs. It breaks memory requirements into four separate budgets, compares tensor parallelism and expert parallelism, discusses placement strategies for conditional memory parameters, and outlines a practical deployment and testing path for teams building private inference services.

    1. Why “Enough Total VRAM” Does Not Mean “Deployable”

    For internal AI assistants, coding assistants, and model API services, deploying very large Mixture-of-Experts (MoE) models locally has become a common choice. However, many teams make only one calculation during selection: they add up the nominal VRAM of several accelerators, compare it with the model weight size, conclude that the model “fits,” and then run into OOM, throughput collapse, or latency spikes under real load testing.

    The root cause is that the total VRAM across 8 accelerators is not a unified, shared memory with a single address space. It consists of 8 independent address spaces that can exchange data only through interconnect links with limited bandwidth. Deployment feasibility therefore depends on three dimensions: whether capacity is sufficient, whether allocation is balanced, and whether communication is efficient. Capacity is only the entry ticket.

    Take a very large MoE model with roughly 500 billion backbone parameters plus about 196 billion conditional memory parameters as an example (with approximately 8 billion and 16 billion activated parameters per token during Prefill and Decode, respectively). Discussing deployment on two configurations of Blackwell-based professional cards, 8×96GB and 8×72GB, makes the coupling between resource planning and parallelism strategy clear.

    2. How Model Structure Determines the Memory Budget

    2.1 Activated Parameters Are Not VRAM Requirements

    A common misconception is that since only about 8 billion parameters are activated per token, a few cards should be enough. Activated parameters describe the subset of parameters that actually flow through a single forward pass; this is a compute concept. VRAM usage, however, depends on all weights that must remain resident. The sparsity of the MoE architecture reduces compute consumption, not storage usage.

    2.2 Four Resource Components Must Be Accounted for Separately

    Rigorous planning should split VRAM into four independent budgets:

    1. Backbone weights: The resident copies of all experts and shared layers, the largest and most rigid component.
    2. Conditional memory access space: Engram-style conditional memory parameters need to be randomly accessed. Their placement (resident in VRAM, tiered offload to host memory, or stored in object/file storage) directly changes VRAM pressure and access latency.
    3. KV Cache: Grows linearly with context length and concurrency, and is the only elastic item that the service operator can adjust flexibly.
    4. Runtime workspace and communication buffers: Includes temporary operator tensors, sampling and decoding buffers, and send/receive buffers required for parallel communication. This part is often overlooked, but its peak can be considerable during long-sequence Prefill.

    A public configuration has mentioned a VRAM budget of about 614GB as a planning reference for a specific loading method. The point of this number is not exact reproduction but to indicate the scale: under mixed-precision weights, the backbone and conditional memory together already reach hundreds of GB. 8×72GB (576GB) leaves almost no elastic space, while 8×96GB (768GB) has room to hold a meaningful KV Cache.

    2.3 A Reusable Estimation Script

    1. def plan_memory(n_main_b, n_engram_b, bytes_per_param,
    2. n_gpu, gpu_mem_gb, ctx_len, concurrency,
    3. layers, kv_heads, head_dim, kv_bytes=2):
    4. weights = (n_main_b + n_engram_b) * 1e9 * bytes_per_param / (1024**3)
    5. kv_per_token = 2 * layers * kv_heads * head_dim * kv_bytes / (1024**3)
    6. kv_cache = kv_per_token * ctx_len * concurrency
    7. runtime = weights * 0.08 # Empirical reserve: workspace + communication buffers
    8. total = weights + kv_cache + runtime
    9. cap = n_gpu * gpu_mem_gb * 0.92 # Reserve for driver and fragmentation overhead
    10. return {"weights_GB": round(weights,1),
    11. "kv_GB": round(kv_cache,1),
    12. "total_GB": round(total,1),
    13. "capacity_GB": round(cap,1),
    14. "feasible": total < cap}

    The value of the script is turning “can it fit” into a quantitative problem with tunable parameters: lowering ctx_len or concurrency, switching to lower-bit quantization, or tiering conditional memory offload will all change the conclusion.

    3. The Division of Labor and Combination of TP and EP

    Tensor Parallelism (TP) splits the tensors inside a single operator across multiple cards. It suits regular computation such as large matrix multiplications and can significantly reduce per-card weight and compute burden. The cost is that every layer requires cross-card reduction, making it sensitive to interconnect bandwidth and latency. TP degree usually should not exceed the scale of the high-speed interconnect domain within a single machine.

    Expert Parallelism (EP) targets the expert layers of MoE models by placing different experts on different devices. Since each token is routed to only a few experts, EP is memory-efficient, but it introduces routing computation and cross-card All-to-All data exchange. Load imbalance (popular experts concentrated on certain cards) makes individual cards bottlenecks, and overall throughput is determined by the slowest card.

    In engineering practice, the two are often combined: TP handles the dense backbone and attention parts, while EP handles the sparse expert parts. The values must match the inference framework’s support matrix, model implementation details, and server topology; there is no universal optimum. The practical rule is to keep TP within the high-speed interconnect range of a single machine, then use EP to expand expert distribution within the node.

    4. Placement Strategies for Conditional Memory

    Conditional memory parameters are large and have a different access pattern from backbone weights, so placement is an independent tuning dimension:

    • Fully resident in VRAM: Lowest latency, but squeezes KV Cache space.
    • Tiered offload to host memory: Lower VRAM pressure, with controllable memory access latency.
    • On-demand loading from a storage service: Suitable for cold data, requiring a cache layer and prefetch strategy.

    The choice should be based on business SLAs: interactive conversations are sensitive to tail latency, while batch-style API services can tolerate higher latency in exchange for greater concurrency.

    5. Implementation Path for 8-GPU Deployment

    1. Define service goals: Distinguish interactive from batch workloads, and determine context length, concurrency, and the P99 latency limit.
    2. Calculate the VRAM budget: Use the script above to output the four components and confirm capacity and elastic headroom.
    3. Choose the parallelism scheme: Select a TP/EP combination based on topology and check framework support.
    4. Verify the topology: Confirm inter-card interconnect bandwidth, NUMA affinity, and whether data paths are balanced.
    5. Load test and tune: Start from low concurrency, increase load gradually, and observe VRAM peaks, routing balance, and tail latency.
    6. Add observability: Connect monitoring, alerting, and logging services, and set threshold alerts for VRAM, throughput, and queue length.
    7. Elasticity and disaster recovery: If multiple replicas are needed, use a container platform for orchestration and distribute model files through object storage.

    6. Common Pitfalls and Troubleshooting Checklist

    • Looking only at the sum of nominal VRAM while ignoring runtime buffers and fragmentation.
    • Treating activated parameters as VRAM requirements.
    • Setting TP degree too high, making cross-card reduction the bottleneck.
    • Ignoring expert load imbalance, causing individual cards to overload.
    • Leaving KV Cache unbounded, which inevitably leads to OOM under long context and high concurrency.
    • Lacking a load-test baseline, making it impossible to tell whether tuning is effective.

    7. Conclusion

    The essence of 8-GPU local deployment is a combined problem of resource allocation and communication optimization. Splitting VRAM into four budgets, binding the parallelism strategy to the topology, treating conditional memory placement as an independent variable, and using load-test data as the only judge are what make stable and predictable inference services possible under capacity constraints. For enterprises with compliance and data-residency requirements, this approach also applies to building a private inference foundation in environments with complete compute, container, and observability capabilities, such as Baidu AI Cloud.