Local Deployment of Trillion-Parameter MoE Models: Three Configuration Tiers and Cost Estimates

    This article provides a practical framework for deploying trillion-parameter Mixture-of-Experts (MoE) models locally. It separates total weight capacity from GPU memory requirements, explains why sparse expert activation reduces compute but does not remove the need to address all experts, and outlines three deployment tiers: minimal runnable setups, single-user interactive serving, and high-concurrency high-precision production. It also includes capacity estimation formulas, communication constraints, cost drivers, and a risk checklist for planning and procurement.

    Introduction

    Trillion-scale MoE models are becoming an important direction in the evolution of large language models. When the parameter count reaches the trillion level, local deployment is no longer just about buying a few faster GPUs. The key is to calculate three things at the same time: how to estimate total weight capacity, what determines the lower bound of GPU memory, and whether multi-card communication will constrain compute throughput.

    This article uses a typical trillion-scale MoE model as an example: approximately 2.8 trillion parameters in total, using a MoE architecture, with 896 experts, and 16 experts activated per token. Around three objectives — “minimum runnable setup,” “single-user high-speed interactive output,” and “high-concurrency high-precision service” — it breaks down hardware configuration, cost estimation methods, and risk considerations.

    A key point must be emphasized: in this article, total weight capacity is estimated from the total parameter count, while the lower bound of GPU memory depends on expert residency and offloading strategies. The total amount of addressable storage cannot be directly equated with GPU memory usage.

    1. First, Clarify a Common Misconception: Why 1.79% Does Not Save GPU Memory?

    The core selling point of MoE is sparse activation: although the total number of parameters is very large, each token activates only a small number of experts, so the compute cost of a single forward pass is lower than that of a dense model of the same scale.

    With 896 experts and 16 experts activated per token, the expert activation ratio is:

    1. 16 / 896 ≈ 1.79%

    However, this 1.79% only affects compute cost. It is not the parameter activation ratio, and it does not represent GPU memory usage.

    The reason is as follows:

    • Compute dimension: Each token performs matrix operations with only 16 experts, so the compute workload is reduced.
    • Memory dimension: During inference, the system cannot predict in advance which experts the next token will route to. Therefore, the deployment plan must cover the addressable range of all 896 experts.
    • Storage hierarchy dimension: The addressable range does not necessarily all reside in GPU memory. It can be shared among CPU large-capacity memory, GPU memory, or heterogeneous caches.

    Therefore, the correct statement is: total weight capacity should be estimated from the total parameter count, while the lower bound of GPU memory depends on expert residency and offloading strategies.

    The memory scope corresponding to the three tiers in this article is as follows:

    Tier GPU memory scope
    Tier 1: Minimum runnable setup Weights are mainly placed in CPU DDR memory. GPU memory mainly handles shared attention, current activations, KV cache, transfer buffers, and a small amount of expert cache.
    Tier 2: Single-user interaction GPU memory must handle hot experts, necessary KV cache, and activation buffers, with CPU memory serving as an overflow layer.
    Tier 3: High-concurrency high-precision service GPU memory must hold all weights, 10 KV caches, activation buffers, communication buffers, and a certain amount of redundancy.

    2. Quantization and Memory Floors: How Do 1487 GB and 3 TB Come From?

    Modern large models usually use low-bit quantization to compress weights. The example model in this article uses a micro-scaling quantization scheme with 4-bit weights and 8-bit activations.

    If we consider only the raw parameter tensor, the theoretical lower bound for 4-bit weights is:

    1. 2.8 trillion × 4 bit ÷ 8 = 1400 GB

    However, actual deployment also needs to account for scale factors. Micro-scaling quantization usually attaches one 8-bit scale to every 32 4-bit elements, used to restore the numerical range. Therefore:

    1. 2.8 trillion × (4 + 8/32) bit ÷ 8
    2. = 2.8 trillion × 4.25 bit ÷ 8
    3. ≈ 1487.5 GB

    In other words, with only weights and scale factors, the 4-bit scheme is already close to 1.5 TB. This is only the weight capacity and does not include the following:

    • Unquantized tensors, such as some normalization layers, embedding layers, and router layers;
    • Model metadata, tensor alignment, and padding;
    • Runtime workspace, temporary buffers, and communication buffers;
    • KV cache, which grows with context length and concurrency;
    • Memory fragmentation, address-mapping overhead, and fault-tolerance redundancy.

    If the quantization precision must be no lower than 8-bit, the weight capacity becomes approximately:

    1. 2.8 trillion × 8 bit ÷ 8 = 2.8 TB

    Considering unquantized tensors, alignment, metadata, and runtime buffers, actual planning can be close to the 3 TB level.

    GPU memory estimation can refer to the following formulas:

    Item Estimation formula Notes
    Weight capacity Total parameters × bytes per parameter × quantization and scale factor About 1.5 TB for 4-bit, and on the order of 3 TB for 8-bit
    KV cache Layers × KV heads × head_dim × 2 × context length × concurrency × bytes per element Both K and V need to be counted; GQA/MQA affects the number of KV heads
    Activation buffer Batch size × sequence length × hidden dimension × bytes per element × number of temporary copies Depends on the forward-pass implementation, operator fusion, and framework
    Communication buffer Token hidden dimension × number of activated experts × batch size × concurrency × bytes Buffering may be required before and after all-to-all
    Runtime overhead Reserve 15% to 30% or more of usable memory Higher overhead is recommended for high-concurrency scenarios

    Therefore, the “memory floor” of a trillion-scale MoE model is not a fixed number. It is a range determined jointly by weights, KV cache, activation buffers, and deployment strategy.

    3. Communication Bottlenecks: Why Multi-GPU MoE Is Not Only About GPU Count?

    Even if memory capacity is sufficient, large-scale MoE inference still faces communication bottlenecks.

    The 896 experts are split and deployed across multiple GPUs. After a token is routed, the system needs to use all-to-all communication to send activations to the GPUs hosting the target experts, compute the results, and then merge them. If expert distribution spans multiple communication domains, communication latency can consume the compute benefits, causing GPUs to wait for data and compute resources to idle.

    Common optimizations include:

    • Expert parallelism: Distribute different experts across GPUs or nodes to reduce per-GPU weight pressure.
    • All-to-all overlap: Overlap communication with computation to hide part of the transfer latency.
    • Communication quantization: Reduce the bit width of data transferred across cards, for example by using lower-precision transmission.
    • Hierarchical routing: Prefer intra-node routing and reduce cross-node expert calls.
    • Hot-expert replication: Replicate high-frequency experts to reduce communication hotspots.
    • Token merging and batching: Improve the efficiency of each all-to-all data block.

    To determine whether a super node is needed, check the following questions:

    1. After expert sharding, are cross-node routes frequently triggered?
    2. Does all-to-all time account for more than 20% of total latency?
    3. Is inter-node bandwidth significantly lower than inter-GPU interconnect bandwidth within a node?
    4. Does routing have hot spots concentrated on a few experts, causing local congestion?
    5. Can communication overhead be reduced through overlap, communication quantization, or hierarchical routing?
    6. Will the target concurrency cause communication traffic to grow rapidly with concurrency?

    If the answer to multiple questions is “yes,” a single high-bandwidth communication domain is usually required, such as a multi-GPU cluster or super node built from high-speed interconnects.

    After determining the memory scope and communication constraints, configurations can be organized by objective.

    Tier Objective Memory scope Communication requirements Configuration approach Typical scenarios
    Tier 1 Minimum runnable setup Weights are mainly placed in CPU memory, and GPUs retain only what is needed for runtime Relatively low communication requirements, but CPU-to-GPU transfer must be controlled GPU + CPU heterogeneous offloading Offline batch processing, research validation
    Tier 2 Single-user interaction, with about 25 tps as a reference GPUs reside hot experts, and CPU handles overflow weights Requires good CPU-GPU bandwidth and KV management Hot-expert caching, memory expansion, load-test tuning Single-user development, internal trial
    Tier 3 10 concurrent requests and more than 25 tps for an individual user, with precision no lower than 8-bit All weights are resident in high-memory GPUs, with room reserved for KV and activations Requires a single high-speed communication domain High-memory GPU cluster, high-speed interconnect, redundancy design External production service

    Tier 1: Minimum Runnable Setup, Without Caring About Speed

    The core of this tier is GPU + CPU heterogeneous inference.

    A MoE layer usually contains a shared attention part and a large number of sparse experts. Shared attention is compute-intensive and is suitable for staying on the GPU. The number of experts is large, but each token activates only a few experts, so most expert weights can be placed in CPU large-capacity memory, with CPU memory carrying the addressable range.

    The following is pseudocode, used only to illustrate the idea and not corresponding to a specific framework implementation:

    1. # Pseudocode for illustrating GPU/CPU expert offloading.
    2. # Actual deployment needs to replace this with a specific inference framework, communication library, and memory-management logic.
    3. def forward_token(token, route):
    4. # 1. Shared attention: keep computation on the GPU.
    5. hidden = gpu_attention(token)
    6. # 2. Routing: select the 16 activated experts.
    7. experts = router(hidden, top_k=16)
    8. # 3. Expert computation: most experts reside in CPU memory.
    9. outputs = []
    10. for eid in experts:
    11. if expert_loc[eid] == "GPU":
    12. y = gpu_expert[eid](hidden)
    13. else:
    14. w = cpu_to_gpu(expert_weight[eid])
    15. y = gpu_compute(w, hidden)
    16. outputs.append(y)
    17. return combine(outputs)

    The objects involved in the code need to be replaced with real implementations:

    • expert_loc: A mapping of expert locations, such as GPU, CPU DDR, NVMe, or remote memory.
    • router: Routing and scheduling logic. It needs to support top-k, capacity limits, load balancing, and failure fallback.
    • gpu_compute: The actual computation function after loading expert weights.
    • cpu_to_gpu: The CPU-to-GPU transfer function. It can be replaced with PCIe, NVLink, RDMA, or unified memory access.
    • gpu_attention: The shared attention part, which needs sufficient memory reserved.

    Key prerequisites for Tier 1 include:

    • Expert table: Records each expert’s weight location, version, and quantization precision.
    • Routing table: Records the mapping between experts and GPUs/CPUs.
    • KV cache: Sufficient memory must be reserved; otherwise, long contexts may cause OOM.
    • Transfer batch size: The more fragmented CPU-to-GPU transfers are, the higher the latency. Batch prefetching is needed.
    • Cache replacement policy: Hot experts should be retained as much as possible, while cold experts should be loaded on demand.

    This tier is suitable for scenarios where “slower is acceptable.” Output speed should be based on actual measurements. It is usually not suitable for real-time interaction and is more appropriate for offline batch processing, model validation, and R&D debugging.

    Tier 2: Single-User Use, With 25 tps as an Interaction-Experience Reference

    The goal of Tier 2 is to provide a relatively smooth interaction experience for a single user. 25 tps can only be used as an interaction-experience reference value. It is not a fixed commitment, and not all models, contexts, and hardware combinations can achieve it.

    Measured results for 25 tps depend on at least the following factors:

    • Model total parameter count and expert activation ratio;
    • Whether expert routing distribution is balanced;
    • Context length and KV cache size;
    • GPU model, memory capacity, and memory bandwidth;
    • CPU-GPU transfer bandwidth;
    • High-speed interconnect or PCIe topology;
    • Whether hot experts can be stably resident;
    • Batching, prefetching, and cache replacement strategies.

    Therefore, Tier 2 cannot be specified in advance as “a few to a dozen high-end GPUs are enough.” The number of GPUs should be determined through actual load testing.

    The core method of Tier 2 is to improve the residency rate of hot experts in GPU memory:

    • Identify experts that are frequently routed and keep their weights resident in GPU memory.
    • Dynamically migrate experts according to hotspot distribution, avoiding static partitioning that causes hotspot congestion.
    • Optimize KV cache management, reserve contiguous memory, and reduce fragmentation.
    • Use higher-bandwidth CPU-GPU transfer links.
    • For long-context scenarios, set a maximum context length or adopt a sliding-window strategy.

    Recommended acceptance checks:

    • Fix a representative set of prompts;
    • Fix the context length;
    • Record first-token latency, output tps, and P50/P99 latency;
    • Record the number of OOM events, expert cache hit rate, and CPU-to-GPU transfer volume;
    • Compare output quality under the target precision.

    Tier 3: 10 Concurrent Requests and More Than 25 tps per User, With Precision No Lower Than 8-bit

    Tier 3 is the most demanding tier. It needs to satisfy the following simultaneously:

    • 10 concurrent requests;
    • Output speed of at least 25 tps for an individual user;
    • Quantization precision no lower than 8-bit;
    • Stable service with fallback capability and operability.

    The weight capacity for 8-bit weights is approximately 3 TB. If we only look at the weight lower bound:

    GPU memory per card Theoretical number of cards needed to hold 3 TB of weights only Notes
    80 GB About 38 cards Does not include KV cache, activation buffers, communication buffers, or redundancy
    192 GB About 16 cards Does not include KV cache, activation buffers, communication buffers, or redundancy

    This is only the theoretical lower bound. Actual deployment must reserve memory for the following:

    • 10 KV caches;
    • Activations and temporary buffers;
    • All-to-all communication buffers;
    • Model metadata and unquantized tensors;
    • Memory fragmentation;
    • Fault redundancy and space for rolling upgrades.

    Therefore, it is recommended to increase the theoretical card count by 20% to 50% or more, depending on context length, concurrent request distribution, and framework implementation. If planning with 192 GB cards, 16 cards is only the starting point. For production, it is better to plan around 20 cards or based on load-test results.

    Tier 3 also requires a sufficiently strong communication system. Multi-card MoE generates denser all-to-all traffic under high concurrency, so a single high-speed communication domain is required, and crossing low-bandwidth nodes should be avoided as much as possible.

    Production environments should also prepare fallback plans:

    • Reduce the maximum concurrency when concurrency overloads occur;
    • Truncate or queue long requests;
    • Degrade to a lower-concurrency mode;
    • Switch to CPU offloading mode to maintain availability;
    • Evaluate the business impact of quantization precision, rather than looking only at throughput.

    5. Cost Breakdown: Memory Hierarchy Determines the Order of Magnitude

    The cost of deployment is essentially determined by which storage hierarchy the weights reside in, how many high-speed GPUs are needed, and whether high-speed interconnects are required. The following is an order-of-magnitude estimation template, not a quotation or purchasing recommendation.

    Cost item Estimation formula or template Notes
    GPU purchase or rental price Number of cards × purchase unit price; or number of cards × 24 × 30 × hourly rental rate Prices vary greatly among 80 GB, 192 GB, and different interconnect capabilities
    CPU memory cost per GB Required DDR capacity × price per GB In Tier 1, CPU memory may become a major cost item
    High-speed interconnect Number of ports × unit price, or networking solution × one-time cost Interconnect cost cannot be ignored for multi-card MoE
    Power and cooling Device power consumption × electricity price × usage duration × cooling factor Dozens of accelerator cards significantly increase data-center pressure
    Operations cost Person-months × labor rate, or a percentage of hardware investment Includes load testing, monitoring, fault handling, and cache tuning
    Storage and data Model repository, logs, checkpoints, and data backups Weight files for a trillion-parameter model consume substantial storage

    For a rough estimate, total cost can be decomposed as follows:

    1. Total cost ≈ GPU cost + CPU memory cost + interconnect cost + power and cooling cost + operations cost + storage and network cost

    For Tier 3, assume planning with 192 GB cards. The theoretical lower bound is about 16 cards. After considering KV cache and redundancy, estimate 20 cards. The monthly rental cost can first be calculated as follows:

    1. Monthly rental cost ≈ 20 × 24 × 30 × hourly rental price per card

    Then add CPU memory, interconnect, power, operations, and storage costs. Actual amounts must be based on vendor quotes and data-center conditions.

    Three types of hidden costs must be avoided:

    1. Communication and interconnect costs: Multi-card MoE has high requirements for high-speed interconnects. Networking hardware and network configuration are themselves an expense.
    2. Power and cooling costs: The power consumption and cooling costs of dozens of high-end accelerators cannot be ignored.
    3. Operations complexity costs: Heterogeneous deployment involves CPU-GPU coordination, expert caching, routing monitoring, memory governance, and failure fallback. Labor costs are often underestimated.

    For teams with elastic needs but unwilling to invest heavily in hardware upfront, cloud-based solutions can also be evaluated. Local deployment and cloud deployment are not mutually exclusive. The key is to choose a matching tier based on concurrency scale, speed requirements, data compliance, and budget.

    6. Summary, Selection Advice, and Risk Checklist

    Local deployment of trillion-scale MoE models can follow a four-step decision process:

    1. Calculate total weight capacity: about 1.5 TB for 4-bit, and on the order of 3 TB for 8-bit.
    2. Clarify the memory scope: total weight capacity should be estimated from total parameter count, while the lower bound of GPU memory depends on expert residency and offloading strategies.
    3. Evaluate communication constraints: multi-card MoE must assess all-to-all communication, high-speed interconnects, and super-node requirements.
    4. Calculate total cost of ownership: include GPU, CPU memory, interconnect, power, cooling, operations, and storage together.

    Selection advice:

    • Minimum runnable setup: Prioritize GPU + CPU heterogeneous offloading and accept lower speed.
    • Single-user high speed: Prioritize optimizing hot-expert residency, KV cache, and CPU-GPU bandwidth. The number of GPUs must be determined through load testing.
    • High concurrency and high precision: Plan a high-memory cluster based on about 3 TB of 8-bit weights, and reserve KV cache, activation buffers, and fault redundancy.

    Risk and compliance checklist:

    • Data privacy: Do input data, logs, and caches need anonymization or encryption?
    • Model license: Do model weights permit local deployment, commercial use, or redistribution?
    • Output content moderation: Do security review and content filtering mechanisms need to be integrated?
    • Quantization precision impact: Will 4-bit or 8-bit quantization reduce business effectiveness? Is offline evaluation needed?
    • Memory redundancy: Is enough memory reserved to prevent OOM caused by long contexts or sudden concurrency spikes?
    • Fallback plan: Can the system degrade to CPU offloading or a queuing mode during high-concurrency failures?
    • Operations monitoring: Can expert hit rate, all-to-all latency, memory fragmentation, and GPU temperature be monitored?

    In one sentence: local deployment of trillion-parameter MoE models is not simply “buying a good card.” It is a systematic engineering effort to balance memory capacity, communication bandwidth, quantization precision, and budget constraints. Clarify the tier and objective first, then derive configuration and cost backward, so that the budget is spent where it matters most.