The Cost of Deploying a Trillion-Parameter LLM On-Premises

    A practical breakdown of the real cost of self-hosting a trillion-parameter Mixture-of-Experts model: why activation ratio does not reduce VRAM needs, how to calculate weight memory down to the byte, why interconnect topology is the second major expense, and which cost items to budget for before procurement.

    1. First, clear up a common misconception: activation ratio is not memory ratio

    When people first read a description like “2.8 trillion parameters, only 16 experts activated per token,” they instinctively calculate: the activation ratio is about 1.79%, so does that mean VRAM usage is only 1.79% as well? This is the most expensive misunderstanding in on-premises deployment planning.

    For a Mixture-of-Experts (MoE) architecture, VRAM consumption is determined by the total parameter count, while compute demand and memory bandwidth pressure are determined by the activated parameters. The reason is that routing is dynamic: which 16 experts a given token goes through is only known at runtime. You cannot predict which experts the next batch will hit, so you must keep all experts resident in storage, then move activations to the compute units holding the selected experts during inference, and move the results back afterward.

    Expressing this constraint in pseudocode makes it more intuitive:

    1. # Weights must be fully resident (capacity constraint)
    2. for expert in all_experts: # count equals the total number of experts
    3. expert.load_to_device()
    4. # Compute happens only on the routed subset (compute constraint)
    5. for token in batch:
    6. selected = router(token).top_k(16)
    7. y = sum(experts[i](token) for i in selected)

    Capacity and compute are decoupled, and this is precisely the essence of the MoE deployment cost structure. In addition, the backbone of such models usually stacks components like linear attention variants, residual connections, and gated multi-head latent attention. These do not change the capacity conclusion above, but they do affect operator implementation and how VRAM fragmentation is distributed.

    2. Calculating weight VRAM down to the byte

    The mainstream approach is to introduce quantization-aware training in the later stages of training, so the model converges in a low-precision format and avoids accuracy collapse at inference time. Assuming weights use a 4-bit floating-point format and activations use an 8-bit floating-point format, the estimate can be broken into three steps:

    1. Raw data floor: 2.8T × 4 bit ÷ 8 ≈ 1400 GB.
    2. Adding scale factors: under the Open Compute Project (OCP) micro-scaling specification, every 32 4-bit elements share one 8-bit scale, so the effective bit width becomes 4.25 bit, and 2.8T × 4.25 ÷ 8 ≈ 1487.5 GB.
    3. Adding the incompressible parts: non-4-bit tensors (embedding layers, normalization parameters, router gates), metadata, memory alignment, the runtime workspace, and the KV cache.

    Step 3 is the one most often underestimated. In practice, runtime overhead plus the KV cache usually requires reserving another 10%–20% of headroom, and the KV cache grows linearly with concurrency and context length. A sound engineering approach is:

    1. Total VRAM required ≈ quantized weights + non-quantized tensors + runtime workspace + KV cache (concurrency × context length)
    2. Available VRAM = VRAM per card × number of cards × effective utilization (typically 0.8–0.9)
    3. Minimum card count = ceil(total VRAM required / available VRAM)

    As a reference point, a dense/sparse model at the 670-billion-parameter level needs about 685 GB for 8-bit weights; after 4-bit quantization, weights are about 335 GB plus roughly 37 GB of activations, for a total of about 400 GB — just enough to fit into 8 accelerator cards with 80 GB each (640 GB). A trillion-scale model is more than four times that size, which is exactly where the hard threshold for a “full-strength” deployment lies.

    3. Interconnect topology: the overlooked second cost

    VRAM is only the entry ticket; what really determines throughput is the interconnect. Expert parallelism splits 896 experts across different devices, and every layer performs two global All-to-All operations: one to dispatch token activations to the target experts, and one to collect the results back. The communication volume is roughly:

    1. Bytes per layer ≈ 2 × number of tokens × hidden dimension × activation bytes × number of layers

    When the communication domain spans nodes and can only run over Ethernet or InfiniBand, round-trip latency directly eats up the compute gains from low precision, showing up as GPU utilization lingering at low levels over long periods. This is why the official recommendation is a high-bandwidth supernode built from 64 or more accelerators, using NVLink or an equivalent high-speed interconnect to make the communication domain as large as possible, so that the vast majority of All-to-All traffic stays within a single domain. On the engineering side, expert placement strategies, overlapping communication with computation, and hierarchical All-to-All are also needed to further compress tail latency.

    4. The cost checklist: one-time investment and ongoing spending

    • Hardware: purchase using the minimum card count multiplied by a redundancy factor of 1.2–1.5, and budget for high-speed interconnect, parallel storage, and network ports as well — these are often left out of the calculation.
    • Storage: 1.5 TB-class weights need a high-throughput parallel file system to carry them, and load speed directly affects cold-start and failure-recovery times.
    • Power and cooling: rack-level power density is high, and upgrading the facility’s power supply and heat dissipation is often a hidden major expense.
    • Operations: monitoring and alerting, logging services, link health checks, and auto-scaling capabilities are needed to support stable long-running operation.

    5. Cost-reduction paths and decision guidance

    If the business can tolerate some loss of accuracy, consider distilling down to a small or medium parameter size, more aggressive low-bit quantization, or a hybrid form of “on-demand in the cloud with on-premises fallback.” If a private full-strength deployment is mandatory, the budget should be centered on interconnect and storage rather than simply piling up cards. Baidu AI Cloud can provide supporting capabilities in general areas such as container platforms, parallel file storage, and monitoring and alerting, making it easier to map the capacity model above directly into a resource plan that can be procured and operated. Calculate the two accounts — VRAM and communication — clearly before talking about procurement; that is the only reliable path to avoiding a blown budget.