Local Deployment of Large-Scale MoE Models on 8 GPUs: Architecture and Parallelism Planning
Deploying a large Mixture-of-Experts model on an 8-GPU server requires more than comparing total VRAM. Model weights, conditional memory, KV cache, runtime workspace, communication buffers, expert placement, parallelism strategy, context length, and concurrency all affect feasibility and latency. This guide presents a reusable framework for estimating resources and evaluating TP/EP configurations for stable local deployment.
1. Understand the Model Structure: Weights, Activations, and Memory
Large-scale MoE models typically combine a shared backbone with many experts. The backbone includes attention layers, normalization layers, shared feed-forward layers, and other common components. Expert layers are activated sparsely through a routing mechanism.
Publicly discussed configurations may include backbone parameter counts in the hundreds of billions and conditional or external memory modules with hundreds of billions of parameters. The number of parameters activated per token may range from several billion to around tens of billions during Prefill and Decode. However, activated parameters describe only the computation path for an individual token. They do not mean that the full model can occupy VRAM based only on the activated parameter count. Inactive expert weights must still remain resident or be quickly loaded; otherwise, routed tokens cannot be processed when those experts are needed.
Deployment planning should therefore track at least four separate resource categories:
- Backbone weights: Attention, shared feed-forward layers, normalization layers, embeddings, output layers, and other common components. These are usually sharded according to precision and parallelism strategy.
- Conditional or external memory access space: If the memory module is implemented as independent parameters or an index structure, determine whether it will be sharded with the backbone, replicated, or managed through hierarchical caching and on-demand loading.
- KV cache: Its size grows with context length, concurrent requests, and the number of layers. It is one of the most commonly underestimated costs in long-context serving.
- Runtime workspace and communication buffers: These include temporary activations, routing buffers, all-reduce and all-to-all buffers, paging metadata, and space reserved for memory fragmentation.
Weights are relatively stable, while KV cache usage depends heavily on concurrency. Communication buffers are strongly affected by the parallelism strategy. Selecting GPUs based only on total model weight size often leads to VRAM overflows, severe fragmentation, or communication queues during load testing.
2. Estimating the VRAM Budget
A practical VRAM budget can be expressed as:
Total requirement ≈ backbone weights + memory access space + KV cache + runtime workspace + communication buffers + safety margin
A general KV cache estimate is:
KV bytes per token ≈ 2 × number of layers × number of KV heads × head dimension × bytes per data type
Total KV ≈ KV bytes per token × sequence length × concurrent requests ÷ TP sharding benefit
Tensor parallelism generally reduces per-GPU KV usage, but the actual reduction is affected by GQA, replication policies, and paging fragmentation. It should not be treated as a perfectly linear TP reduction. In practice, reserve 15%–25% of capacity for runtime and communication overhead. For long-context workloads, a reserve closer to 30% may be more appropriate.
A simplified planning procedure is:
Input: per-GPU VRAM, GPU count, weight GB, memory-module GB,KV GB per sequence, target concurrency, reserve ratioAvailable total VRAM = per-GPU VRAM × GPU countFixed usage = weight GB + memory-module GBElastic usage = KV GB per sequence × target concurrencySafety margin = available total VRAM × reserve ratioIf fixed usage + elastic usage + safety margin <= available total VRAM:Configuration is feasible; proceed to load testingElse:Reduce concurrency, shorten context length, increase quantization,or adjust parallelism and placement strategy
An 8×96 GB platform provides 768 GB of total VRAM, while an 8×72 GB platform provides 576 GB. The difference is not merely 192 GB. It can determine whether the deployment can use less aggressive quantization, retain sufficient KV capacity, and maintain adequate communication headroom.
Some publicly discussed configurations use several hundred gigabytes of VRAM as a reference for a particular loading method. Such figures should be treated only as starting points. The actual budget must be recalculated according to quantization, memory-module placement, and serving parameters.
3. TP and EP: What They Partition and Where Communication Costs Occur
Tensor parallelism (TP) partitions matrix multiplication and attention computation. It requires frequent communication and is sensitive to latency, so it is best suited to a high-bandwidth interconnect within the server. Increasing TP reduces per-GPU weight and KV pressure, but each layer must perform aggregation communication. Using all eight GPUs for TP may therefore introduce substantial synchronization overhead.
Expert parallelism (EP) distributes different experts across GPUs. After routing, tokens are sent to the target experts through all-to-all communication. This traffic can be bursty, and uneven expert utilization can create bottlenecks. Hot experts may overload specific GPUs, so capacity factors, redundant experts, and routing balance should be monitored.
Common configurations for an 8-GPU system include:
- TP=8: Simple to implement. Suitable when interconnect bandwidth is strong and minimizing per-GPU weight usage is the primary goal.
- TP=4 + EP=2: Balances backbone sharding and expert distribution.
- TP=2 + EP=4: Relies more heavily on expert parallelism. It can reduce per-GPU weight pressure, but may generate more frequent all-to-all communication.
There is no universally optimal configuration. The choice should be validated through a grid test that considers the model’s layer structure, number of experts, interconnect topology, and request patterns.
Placement strategy is equally important:
- Attention and shared backbone layers are generally suitable for TP sharding.
- Expert layers are suitable for EP distribution.
- Frequently accessed conditional memory can be replicated across multiple GPUs to reduce cross-GPU access. If the module is too large, it can be sharded according to access locality and combined with caching.
Communication buffers should have their own reserved capacity rather than competing directly with the KV cache.
4. Context Length and Concurrency: Evaluate Prefill and Decode Separately
The Prefill phase is compute-intensive. Long inputs create larger temporary activations and chunking buffers. Decode is more dependent on memory bandwidth and communication, while long outputs extend the time that KV entries remain resident.
Testing should distinguish among:
- Long input with short output
- Short input with long output
- Mixed workloads
Chunked prefill can smooth the instantaneous memory impact of long requests. Continuous batching can improve throughput, but it also increases concurrent KV usage. Paged KV-cache management can reduce fragmentation. Prefix caching is useful when system prompts are frequently reused, such as in enterprise assistant workloads.
Concurrency should not be determined solely by peak throughput. It should be derived from P95 and P99 latency, queueing time, and timeout rates. Maximum context length, maximum concurrency, batching windows, and per-request output limits need to be configured together.
For internal development assistance and enterprise question-answering workloads, shorter-request latency may take priority. For batch document processing, interactive priority can be reduced in favor of higher batch efficiency.
5. Planning Comparison: 8×96 GB vs. 8×72 GB
| Planning Area | 8×96 GB Platform | 8×72 GB Platform |
|---|---|---|
| Total VRAM | 768 GB | 576 GB |
| Weight and memory placement | More headroom; less aggressive quantization may be possible | Requires stricter quantization, tiered loading, or offloading |
| KV cache and concurrency | Better support for longer contexts or higher concurrency | Context length and concurrency may need to be limited, or sharding increased |
| Parallelism to evaluate first | TP=8 or TP=4 + EP=2 | TP=4 + EP=2 or TP=2 + EP=4 |
| Main risks | Cost, power consumption, and communication bottlenecks | Memory fragmentation, amplified all-to-all overhead, and insufficient OOM headroom |
The 96 GB platform provides more flexibility for weights, KV cache, and communication buffers. It is better suited to long-context workloads, higher concurrency, or multiple services sharing the system. The 72 GB platform can still be viable, but it requires more precise quantization, expert placement, and concurrency controls. During testing, pay particular attention to peak VRAM usage and all-to-all latency.
6. Deployment Process and Observability Checklist
A practical process is:
Model inventory → single-node validation → parallelism grid testing → load testing → gradual rollout
- Build a model structure inventory: number of layers, hidden dimension, number of experts, activated experts per token, number of KV heads, and quantization method.
- Perform a small-scale loading test to verify weight integrity and the access path for the memory module.
- Test TP/EP combinations in a grid and record peak per-GPU VRAM, communication time, and expert-load variance.
- Run scenario-based tests for short-input/long-output, long-input/short-output, and mixed-concurrency workloads.
- Monitor memory fragmentation, KV-cache hit rate, queue length, all-to-all latency, and P99 latency.
- Roll out gradually. Start with strict limits on maximum context length and concurrency, then increase them step by step.
Example configuration:
model:dtype: bf16quantization: int8_weight_onlyparallel:tensor_parallel: 4expert_parallel: 2memory_module_replicas: 2runtime:max_context_tokens: 32768max_concurrency: 64prefill_chunk_tokens: 4096kv_cache_fraction: 0.35
The central challenge in deploying a very large MoE model on eight GPUs is not simply whether the system has enough VRAM. It is the balance among weights, memory modules, KV cache, communication, and concurrency. Start with a calculable VRAM budget, then refine the TP/EP layout through load-test data. This approach is more likely to produce a deployment that is stable and operationally manageable.
