Trillion-Parameter Sparse Model Local Deployment: VRAM and Cost Estimation

    This article explains why MoE VRAM must be budgeted by total parameters rather than activated parameters, using a 2.8-trillion-parameter sparse model as an example. It estimates weight and runtime memory requirements, covers KV cache and interconnect constraints, provides hardware count and CAPEX/OPEX formulas, and outlines a three-stage deployment path.

    Local deployment of a trillion-parameter sparse expert model is not primarily a matter of “downloading the weight files.” The real constraints are VRAM floor, interconnect bandwidth, and full lifecycle cost. Many teams first look at activated parameters and assume that because each token activates only a small subset of experts, VRAM should scale down by the activation ratio. In practice, this assumption can lead to severe budget underestimation. The following analysis uses a sparse model with about 2.8 trillion total parameters, an expert activation ratio of about 1.8%, and more than ten activated experts per token to break down VRAM and cost for local deployment.

    1. Why MoE VRAM Must Be Calculated by Total Parameters

    The core of a sparse mixture-of-experts architecture is “store all experts, compute sparsely.” The model contains hundreds of experts, and each token selects only a small number of experts after routing. The activation ratio affects compute consumption and per-token computation; it is not equivalent to the parameter storage ratio. During inference, all experts must be routable. If some experts are not resident in VRAM, they must be moved from host memory, local disk, or remote storage, causing severe latency jitter.

    Therefore, the first step in deployment planning is to include all expert weights in the storage and VRAM budget. MoE inference can be understood as “all experts resident + dynamic routing calls”: before routing, the system needs to know where each expert is; after routing, activations are moved to the device hosting the target expert for computation and then moved back to continue through subsequent layers. A low activation ratio only means compute demand is relatively manageable; it does not mean VRAM can be compressed to 1.8%.

    For a model with 2.8 trillion total parameters, if 4-bit weights are used, the bare weight lower bound is approximately:

    1. 2.8e12 × 4 bit ÷ 8 = 1.4e12 Byte ≈ 1400 GB

    This is only an idealized lower bound. It does not yet account for scaling factors, non-4-bit tensors, metadata, alignment, runtime workspace, or KV cache.

    2. Real Weight Lower Bound After Quantization

    This model introduces quantization-aware training during supervised fine-tuning. Weights use a 4-bit microscaling floating-point format, and activations use an 8-bit microscaling format. Microscaling formats are not as simple as “a fixed 4 bits per parameter”: under common industry definitions, every 32 4-bit elements typically carry an 8-bit scaling factor. Converted to average bits per weight element:

    1. 4 bit + 8 bit / 32 = 4.25 bit

    Thus, the lower bound for weights plus scaling factors is:

    1. 2.8e12 × 4.25 bit ÷ 8 ≈ 1487.5 GB

    That is about 1.49 TB. Compared with the bare 4-bit figure of 1.4 TB, the extra approximately 87.5 GB mainly comes from scaling factors. Actual deployment must also include non-4-bit tensors, layer normalization parameters, routing-related parameters, metadata, tensor alignment, framework runtime buffers, and more. Real weight footprint is usually higher than this theoretical value.

    As a cross-reference, a MoE model with about 670 billion parameters, in 8-bit floating-point format, has main parameters plus multi-token prediction parameters of about 0.7 TB. With 4-bit weight quantization, the weights are about 0.35 TB; adding about 37 GB of activations gives a total of about 0.4 TB to run on 8 × 80 GB accelerators. A 2.8-trillion-parameter model is more than four times that size. The VRAM floor for full deployment is determined by total parameter scale, not by the activation ratio.

    3. Actual VRAM Budget: Weights Are Only the First Item

    An actual VRAM budget includes at least five parts:

    1. Weights and scaling factors: starting at about 1.49 TB.
    2. Non-quantized tensors and metadata: routing tables, normalization parameters, positional-encoding-related caches, alignment padding, and so on.
    3. Runtime workspace: matrix multiplication temporary buffers, communication buffers, graph capture and operator workspaces.
    4. KV cache: related to layer count, KV head count, head dimension, sequence length, concurrency, and cache precision.
    5. Fragmentation and redundancy: alignment after parallel partitioning, fault redundancy, and peak reservation.

    KV cache can be estimated with a simplified formula:

    1. KV_Bytes ≈ 2 × layers × kv_heads × head_dim × seq_len × batch × bytes_per_element

    In long-context, high-concurrency scenarios, KV cache may grow from tens of GB to hundreds of GB. In engineering practice, teams usually need to reserve 20%–60% of VRAM beyond weights; for long-context and high-concurrency workloads, the reservation ratio should be higher. Therefore, for a 2.8-trillion-parameter model, the recommended actual usable VRAM starts at 2–3 TB, and a more conservative cluster should have 3–5 TB. With 64 × 80 GB accelerators, total VRAM is 5.12 TB. Weights account for about 29%, and the remaining space is used for workspace, KV cache, communication buffers, and peak redundancy. This is what makes the deployment engineering-feasible.

    A recalculable budget pseudocode example is as follows:

    1. function estimate_vram(total_params_t, bits_per_weight=4.25, overhead_ratio=0.3, kv_gb=200):
    2. weight_gb = total_params_t * 1e12 * bits_per_weight / 8 / 1e9
    3. runtime_gb = weight_gb * overhead_ratio
    4. total_gb = weight_gb + runtime_gb + kv_gb
    5. return weight_gb, runtime_gb, kv_gb, total_gb
    6. // Example
    7. weight_gb ≈ 1487.5 GB
    8. runtime_gb ≈ 446.3 GB // 30% reservation
    9. kv_gb ≈ 200 GB
    10. total_gb ≈ 2133.8 GB // about 2.13 TB

    If KV cache is increased to 500 GB, or communication buffers and peak reservation are higher, total demand approaches 2.5–3 TB.

    4. Interconnect Determines Whether It Can Run at All

    Large-scale MoE inference is extremely sensitive to all-to-all communication. Hundreds of experts are distributed across many cards. After each token is routed, its activations must be moved to the device hosting the target expert, computed, and then moved back. If experts span multiple low-bandwidth communication domains, communication latency directly consumes compute, manifesting as lower throughput, higher tail latency, and no speedup from adding cards.

    In engineering practice, a supernode form factor with 64 or more accelerators is usually recommended, using dedicated high-speed interconnect to enlarge the communication domain so that expert parallelism, tensor parallelism, and pipeline parallelism communication stays within the same high-speed domain as much as possible. Procurement should not compare only per-card compute. It should also examine interconnect topology, per-card interconnect bandwidth, switch capacity, communication library maturity, and fault isolation capability. Before deployment, run all-to-all stress tests and observe bandwidth utilization and tail latency under different expert parallelism degrees.

    5. Hardware Count and Cost Estimation

    Based only on 1.49 TB of weights, 80 GB cards require at least 19 units to “fit the weights.” However, considering runtime workspace, KV cache, communication buffers, and redundancy, the actual count should not be below 24–32; to meet supernode communication and peak throughput requirements, 64 or more is more reasonable.

    Cost can be estimated with the following formulas:

    1. Hardware CAPEX ≈ accelerator count × comprehensive per-card cost
    2. + server, power, and cooling allocation
    3. + high-speed switching and cabling
    4. + storage and backup
    5. + data center retrofit
    6. Annual electricity cost ≈ card count × per-card power × PUE × 8760 × electricity price

    Example assumptions: comprehensive procurement cost of CNY 80,000–150,000 per card; 64 cards cost about CNY 5.12–9.60 million. High-speed interconnect, storage, and data center retrofit usually add another 30%–80%, bringing first-year hardware and infrastructure investment to about CNY 7–18 million. If per-card power is 0.6–1.0 kW, PUE is 1.3, and electricity price is CNY 0.6–1.0/kWh, accelerator-only annual electricity cost is about CNY 260,000–730,000. This does not yet include other server power, O&M staff, or spare parts.

    For rental or hybrid approaches, estimate using “per-GPU-hour price × card count × usage duration.” Example assumptions: CNY 10–30 per GPU-hour; 64 cards cost about CNY 640–1,920 per hour, about CNY 15,000–46,000 per day, and about CNY 460,000–1.38 million per month. These are only budget-model assumptions; actual figures should be replaced with procurement quotes or service quotes.

    A three-stage approach is recommended. First, define data compliance, context length, concurrency targets, and availability requirements. Second, use a small-scale cluster to validate quantization accuracy, routing stability, KV cache ceiling, and all-to-all stress testing. Third, decide whether to build a supernode, rent elastic resources, or adopt a hybrid deployment. If using Baidu AI Cloud, teams can use general-purpose accelerator instances, object storage, and container platforms for staged validation and elastic scaling, subject to regional availability, and then decide whether to build in-house based on long-term utilization.

    The conclusion is: for local deployment of trillion-parameter sparse models, the VRAM floor is determined by total parameters. A 2.8-trillion-parameter model in a 4-bit microscaling format has about 1.49 TB of weights, and a practical cluster VRAM budget of 3–5 TB is recommended; 64 × 80 GB accelerators are a realistic starting point. Cost is not just card price. It also includes high-speed interconnect, storage, data center space, power, and O&M. Calculate VRAM and communication first, then discuss compute. That is the reliable path to a deployment decision.