Deploying a 2.8-Trillion-Parameter MoE Model: Capacity Planning and Performance Tuning
This article walks through the practical process of deploying a 2.8-trillion-parameter mixture-of-experts (MoE) model: how to calculate GPU memory capacity before choosing hardware, how to verify the hardware topology and software environment, how to distribute and validate 1.47TB of quantized weights, how to select a parallelism strategy based on measured bandwidth, which startup parameters matter, how to run a three-layer functional validation, and how to tune performance and troubleshoot common failures such as OOM during loading, high latency with low GPU utilization, and inconsistent outputs under concurrency. The key conclusions: do capacity math first, choose parallelism based on measured topology, and tune parameters with your own benchmark data.
Plan Capacity Before You Deploy
Before deploying a large MoE model, you must answer one question: will the weights and runtime buffers actually fit in GPU memory? In this case study, the model has roughly 2.8 trillion total parameters, activates about 100 billion parameters per forward pass, and has an activation ratio of about 3.7%. Sparse activation reduces compute per token, but all expert weights must reside in GPU memory, so total parameter count determines the hardware floor.
The model here uses W4A8 quantization: weights stored at 4-bit, activations computed at 8-bit. 2.8 trillion parameters at 4-bit come to about 1.4TB, and with quantization scaling factors plus a few unquantized layers, the measured weight footprint is about 1.47TB.
A common early mistake is looking only at a single server’s spec. With 8 GPUs of 64GB each per server, two servers give 16 × 64GB = 1024GB, roughly 1TB — already less than 1.47TB, and that doesn’t include KV cache, activations, or communication buffers. Two servers with sixteen cards simply cannot hold this model.
The table below shows per-card headroom under different configurations, assuming the inference framework’s gpu-memory-utilization is set to 0.85:
| Configuration | Cards | Usable memory per card | Weight shard per card | Remaining space per card |
|---|---|---|---|---|
| 2 nodes, 64GB per card | 16 | ~54GB | ~92GB | Insufficient — won’t fit |
| 4 nodes, 64GB per card | 32 | ~54GB | ~46GB | ~8GB |
| 4 nodes, 96GB per card | 32 | ~82GB | ~46GB | ~35GB |
The conclusion: 32 cards is the minimum viable starting point, but headroom on 64GB cards is tight. Long-context and high-concurrency workloads require more cards or cards with more memory.
Per-card memory requirements can be estimated as:
Per-card memory ≈ weight shard + KV cache shard + peak activations + communication buffers + runtime overhead
KV cache is the most frequently underestimated item. Bytes per token:
KV bytes per token = 2 × number of layers × number of KV heads × head dimension × bytes per element
A worked example with assumed parameters: 60 layers, 8 KV heads, head dimension 128, KV cache in FP8 (1 byte per element). Each token uses 2 × 60 × 8 × 128 × 1 = 122,880 bytes, about 0.12MB. A single 1M-token request takes about 122.9GB. With a tensor parallel degree of 8 and KV heads shardable across cards, each card carries about 15.4GB. The actual number of layers and KV heads should come from the model’s config.json. If the number of KV heads is smaller than the tensor parallel degree, some KV data gets replicated across cards and actual usage is higher.
In the inference framework, --max-model-len caps the maximum length of a single request, and --gpu-memory-utilization caps the fraction of GPU memory the framework may use. Start with the latter at 0.85, and lower it to around 0.8 if you hit OOM. Together these two parameters determine how much total context can be held concurrently — use the formulas above to work backward to an acceptable concurrency level.
Verifying Hardware Topology and the Software Environment
Before downloading weights, complete the low-level environment checks. Any missing item tends to surface only during the loading phase, when debugging is far more expensive.
1. Check inter-card topology. Use the vendor’s device management command to inspect how the accelerators in each machine are interconnected. Ideally every pair of cards has a direct link. If only partial direct connectivity exists, place the operator groups with the heaviest communication on directly connected card groups when configuring parallelism.
2. Verify bandwidth. Measure intra-node inter-card bandwidth with the vendor’s collective communication test tool. For cross-node bandwidth over RoCE or InfiniBand, use ib_write_bw from the perftest suite to measure point-to-point bandwidth. Compare measured values against vendor specifications and record the gap. When cross-node bandwidth is significantly lower than intra-node bandwidth, tensor parallelism efficiency drops sharply — this directly affects your parallelism strategy.
3. Check NUMA and device affinity. Use lscpu and numactl -H to see the NUMA layout, then use lspci or vendor tools to confirm which PCIe switch each accelerator hangs under. Launch inference processes with core binding, for example numactl --cpunodebind=0 --membind=0 <launch command>, and make sure each process sits on the same NUMA node as its GPU.
4. Use the official inference image. Model publishers typically provide an image with pinned versions of the inference framework, communication libraries, and operator libraries. Using it directly avoids version conflicts from building your own.
5. Run an empty-model communication test. Inside the container, initialize only the distributed process group without loading real weights. This quickly exposes firewall, RDMA network, and shared storage permission problems.
Weight Distribution and Integrity Verification
Transfer time for 1.47TB of weights depends on bandwidth. Theoretical estimates: 1.47TB is about 11.76Tb, roughly 20 minutes over a 10Gbps link and about 3.3 hours over 1Gbps. Real throughput is affected by storage I/O and network congestion — measure it.
Download in parallel to local disks. Use a multi-threaded segmented download tool to pull weights concurrently to each node’s local NVMe SSD rather than reading from shared storage, whose I/O throughput easily becomes the bottleneck. Each node’s local disk should reserve at least 1.47TB, plus buffer for decompression and format conversion. If the framework only reads the local shard, actual usage can be smaller — but confirm the framework’s loading behavior first.
Verify integrity. After downloading, check SHA256 hashes one by one against the manifest provided by the publisher, and verify the file count. Missing or corrupted weight files typically surface during loading as tensor shape mismatches or synchronization timeouts, which are costly to debug.
Pre-check the tensor index. Before starting the load, scan the index files in the weight directory and confirm that the tensor names and shapes in each shard match the declarations in the model configuration file.
Choosing a Parallelism Strategy
Two servers with sixteen cards allow two common options:
- Option A: intra-node tensor parallelism + cross-node pipeline parallelism. Tensor parallel degree 8, pipeline parallel degree 2. Only activations at pipeline boundaries cross the network, so communication volume is small. The cost is pipeline bubbles and increased per-token latency.
- Option B: cross-node tensor parallelism. Tensor parallel degree 16. Every layer’s All-reduce crosses the network, demanding high RDMA bandwidth and low latency.
Base the choice on measured cross-node bandwidth and latency. If cross-node and intra-node bandwidth differ significantly, prefer Option A. If the network is strong enough and the business is latency-sensitive, benchmark both options before deciding.
MoE layers additionally require expert parallelism (EP). The expert parallel group size must divide evenly into the total number of experts; otherwise cards hold uneven numbers of experts and the load becomes imbalanced. Each token’s routing result is sent to the target card via All-to-All communication, then collected back after computation.
Startup Parameters Explained
The table below uses vLLM-style parameter names. Names may differ across inference frameworks and versions — check the documentation for your version.
| Parameter | Purpose | Recommended setting | Risk |
|---|---|---|---|
--tensor-parallel-size |
Number of tensor-parallel cards | 8 for Option A, 16 for Option B | Mismatch with actual card count fails at startup |
--pipeline-parallel-size |
Number of pipeline stages | 2 for Option A | Larger values increase bubbles |
--enable-expert-parallel |
Enable MoE expert parallelism | Match the expert sharding in the weights | Misconfiguration causes startup failure or garbled output |
--max-model-len |
Max length per request | Set per business need; don’t exceed the KV budget | Too large causes OOM on long requests |
--gpu-memory-utilization |
Fraction of GPU memory the framework may use | 0.85 initially | Too high risks OOM; too low wastes memory |
--max-num-seqs |
Concurrently scheduled requests | Tune based on benchmark results | Too large increases KV usage |
--max-num-batched-tokens |
Total tokens per batch | Start small and increase gradually | Too large exceeds peak activation memory |
Beyond these, enable the framework’s metrics export endpoint and configure asynchronous log writing so synchronous disk I/O never blocks the inference process.
Three-Layer Functional Validation
After the service starts, don’t jump straight into high-concurrency load testing. Validate in three progressive layers.
Layer 1: single-request correctness. Use short prompts of no more than 512 tokens, set temperature to 0, and compare outputs against reference results from a known-good environment. Also check server logs for communication timeouts or device errors.
Layer 2: concurrency and KV boundaries. Send 10 requests simultaneously, increasing input length step by step from 1K to 128K. Record per-card memory usage every few seconds. Expected behavior: memory grows roughly linearly with generated tokens, with no monotonic growth that never gets released.
Layer 3: long-sequence stability (soak test). Build a batch of conversational requests containing texts of 80K tokens or more, and run continuously for at least 30 minutes. This duration is enough to observe memory fragmentation and latency drift trends; extend it before production launch according to your SLO. Pass criteria can follow this template:
- P95 time-to-first-token and per-token latency drift no more than a set threshold in the late phase relative to the first 5 minutes;
- Error rate below a set threshold, with no sporadic crashes;
- Per-card memory curves reach a plateau with no sustained monotonic growth.
Performance Tuning
Overlapping communication and computation. All-to-All is one of the main costs in MoE inference. Larger batches allow more independent computation to interleave within the same communication phase. Some frameworks also support splitting large communication operations into smaller shards that overlap with computation from different micro-batches. Availability depends on the framework version.
Graph mode and operator fusion. Static graph capture reduces Python runtime overhead and lets the framework pre-allocate memory buffers. The cost is warm-up time for the first compilation. Suggested measurement: time from process start to first request completion, minus weight loading time, taking the median of 3 consecutive restarts. If online input lengths fall outside the captured shape range, recompilation is triggered — so choose capture shape tiers based on your production request length distribution.
Recalibrating quantization scales (optional). If the W4A8 model loses accuracy on specific tasks, recompute scaling factors with a representative calibration set. A common starting point is 512 to 2048 samples close to the business distribution. After recalibration, compare against the original scales on your own evaluation tasks, such as mathematical reasoning and factual QA. Keep the original scales for rollback. This method requires framework support for loading custom scales — confirm that before deploying.
Troubleshooting
Symptom 1: OOM during loading. First check whether --gpu-memory-utilization is too high and lower it below 0.8. Then verify the per-card weight shard size — it should be close to total weights divided by card count. A noticeably oversized shard on one card means the sharding configuration is wrong. Also check the distributed launcher’s environment variables: if they’re missing, every process may load the full weights.
Symptom 2: high latency but low GPU utilization. Suspect cross-node communication bottlenecks first. Watch the NIC’s RDMA counters to see whether communication phases are stalled waiting. Another possibility: processes aren’t core-bound, so data-movement threads get scheduled to a remote NUMA node, adding PCIe round-trip latency.
Symptom 3: sporadic garbled output under concurrency. The cause space is broad; debug in this order:
- Determinism test. Run the same prompt multiple times, both standalone and under high concurrency, with temperature 0. If results differ, the problem is likely in batching or request isolation.
- Expert routing consistency. Check whether router outputs match across cards, and verify the expert-to-card mapping against the weight metadata.
- All-to-All ordering. With small batches, verify each token returns to its correct position after result merging.
- Weight consistency. Compare weight file hashes across nodes, and confirm no other process wrote to the weight directory during startup.
- Request tracing. Assign a unique ID to each request and log per card, so you can locate which layer and which card produced the corruption.
Summary
Three main conclusions.
First, do capacity planning before deployment. The weights in this case are about 1.47TB — more than the total GPU memory of two servers with sixteen cards. 32 cards is a low starting point, with very narrow headroom.
Second, the parallelism strategy must be based on measured physical topology. The bandwidth gap between intra-node and inter-node links determines how to split tensor parallelism and pipeline parallelism.
Third, tune parameters with benchmark data. Memory utilization, batching windows, and graph capture shapes should all be determined from your own business data, not copied from rules of thumb.
As long-context multi-turn interaction becomes mainstream, KV cache management, sparse attention operators, and hardware-software co-optimization of multi-node All-to-All communication will determine whether ultra-large-scale models can be deployed at reasonable cost.
