Adapting a Trillion-Parameter Multimodal MoE Model to Chinese-Developed AI Accelerators
This article describes how a Chinese-developed AI accelerator that supports both training and inference was adapted to train a natively multimodal Mixture-of-Experts model with trillions of parameters. It covers adaptation work on attention, expert routing, the vision encoder, and cross-modal projection, along with the distributed training setup based on FSDP2. It also reports a 400-step test on two servers with 16 accelerators, including stability, loss curves, memory usage, and gradient checks on the vision branch.
1. Background: New Demands on Compute Platforms from Ultra-Large Multimodal Models
As model capabilities keep expanding, new flagship large models generally share three traits: parameter counts in the trillions, context windows up to one million tokens, and native multimodal capabilities combined with Mixture-of-Experts (MoE) architectures. Consider a recently released open-weight, natively multimodal model. It has about 2.8 trillion total parameters and supports context lengths up to 1 million tokens. It uses a gated hybrid attention mechanism and an MoE architecture, and it provides both visual understanding and tool calling.
Models like this place far greater demands on training platforms than traditional dense models. The main challenges fall into four areas:
- High attention computation complexity: Dynamic sparse retrieval attention requires operator-level support for efficient sparse memory access and compute scheduling. Generic operator implementations often cannot fully use the hardware.
- Communication pressure from expert routing: In MoE architectures, routing tokens to experts creates large volumes of irregular data exchange across devices. This puts pressure on multi-device interconnect bandwidth and collective communication libraries.
- Greater memory management difficulty: At trillion-parameter scale with long-sequence training, the combined size of parameters, gradients, optimizer states, and activations far exceeds the memory of a single device. Deep sharding and fine-grained memory scheduling are required.
- Long cross-modal training pipeline: The vision encoder, cross-modal projection, and language backbone must work together in one forward pass, backward pass, and parameter update flow. A break in gradient flow at any stage can leave a modality branch connected but untrained.
Verifying whether a Chinese-developed AI accelerator can train such a model is therefore a comprehensive test of its operator completeness, software stack maturity, and multi-device communication capability.
2. Adaptation Design: Connecting Four Core Modules to the Training Pipeline
The core approach was to connect each key computation module to the unified training pipeline, rather than simply replacing operators. The work focused on four modules:
- Attention computation: Develop a high-performance custom operator for the dynamic sparse retrieval part of the hybrid attention mechanism. The operator must preserve computational efficiency and numerical accuracy under sparse memory access patterns.
- Dynamic routing: Adapt the expert routing logic so that gating weight computation, Top-K selection, and expert dispatch run correctly on the target hardware and work with the expert parallelism strategy.
- Vision encoding: Include the full forward and backward computation of the vision tower in the training graph, so that image embeddings receive real gradients during backpropagation.
- Cross-modal projection: Connect the projection layer that maps visual features into the language space, so that the joint image-text loss propagates back to the vision branch.
At the distributed training framework level, the design keeps the native AutoModel workflow of a mainstream training framework. FSDP2 (second-generation fully sharded data parallelism) shards model parameters, gradients, and optimizer states across GPUs, which substantially reduces per-device memory pressure. The accompanying collective communication library handles communication across devices and nodes, maintaining efficiency and stability in multi-node, multi-device setups.
3. Test Setup and Results: 400 Stable Steps on 16 Accelerators
The validation environment used two servers with 16 flagship Chinese-developed AI accelerators in total. To keep validation costs down, the test used a reduced model configuration: a 13-layer language backbone and 16 routed experts with Top-8 routing. The full 27-layer vision tower and cross-modal projection module were retained. The training data came from a public medical visual question answering (VQA) image-text dataset. The global batch size was 16, and the sequence length was 1024.
The results were as follows:
- Stability: All 16 training processes completed 400 consecutive optimizer updates, with no numerical overflow or unexpected interruptions.
- Convergence: Training loss averaged 8.9365 over steps 21 to 70 and fell to an average of 2.1802 over the final 50 steps. Validation loss dropped from 6.5297 at step 100 to 4.6873 at step 400, which shows a normal convergence curve.
- Memory usage: The sampled peak memory on the device was 44.80 GiB. This is within a reasonable range for a single accelerator, which indicates that the sharding strategy and memory scheduling worked effectively.
The vision branch was verified separately. The team checked gradients for each component during training. The image embedding layer, the first and last layers of the vision tower, and the cross-modal projection module all produced nonzero gradients and completed parameter updates. This confirms that the vision encoder actually took part in training rather than being bypassed as a data input. This check is easy to overlook in multimodal training adaptation, and it is the clearest evidence that the pipeline works correctly.
The validation used a randomly initialized reduced configuration. Its goal was to verify the functional correctness and system stability of the training pipeline, not full-scale pretraining of the complete model. Production-grade pretraining would require further validation with more accelerators, longer sequences, and the full model configuration.
4. Supporting Optimizations: From Running to Running Efficiently
Beyond the core training pipeline adaptation, the software stack received four key optimizations:
- FSDP2 and expert parallelism: Resolved communication conflicts between parameter sharding and the expert routing parallelism strategy, so the two parallelism methods can be used together.
- Parameter prefetching and gradient communication scheduling: Overlapped computation with communication to hide waiting time from cross-device synchronization and improve overall training throughput.
- High-performance sparse attention operator: Custom implementation for the hybrid attention mechanism, which substantially improves compute utilization in sparse computation scenarios.
- Chunk Loss: Computes the loss in chunks along the sequence dimension to prevent memory spikes during loss computation with long sequences. The 400-step test used this feature.
Chunk Loss was verified in the test. The other three optimizations have been adapted and can support larger training configurations.
5. Summary and Takeaways
This work shows that the hardware and software stack of Chinese-developed AI accelerators can support training of natively multimodal MoE models with trillions of parameters. The value lies not only in running the model but also in confirming end-to-end engineering feasibility, from operators and communication to the distributed training framework. The case offers three reusable lessons for large model training teams. First, multimodal training must explicitly verify gradient updates in each modality branch to avoid silent failures. Second, validating the pipeline on a reduced configuration keeps validation costs low and exposes adaptation issues early. Third, system-level optimizations such as chunked loss and communication scheduling matter as much as operator adaptation and should be planned alongside it from the early stages. As operator ecosystems and parallelism strategies continue to mature, these platforms may take on more training and inference workloads for frontier models.
