Validating the MoE Multimodal Training Pipeline on Domestic GPUs

    This article details the training pipeline validation of a 2.8-trillion-parameter Mixture of Experts (MoE) native multimodal model on a domestic GPU using a clipped configuration. Running 400 continuous steps on a dual-node, 16-GPU setup without numerical errors, the text explores the verification scope, core technical challenges like dynamic sparse attention and memory pressure, FSDP2 sharding management, and communication optimizations. It also analyzes loss curve implications and outlines the necessary steps to transition from a functional pipeline validation to full-scale pre-training.

    Introduction

    Native multimodal architectures and Mixture of Experts (MoE) are becoming the mainstream design for large models. Once parameter scales reach the trillion level, the underlying compute platform faces immense pressure across communication, memory, and operators. Recently, a domestic GPU vendor successfully adapted the training pipeline for a 2.8-trillion-parameter MoE native multimodal model in a laboratory environment. Under a dual-node, 16-GPU configuration, training ran continuously for 400 steps without numerical overflow or abnormal interruptions.

    This article focuses on the technical details of this pipeline validation. It will outline the verification scope, explain key difficulties, provide sharding code examples, and analyze what the loss curve can and cannot prove.

    1. Target Model and Verification Scope

    The target model scale is 2.8 trillion parameters. However, this experiment did not train the full model; instead, a clipped configuration was adopted:

    • The language backbone was truncated to 13 layers, configured with 16 routing experts and a Top-8 activation strategy.
    • The multimodal module fully retained 27 layers of the vision tower and the cross-modal projection module.
    • The model used random initialization without loading final pre-trained weights.

    The purpose of this design is to verify three things with minimal resources: whether the training pipeline can run, whether multi-GPU communication is correct, and whether numerical computation is stable. It cannot indicate the final accuracy or capability of the model. When referencing these results, readers must distinguish between the “target model scale” and the “actual verified clipped configuration.”

    2. Three Difficulties in MoE Multimodal Training

    Dynamic sparse attention. This mechanism filters irrelevant tokens to reduce the computational load for long sequences. However, memory access becomes irregular after filtering, leading to a drop in memory bandwidth utilization and cache hit rates. Scheduling these sparse matrices in a multi-GPU environment is a major challenge for operator adaptation.

    Expert routing communication. The core of MoE is sparse activation: each token is only sent to Top-K experts for processing. Since experts are distributed across different devices, this generates massive cross-device data exchanges, making All-to-All communication a potential bottleneck. If the communication link is not optimized, overall throughput will drop significantly.

    Memory pressure. Even with mixed-precision training, the model weights, gradients, optimizer states, and intermediate activation values of a 2.8-trillion-parameter model far exceed the memory capacity of a single GPU. Traditional pure tensor parallelism or pure data parallelism struggles to independently support training at this scale. This is the direct reason for adopting sharding strategies.

    3. Clipped Configuration and Parameters Required for Reproduction

    While a clipped configuration reduces verification costs, it also obscures certain details. The original test did not publicly disclose the following parameters, which are critical for reproducing the results:

    1. Dataset name, number of samples, and preprocessing methods. A public multimodal image-text QA dataset was used, but the specific name and version were not provided.
    2. Random seeds, to ensure consistent initialization and data ordering across runs.
    3. Global batch size, per-GPU batch size, and sequence length.
    4. Parallel configuration, including data parallel group size, sharding strategy, and whether gradient accumulation was enabled.
    5. Learning rate, optimizer parameters, and learning rate scheduling.
    6. Framework version, CUDA or vendor driver version, and operator library version.

    If you intend to reproduce a similar experiment, it is recommended to record these parameters in a configuration file before each run and save them alongside the logs.

    4. FSDP2 Sharding Management

    To address the memory bottleneck, the training framework utilized FSDP2 (Fully Sharded Data Parallel 2). FSDP2 shards parameters, gradients, and optimizer states across GPUs along the data parallel dimension. During forward computation, parameters are gathered on-demand and released after computation, thereby reducing the peak memory usage per GPU.

    The main difference between FSDP2 and FSDP1 is that FSDP1 manages flattened parameters via a wrapper class (such as FullyShardedDataParallel), whereas FSDP2 uses the fully_shard function to perform in-place sharding on modules individually. Parameters are represented as DTensors, allowing for finer sharding granularity for sub-modules and easier integration with other parallel strategies. The interfaces and behaviors of the two are different and cannot be mixed in the same codebase.

    The following example demonstrates the basic usage of FSDP2. The model class in the example is a placeholder and needs to be replaced with the actual implementation. This interface is available in newer versions of PyTorch; refer to the official documentation for the exact version.

    1. import torch
    2. import torch.distributed as dist
    3. from torch.distributed.device_mesh import init_device_mesh
    4. from torch.distributed.fsdp import fully_shard
    5. dist.init_process_group(backend="nccl")
    6. # Dual-node with 16 GPUs total, using a 1D data parallel mesh
    7. mesh = init_device_mesh("cuda", (dist.get_world_size(),))
    8. # Placeholder model: assume it exposes language and vision sub-modules
    9. model = MultimodalMoEModel(
    10. language_layers=13,
    11. num_experts=16,
    12. top_k=8,
    13. vision_layers=27,
    14. )
    15. # Shard sub-modules individually first, then shard the overall model
    16. for block in model.language_blocks:
    17. fully_shard(block, mesh=mesh)
    18. for block in model.vision_blocks:
    19. fully_shard(block, mesh=mesh)
    20. fully_shard(model, mesh=mesh)
    21. # Create the optimizer after sharding, as parameters are already sharded
    22. optimizer = torch.optim.AdamW(model.parameters(), lr=1e-4)

    When using this code, three points must be noted. First, sharding should be completed before creating the optimizer. Second, the expert modules in MoE usually require individually designed sharding boundaries to avoid communication overhead from numerous small modules. Third, the sharding strategy will affect how checkpoints are saved and loaded, which needs to be designed in advance.

    5. Communication and Operator Adaptation

    Distributed training relies on vendor-provided collective communication libraries to complete cross-node data exchanges. In the MoE architecture, the latency of All-to-All communication directly determines training efficiency. Common methods to improve efficiency include arranging communication paths based on physical topology, overlapping communication with computation, and merging small messages. These optimizations require recording the version of the communication library used and whether specific tuning for All-to-All was applied.

    At the operator level, adaptation involves the forward computation of specific mixed attention mechanisms and MoE routing, as well as the corresponding backward gradient computation. Such operators need to support non-standard matrix operations and complex indexing. Operator correctness usually requires layer-by-layer comparison with a reference implementation to confirm consistent results.

    6. Loss Curve and Numerical Stability

    Over the 400 continuous training steps, the mean training loss decreased from 8.9365 (steps 21 to 70) to 2.1802 (the final 50 steps). Validation loss dropped from 6.5297 to 4.6873. No NaN or Inf occurred throughout the process.

    This data indicates three things: the training pipeline can run, the optimizer is updating parameters, and the model is fitting the training data with some generalization on the validation set. However, a decrease in loss itself does not prove that gradient computation is entirely correct. Loss might decrease due to incorrect gradients or because the data is inherently easy to fit. To confirm the pipeline is correct, the following checks are required:

    • Perform gradient checks on a small-scale model, comparing analytical gradients with numerical gradients.
    • Compare operator outputs with a reference implementation layer-by-layer under the same inputs.
    • Add numerical assertions at key positions, such as checking if gradients are finite and if their norms are within a reasonable range.
    • Verify parameter updates for the vision branch, ensuring the gradients for relevant parameters are not zero.

    Regarding peak memory usage, the cited 44.80GiB requires clarification on the measurement methodology. It could be a per-GPU peak or a global peak, and the measuring tools and parallel strategy will also affect the result. Readers should verify the corresponding test logs before citing this number.

    7. Overall Progress of Domestic Compute Adaptation

    The adaptation speed of domestic GPUs in large model training has visibly accelerated. Multiple vendors have publicly reported progress on domestic chip clusters participating in large model training, multimodal pre-training, and reinforcement learning, with some announcing compatibility with mainstream open-source models.

    These advancements indicate that domestic compute is transitioning from single-node validation to multi-node collaboration. However, figures in public materials often lack unified metrics, such as the calculation method for effective training rate, cluster size, and test duration. When evaluating a milestone, it is best to consult the original report first before deciding whether to trust the specific numbers.

    8. From Pipeline Validation to Full-Scale Training

    Functional validation under a clipped configuration is not equivalent to full-scale pre-training. Scaling from a dual-node 16-GPU setup to thousands or tens of thousands of GPUs requires solving the following issues:

    Cluster scaling. Network topologies will become more complex. Inter-node network jitter, bandwidth bottlenecks, and hardware failures can all slow down training.

    Fault tolerance and recovery. In large-scale clusters, hardware failures are the norm. Training requires periodic checkpoint saving and the ability to recover from the latest checkpoint after a failure. The recovery process itself needs to be rehearsed.

    Long-term stable operation. Running a 10,000-GPU cluster continuously for months places high demands on hardware lifespan, memory ECC correction capabilities, and the memory management of the software stack. Operations should monitor ECC alerts, memory growth trends, and process memory usage.

    Effective utilization. Pipeline validation focuses on whether it can run. Full-scale training focuses more on Model FLOPs Utilization (MFU), which is the actual achieved computation divided by the hardware peak computation. Common ways to improve MFU include operator fusion, overlapping computation and communication, and reducing unnecessary synchronization. MFU should be re-measured after each optimization to confirm the changes are effective.

    Common steps for troubleshooting non-convergence. If the loss does not decrease for an extended period, check in the following order: learning rate and warmup settings; data labels and preprocessing correctness; whether gradients are zero or exploding; whether sharded parameters are loaded correctly; and whether a small-scale model can overfit a small batch. Most issues can be found within these steps.

    Conclusion

    This experiment demonstrates that a domestic GPU successfully completed the training pipeline validation for a 2.8-trillion-parameter MoE multimodal model under a clipped configuration. Training can run stably, and loss decreases as expected. However, extending these results to full-scale training still requires supplementary reproducible parameter records, correctness control experiments, and fault tolerance and efficiency data on large-scale clusters.