8-GPU Local Deployment of Large MoE Models: Architecture, TP/EP, and Memory Planning
This article explains how to plan an 8-GPU local deployment for a large sparse MoE model, covering model structure, four-part GPU memory budgeting, TP and EP partitioning, conditional memory placement in host memory, and integration and acceptance checks for typical 96GB and 72GB GPU platforms.
1. Problem Definition: What Must Fit on 8 GPUs
Enterprise AI assistants, developer coding assistance, and external model API services place different demands on a local inference cluster. Assistant workloads focus on first-token latency and long-context stability. Developer assistance focuses on throughput under concurrency and the response rhythm of code completion. API services focus on SLAs and resource isolation. On the hardware side, however, they face the same question: how to run a sparse model with total parameters in the hundreds of billions stably on a single 8-GPU server.
This article uses two typical platforms as references: an 8-GPU platform with 96GB of GPU memory per GPU (768GB nominal total) and an 8-GPU platform with 72GB per GPU (576GB nominal total). A common misunderstanding should be corrected up front: the 768GB or 576GB is not a single unified shared memory space. It consists of eight independent address spaces connected by high-speed interconnects or PCIe switching. Capacity is only the first threshold. Balanced allocation and efficient communication are what determine actual usability.
2. Model Structure: Sparse Activation and Conditional Memory
These models generally use a MoE backbone and additionally attach a set of conditional memory parameters. For the model scale referenced in this article, the backbone has about 552B parameters and the conditional memory has about 196B parameters, totaling approximately 748B.
The real driver of compute pressure is activation scale: during Prefill, about 8B parameters are activated per token; during Decode, about 16B parameters are activated per token. One point must be emphasized because it is repeatedly misread: activated parameters describe the portion triggered along the compute path. They do not mean that GPU memory only needs space for 8B or 16B parameters. All expert weights, conditional memory index structures, and runtime caches must either remain resident or be quickly addressable; otherwise, computation cannot complete when routing selects an expert that is not loaded.
Decode activation is higher than Prefill activation because autoregressive decoding must account for conditional computation over historical context, while Prefill processes the entire prompt in parallel with a shorter per-token compute path. This difference directly leads to deployment strategy: Prefill is compute-intensive, while Decode is memory-bandwidth and capacity-intensive. Their resource profiles differ, which is why engineering approaches such as PD separation arise.
3. Four-Part GPU Memory Budget
Rigorous capacity planning should divide GPU memory into four independently accounted parts:
- Backbone weights: MoE expert matrices are the main consumer. Under mixed-precision implementations, public configurations have used a GPU memory budget of about 614GB as a planning reference for a specific loading method. This number varies with quantization method, expert placement, and parallel partitioning, so it can only serve as a magnitude anchor.
- Conditional memory access space: Index tables, mapping structures, and necessary resident shards. If all of this is placed in GPU memory, it will significantly squeeze the other three parts.
- KV Cache: Proportional to the number of layers, KV heads, head dimension, context length, and concurrency. It is the main variable for long-context workloads. General estimation formula:
KV_bytes ≈ 2 × layers × kv_heads × head_dim × seq_len × concurrency × bytes_per_elem
- Runtime workspace and communication buffers: Temporary operator tensors, AllReduce/All-to-All send and receive buffers, and framework reservations. Experience shows that a considerable margin is needed; otherwise, fragmentation can cause OOM under high concurrency.
Plugging the 614GB-scale budget into the two platforms: 96GB × 8 still leaves approximately 150GB for KV Cache and runtime use; the 576GB nominal capacity of 72GB × 8 is already below this budget, meaning some parameters must rely on host memory (a typical approach is offloading conditional memory), or loading cannot complete. This arithmetic relationship is the first dividing line in platform selection.
4. TP and EP: Division of Labor Between Two Partitioning Methods
TP (Tensor Parallelism) splits large matrices in a layer by rows or columns across multiple GPUs. Each GPU holds a weight shard and participates in computation for the same layer, and results are merged through AllReduce. The advantages are linear sharing of memory and compute and friendliness to dense layers and attention layers. The cost is that every layer requires cross-GPU synchronization, making it extremely sensitive to interconnect bandwidth. If TP degree is too high, communication overhead will consume the compute gains.
EP (Expert Parallelism) targets MoE expert networks by placing different experts as whole units on different devices. Because each token activates only a few experts, actual communication volume depends on routing distribution: when load is balanced, All-to-All data volume is manageable; once hotspot experts concentrate, some GPUs become overloaded while others sit idle. Therefore, expert routing strategy and cross-GPU data exchange are the main performance variables for EP.
The two can be combined. A typical approach is to use TP for attention and dense parts to ensure low latency, and use EP for expert parts to ensure capacity. The values must match the inference framework, model implementation, and server topology. There is no universal optimal solution. Illustrative configuration logic:
world_size = 8tp_size = 2 or 4 # constrained by interconnect bandwidthep_size = world_size / tp_size# Constraint: high-bandwidth interconnect within tp_size group; lower bandwidth tolerated between ep groups
5. Conditional Memory Placement and Host-Side Architecture
Placing conditional memory in host memory so that GPU memory can better serve backbone weights and runtime cache is a key approach that makes the 72GB platform feasible. However, the cost does not disappear; it shifts to the CPU side. Evaluation then focuses on total memory capacity and whether there is headroom, whether memory bandwidth can support the frequency of conditional access, whether dual-socket CPU NUMA distribution causes cross-node memory access, whether the PCIe access path is direct or switched, and whether caching and prefetching strategies are effective.
6. Integration and Acceptance Checklist
- Verify that the number of memory DIMMs and channel population are symmetric across dual-socket CPUs to avoid a single-socket bandwidth bottleneck.
- Check the connection relationship between PCIe slots and GPUs, and confirm whether any inter-GPU link crosses a Root Complex with degraded bandwidth.
- Explicitly set CPU/GPU affinity and memory binding for inference processes to avoid thread migration to remote NUMA:
# Affinity binding example (fill in according to topology query results)process_0 → gpu0, node0 cpus, node0 memoryprocess_4 → gpu4, node1 cpus, node1 memory
- Stress-test acceptance should cover at least: first-token latency, per-token output latency, steady-state throughput, GPU memory watermark curve, expert load skew, and OOM boundary under long context.
- With the same 8-GPU count, latency and throughput can differ by several times due to topology and data placement. Acceptance must be based on measured results rather than nominal capacity.
7. Conclusion
The essence of local 8-GPU deployment for large MoE models is joint optimization of a four-part budget and two types of parallelism under fixed capacity: first calculate the weight account at the 614GB scale, then determine whether host memory offload is needed, then use TP to protect latency and EP to protect capacity, and finally use topology and affinity to turn theoretical bandwidth into actual throughput. If business elasticity fluctuates significantly and multiple model services need to be launched quickly, a general container platform and elastic compute can also be used, together with logging services and monitoring and alerting to build observability, complementing the local cluster.
