Verifying MoE Multimodal Training Pipelines on Domestic GPUs: A Trimmed Configuration Approach
This article details the verification process of a Mixture-of-Experts (MoE) multimodal training pipeline on domestic GPUs using a trimmed model configuration. It covers the core challenges of MoE multimodal models, the design of the trimmed verification scheme, key engineering adaptations including operator alignment, FSDP2 sharding, and cross-node communication optimization, as well as an analysis of training metrics and an adaptation checklist.
1. Defining the Boundaries of Verification
This article discusses a pipeline verification under a trimmed configuration, rather than the results of a full-scale trillion-parameter pre-training. The target model size was 2.8 trillion parameters, but the version actually run was trimmed to a scale lower than the original. The conclusions drawn below indicate that the training pipeline is functionally viable and exposes specific engineering challenges, but they should not be extrapolated to guarantee full-scale training stability.
2. Challenges of MoE Multimodal Models
Native multimodal large models generally consist of three components: a vision encoder (vision tower), a language backbone, and a cross-modal projection module. The MoE architecture introduces expert routing on top of this, where each token is assigned to a subset of experts by a routing network. This introduces two primary pressures:
First, memory constraints. Dynamic sparse attention reduces computation in long contexts, but its on-demand allocation characteristics easily cause fragmentation, potentially triggering Out-of-Memory (OOM) exceptions during multi-card parallel execution.
Second, communication overhead. Distributing tokens to different experts requires All-to-All communication. The communication data volume does not simply grow linearly with the number of experts; it depends on the Top-k value, expert capacity limits, the actual routing distribution of tokens, and the parallel partitioning method. When routing distribution is uneven, the cards hosting a few experts become bottlenecks, and the waiting time stretches the overall step duration.
Therefore, running such models on domestic GPU clusters requires not only strong single-card computing power but also robust system-level communication scheduling and memory management.
3. Designing the Trimmed Verification Scheme
Given the high cost of full-scale pre-training, a common practice is to use a trimmed configuration for functional verification. The goal is to use fewer resources to expose operator precision issues and communication breakpoints, rather than to reproduce final performance.
This verification used a dual-node, 16-card environment and implemented four key modifications:
- The language backbone was reduced to 13 Transformer modules to lower activation memory usage.
- 16 routing experts were retained with Top-8 activation, preserving the core scheduling logic of MoE.
- The vision tower (27 layers) and the cross-modal projection module were fully retained to ensure a genuine test of multimodal feature extraction and alignment.
- The MedPix-VQA image-text dataset was used, and the model was trained from random initialization to observe gradient flow and parameter updates from a zero-base state.
This design of “slimming the language backbone while keeping the complete multimodal section” is well-suited for testing cross-modal alignment, expert dispatch, and mixed attention—the three areas most prone to errors. Note that the convergence curve from random initialization training reflects the model’s learning capability on this dataset, not its generalization effect after pre-training.
4. Three Key Adaptations
1. Operator Completion and Precision Alignment
MoE’s mixed attention and expert routing contain conditional branches and tensor dimension transformations. This requires the operator library to support dynamic shapes and non-contiguous memory access; otherwise, operators beyond basic matrix multiplication cannot run properly on the MoE structure. After operator completion, it is crucial to verify whether gradient values overflow. This practice verified correctness through gradient checks and numerical alignment tests, rather than simply assuming success once the operators could run.
2. FSDP2 Memory Sharding
Even after trimming, the model still struggles to fit entirely on a single card. The team used FSDP2 (Fully Sharded Data Parallel 2) to shard parameters, gradients, and optimizer states:
- Parameters were partitioned across 16 cards by layer or module. They were aggregated on-demand via All-Gather during forward computation and immediately released after computation.
- During backpropagation, gradients were synchronized and sharded via Reduce-Scatter. Each card only updated the optimizer states it was responsible for.
This approach kept the memory peak within a manageable range for a single card, serving as a critical measure to prevent abnormal interruptions.
3. Cross-Node Communication Optimization
The dual-node environment increased cross-node communication latency. The team optimized underlying communication primitives based on a collective communication library similar to MCCL. In All-to-All communication, a topology-aware routing strategy was adopted to reduce packet collisions across the inter-node network, thereby alleviating the communication pressure caused by expert routing.
5. Interpreting the Training Data
The verification continuously completed 400 training steps without numerical overflow or abnormal interruptions. This indicates that the pipeline can run stably under this configuration, though 400 steps are insufficient to prove long-term training stability.
The loss data is as follows:
| Metric | Early Stage (Mean of Steps 21-70) | Late Stage (Mean of Last 50 Steps) |
|---|---|---|
| Training Loss | 8.9365 | 2.1802 |
| Validation Loss | 6.5297 | 4.6873 |
Both training and validation losses decreased synchronously, showing no obvious signs of overfitting. However, only this segment of the curve was provided, making it impossible to completely rule out overfitting. After FSDP2 sharding, the peak memory was 44.80GiB, leaving some headroom for subsequent increases in model size or batch size.
It should be noted that the original material did not disclose complete specifications such as batch size, sequence length, compute precision format, and dataset partition ratio. Readers wishing to cite these figures should verify against the original disclosure and avoid direct horizontal comparisons with results from other platforms.
6. Citable Industry Progress
The adaptation pace of domestic GPUs is accelerating, with multiple vendors advancing training verification on large-scale clusters. In public reports, some vendors have disclosed training efficiency rates or version training status for ultra-large clusters, but the statistical scopes of these data vary. For example, the definition of effective training rate, the statistical period, and the cluster size all affect the results. When citing, one should locate the original release and verify the definitions before use.
Regarding the future shipment volume and market share of domestic AI chips, current forecasts from various institutions differ significantly. This article does not cite specific numbers; readers can independently consult reports that include publication dates and statistical scopes.
7. Adaptation Checklist
If you are also preparing to adapt an MoE model on domestic GPUs, you can use the following points as a starting point:
- Operator Coverage: List all operators used by the model. Confirm that both forward and backward implementations are complete and cover dynamic shapes and non-contiguous memory access.
- Precision Alignment: Design unit tests for critical operators to compare numerical errors against reference implementations.
- Sharding Configuration: Record the FSDP2 sharding granularity, communication group partitioning, and peak memory for reproducibility.
- Communication Topology: Measure the latency of All-to-All in cross-node scenarios. Observe whether the routing distribution is severely uneven.
- Troubleshooting: When encountering OOM, first check for memory fragmentation and activation usage. When encountering numerical anomalies, first check the gradient range and operator precision.
8. Conclusion
This trimmed configuration verification demonstrates that domestic GPUs can successfully run the training pipeline of an MoE multimodal model in a dual-node, 16-card environment. Through memory sharding and communication optimization, the primary engineering issues were resolved. Its value lies in providing a verifiable engineering path. To determine whether domestic computing power can support full-scale trillion-parameter training, more comprehensive data is still needed, including longer training steps, larger model scales, and stricter precision controls.
