Deploying Trillion-Scale MoE Models Locally: VRAM and Cost Estimation

    This article provides a detailed analysis of the VRAM requirements and deployment costs for hosting a 2.8 trillion parameter Mixture of Experts (MoE) model locally. It covers the baseline memory for weights and runtime overhead, the impact of communication bandwidth on performance, tiered deployment strategies including CPU heterogeneous inference, multi-GPU parallel inference, and super-nodes, as well as a practical formula for estimating hardware configurations and overall investments.

    1. VRAM Lower Bound: Calculating Weights First, Then Runtime Overhead

    Take a 2.8 trillion parameter (2.8T) MoE model as an example. The model has 896 expert modules, with only 16 experts activated per token, resulting in an activation ratio of about 1.79%. Sparse activation only reduces the computation for each forward pass, not the VRAM usage. The weights of all experts must reside in memory, and the routing mechanism only determines which 16 experts to call at each step. Therefore, VRAM must be calculated based on the full 2.8 trillion parameters.

    The model adopted quantization-aware training during the supervised fine-tuning stage, with weights in MXFP4 format and activations in MXFP8 format. In MXFP4, each element occupies 4 bits, with an 8-bit scale factor shared per 32 elements, equating to 4.25 bits per parameter. Based on this, the weight storage is calculated as follows:

    • Raw data lower bound: 2.8T × 4 bits ÷ 8 = 1400 GB
    • Including scale factors: 2.8T × 4.25 bits ÷ 8 ≈ 1487.5 GB

    Beyond the weights, there are other overheads. The table below provides a VRAM breakdown under a set of assumptions, where the KV Cache is calculated for 4×10^6 concurrent tokens (model configuration details in section 4.1).

    Item Estimated Value Assumption Basis
    Weights (incl. scale factors) 1487.5 GB Calculated above
    Non-4-bit tensors (embeddings, norm layers, etc.) & metadata ~40 GB Assumed value; requires testing based on model structure
    KV Cache ~492 GB 4×10^6 concurrent tokens; see section 4.1
    Workspace & temporary activation storage ~150 GB 10% of weight capacity
    Subtotal ~2169 GB Sum of the four items
    Alignment & fragmentation (+10%) ~2386 GB, i.e., ~2.4 TB Runtime empirical coefficient

    Under these assumptions, the total is about 2.4TB. If the number of concurrent tokens is changed to 2×10^6, the total is about 2.1TB; if changed to 5×10^6, it is about 2.5TB. The 1.49TB for weights is a fixed lower bound, while the rest varies with concurrency and context length.

    For reference, a 671B parameter model in FP8 format requires about 685 GB of VRAM. The weight scale of the 2.8T parameter model is about 4 times that, and the deployment threshold rises accordingly.

    2. Communication: The Factor Determining Performance Ceiling

    The bottleneck for large-scale MoE inference is usually communication bandwidth, not computing power (FLOPS). The 896 experts are distributed across multiple accelerator cards. After routing each token, the activation vector must be sent to the card hosting the target expert, and after computation, the result is sent back. This process is known as All-to-All communication. The amount of data moved across cards is proportional to the dispersion of expert distribution. The more dispersed the experts, the more data is moved, and the longer the GPU waits for data.

    A common practice is to place multiple cards within the same high-speed interconnect domain (e.g., an NVLink domain) so that inter-card communication uses high-bandwidth channels, reducing the number of hops through network switches. Each additional hop increases latency and jitter. Once the communication domain is split, GPU utilization drops significantly. Therefore, before deployment, the hardware topology should be confirmed first, and then the number of cards should be decided.

    3. Tiered Deployment Paths

    3.1 CPU Heterogeneous Inference: Verifying Feasibility

    The applicable scenario is verifying model capabilities without requiring real-time responses. Weights are placed in CPU memory, the GPU only handles part of the operator computations, and the two exchange data via PCIe.

    Minimum configuration reference:

    • System memory no less than 1.5TB, weights resident in DRAM, and NUMA affinity confirmed.
    • One entry-level or consumer-grade accelerator with a PCIe 4.0 x16 interface or better.
    • NVMe disk array for reading model files.

    Performance expectations: Under the condition of batch=1 and weights resident in memory, the single-token latency is expected to be at the second level. Specific values depend on the number of activated parameters, the quantization format, and the memory bandwidth, and need to be tested on the target machine.

    Failure boundaries include: insufficient memory capacity prevents model loading; insufficient memory bandwidth directly limits throughput; slow disk reads significantly increase startup loading time.

    Regarding costs, large-capacity memory is the main expense, and current full-machine quotations should be used as a reference. This article does not provide fixed amounts.

    3.2 Multi-GPU Parallel Inference: 32x 80GB Accelerator Cards

    The multi-GPU solution splits the model across multiple cards. Each card holds only a portion of the weights, and high-speed synchronization of intermediate results is required between cards. 16x 80GB cards total 1.28TB, which is lower than the 1.49TB weight lower bound, making it unusable. 32 cards total 2.56TB, which can accommodate the ~2.4TB requirement, so the minimum runnable configuration is 32x 80GB accelerator cards. The remaining capacity is about 7%, meaning more cards will be needed for longer contexts or higher concurrency.

    Minimum configuration reference:

    • 32x 80GB accelerator cards, with NVLink or equivalent high-speed interconnect between cards.
    • Servers configured according to the number of cards; cross-machine communication requires high-speed networking.
    • System memory and NVMe meet model loading requirements.

    Cost is calculated using an example unit price of 200,000 CNY per card. This price is for demonstration only, does not represent a quote, and should be based on daily procurement quotes.

    • Accelerator procurement: 32 × 200,000 CNY = 6.4 million CNY
    • Applying a cluster multiplier of 1.4~1.8 (covering servers, networking, storage, cooling, and implementation), the total investment is about 8.96 million to 11.52 million CNY.

    Failure boundaries include: insufficient number of cards prevents loading; too little remaining capacity results in a very low concurrency limit; cross-server communication bottlenecks cause measured throughput to fall below expectations.

    3.3 Super-node: 64 Cards Forming a Unified Communication Domain

    The super-node solution aims to keep all cards within the same high-bandwidth communication domain, reducing latency caused by cross-node communication. The scheduler needs to predict expert distribution based on routing information, trying to overlap token distribution and result return.

    Minimum configuration reference:

    • 64 accelerator cards forming a fully interconnected high-bandwidth domain.
    • Supporting CPU nodes, large-capacity memory, and high-speed networking.
    • Inference service software supporting routing-aware scheduling.

    Cost is also calculated using the example unit price: accelerator procurement is 64 × 200,000 CNY = 12.8 million CNY. After applying the 1.4~1.8 multiplier, the total investment is about 17.92 million to 23.04 million CNY. The additional costs for super-node vendors vary greatly, and specific quotes should be used.

    Failure boundaries include: a card failure within the domain simultaneously reduces overall capacity and performance; when scheduling and communication optimization are incomplete, measured performance may be far below theoretical values.

    4. Cost Estimation and Configuration Formulas

    4.1 Quick Estimation Steps

    1. Weight capacity = Number of parameters × Quantization bits ÷ 8 × 1.06 (incl. scale factors)
    2. KV Cache = 2 × Number of layers × Number of KV heads × Head dimension × Bytes per element × Max concurrent tokens
    3. Workspace & temporary activation storage: ~10% of weight capacity
    4. Total VRAM = (Sum of items 1, 2, and 3) × 1.1 (alignment and fragmentation)
    5. Number of cards = Total VRAM ÷ VRAM per card, rounded up; a common practice is to use powers of 2 for easy tensor parallelism splitting.
    6. Investment = Unit price per card × Number of cards × 1.4~1.8 (cluster multiplier)

    Example (assumed values, need to be replaced with real model configuration): The model has 60 layers, 8 KV heads, a head dimension of 128, and uses FP8 for KV Cache, with 1 byte per element.

    • KV Cache per token = 2 × 60 × 8 × 128 × 1 = 122,880 bytes, ~0.12 MB
    • For 4×10^6 concurrent tokens, KV Cache is ~491 GB.

    Substituting into the above steps: Weights 1487.5 GB, KV Cache 491 GB, Workspace 150 GB, totaling ~2169 GB; multiplied by 1.1 gives ~2386 GB. Dividing by 80 GB per card gives 29.8 cards. Rounding up and taking the power of 2 yields 32 cards.

    The 1.4~1.8 multiplier is an empirical assumption.