Eight-GPU Local Deployment and Resource Planning for Large MoE Models
Deploying a large mixture-of-experts model on an eight-GPU server is a joint problem of capacity, compute, communication, and service policy. This guide covers how to set capacity, latency, and concurrency goals; budget backbone weights, expert weights, conditional memory, and KV cache; combine tensor and expert parallelism; plan GPU and host memory; place conditional memory; check topology and device binding; tune service settings; and validate the system before production.
Define deployment goals first: capacity, latency, and concurrency cannot all be maximized
Local deployment of a large mixture-of-experts (MoE) model is not simply a matter of loading model files into GPU memory and starting an inference service. Usability depends on at least the weight size, how experts are distributed, GPU memory capacity, interconnect bandwidth between GPUs, context length, concurrent requests, and how well the inference framework supports tensor parallelism and expert parallelism.
Internal knowledge Q&A usually cares more about long context and stable concurrency. Developer-assistance workloads care more about time to first token, sustained generation speed, and response stability. A model API service needs a closer look at throughput, queue length, failure recovery, and resource isolation. Before deployment, set the following targets:
- Maximum context length
- Target concurrent requests
- Time-to-first-token goal
- Sustained generation speed per request
- Whether some weights may stay in host memory
- Whether multi-tenant isolation is required
- Whether the service can accept quantization or lower precision
These choices directly determine GPU memory, host memory, and the parallel layout. The same model may run with short context and low concurrency, but as context length and concurrency grow, the KV cache quickly becomes the main source of GPU memory use.
Memory composition of an MoE model
A large MoE model is usually made of a shared backbone and many expert networks. Each token is routed to only a small number of experts, so compute is typically far below that of a dense model in which all parameters are active at once. Active parameter count describes only the parameters used in one forward pass. It does not mean the remaining weights can stay unloaded.
Treat memory as four categories.
1. Backbone weights
Backbone weights include attention layers, routing layers, normalization layers, and shared non-expert components. They usually need to stay resident in GPU or host memory. With half-precision storage, weight size is roughly the parameter count times bytes per parameter. Lower-bit quantization can cut capacity a lot, but it adds quantization error, dequantization cost, and implementation complexity.
Backbone weights are a baseline capacity cost. An MoE structure does not remove them. On multi-GPU setups, poor sharding of the backbone can leave one GPU out of memory while others still have large free regions.
2. Expert weights
Expert weights are a major source of capacity. Expert parallelism spreads experts across GPUs so each device stores only part of them and single-GPU memory pressure falls.
An even split of experts does not guarantee balanced load. At runtime, popular experts can receive more tokens, so some GPUs stay busy, communication buffers grow, and local memory peaks appear. Watch expert counts, routing load, and actual peak memory per GPU.
3. Conditional memory or external parameter space
Some large models include conditional memory: extra parameters or memory tables accessed dynamically from the input. Whether all of that data must live in GPU memory depends on the model implementation and the inference runtime.
Common placements:
- Keep everything in GPU memory for lower access latency, at the cost of more GPU memory
- Keep it in host memory and fetch on demand to reduce GPU pressure
- Use a tiered cache: hot data on the GPU, cold data in host memory
- Store it in a compressed or quantized format to cut capacity
If conditional memory lives in host memory, CPU-to-GPU transfers can become the bottleneck. Host memory size alone is not enough. Also consider memory bandwidth, access locality, cache hit rate, and the transfer path.
4. KV cache and runtime workspace
The KV cache stores keys and values for context already processed and is read repeatedly during generation. Its size usually depends on:
- Number of layers
- Number of KV heads
- Dimension per head
- Data precision
- Context length
- Concurrent requests
A simplified relation is:
Total KV cache≈ cache size per token × context tokens × concurrent requests
Once weights are fixed, long context and high concurrency drive most of the memory growth. The runtime also needs room for activations, temporary tensors, communication buffers, memory pools, and operator workspace. Do not assign all GPU memory to weights. Small request swings can then cause out-of-memory failures.
Tensor parallelism and expert parallelism on an eight-GPU server
1. Tensor parallelism (TP)
Tensor parallelism splits matrices or tensors in the same layer across GPUs so they compute together. It fits large linear and attention layers and reduces per-GPU weight capacity and compute load.
A larger TP degree usually means a smaller shard per GPU, but more cross-GPU synchronization. During decode, every token runs many layers, so communication latency can dominate. Larger TP is not always better. Match it to the server’s high-speed interconnect topology.
If the eight GPUs form several high-speed subgroups, use higher TP inside a subgroup and expert or data parallelism across subgroups. That reduces synchronization across topology boundaries.
2. Expert parallelism (EP)
Expert parallelism targets MoE layers and places different experts on different GPUs. After routing, tokens are sent to the device that holds the chosen expert and returned after compute. This is often called token exchange or expert communication.
EP performance depends mainly on three factors:
- Whether routing is balanced
- Bandwidth between GPUs
- Whether expert compute is large enough to hide communication cost
With few tokens per request, expert communication can take a large share of time. With higher concurrency, larger communication batches can raise device utilization, but also raise queueing and cache pressure. Choose EP from real load tests, not from memory capacity alone.
3. Combining TP and EP
TP and EP can be combined. For example, shard tensors inside each expert group and distribute experts at a higher level. The combination reduces both per-GPU weight pressure and expert capacity pressure, but communication paths become more complex.
Confirm the following:
- Parallel group sizes divide the GPU count evenly
- Experts map evenly onto devices
- The inference framework supports the model’s routing logic
- Communication groups do not cross different interconnect domains unintentionally
- Checkpoint weights can be loaded in the target parallel layout
- Parallel groups initialize stably after restart
How to plan GPU and host memory
On an eight-GPU server, do not treat usable capacity as single-GPU memory multiplied by eight. Use a layered budget:
Total GPU memory budget= weight shards+ conditional-memory GPU cache+ KV cache+ activations and temporary tensors+ communication buffers+ runtime safety margin
Reserve the safety margin for service variation. For an API service, do not estimate from one fixed request size. When concurrency rises together and context lengths differ, peak memory can sit well above the average.
Host memory needs to cover:
Host memory requirement= CPU-side weights+ conditional-memory data+ weight-loading copies+ request queues and caches+ runtime management overhead
Loading often creates temporary copies, so host memory should not be sized only to the final weights. If some weights stay in host memory, also account for NUMA. On multi-socket servers, bind each GPU to a nearby CPU node to avoid extra latency from cross-node access.
Tiered placement for conditional memory
Place conditional memory according to the workload.
GPU first
Fits low-latency cases with relatively stable request size. Access is short and latency is low, but GPU pressure is high and can squeeze the KV cache.
Host memory first
Fits limited GPU memory and longer context. It frees GPU capacity, but access latency is higher and may be limited by PCIe or other host interconnects.
Tiered cache
Often the more balanced option. Put hot data on the GPU and cold data in host memory by access frequency, recency, or business priority. The runtime needs stable cache management. Frequent swap-in and swap-out causes jitter.
Communication topology and device binding
Multi-GPU inference is often limited by communication, not raw compute. Before deployment, check:
- Whether GPUs have a high-speed interconnect
- Whether distance from each GPU to its CPU node is consistent
- Whether NICs, storage, and GPUs sit in a reasonable topology
- Whether communication takes extra cross-node paths
- Whether processes are bound to the correct CPU cores and GPU devices
Wrong binding lowers GPU utilization, raises odd CPU use, increases transfer latency, and can leave some GPUs idle. Judge runtime from GPU utilization, memory use, PCIe transfers, communication wait, and CPU thread state together.
How service settings actually affect the system
Context length
Longer context means a larger KV cache. Do not use the model’s maximum supported context as the service default. Set a limit from real workload needs and handle over-long requests with a tiered policy.
Batching
Dynamic batching raises throughput but increases scheduling complexity and memory peaks. For interactive assistants, protect response time for short requests. For offline generation, larger batches are more acceptable.
Output length
The maximum number of generated tokens directly affects how long a request holds resources and how much KV cache it uses. Set a reasonable server-side cap so a few abnormal requests do not occupy capacity for a long time.
Precision and quantization
Lower precision can cut weight capacity sharply, but quality, operator compatibility, and generation stability still need checks. After quantization, remeasure throughput and memory. Do not assume the compression ratio becomes a matching performance gain.
A practical validation sequence
After deployment, test in this order:
- Confirm weights are complete with a single GPU or a small process group
- Check TP shard loading and output consistency
- Check that EP routing covers every expert
- Test basic generation with short context
- Increase context length step by step
- Increase concurrency step by step
- Record time to first token, generation speed, and throughput
- Watch memory peaks and communication wait
- Inject over-long requests and abnormal interruptions
- Verify process restart, request cancellation, and memory reclaim
Do not look only at averages. Track P95 and P99 latency, queue wait, and how requests of different lengths affect each other. Move to production only if the system stays stable under peak load.
Common problems and where to optimize
If GPU memory is insufficient, first check whether the KV cache reservation is too large, whether conditional memory can move to host memory, whether weight precision can be reduced, and whether TP and EP are unbalanced.
If GPU utilization is low, look for communication wait, batches that are too small, skewed expert load, or slow CPU-side data preparation. Raising concurrency alone may not help and can increase queueing and memory peaks.
If time to first token is high, focus on prefill input length, where weights are loaded, expert routing cost, and cross-GPU communication. If generation speed drops, focus on KV cache access, decode batching, and expert exchange efficiency.
Summary
Running a large MoE model locally on eight GPUs is a joint optimization of capacity, compute, communication, and service policy. Parameter scale sets the base weight budget. Engram-style or other conditional memory sets the tiered storage layout. TP sets how layers are sharded. EP sets expert placement and the token-exchange path. Context length and concurrency set how the KV cache grows.
A sound plan does more than answer whether eight GPUs can hold the model. It also answers how weights are sharded, whether experts are balanced, where conditional memory lives, what the memory peak is, whether communication crosses slow links, and whether the service stays stable under long context and high concurrency. Only when those factors are planned together and checked with staged load tests can the system reliably serve internal assistants, developer assistance, and model APIs.
