The Cost of Deploying a Trillion-Parameter MoE Model Locally

    This article breaks down what it actually costs to run a trillion-parameter Mixture-of-Experts (MoE) model on your own hardware. It explains why memory capacity must be sized by total parameters rather than activated parameters, why 4-bit weights still require far more than half the raw parameter volume once scaling factors and runtime overhead are included, why high-speed interconnect and a large communication domain matter as much as raw capacity, and how to split the bill into hardware, data center, storage, and engineering costs. A reusable capacity estimation function and a phased adoption strategy are included.

    1. Why “Trillion Parameters” Cannot Be Sized by Activation Volume

    When teams first work with ultra-large-scale MoE (Mixture-of-Experts) models, they instinctively try to scale resources by a ratio: since each token activates only a tiny fraction of all experts, surely memory usage is only a small fraction too? This intuition holds at the compute level but breaks down completely at the storage level.

    Take a typical configuration: roughly 2.8 trillion total parameters, with the expert layers made up of 896 experts, each token routed to 16 of them, for an expert activation ratio of about 1.79%. Here it is important to stress a concept that is often confused — the expert activation ratio is not the same as the parameter activation ratio. The former describes how many experts are invoked; the latter describes how many weight elements actually participate in computation. The two are not numerically equivalent, because each expert also contains attention, projection, normalization, and other structures, and the backbone is always resident and participating in computation for every token.

    This leads to the first hard constraint:

    • Memory (or unified memory) capacity is sized by total parameters, because all 896 experts must stay resident in storage, ready to be hit by routing at any time;
    • Compute consumption is sized by activated parameters; the activation ratio only affects FLOPs and memory access volume, not the capacity floor;
    • Any claim that “sparse means cheap” is only partially true on the compute dimension and severely underestimates cost on the capacity dimension.

    At the architecture level, this class of models typically uses a linear attention / incremental state-update mechanism (such as the various Delta-style linear attention variants) as the backbone, combined with residual accumulation and gated low-rank attention components, to reduce KV complexity under long contexts. For the party doing the deployment, the only conclusion that really needs to be remembered is this: the backbone structure drives KV and state overhead for long text, while the expert structure drives capacity and communication overhead — the two must be accounted for separately.

    2. The Real Floor for 4-bit Weights: Don’t Just Divide Parameters by 2

    Quantization-aware training (QAT) folds the numerical format into the optimization objective at the end of training, and is the key prerequisite that makes ultra-large-scale models of this kind deployable at all. A typical scheme is 4-bit weights with 8-bit activations — 4 bits on the weight side, 8 bits on the compute side.

    By raw data estimate, 2.8 trillion parameters converted to 4-bit is about 1400GB. But in engineering terms it is never that number, because block-wise quantization has to carry scaling factors: every 32 4-bit elements come with one 8-bit scale.折算 according to the OCP (Open Compute Project) micro-block format specification, the effective bit width is about 4.25 bits:

    1. Effective weight size ≈ 2.8e12 × 4.25 / 8 ≈ 1487.5 GB

    And that 1487.5GB is still only the “weight body” itself. A real deployment also has to stack on:

    1. Tensors that are not quantized: normalization parameters, biases, routing gates, and position-related parameters typically stay at higher precision;
    2. Metadata and alignment padding: tensor descriptors, shard indexes, and fragmentation caused by memory alignment;
    3. Runtime workspace: dequantization buffers, temporary activations, and communication send/receive buffers;
    4. KV cache and state cache: growing linearly with concurrency and context length, easily consuming hundreds of GB in long-text scenarios;
    5. Framework and scheduling overhead: memory pools, defragmentation, and backup copies.

    As a horizontal reference, the publicly disclosed 671B-class ultra-sparse model (including about 14B of auxiliary multi-token-prediction parameters) needs about 685GB of weights at 8-bit, and about 335GB of weights plus about 37GB of activations after 4-bit quantization, for a total of about 400GB — just barely able to run on 8 80GB accelerator cards (640GB). A trillion-scale model is more than four times that size, so the capacity floor for a full deployment is set directly: the single-machine 8-card tier is completely insufficient in capacity.

    Capacity solves “does it fit”; communication decides “does it run.” The inference process of an ultra-sparse MoE can be abstracted as:

    1. for each token:
    2. gate = router(hidden) # compute routing, select top-k experts
    3. x = all_to_all_dispatch(x, gate) # send token activations to the devices holding the experts
    4. y = expert_compute(x) # expert forward computation
    5. h = all_to_all_combine(y) # gather results back to the original device

    Every token goes through one “dispatch — compute — gather” cycle. When 896 experts are split across dozens of cards, all-to-all communication volume scales up with concurrency and card count. If the communication domain spans links with clearly different bandwidth tiers, communication latency will directly eat the compute gains, showing up as GPU utilization lingering at a low level over the long term.

    This is why the recommendation is a super node made up of 64 or more accelerators — the essence is to make the communication domain larger: use high-bandwidth intra-domain interconnect (such as NVLink and equivalents of the same class) to bring the cards participating in all-to-all into the same low-latency domain, avoiding high-frequency small messages crossing slow links. Supporting engineering measures include a hybrid split of expert parallelism and data parallelism, routing load balancing to avoid hot-spot experts, overlapping communication with computation, and hierarchical all-to-all (aggregate within the domain first, then transfer across domains).

    4. How to Calculate the Cost: Split the Bill into Four Parts

    Back to the question in the title, the cost of local deployment can be broken into four categories, and ignoring any one of them will distort the budget.

    • Hardware purchase or rental: starting from a 64-card super node, plus high-speed NICs, switches, and storage; if going the rental route, billed hourly or monthly, with attention to whether a whole node is delivered and whether the intra-domain interconnect spec is guaranteed.
    • Data center and supporting facilities: power, cooling, rack space, and operations staff — often underestimated for long-term self-builds.
    • Storage and data pipeline: model weights start at nearly 1.5TB, and loading plus version management need a high-throughput parallel file system or object storage paired with a caching layer.
    • Engineering and personnel: parallel-strategy tuning, quantization and inference-framework adaptation, and hooking up monitoring, alerting, and logging services — an ongoing investment.

    A reusable capacity estimation flow:

    1. def estimate(weights_bytes, kv_per_token, ctx_len, concurrency, overhead=1.25):
    2. kv = kv_per_token * ctx_len * concurrency
    3. return (weights_bytes + kv) * overhead # total unified memory / VRAM requirement

    First use the weight floor to judge “can it fit,” then use KV and concurrency to judge “how many users can it serve,” and finally use the communication topology to judge “is the latency acceptable.” Only when all three pass is it ready to go live.

    5. Practical Advice: A Phased Rollout

    For most teams, going straight to the full version is not economical. A more robust path is to proceed in stages: first validate business results and prompt engineering with a quantized distilled version or a smaller parameter tier; once results meet the bar, then evaluate capacity and concurrency to settle on card count and parallel splitting; for high-concurrency online scenarios, prefer on-demand use of high-speed-interconnect instances in the cloud, paired with a container platform for elastic scaling and with monitoring, alerting, and logging services for observability; for offline batch processing with strict data-compliance requirements, then evaluate the long-term amortized cost of a self-built super node. Baidu AI Cloud typically offers a general combination of capabilities in these scenarios, from high-speed-interconnect compute to storage, containers, and observability services, making it easier for teams to focus on model adaptation rather than data center operations.

    The conclusion is clear: for local deployment of a trillion-scale ultra-sparse model, the capacity floor is determined by total parameters and quantization format, real-world usability is determined by the communication domain, and the final bill is made up of four parts — hardware, data center, storage, and personnel. Only after working out these three accounts should you decide between self-building and the cloud, so you are not misled by the intuition that “sparse means cheap.”