Adapting Domestic AI Chips for Trillion-Parameter Multimodal LLM Training: A Verification Study
This article explores the recent technical milestone of adapting domestic AI chips and a self-developed software stack to train a trillion-parameter multimodal large model. It details the adaptation methodology for hybrid attention, Mixture of Experts (MoE) architecture, and joint text-image training using FSDP2. The article also covers the functional verification experiment setup, loss convergence results, and key engineering optimizations for scaling up training.
I. Background: Training Challenges of Trillion-Parameter Multimodal Models
Recent industry developments have marked a significant technical milestone: a general-purpose domestic GPU-based AI training and inference acceleration card, along with its software stack, successfully completed training adaptation for an open-weight native multimodal large model. This model features approximately 2.8 trillion total parameters and supports a context length of up to 1 million tokens. In a dual-node, 16-card joint test, it completed 400 training steps continuously and stably without numerical overflow or abnormal interruptions.
This progress is noteworthy because such models impose extreme demands on underlying compute infrastructure:
- Hybrid Attention Mechanism: The model uses a hybrid approach combining linear attention and dynamic sparse attention, resulting in diverse attention computation paths and high operator implementation complexity.
- Mixture of Experts (MoE) Architecture: Expert routing is dynamic, and the distribution and aggregation of tokens to experts generate massive cross-card communication.
- Joint Text-Image Training: It requires fully retaining the visual encoder tower and cross-modal projection module, with the training pipeline covering both language and vision branches.
For any non-mainstream ecosystem acceleration hardware, running a complete forward-backward-parameter update loop on such a model requires systematic adaptation. This article uses this practice as a sample to break down the key technical paths and verification methodology.
II. Core Adaptation: Integrating Heterogeneous Modules into a Unified Training Pipeline
2.1 Adaptation Scope
This adaptation did not merely run the language trunk; it focused on four key modules:
- Hybrid Attention Computation: Requires implementing high-performance operators for linear attention and dynamic sparse retrieval respectively.
- Dynamic Expert Routing: The gating and distribution logic of MoE must coordinate with the distributed training framework.
- Visual Encoder Tower: Ensuring the vision branch genuinely participates in gradient computation and parameter updates.
- Cross-Modal Projection: Bridging the alignment pipeline of image-text representation spaces.
These four modules were integrated into the same forward, backward, and parameter update pipeline, which is the prerequisite for ensuring training semantic correctness. Adapting any module only at the inference level without participating in backpropagation would distort the training results.
2.2 Software Stack Layered Design
The overall solution retains the native model loading process of mainstream training frameworks without making intrusive modifications to the model structure, which is crucial for ecosystem compatibility. In terms of distributed strategy, it adopts FSDP2 (Fully Sharded Data Parallel 2):
- Model parameters, gradients, and optimizer states are sharded across different GPUs, significantly reducing per-card VRAM pressure.
- Cross-card and cross-node communication is handled by a self-developed collective communication library, replacing the traditional role of NCCL.
This layered approach of “native framework + self-developed communication layer” is a common and reasonable architectural choice for domestic computing ecosystems adapting to large models: reusing mature ecosystems at the upper layer while replacing the lower layer with communication and operator implementations deeply optimized for the hardware.
III. Verification Experiment Design: Functional Validation with Small-Scale Pruned Configuration
It must be emphasized that this test used a randomly initialized pruned configuration rather than a full-scale pre-training of the complete model. The purpose was to verify the functional correctness and stability of the training pipeline. The test configuration was as follows:
| Configuration Item | Value |
|---|---|
| Hardware Scale | 2 servers, 16 acceleration cards |
| Language Trunk | 13 layers, 16 routing experts (Top-8 routing) |
| Vision Branch | Complete 27-layer vision tower + cross-modal projection |
| Dataset | Image-text QA multimodal dataset |
| Global Batch Size | 16 |
| Sequence Length | 1024 |
This verification method of “pruned version + real pipeline” is very common in large model engineering practices: first using a small configuration to verify infrastructure issues such as distributed communication, operator numerical correctness, and VRAM levels, then gradually expanding to larger scales, effectively reducing trial-and-error costs for full-scale training.
IV. Key Results Interpretation
4.1 Loss Convergence Trend
The 16 training processes completed 400 optimizer updates continuously. The training loss dropped from an average of 8.9365 (steps 21-70) to 2.1802 (last 50 steps); the validation loss dropped from 6.5297 (step 100) to 4.6873 (step 400). The synchronous decline in training and validation loss indicates that the model was genuinely learning the data distribution, rather than exhibiting gradient anomalies or overfitting artifacts. The sampled peak VRAM usage was 44.80GiB, which is within a controllable range.
4.2 Vision Branch Genuinely Participating in Training
The technical team confirmed via gradient checks that the image embeddings, first and last layers of the vision tower, and the cross-modal projection module all generated non-zero gradients and parameter updates. This aspect is easily overlooked in multimodal training verification—if the vision branch only performs forward computation without effective gradient backpropagation, the model degenerates into a “text-only learning” pseudo-multimodal training. Gradient-level verification is the gold standard for determining whether the multimodal training pipeline is genuinely connected.
V. Engineering Optimizations for Larger Scales
Beyond getting the basic pipeline running, this work also completed several optimizations aimed at larger-scale training:
- FSDP2 and Expert Parallelism Coordination: Enabling parameter sharding in the data dimension and expert sharding in the MoE dimension to work together, avoiding conflicts in VRAM and communication.
- Parameter Prefetch and Gradient Communication Scheduling: Overlapping communication with computation to hide cross-node transmission latency.
- High-Performance Hybrid Attention Operators: Hardware-level optimizations targeting sparse retrieval paths.
- Chunk Loss Calculation: Chunking the large vocabulary loss computation to avoid VRAM overflow caused by instantaneous activation value expansion.
Among these, Chunk Loss was actually enabled during the 400-step test, while the other optimizations have been adapted, reserving engineering space for subsequent larger-scale training configurations.
VI. Summary and Implications
The significance of this verification lies not in how many steps were trained, but in proving a complete path: domestic compute + self-developed software stack + mainstream distributed training framework can undertake the training semantics of trillion-parameter multimodal MoE models. For teams planning to build an autonomous and controllable computing system, a universal methodology can be extracted from this case:
- Layered Adaptation: Reuse native frameworks at the upper layer; replace communication and operators at the lower layer.
- Pruned Verification First: Small-scale functional verification precedes full-scale training.
- Gradient-Level Checks: Use non-zero gradients and parameter updates as the criterion for pipeline correctness.
- VRAM Engineering: Sharding, chunked computation, and communication overlapping are the three main levers for supporting large model training.
As the operator ecosystem and communication libraries continue to improve, the engineering threshold for heterogeneous compute to undertake large model training will keep decreasing, which is a direction the industry should continuously monitor.
