Training a Trillion-Parameter MoE Multimodal Model on Domestic GPUs: Memory and Communication Tuning
Training a 2.8-trillion-parameter native multimodal MoE model hinges on whether memory and communication stay stable over long runs—raw compute alone is not enough. A team recently validated the training pipeline of a model at this scale on a domestic GPU platform, completing 400 consecutive steps on two machines with 16 GPUs without numerical overflow or unexpected interruptions. This article organizes the key concerns and practices across five areas: memory management, numerical stability, communication optimization, fault tolerance and checkpointing, and scaling. All figures and practices are engineering experience or general methods, not official product metrics.
Training a 2.8-trillion-parameter native multimodal MoE model is difficult mainly because memory and communication must remain stable over long runs. Simply adding more compute does not solve the problem. Recently, a team validated the training pipeline for a model of this scale on a domestic GPU platform, running 400 consecutive steps on a two-node, 16-GPU configuration without numerical overflow or abnormal interruption.
This result shows the underlying pipeline has basic usability, but it covers only a small cluster and a short training duration. This article organizes the issues and practices that arise during adaptation across five areas: memory, numerical stability, communication, fault tolerance, and scaling. All numbers and practices described here are engineering experience or general methods, and do not represent official metrics for any product.
1. Two Main Challenges of Trillion-Parameter MoE Multimodal Training
1.1 Dynamic sequences make memory unpredictable
Multimodal inputs contain images, text, and audio, and sequence lengths vary greatly across samples. Dynamic sparse attention reduces part of the computation, but it also makes memory allocation shapes irregular.
KV Cache memory usage grows approximately linearly with sequence length. When a single long text or multiple images enter the pipeline at once, peak memory can be significantly higher than the average. Frequent allocation and release of tensors of varying sizes leave gaps in memory that are hard to reuse—fragmentation. Once fragmentation accumulates to a certain point, large allocation requests can still fail even when total free memory is sufficient, manifesting as OOM (Out of Memory).
1.2 Communication and load issues from expert routing
In MoE layers, each token is routed to a subset of experts. When experts are distributed across GPUs, one forward pass requires two All-to-All communications: dispatching tokens to experts, then collecting the results. If communication cannot overlap with computation, GPUs sit idle while waiting.
Routing is also prone to load imbalance. GPUs hosting popular experts receive too many tokens, concentrating memory and compute pressure on those GPUs while others sit idle. An overloaded GPU can exceed its memory limit and directly interrupt training.
2. Memory Management: Approaches and Caveats
2.1 How to configure memory pooling and bucket strategies
Memory pooling reduces fragmentation caused by frequent allocation and release. Specific parameters—such as block size, fragmentation reclamation thresholds, and cache limits—should follow the documentation of your framework and vendor, as defaults may differ across versions.
Another effective practice is bucketing by sequence length. Placing samples of similar length in the same batch reduces peak fluctuations caused by extreme shapes. After bucketing, each batch’s memory demand stays closer to a stable value, making it easier to estimate the upper limit of batch size.
2.2 How to troubleshoot OOM
When OOM occurs, the following sequence helps locate the cause quickly:
- Record peak memory and fragmentation rate for each step, and determine whether memory grows gradually or spikes suddenly.
- Fix the random seed, reproduce the failing sample or batch, and record its sequence length and modality composition.
- Run a binary search over sequence lengths to find the critical length that triggers OOM.
- Check whether intermediate tensors are unintentionally kept alive—for example, accumulating loss with its computation graph inside a loop.
- Try, one at a time: reducing the micro batch, enabling activation recomputation, and shortening the maximum sequence length. Change only one variable at a time so results are comparable.
2.3 Which metrics to monitor continuously
Monitor at least three categories: peak memory as a percentage of GPU capacity, fragmentation rate, and the slope of memory growth over consecutive steps. Thresholds should be set by each team based on actual GPU capacity and task characteristics. A common starting point is to alert when peak usage exceeds 90% of capacity and to save a memory snapshot at that moment for later analysis.
3. Numerical Stability: Mixed Precision and the Optimizer
3.1 Division of labor in mixed precision
Forward and backward computation typically use BF16 to save memory and bandwidth. Optimizer states (first and second moments) and master weights should be kept in FP32. BF16 has few mantissa bits, so long accumulations of small values tend to lose precision; the more training steps, the more likely these errors accumulate.
Gradient clipping should be completed before parameter updates. In large-model training, the global gradient norm must be aggregated across GPUs, so in distributed environments the per-GPU norms need an All-Reduce before a unified scaling factor is computed.
3.2 Reference pseudocode for the optimizer update
The pseudocode below shows the order of these steps. It does not cover full distributed details or a complete learning-rate schedule implementation. In practice, adjust it to your framework version and parallelism strategy.
# Pseudocode: illustrates step order; framework and distributed details# must be adapted to your actual environmentdef optimizer_step(params, grads, m, v, lr, beta1, beta2, eps,max_norm, step, weight_decay):# 1. Cast to FP32 and compute the global gradient norm# (requires All-Reduce across GPUs in distributed settings)g32 = [g.float() for g in grads]total_norm = global_grad_norm(g32)# 2. Clip gradients first, then update optimizer statesscale = min(1.0, max_norm / (total_norm + 1e-6))for p, g in zip(params, g32):g = g * scalem[p] = beta1 * m[p] + (1 - beta1) * gv[p] = beta2 * v[p] + (1 - beta2) * g * g# 3. Bias correction (standard AdamW practice)m_hat = m[p] / (1 - beta1 ** step)v_hat = v[p] / (1 - beta2 ** step)# 4. Decoupled weight decay applied on FP32 master weights,# then written back to the low-precision copyupdate = m_hat / (v_hat.sqrt() + eps) + weight_decay * p.masterp.master -= lr * updatep.data.copy_(p.master.to(p.dtype))
Compared with earlier sketch-style versions, this one clips gradients before updating and adds bias correction and decoupled weight decay. If bias correction is omitted, update magnitudes will be too small early in training, and early behavior will diverge from the standard implementation.
4. Communication Optimization Checklist
Communication problems generally require measurement before tuning. Check in the following order:
- Topology verification: Use collective communication test tools to measure intra-node and inter-node bandwidth and latency separately, and confirm that expert-parallel groups stay within the same node or the same switch whenever possible. If cross-node bandwidth is far below theoretical values, first check NIC binding, RDMA configuration, and switch links.
- Environment variables: Environment variables for NCCL or vendor communication libraries should follow the documentation of the corresponding version. Record current values before modifying, change one variable at a time, and compare per-step latency.
- Computation-communication overlap: Confirm that asynchronous communication operators are enabled in the framework, and use profiling tools to check whether All-to-All is hidden by computation. If the overlap ratio is very low, look for implicit synchronization points, such as reading concrete tensor values before communication.
- Load balancing: Count the tokens received by each expert per step and observe the ratio of maximum to average. Auxiliary load-balancing losses or capacity factors can limit the load on individual experts. Tokens exceeding capacity need an explicit handling policy: drop them, or route them to backup experts.
- Version boundaries: Overlap and fusion optimizations behave differently across library versions. After any upgrade, rerun the communication benchmarks.
5. Fault Tolerance and Checkpointing for Long Training Runs
5.1 How to configure monitoring and alerting
During training, collect GPU temperature, memory usage, PCIe bandwidth, and NCCL communication latency in real time. When communication latency spikes or a GPU’s memory approaches its limit, the system should immediately capture a snapshot. Silent errors often appear first as slow metric drift, so trends matter more than individual values.
5.2 Checkpoint size and save time
Checkpoint size is often underestimated. At roughly 14 bytes per parameter (BF16 weights, FP32 master weights, and two FP32 optimizer states), one full save of a 2.8-trillion-parameter model requires about 39TB. If the storage system’s aggregate write bandwidth is 10GB/s, a single save takes on the order of one hour. This is a rough estimate that excludes compression and duplicate data. Compressing save time to seconds requires sharded parallel writes, asynchronous saving, and incremental checkpointing—faster storage alone cannot achieve it.
5.3 Consistency verification and rollback
After each save, compute the file hash and compare it against the write record. After resuming training, observe whether the loss over the first few dozen steps matches the trend before the save. If the deviation is too large, stop training and inspect the checkpoint files. A rollback policy must clarify two things: which checkpoint to roll back to, and whether the discarded steps count toward effective training time.
6. Scaling and Effective Training Rate
6.1 How to compute the effective training rate
The effective training rate can be computed as:
Effective training rate = effective training time / total time occupied by the job × 100%
Here, effective training time refers to the time the model actually spends on forward and backward computation that advances parameter updates. Checkpoint saving, failure recovery, rollback recomputation, and queue waiting are not counted. The statistics window, job scale, and failure criteria must all be stated in any report; otherwise, numbers from different sources are not comparable.
6.2 A note on publicly circulated figures
Some figures circulating online—for example, “effective training rate above 97%” or “covering 99% of non-closed-source large models”—lack sources, statistical definitions, cluster scale, and task types. Without that information, this article does not cite them. A more careful formulation is: under a specific cluster and task configuration, the effective training rate reached a high level, with exact figures subject to measured reports.
6.3 Topology-aware scheduling
At the scale of a thousand GPUs or more, scheduling strategy matters significantly. Communication-intensive expert groups should be placed within the same node or the same RDMA network domain whenever possible, reducing traffic across switches. The scheduler needs to be topology-aware so that the same expert-parallel group is not scattered across distant nodes.
6.4 The role of cloud-native infrastructure
At large scale, bare-metal scheduling alone cannot meet high-availability requirements. General-purpose cloud-native infrastructure typically provides container orchestration, object storage, and distributed file systems. Container orchestration supports elastic scaling of jobs and isolation of failed nodes; object storage suits large-scale training data and historical checkpoints; distributed file systems better serve high-frequency concurrent checkpoint reads and writes across many GPUs. Selection should weigh bandwidth, consistency model, and cost together—nominal capacity is only one of several metrics.
7. Recommendations Before Going Live
Before production training begins, complete three things. First, reproduce key results on a small cluster, including peak memory, communication latency, and the loss curve. Second, establish consistency verification and rollback procedures for checkpoints, and rehearse recovery regularly. Third, based on small-scale measurements, set explicit alert thresholds for memory, communication, and loss.
400 consecutive steps demonstrate that the pipeline is basically usable, but say nothing about stability after tens of thousands of steps. Long-horizon training stability must be validated separately.
Conclusion
Domestic GPUs running trillion-parameter multimodal MoE training now have verifiable preliminary results. The work ahead concentrates on a few concrete problems: memory fragmentation, expert load, communication overlap, and checkpoint efficiency. Each requires measured data, and each team should confirm results independently before deployment.
