Estimating Local Deployment Costs for Trillion-Parameter MoE Models
A practical method for sizing memory, accelerators, networking, and three-year total cost of ownership when running a hypothetical 2.8-trillion-parameter sparse mixture-of-experts model on premises. The guide separates total parameters, active parameters, and deployment replicas, then walks through HBM budgets, KV cache, expert-parallel communication, CAPEX versus OPEX, optimization options, and a pre-production benchmark checklist. Figures are order-of-magnitude planning ranges, not vendor quotes or measurements of any released model.
1. Define the problem: total parameters, active parameters, and replicas
Cost discussions for very large mixture-of-experts (MoE) models often mix up three different ideas:
- Total parameters set the lower bound on weight storage. Even if each token activates only some experts, every expert must remain routable, so an inference cluster usually has to hold the full weight set.
- Active parameters mainly drive compute. A low activation ratio does not shrink memory by the same ratio. A model with trillions of total parameters and an activation ratio under 2% still needs every expert in HBM or in tiered storage.
- Deployment replicas affect concurrency and availability. A single replica that can run is not the same as a production service. Production also has to account for KV cache, dynamic batching, redundancy, failure recovery, rolling upgrades, and peak traffic.
This article uses a hypothetical 2.8-trillion-parameter sparse MoE as a capacity example. It illustrates the method and the order of magnitude only. It does not correspond to any specific released model. A real project must follow the publisher’s final weight format, parallelism strategy, context length, and inference framework.
2. Memory accounting: do not stop at “parameters ÷ 8”
2.1 Theoretical floor for raw weights
If the total parameter count is (P) and weights are quantized to (b) bits, raw weight storage is approximately:
weight bytes ≈ P × b ÷ 8weight GB ≈ P × b ÷ 8 ÷ 10^9
For 2.8 trillion parameters at 4 bits:
2.8 × 10^12 × 4 ÷ 8 ÷ 10^9 = 1400 GB
That is an idealized floor. Real 4-bit microscaling formats usually store extra scale factors. If every 32 four-bit elements carries one 8-bit scale, the effective width is about:
4 + 8 ÷ 32 = 4.25 bits
Weights plus scales are then about:
2.8 × 10^12 × 4.25 ÷ 8 ÷ 10^9 ≈ 1487.5 GB
That still excludes unquantized tensors, embeddings, normalization layers, metadata, alignment padding, runtime workspace, communication buffers, headroom for uneven expert load, and KV cache.
2.2 A practical HBM budget
A useful engineering estimate is:
total HBM ≈ effective weights × (1 + metadata and alignment overhead)+ unquantized tensors+ KV cache+ communication and runtime workspace+ fragmentation and safety margin
Where:
- Effective weights include the quantization format and scale overhead.
- Metadata and alignment are often reserved at 3%–10%.
- Unquantized tensors depend on the architecture and usually need several percentage points.
- KV cache depends strongly on concurrency, context length, layer count, KV head dimension, and whether KV itself is quantized.
- Communication and runtime workspace are not negligible under large-scale expert parallelism.
- A safety margin of at least 20%–40% is advisable, and higher for long context or high concurrency.
So a 2.8-trillion-parameter model at about 1.5 TB of 4-bit weights should not be planned with only 1.5 TB of accelerator memory. A single validation replica often needs 1.8–2.5 TB reserved. Higher concurrency, longer context, extra replicas, or redundancy can push the requirement into 3 TB, 5 TB, or more than 10 TB.
2.3 KV cache is more expensive than many expect
KV cache can be approximated as:
KV ≈ concurrent requests × average context length× KV bytes per token per layer × number of layers
Moving from 4K to 32K or 128K context can multiply KV usage. Production systems should use paged KV management, KV quantization, prefix caching, request-level rate limits, and queues split by length. Otherwise the weights may fit, but concurrency quickly causes out-of-memory failures.
3. From the theoretical floor to an engineering line
Weights alone—about 1.49 TB at 2.8 trillion parameters and 4.25 bits—can look as if a small number of high-memory accelerators is enough. The real bottleneck in MoE inference is expert parallelism and communication.
With 896 experts and 16 activated per token, different tokens route to different experts. When experts are spread across accelerators, each token’s activations must be sent to the devices that hold the chosen experts and then returned. That all-to-all path is highly sensitive to bandwidth, latency, topology, and load balance. Enough memory does not mean acceptable throughput.
Deployment can be grouped into tiers:
| Tier | Scale | Primary goal | Risk |
|---|---|---|---|
| Validation inference | 24–32 accelerators in the 80 GB class | Load weights and serve one stream or low concurrency | Tight headroom, low communication efficiency, not for production |
| Small production | 64 or more accelerators | Low-concurrency service, internal trial, quality evaluation | Still exposed to expert imbalance and KV growth |
| Standard production | 128–256 accelerators | Stable concurrency, redundancy, longer context | Network and operations cost rise quickly |
| Multi-node, multi-rack cluster | More than 256 accelerators | High throughput, multi-tenant use, high availability | Needs mature scheduling, failure recovery, and capacity planning |
“It loads” is only the minimum bar. For this class of MoE, a tightly coupled cluster of 64 or more accelerators with high bandwidth and low latency is a more realistic starting point. A production SLA should also include N+1 redundancy, rolling upgrades, and failure-domain isolation, which typically multiplies capacity by 1.3–1.5.
4. Network cost can dominate the bill more than raw compute
Communication in a large MoE differs from a dense model. Dense models mainly use regular traffic from tensor and pipeline parallelism. MoE adds dynamic all-to-all after routing. Typical traits:
- Each token’s route changes dynamically.
- Expert popularity can be uneven.
- Each message is not always large, but it is latency-sensitive.
- Tail latency is amplified by the slowest hop.
- Cross-node traffic costs much more than traffic inside a node.
Cluster design should follow a few rules:
- Enlarge the high-speed interconnect domain first. Keep one expert-parallel group inside a high-bandwidth domain so all-to-all crosses domains as little as possible.
- Use hierarchical communication. Aggregate inside the node, then forward between nodes, instead of a full mesh of small messages.
- Place experts deliberately. Co-activated experts should sit where communication is cheaper. Hot experts may be balanced or replicated, but replicas consume extra memory.
- Overlap communication and compute. Chunked transfers, pipelined scheduling, and asynchronous execution can hide some latency. They cannot fix a bandwidth shortage.
- Validate the network with load tests, not peak FLOPS. For MoE, p95 and p99 latency under congestion matter more than theoretical compute.
With a limited budget, fewer cards with more memory and a better interconnect are preferable to stacking cards on a slow network. In a large MoE, a communication bottleneck leaves expensive accelerators waiting.
5. Spend in TCO, not only in server list price
On-premises cost splits into capital and operating expense:
CAPEX = accelerators + servers + high-speed network + storage+ facility and power upgradesOPEX = power + cooling + bandwidth + operations staff+ spares + software and securitythree-year TCO ≈ CAPEX + 3 × OPEX
The ranges below are broad planning bands only, not quotes from any vendor. Assumptions:
- One 80 GB or 96 GB-class accelerator, allocated at the server level: RMB 100,000–300,000.
- Network and storage allocated per card: RMB 20,000–80,000.
- Facility, power, and cooling allocated per card: RMB 10,000–50,000.
- Combined CAPEX per card: about RMB 130,000–430,000.
- Three-year TCO estimated at 1.4–1.6 times CAPEX, and sensitive to power price, utilization, and how the cluster is operated.
| Scale | Rough CAPEX | Rough three-year TCO | Fit |
|---|---|---|---|
| 32 cards | about RMB 4.2–14 million | about RMB 6–22 million | Validation, low concurrency, temporary environments |
| 64 cards | about RMB 8.3–28 million | about RMB 12–44 million | Small production, internal service |
| 128 cards | about RMB 17–55 million | about RMB 25–90 million | Standard production, longer context |
| 256 cards | about RMB 33–110 million | about RMB 50–180 million | High throughput, multiple replicas, high availability |
Active-active sites, cross-site disaster recovery, N+1 redundancy, higher-bandwidth networking, or faster storage can add another 30%–100%. Phased build-out, bursting peaks to cloud capacity, or reusing the cluster for offline jobs can reduce initial CAPEX.
Short cloud validation runs
If the goal is only a two-week load test after weights are released, renting general-purpose accelerator instances is a reasonable first step:
rental = accelerator count × hours × price per card-hour+ storage + network traffic + high-availability and operations services
Sixty-four cards for 72 hours is 4,608 card-hours. At a broad band of RMB 10–60 per card-hour, compute is about RMB 46,000–276,000. Running the same 64 cards for a month at 720 hours is 46,080 card-hours, or roughly RMB 460,000–2.76 million for compute alone—on the order of several hundred thousand to a few million RMB per month. Actual prices depend on region, card type, storage, and bandwidth.
6. How to bring the budget into range
6.1 Start from quantization-aware deployment
Do not assume 4-bit is always acceptable. Check quantization error layer by layer, with extra attention on routing, normalization, sensitive attention layers, and long-context tasks. Mixed precision is an option: most weights at 4 bits, sensitive modules at higher precision. Quantization can cut memory and bandwidth pressure substantially, but quality regression must be measured on the real workload.
6.2 Plan expert parallelism with the topology
Higher expert parallelism is not automatically better. It reduces weights per card but increases all-to-all hops. Choose the parallel mix from the size of the high-speed domain, the expert count, experts activated per token, and batch size. Keep communication-heavy expert groups inside the same high-speed domain.
6.3 Manage KV cache tightly
Use paged KV cache, KV quantization, prefix cache, length-based queues, and admission control. Queue very long requests separately so a few of them do not stall the whole batch. Size memory for p99, not for the average.
6.4 Split prefill and decode
Prefill is more compute-heavy; decode is more memory- and communication-heavy. If inputs are long and outputs are short, shift more capacity toward prefill. If outputs are long, protect decode memory bandwidth and concurrency. Where the stack allows it, prefill and decode can use different parallel strategies.
6.5 Use tiered storage for validation, not as a production rescue
CPU memory or NVMe can hold cold weights and lower the HBM floor, but swapping them in per token adds serious latency. That pattern fits offline evaluation, low-QPS checks, and faster cold start. It does not fit high-concurrency online serving. In production, hot experts and runtime state must stay in HBM.
6.6 Track cost per million tokens
Server price alone is a weak metric. A more useful one is:
cost per million output tokens =fully loaded cluster cost per hour÷ stable output tokens per hour× 10^6
Record p95/p99 latency, success rate, context-length distribution, and cache hit rate with that number. Throughput figures are not comparable without them.
7. Benchmark checklist before go-live
Once weights and the inference plan are fixed, at least these tests should be done:
- Full-weight load: cold-start time, peak memory, retry on failure, and sharded-load stability.
- Single stream and low concurrency: time to first token, time per token, and high-water memory at batch sizes 1, 2, and 8.
- Long context: KV growth and tail latency at lengths such as 4K, 32K, and 128K.
- Expert load: routing distribution, hot experts, communication wait time, and all-to-all congestion.
- Quantization quality: task-quality gap among 4-bit, mixed precision, and the original precision.
- Capacity and rate limits: ramp load until the throughput knee and the point where p99 degrades.
- Failure recovery: degradation and recovery time for a single card, node, or link failure.
- TCO review: feed measured throughput, power, utilization, and operations effort back into the cost model.
Conclusion
For a sparse MoE at the 2.8-trillion-parameter scale, raw 4-bit weights are about 1.4 TB, and about 1.49 TB once scales are included. Usable accelerator memory is usually planned at 1.8–2.5 TB or more, and long context plus high concurrency push it further. A tightly coupled cluster of 64 or more accelerators is only a starting point for stable service. Standard production often needs 128–256 cards or more, plus high-bandwidth interconnect, redundancy, and mature operations.
On cost, a 64-card on-premises cluster is roughly in the tens of millions of RMB over three years, 128 cards moves into the several-tens-of-millions range, and 256 cards can reach the hundred-million-RMB range. Actual prices vary widely with accelerator spec, network, storage, power price, and availability requirements. The more reliable path is to load weights, check quantization quality, and run real workload tests on rented general-purpose accelerators first, then decide among building, renting, or a hybrid from cost per million tokens. After official weights are released, memory, throughput, tail latency, and total cost of ownership still have to be verified against real benchmarks.
