Adapting Multimodal LLM Training to a Chinese-Made GPU Cluster: Practical Notes

    This article describes how a multimodal large language model with a Mixture of Experts (MoE) architecture was adapted for training on a Chinese-made GPU cluster. The work builds on the native framework workflow with FSDP2 and covers attention, MoE routing, the vision encoder, and cross-modal projection. It reviews the results of a 400-step test on 16 accelerator cards, including loss trends, peak memory use, and a gradient check on the vision branch. The test used a reduced, randomly initialized configuration, so it validates training pipeline functionality rather than model quality.

    1. Background: Training Challenges of Very Large Multimodal Models

    As open-source large language models continue to improve, their parameter counts, context lengths, and modality complexity keep growing. One example is an open-weight native multimodal model with about 2.8 trillion total parameters. It supports context windows of up to 1 million tokens. Internally, it uses a hybrid attention mechanism and a Mixture of Experts (MoE) architecture, and it provides visual understanding and tool calling capabilities.

    This class of model places several demands on training infrastructure:

    1. Memory pressure: At the trillion-parameter scale, parameters, gradients, and optimizer states cannot fit entirely on a single accelerator card. Fine-grained distributed sharding strategies are required.
    2. Communication complexity: Expert routing in MoE architectures introduces dynamic data dispatch and aggregation. Cross-card and cross-node communication volume is significantly higher than in dense models.
    3. Dynamic sparse computation: Dynamic sparse retrieval attention requires operators that can handle irregular memory access patterns efficiently. General-purpose operator libraries often cannot handle this directly.
    4. Joint multimodal training: Mixed image-text data flow requires the vision encoder branch and the language backbone to stay consistent through forward computation, backpropagation, and parameter updates. A gap at any stage causes the vision branch to participate in name only.

    To address these challenges, a Chinese GPU vendor recently announced that its flagship AI training and inference accelerator card and accompanying software stack have completed training adaptation for this model. In a joint test on two servers with 16 cards, training ran for 400 consecutive steps with no numerical overflow or abnormal interruptions. The vision branch also produced actual gradient updates. This case offers a useful reference path for supporting very large-scale model training on Chinese compute platforms.

    2. Core of the Adaptation: Building a Native FSDP2 Multimodal Training Path

    2.1 Why FSDP2

    In distributed training frameworks, Fully Sharded Data Parallel (FSDP) reduces per-device memory usage by sharding model parameters, gradients, and optimizer states across devices. The newer FSDP2 improves its API design and composability, so it can combine more flexibly with tensor parallelism, expert parallelism, and other strategies. This makes it well suited to MoE models, which activate only a subset of their parameters for each input.

    This adaptation kept the standard training workflow of a mainstream large model framework and made no invasive changes to the hardware platform. This matters a great deal. Only by reusing the upstream framework’s standard path as much as possible can adaptation work keep pace with framework version updates, avoiding one-off engineering work.

    2.2 Four Functional Modules

    The adaptation work centers on the following modules. All of them are integrated into a complete loop covering forward computation, backpropagation, and parameter updates.

    • Attention computation: For the hybrid attention mechanism used by the model, which includes dynamic sparse attention and gating mechanisms, the adaptation provides high-performance operator implementations. These maintain computational efficiency and numerical accuracy over long sequences.
    • Dynamic routing: Top-K routing in MoE layers dispatches tokens to experts dynamically. This requires efficient All-to-All communication support at the collective communication library level.
    • Vision encoding: The full vision tower is integrated into the training graph, which supports forward and backward computation for high-resolution image embeddings.
    • Cross-modal projection: The projection module that maps visual features into the language space must connect correctly with gradients on both sides. Otherwise, gradient flow breaks.

    Cross-card and cross-node communication is handled by the vendor’s proprietary collective communication library. This library manages parameter aggregation after FSDP2 sharding, gradient synchronization, and routing communication for MoE layers.

    3. Test Configuration and Training Data

    3.1 Test Environment

    Validation used two servers with 16 accelerator cards in total. To run the full pipeline within these limited resources, the test model used a reduced configuration: a 13-layer language backbone and 16 routed experts with Top-8 routing active. The configuration keeps the complete 27-layer vision tower and the cross-modal projection module. This ensures that every stage of the multimodal training path is exercised.

    The training data is an image-text dataset for medical visual question answering. The global batch size is 16, and the sequence length is 1024.

    3.2 Key Training Metrics

    All 16 training processes completed 400 consecutive optimizer updates. The main metrics are below.

    Metric Early stage Final stage
    Training loss Mean of steps 21–70: 8.9365 Mean of last 50 steps: 2.1802
    Validation loss Step 100: 6.5297 Step 400: 4.6873
    Peak per-card memory — 44.80 GiB

    The loss decreases steadily and smoothly. This indicates that numerical precision controls, such as the mixed-precision strategy and gradient scaling, stay reliable across the entire pipeline. The peak memory of 44.80 GiB per card confirms that the sharding strategy and memory management scheme work as intended.

    3.3 Verifying Real Participation of the Vision Branch

    A problem that is easy to miss in multimodal training is a vision branch that appears to be in the data flow but never receives gradient updates. The team ran a targeted check. The image embedding layer, the first and last layer parameters of the vision tower, and the cross-modal projection module all produced non-zero gradients and actual parameter updates. This shows that the vision encoder took part in end-to-end training and was not simply bypassed as static input.

    This verification method is worth adopting. In similar projects, developers can self-check with the following approach:

    1. # Example: check whether vision branch parameters receive gradient updates
    2. for name, param in model.named_parameters():
    3. if "vision" in name or "projector" in name:
    4. assert param.grad is not None, f"{name} has no gradient"
    5. assert param.grad.abs().sum() > 0, f"{name} gradient is all zeros"

    4. Advanced Optimizations: Groundwork for Larger-Scale Training

    Beyond the core training path, four additional key optimizations were completed:

    1. FSDP2 and expert parallelism working together: Parameter sharding and expert sharding are combined orthogonally, which distributes memory more evenly across the MoE model.
    2. Parameter prefetching and gradient communication scheduling: Computation and communication are pipelined to hide cross-node communication latency and improve overall throughput.
    3. High-performance sparse attention operators: Dedicated operator implementations target dynamic sparse retrieval patterns. They provide the foundation for long-context training.
    4. Chunk loss computation: The loss is computed in chunks so that the logits tensor does not fill memory all at once in scenarios with large vocabularies and long sequences. The 400-step test already used this optimization.

    The last three optimizations have been adapted and can be enabled in larger-scale training configurations.

    5. Engineering Takeaways and Summary

    The scope of this work needs to be stated clearly. The validation used a reduced configuration with randomly initialized weights. Its goal was to verify the functional correctness and runtime stability of the training pipeline, not to produce a usable model. This differs from full-scale pre-training. When assessing similar results, teams should distinguish between the pipeline running successfully and performance meeting the target.

    For the industry as a whole, the value of this work is a reusable methodology. It builds on the native framework workflow, uses FSDP2’s unified sharding strategy as the core, adds specialized operators and communication optimizations, and checks results with gradient-level verification. For teams that want to train large models on Chinese compute platforms, this approach of adapting the pipeline, validating at small scale, and then scaling up gradually can reduce migration and validation costs and risks. It works best alongside the general compute scheduling, object storage, and monitoring and alerting services that cloud providers offer.