Deploying Large MoE Models on Eight GPUs: TP, EP, and Resource Planning
Learn how to plan an eight-GPU deployment for large mixture-of-experts models, including weight placement, conditional memory, KV cache, tensor and expert parallelism, and server topology. This guide compares two illustrative memory configurations and outlines a staged validation process for setting practical context-length, concurrency, and cache limits.
Eight-GPU servers are often treated as a basic deployment unit for enterprise assistants, developer tools, knowledge-based question answering, and model API services. However, having enough aggregate GPU memory does not guarantee stable inference.
For very large models that combine mixture-of-experts architectures, conditional memory modules, and distributed inference, deployment depends on several interrelated factors: how weights are partitioned, where experts are placed, how many parameters are active at each inference stage, how GPUs exchange data, and how much cache memory context length and concurrent requests require.
This article uses a class of very large sparse MoE models to explain general engineering practices for eight-GPU, on-premises deployment. It is not tied to a particular vendor, platform, or product. All capacity figures are illustrative; actual requirements depend on the model implementation, weight format, inference framework, and hardware topology.
1. Understand the Model Architecture Before Planning GPU Memory
Mixture-of-experts, or MoE, models combine a large shared backbone with multiple expert networks. Each token passes through only a small number of experts selected by a routing module, rather than every expert. As a result, the computation per token is much smaller than the model’s total parameter count might suggest.
Three concepts must be kept separate:
- Total parameters: The basis for model-file size and weight-storage requirements.
- Active parameters: The parameters that participate in a token’s forward pass.
- Deployment memory footprint: The combined memory required for weights, caches, runtime workspaces, and communication buffers.
For example, a model in this category might have approximately 552 billion backbone parameters and 196 billion conditional-memory parameters. It might activate roughly 8 billion parameters per token during prefill and 16 billion during decode.
Those active parameter counts describe the computational path, not the amount of weight storage needed. To support different routing decisions, the relevant weights and indexing structures must remain available, either in full or as shards, within the accessible memory hierarchy.
GPU memory planning should therefore account for at least the following components.
Backbone Weights
Backbone weights typically include attention layers, shared feed-forward layers, routing layers, normalization layers, and expert parameters. Their memory footprint depends on weight precision and the loading method.
A rough estimate is:
Weight storage ≈ Parameter count × Bytes per parameter
This is only a theoretical lower bound. Actual loading may also require scaling factors, quantization metadata, alignment padding, temporary conversion buffers, and some uncompressed weights.
Server sizing should not rely solely on multiplying parameter count by the nominal storage precision.
Conditional Memory or Engram Storage
Conditional-memory modules typically store large collections of tokens, knowledge fragments, or retrievable parameterized information. They may reside in GPU memory, host memory, or a tiered cache.
Keeping the entire module on GPUs generally makes access latency easier to control, but leaves less room for backbone weights, KV cache, and runtime workspaces.
If conditional memory is placed in host RAM, evaluate:
- Whether host memory capacity is sufficient.
- Whether memory placement is appropriate across NUMA nodes in a dual-socket server.
- Whether the PCIe path between each GPU and its corresponding CPU node can support the workload.
- Whether memory bandwidth can sustain frequent accesses.
- Whether cache hit rates meet service requirements.
- Whether multiple processes compete for the same memory resources.
Host-memory offloading does not make conditional memory free to operate. It moves the cost from GPU memory to CPU memory capacity, bus bandwidth, and access latency.
KV Cache
KV cache is one of the main sources of dynamic memory consumption in long-context and high-concurrency inference. Its size depends on:
- Input context length.
- Generated output length.
- Number of concurrent requests.
- Number of layers.
- Attention-head configuration.
- KV data precision.
- Use of paged caching or cache-reuse mechanisms.
A simplified planning relationship is:
KV cache footprint ≈ Cache bytes per token × Effective context tokens × Concurrent requests
Even if the weights fit across eight GPUs, insufficient KV cache headroom can cause out-of-memory errors, request queues, or process termination when contexts become longer or concurrency increases.
Runtime Workspaces and Communication Buffers
Distributed inference needs additional memory for temporary operator tensors, routing results, All-Reduce buffers, All-to-All buffers, activations, and intermediate data used during token rearrangement.
Inference frameworks differ substantially in their memory-management strategies. These requirements must be verified through actual startup tests and load testing, not static estimates alone.
2. How TP and EP Shape an Eight-GPU Deployment
Tensor Parallelism: TP
Tensor parallelism splits a large matrix or computational tensor across multiple GPUs. Each GPU performs part of the computation, and collective communication combines the results.
TP offers several benefits:
- Reduces the weight storage required on each GPU.
- Allows large linear layers to execute across devices.
- Supports shared backbone and attention modules.
- Helps make model loading possible when per-GPU memory is constrained.
The trade-off is communication overhead. Synchronization may be required at every layer or at several key points, and communication latency directly affects token generation speed.
TP scaling becomes less efficient when GPUs lack high-bandwidth interconnects, communication frequently crosses CPU sockets, or link topology is uneven.
A higher TP degree is therefore not always better. An eight-GPU server can use a large tensor-parallel group or divide its GPUs into smaller parallel groups. The appropriate layout depends on model structure, communication patterns, and target throughput.
Expert Parallelism: EP
Expert parallelism distributes MoE experts across GPUs. When the router selects an expert, the corresponding tokens are sent to the device hosting that expert, processed, and returned to their original positions.
The central challenge is data exchange. Tokens within a batch may be routed to several devices, creating cross-GPU All-to-All traffic. Small request batches or uneven token routing can leave some GPUs busy while others sit idle, producing expert load imbalance.
Deployment planning should examine:
- Whether experts are distributed evenly.
- Whether routing capacity is configured appropriately.
- Whether certain experts receive disproportionately high traffic.
- Whether token rearrangement and result collection consume substantial GPU memory.
- Whether communication buffers are large enough.
- Whether communication latency dominates small-batch decode.
TP and EP can be combined. For example, backbone layers can use TP while expert layers use EP, creating a two-dimensional parallel layout.
However, parallel-group design must match the inference framework’s supported implementation. It cannot be determined simply by combining groups until the GPU count reaches eight.
3. Resource Planning for Two Eight-GPU Configurations
Consider two illustrative configurations:
- Configuration A: Eight high-memory GPUs with approximately 96 GB per GPU.
- Configuration B: Eight GPUs with approximately 72 GB per GPU.
Their aggregate GPU memory is approximately 768 GB and 576 GB, respectively.
These totals do not represent a single shared memory pool that every GPU can access freely. They are eight separate device-memory spaces. Deployment feasibility depends on whether each local shard fits and whether cross-device communication is efficient.
Configuration A: More Headroom for Weights and Larger Caches
With mixed-precision weights, appropriate sharding, and some runtime data kept in host memory, Configuration A generally offers more deployment headroom.
Its advantages include:
- More room for backbone weights.
- A larger KV cache budget.
- Less risk of reaching memory limits under long contexts or higher concurrency.
- Greater tolerance for expert load imbalance and temporary buffer growth.
This does not imply unlimited concurrency. If conditional memory, expert weights, and caches are concentrated on a few devices, those GPUs can still run out of memory.
Inspect actual memory usage on every GPU during loading rather than relying on aggregate capacity.
Configuration B: A More Disciplined Memory Hierarchy
Configuration B has a tighter GPU memory budget and generally requires more precise resource allocation. Measures may include:
- Placing conditional memory in host RAM.
- Using a more compact weight format.
- Reducing the default context length.
- Limiting concurrent requests.
- Setting an explicit KV cache limit.
- Reducing unnecessary memory reservations.
- Prioritizing stable operation during decode.
This configuration may suit low-concurrency workloads, internal trials, or services with modest throughput requirements. Load testing is still essential before production use.
In particular, several long-context requests arriving together can cause dynamic cache usage to exceed estimates quickly.
4. Server Topology Matters More Than GPU Count Alone
An eight-GPU server’s performance depends not only on GPU specifications and memory capacity, but also on its CPUs, host memory, and PCIe topology.
NUMA Planning
Dual-socket servers typically have multiple NUMA nodes. If a GPU is attached to one CPU node while its process threads and host-side cache primarily reside on another, additional cross-node access may be required.
Before deployment, map:
GPU device → PCIe root → CPU socket → Memory NUMA node
Place inference processes, data-preprocessing threads, and associated host caches as close as practical to the GPUs they support.
PCIe and Cross-GPU Communication
Check whether GPUs are distributed evenly across PCIe roots, whether devices share upstream links, and whether communication across CPU sockets creates a bottleneck.
EP requires frequent cross-GPU data exchange. TP collective operations may also traverse several levels of the interconnect topology.
Poor topology can substantially reduce throughput even when GPU memory capacity is sufficient.
CPU and Host Memory Capacity
When conditional memory or some weights reside on the host, the CPU is more than a resource for launching the inference process. It also supports data movement, request scheduling, token preprocessing, cache management, and communication coordination.
Size host memory according to model scale and the offloading proportion. Ensure memory modules are distributed evenly across channels and NUMA nodes.
5. From Capacity Estimates to Production Validation
A staged deployment process makes it easier to identify capacity and performance limits.
Step 1: Build a Static Capacity Budget
Record at least:
- Backbone weight storage.
- Expert weight storage.
- Engram or conditional-memory storage.
- Expected weight shards on each GPU.
- KV cache budget.
- Runtime workspace.
- Communication buffers.
- Safety margin.
Do not eliminate the safety margin to maximize nominal capacity. Changes in batch composition, routing imbalance, or temporary tensor sizes can otherwise cause failures.
Step 2: Confirm the Parallelism Strategy
Choose the TP and EP combination supported by the model implementation, then verify that each parallel group maps appropriately to the hardware topology.
Assess communication overhead and per-GPU load, not just theoretical throughput.
Step 3: Start in Stages
Begin with a weight-loading test, followed by single-request prefill and single-request decode. Then gradually increase context length and concurrency.
This sequence helps distinguish among:
- Insufficient memory for static weights.
- Excessive peak memory during prefill.
- Growing KV cache usage during decode.
Step 4: Establish Monitoring
Before production deployment, continuously collect:
- GPU memory usage per device.
- GPU utilization.
- Inter-GPU communication bandwidth.
- Host memory usage and NUMA locality.
- Prefill latency.
- Average decode speed.
- Time to first token.
- Request queue time.
- Expert load distribution.
- Out-of-memory events and communication timeouts.
Step 5: Tune for the Service Objective
For low latency, prioritize context-length control, cache hit rates, and efficient communication paths.
For high throughput, improve batching efficiency and monitor expert load balance.
For operational stability, preserve more GPU memory headroom rather than allocating the entire theoretical capacity to static weights.
6. Common Misconceptions and Key Takeaways
Active parameter count is not the deployment memory requirement. It describes the computation performed for a token, not the storage needed for the full set of weights.
Eight GPUs do not form a single shared memory pool. Their memory is distributed and must be coordinated through parallelism and communication.
GPU specifications alone do not determine deployment success. With host-memory offloading, bottlenecks can shift to NUMA access, PCIe links, or memory bandwidth.
Successful startup does not prove production readiness. A model that loads correctly may still fail under concurrent requests or long contexts.
Deploying a very large MoE model on eight GPUs is a joint optimization problem involving weight placement, dynamic caches, parallel communication, and hardware topology.
A practical approach starts with a layered resource model, selects a supported TP/EP layout, aligns process placement with NUMA and PCIe topology, and uses staged load tests to establish context-length, concurrency, and cache limits.
Evaluating capacity, communication, and business workload together is essential to achieving a sustainable and maintainable deployment.
