Engineering Practices for Training Trillion-Parameter MoE Multimodal Models on Domestic AI Chips
This article explores the engineering practices and challenges of adapting domestic AI chips for trillion-parameter Mixture-of-Experts (MoE) multimodal model training. It details the functional verification design, key implementation technologies including MoE operators, distributed sharding, and cross-node communication, as well as training stability evaluation methods. The article also provides an industry perspective on the trend of AI hardware adaptation and the critical engineering capabilities required for large-scale model training.
Engineering Practices for Training Trillion-Parameter MoE Multimodal Models on Domestic AI Chips
I. Background: New Challenges for Compute Infrastructure in Large Model Training
As the parameter scale of large models expands from tens of billions to the trillion level, model architectures have evolved from dense Transformers to Mixture-of-Experts (MoE) and multimodal fusion architectures. Taking a recent public technical verification as an example, a domestic GPU vendor announced that its laboratory completed the training link adaptation for a 2.8-trillion-parameter MoE native multimodal large model. It successfully completed 400 training steps under a dual-node, 16-GPU configuration, with no numerical overflow or abnormal interruptions throughout the process.
This progress has drawn industry attention because trillion-level MoE multimodal models pose a triple challenge to underlying hardware and software stacks:
- Implementation difficulty of dynamic sparse attention operators: Sparse attention requires GPU kernels to support irregular memory access patterns. The computation graph changes dynamically with input, testing both the compiler and operator libraries.
- Communication pressure from expert routing: In MoE architectures, tokens must be distributed to different experts based on routing policies, involving massive All-to-All communication. The cross-card and cross-node bandwidth utilization directly determines training throughput.
- Memory heterogeneity introduced by multimodality: The vision tower, cross-modal projection modules, and language backbone differ significantly in parameter scale and activation patterns. Memory management requires fine-grained sharding and scheduling.
II. Verification Design: The Science of Truncation Configuration
It should be clarified first that such verifications are not full-scale pre-training, but rather functional verification of the training link. Its core objectives are to test:
- Whether forward and backward computations execute correctly on the target hardware;
- Whether the loss curve converges as expected;
- Whether distributed communication and memory management remain stable.
This verification adopted a representative truncation strategy:
- Language backbone: Truncated to 13 layers, configured with 16 routing experts (Top-8 activation), retaining the complete MoE routing mechanism;
- Vision branch: Retained the complete 27-layer vision tower and cross-modal projection module to ensure the authenticity of the multimodal link;
- Training method: Randomly initialized training based on medical image-text VQA datasets to avoid masking link issues with pre-trained weights.
The ingenuity of this truncation design lies in the fact that while it reduces the number of layers and experts, it retains all key architectural characteristics—sparse attention, expert routing, and cross-modal alignment modules are all intact. This means that if the link can run smoothly on the truncated configuration and the loss converges normally, the primary risks of scaling up to full size will concentrate on engineering tuning rather than architectural compatibility.
Based on the disclosed metrics, the training loss converged from an initial mean of about 8.94 to a final mean of about 2.18, and the validation set loss dropped from about 6.53 to 4.69. The peak memory was about 44.80GiB, and the vision branch parameters normally participated in gradient updates. This set of data indicates that gradients can correctly backpropagate across modalities, optimizer state management is error-free, and numerical precision is well-controlled.
III. Key Technical Implementation Steps
3.1 MoE Operator Forward and Gradient Implementation
The core of the MoE layer is the Gating Network and Expert FFN. After the gating outputs the Top-K expert indices, tokens need to be rearranged, dispatched, computed, and then aggregated. In GPU implementation, this typically involves:
# Pseudo-code: Core logic of MoE forward computationdef moe_forward(hidden_states, gate, experts, top_k=8):# 1. Calculate routing weights and expert selectionrouting_weights, selected_experts = gate(hidden_states).topk(top_k)routing_weights = softmax_normalize(routing_weights)# 2. Group by expert (Key: requires efficient scatter/gather operators)output = zeros_like(hidden_states)for expert_id, expert in enumerate(experts):mask = (selected_experts == expert_id)token_idx, slot_idx = mask.nonzero(as_tuple=True)if len(token_idx) == 0:continueexpert_input = hidden_states[token_idx]expert_output = expert(expert_input)# 3. Weighted aggregationoutput.index_add_(0, token_idx,expert_output * routing_weights[token_idx, slot_idx].unsqueeze(-1))return output
During backpropagation, non-contiguous memory operations like index_add and scatter require corresponding gradient kernel support, which is often the first “pitfall” for many hardware platforms adapting to MoE models. In this verification, the vendor completed the full forward and gradient implementations for mixed attention and MoE operators, which is the prerequisite for establishing the training link.
3.2 Distributed Sharding Strategy
A trillion-parameter model cannot fit on a single GPU and must rely on parameter sharding. The industry-standard Fully Sharded Data Parallel (FSDP-like) approach shards parameters, gradients, and optimizer states across all GPUs. It aggregates them via AllGather during forward computation and re-shards them via ReduceScatter after backward computation. Its memory footprint can be approximated as:
Single GPU Memory ≈ Total Model Memory / N (number of GPUs) + Activation Memory + Communication Buffer
For MoE models, the Expert Parallelism dimension must also be incorporated: different experts are placed on different devices, and tokens are exchanged between devices via All-to-All communication. This verification utilized an FSDP2-like sharding management mechanism, refining the sharding granularity to the parameter group level to support more flexible memory-communication trade-offs.
3.3 Cross-Node Communication Library
A dual-node, 16-GPU configuration means the communication domain spans node boundaries. The collective communication library for GPUs (aligning with industry-standard AllReduce, AllGather, All-to-All primitives) must run efficiently over RDMA networks. MoE training is particularly sensitive to All-to-All—every forward/backward step of expert parallelism triggers this primitive, meaning the communication library’s block scheduling and stream concurrency capabilities directly impact training efficiency.
IV. Evaluation Methods for Training Stability
For such link verifications, it is recommended to focus on the following evaluation dimensions:
| Evaluation Dimension | Key Indicator | Criterion |
|---|---|---|
| Numerical Correctness | Loss curve shape | Monotonic decreasing trend, no spikes |
| Stability | Overflow/Interruption count | Zero within 400 steps |
| Integrity | Gradient norm of each branch | Both vision/language branches updated |
| Resource Efficiency | Peak memory, utilization | No OOM, predictable peak |
| Convergence | Mean loss difference (head-to-tail window) | Significant drop (e.g., 8.9 -> 2.2) |
It is particularly worth noting the head-to-tail window mean comparison method: comparing the mean loss of several initial steps (e.g., steps 21–70) with that of several final steps (last 50 steps). This filters out single-step noise and objectively reflects the convergence trend, which is a common practice in large model training debugging.
V. Industry Perspective: The Overall Trend of Domestic AI Chip Adaptation
Public information indicates that the adaptation between domestic AI chips and large models is accelerating comprehensively:
- Multiple GPU vendors now support thousand-card clusters for multimodal pre-training and reinforcement learning, with precision aligned with international mainstream products.
- Some vendors’ training adaptations have covered mainstream open-source model series such as DeepSeek, Qwen, and Hunyuan, extending to ten-thousand-card scenarios.
- Vendors have disclosed that their acceleration cards have adapted over 400 mainstream large models, covering the vast majority of non-closed-source models.
- Cloud providers’ self-developed chips have also completed training tasks for critical model versions, achieving an effective training rate of over 97%.
Industry research institutions predict that shipments of high-end AI chips in the domestic market will maintain rapid growth in the coming years, with the market share of local solutions continuously increasing. Under this trend, the engineering adaptation capability of the training link will become the core of compute platform competition, rather than single-card peak compute power. For enterprise users, when selecting a compute infrastructure, they should focus on: operator coverage, distributed framework compatibility, cluster communication efficiency, and fault recovery mechanisms. Platforms like Baidu AI Cloud are providing developers with more accessible large model training environments and toolchain support on top of general cloud capabilities such as container platforms, monitoring and alerting, and object storage.
VI. Conclusion
The training link verification for trillion-parameter MoE multimodal models is a significant milestone in the maturation of domestic AI chips. However, it must be clearly recognized that link verification ≠ full-scale pre-training. Transitioning from a 400-step verification to a complete pre-training of tens of thousands of steps requires solving a series of engineering issues, including long-term stability, checkpoint recovery, elastic fault tolerance, and communication-computation overlap optimization. For developers, understanding the underlying principles of sparse attention, expert routing, parameter sharding, and collective communication is essential to migrate seamlessly across different compute platforms and truly master the complex systems engineering of large model training.
