VRAM and Cost Requirements for Local Deployment of Very Large MoE Models
This article explains how to estimate VRAM and deployment cost for very large MoE models. It separates total parameters from activated parameters, shows how quantization determines the storage floor, uses a comparable 671B MoE model as a reference, estimates the minimum number of accelerator cards, and outlines the main cost components, including hardware, power, networking and storage, and operations.
1. Distinguish Total Parameters from Activated Parameters
Mixture-of-Experts (MoE) models consist of many expert subnetworks, and each token is routed to only a small number of them. For example, a model with 896 experts and 16 active experts per token has an expert activation ratio of 16 ÷ 896 ≈ 1.79%.
This ratio determines the compute per inference, but it does not determine VRAM usage. The inference framework may bring any expert into use at any time, so all expert parameters must remain resident in accessible storage. The first step in deployment planning is to size capacity by total parameters and compute by activated parameters.
Note that 1.79% is only the expert-layer ratio. Attention layers and shared layers that always participate in computation also consume compute, so the strict parameter activation ratio is slightly higher. For capacity planning, this difference does not affect the conclusion.
2. How Quantization Sets the Storage Floor
Quantization is the most direct way to reduce VRAM usage. Compressing weights from 16-bit to 4-bit reduces theoretical capacity to one quarter.
Common micro-scaling formats group several elements and share one scale factor per group. For example, with one 8-bit scale factor shared by every 32 4-bit elements, the average bits per element is:
Effective bits = 4 + 8 ÷ 32 = 4.25 bit
From this, the weight capacity for 2.8 trillion parameters can be calculated:
Weight capacity = total parameters × effective bits ÷ 8
The weight capacity under different formats is compared below:
| Data format | Average bits per element | Weight capacity for 2.8T parameters |
|---|---|---|
| 16-bit | 16 | 5600 GB |
| 8-bit | 8 | 2800 GB |
| 4-bit (raw data) | 4 | 1400 GB |
| 4-bit + 32-element scale factor | 4.25 | 1487.5 GB |
1400 GB is the theoretical lower bound and counts only raw 4-bit data. The overhead from scale factors brings capacity to about 1487.5 GB.
Actual usage also includes the following:
- Unquantized tensors, such as embedding layers, normalization layers, and layers kept at higher precision for accuracy;
- Format metadata and memory alignment padding;
- Runtime workspace for intermediate activations and operator buffers;
- KV cache, whose size grows with context length and the number of concurrent requests.
Therefore, weight capacity is only the starting point for planning and is not equal to the VRAM required for deployment.
3. Use a Comparable Model as a Reference
Take a comparable MoE model with about 671 billion parameters as a reference. In FP8 format, main parameters plus auxiliary parameters are about 685 GB. With 4-bit quantization, weights and activations together are about 400 GB, which can run on eight 80 GB accelerator cards (640 GB total) with headroom.
The 2.8 trillion parameter model is about 4.2 times that size. Extrapolating linearly by parameter count, the 640 GB VRAM of a single 8-card machine cannot hold the weights alone. This shows that as model scale grows, hardware scale changes in steps rather than linearly.
4. Estimating the Number of Cards
The minimum number of cards can be estimated with:
Minimum cards = ⌈weight capacity ÷ per-card VRAM⌉
At 80 GB per card, 1487.5 GB of weights require 19 cards. This is only a theoretical value. KV cache, workspace, communication buffers, and load-balancing headroom all consume VRAM, so actual deployments usually need more cards.
In MoE models, experts are distributed across cards, and expert routing for each token triggers inter-card data exchange. As a result, interconnect bandwidth and latency often affect inference efficiency more than the number of cards itself. For models at this scale, a common approach is to build a supernode with 64 or more accelerators and rely on high-speed interconnect to reduce expert communication overhead.
The following code quickly estimates the total VRAM for different card counts:
import mathdef min_cards(weight_gb: float, per_card_gb: float) -> int:"""Minimum card count estimated from weight capacity only; excludes KV cache and workspace."""return math.ceil(weight_gb / per_card_gb)weight_gb = 1487.5 # 2.8T parameters at 4.25 effective bitsprint(min_cards(weight_gb, 80)) # Output: 19
The total VRAM for different card counts is shown below (80 GB per card):
| Cards | Total VRAM | Can hold weights alone? |
|---|---|---|
| 8 | 640 GB | No |
| 16 | 1280 GB | No |
| 24 | 1920 GB | Yes, with little headroom |
| 64 | 5120 GB | Yes, with ample headroom |
5. How to Calculate Cost
Deployment cost consists of several parts:
Total cost = hardware cost + datacenter and power cost + network and storage cost + operations labor cost
Hardware cost depends on whether you purchase or rent.
Self-built: hardware is depreciated over its service life. Annual hardware cost = cards × per-card purchase price ÷ depreciation years.
Rental: pay by usage time. Annual rent = cards × per-card hourly price × annual operating hours.
Electricity cost can be estimated as:
Annual electricity cost = cards × per-card power (kW) × PUE × 8760 × electricity price
PUE is the data center power usage effectiveness, and 8760 is the number of hours in a year. If server power is already included in per-card power, do not count it twice.
When building an estimate, treat all price parameters as placeholders and replace them with actual quotes.
