Memory and Cost Requirements for Locally Deploying Trillion-Parameter MoE Models
This article explores the hardware requirements and costs for deploying a trillion-parameter Mixture of Experts (MoE) large language model locally. It details the memory lower bounds, the necessity of 64-GPU supernodes for communication efficiency, and a Total Cost of Ownership (TCO) framework. Readers will understand how total parameters dictate memory storage, the impact of KV cache and runtime workspaces, and practical deployment optimization strategies.
Memory and Cost Requirements for Locally Deploying Trillion-Parameter MoE Models
This article addresses a general technical question: if we deploy a large language model with a total parameter count reaching the trillion level and adopting a Mixture of Experts (MoE) architecture locally, how much VRAM, how many accelerator cards, and what cost components are required? To avoid turning this discussion into a deployment manual for a specific product, we will use an “example model” and “hypothetical parameters” for our calculations. The conclusions are applicable to capacity planning for similar ultra-large MoE models.
1. Clarification: Total Parameters Determine Memory, Activated Parameters Determine Compute
The core characteristic of MoE models is “numerous parameters, yet relatively controllable compute per token.” Taking a hypothetical 2.8 trillion total parameter model with 896 experts and 16 experts activated per token as an example, the expert activation ratio is approximately 16/896 ≈ 1.79%. However, it must be emphasized: the expert activation ratio does not equal the strict parameter activation ratio. The model also contains non-expert parameters such as the trunk network, attention components, routing layers, normalization layers, and embedding layers, which do not activate according to the expert routing ratio.
More crucial is the deployment logic: although only a subset of experts is invoked during inference, all 896 experts must first be loaded into the storage and VRAM system, and tokens are then routed to the devices hosting the target experts for computation. Therefore:
- Total parameters primarily determine the lower limit of weight storage;
- The number of activated experts mainly affects compute consumption and communication patterns;
- Parallelism strategies, batch size, and context length determine KV cache and workspace overhead;
- Inter-GPU interconnect bandwidth determines whether actual throughput can approach theoretical compute.
Estimating VRAM solely based on the “activation ratio” will severely underestimate the deployment threshold.
2. VRAM Lower Limit: 4-bit Quantization Does Not Mean “1.4TB is Enough to Run”
Let’s look at the raw weight data. Assume the example model has 2.8 trillion total parameters and uses 4-bit weight quantization. A direct calculation:
2.8T × 4 bit ÷ 8 ≈ 1400GB
However, real quantization formats usually include scaling factors. For instance, in a microscaled 4-bit format, every 32 4-bit elements are accompanied by an 8-bit scale, meaning the average bits per weight element is:
4 + 8/32 = 4.25 bit
Thus, weights plus scales amount to approximately:
2.8T × 4.25 bit ÷ 8 ≈ 1487.5GB
This still does not account for non-4-bit tensors, metadata, alignment padding, runtime workspace, communication buffers, and KV cache. Therefore, approximately 1.5TB is merely the theoretical lower limit for weights and scales, not the runnable VRAM.
Production environments must also add:
- Non-quantized tensors: Some normalization, routing, embedding, or small matrices may retain higher precision.
- KV cache: Related to the number of layers, KV heads, head dim, context length, batch size, and precision. It can be roughly expressed as:
Long contexts and large batch sizes will rapidly amplify this item.KV ≈ 2 × layers × kv_heads × head_dim × seq_len × batch × bytes
- Runtime workspace: Routing sorting, token rearrangement, all-to-all communication buffers, temporary activations, and operator workspace.
- Redundancy and fault domains: Expert replicas, hot expert redundancy, and reserved space for rolling upgrades.
As a magnitude reference, a 600B-level MoE reference model under FP8 requires about 600–700GB for weights, and 4-bit weights plus activations and workspace often require around the 400GB magnitude to run on 8x 80GB GPUs. A trillion-level model is several times this size, so the VRAM lower limit for a full deployment naturally enters the multi-terabyte total VRAM range.
3. Parallelism and Communication: Why a 64-GPU Supernode is the Engineering Starting Point
Assuming the use of 64x 80GB VRAM accelerators, the total VRAM is 5120GB. On the surface, 1.5TB of weight shards is about 23GB per GPU, which seems to leave a large margin. But in reality, we cannot simply divide:
- Expert parallelism will distribute 896 experts across multiple GPUs, with each GPU hosting several expert shards;
- Tensor parallelism and pipeline parallelism will further slice the matrices;
- After routing each token, an all-to-all communication is required to move the activation values to the GPU hosting the target expert, and then move them back after computation;
- Uneven routing will create hot experts, causing some GPUs to wait;
- KV cache, communication buffers, and temporary activations require additional space;
- Production systems also need to reserve space for replicas and failover.
Large-scale MoE inference is extremely sensitive to all-to-all communication bandwidth. If the interconnect domain is too small, cross-node transfer latency will directly consume compute power. In engineering practice, high-bandwidth inter-GPU interconnects are often used to form supernodes, limiting expert parallel communication within a single high-speed communication domain to reduce cross-domain hops. A 64-GPU supernode is therefore more of an “engineering starting point” rather than a “luxury configuration”: the total VRAM must be sufficient, and the communication domain must be large enough.
4. How to Calculate Cost: CapEx, OpEx, and TCO Framework
“How much does it cost” cannot be answered just by looking at GPU prices. It is recommended to use a TCO framework:
TCO = Hardware CapEx + Network & Storage + Datacenter Upgrades+ Electricity + O&M Personnel + Software & Spare Parts+ Downtime Losses & Utilization Depreciation
Hardware CapEx can be expressed as:
CapEx ≈ Num_GPUs × Unit_Price + Server_System + Switch_Network + Storage + Datacenter_Infrastructure
If the unit purchase price of a GPU is denoted as C (10,000 CNY), 64 GPUs alone will cost 64C (10,000 CNY). Switch networks, server systems, storage, and datacenter facilities will often significantly increase the budget, requiring project-specific inquiries. Electricity costs can be calculated as:
IT_Power = Num_GPUs × Unit_GPU_PowerTotal_Power = IT_Power × PUEAnnual_Electricity_Cost = Total_Power × Electricity_Rate × 8760
Example: 64 GPUs, unit GPU power consumption 0.8kW, IT power 51.2kW; PUE at 1.3, total power about 66.56kW; electricity rate at 0.6 CNY/kWh, then the cost is about 39.9 CNY per hour, about 28,700 CNY per month, and about 345,000 CNY per year. This is only electricity and does not include hardware depreciation or O&M. Building a full cluster locally typically corresponds to a capital expenditure in the millions of CNY, depending on GPU prices, network scale, and datacenter conditions.
If you do not want to make an upfront investment, you can also use on-demand rental services for general GPU computing power, container platforms, object storage, and monitoring provided by cloud providers such as Baidu AI Cloud. Rental costs can be roughly estimated as:
Rental_Cost ≈ Num_GPUs × GPU_Hourly_Rate × Runtime × Utilization_Correction
In long-context and high-concurrency scenarios, rental unit prices and storage traffic fees need to be included in stress testing.
5. Deployment Path and Optimization Checklist
- Build a capacity model first: Estimate based on weights, scales, KV cache, and workspace separately, leaving at least a 30%–50% margin.
- Verify quantization accuracy: 4-bit weights with 8-bit activations can reduce VRAM, but evaluate quality loss using a business dataset.
- Control context and batch size: KV cache is the main increment for long contexts; perform KV quantization, paged management, and prefix reuse when necessary.
- Tune expert parallelism: Too low, and it won’t fit; too high, and all-to-all overhead increases. Find the inflection point through stress testing.
- Handle hot experts: Reduce tail latency through replicas, routing balancing, and batch scheduling.
- Establish cost guardrails: Monitor GPU utilization, communication wait times, VRAM watermarks, and cost per thousand tokens to avoid a situation where it “can run but cannot be afforded.”
6. Conclusion
The local deployment threshold for trillion-level MoE models is jointly determined by three factors: the weight storage lower limit brought by total parameters, the runtime margin brought by KV cache and workspace, and the supernode demand brought by all-to-all communication. Based on our example estimates, 4-bit weights plus scales already amount to about 1.5TB, and production-usable total VRAM should be planned at the multi-terabyte level; a supernode composed of 64x 80GB GPUs is a reasonable engineering starting point. In terms of cost, self-building requires capital expenditure in the millions of CNY plus electricity and O&M, while renting is billed by GPU hours and storage/network usage. Final quotes must be based on actual hardware inquiries, datacenter conditions, and business stress testing.
