Training Adaptation of a 2.8T-Parameter Sparse Multimodal MoE Model on Domestic AI Accelerators
This article examines the engineering work required to adapt a roughly 2.8-trillion-parameter sparse multimodal MoE model with million-token context for training on domestic AI accelerators. It covers custom kernels for hybrid attention and dynamic routing, FSDP2 fully sharded data parallelism, expert parallelism with communication overlap, and chunked loss computation. It also describes a gradient-level validation methodology using a pruned 13-layer language backbone and a 16-accelerator test, showing how to verify that each module is actually learning rather than only observing loss decline.
I. Background: Why Training Adaptation for Large Sparse Multimodal MoE Models Is So Challenging
A domestic AI accelerator vendor recently announced that its flagship training/inference unified accelerator and supporting software stack had completed training adaptation for an open-weight native multimodal model with roughly 2.8 trillion parameters and support for million-token context. In a joint test using two servers and 16 accelerators, the system completed 400 consecutive training steps without numerical overflow or abnormal interruption. What makes this noteworthy is not the accelerator card itself, but the set of general engineering problems it exposes when very large sparse models are trained on heterogeneous hardware.
Specifically, training challenges for this class of model fall into three layers:
- Complexity of attention mechanisms. The model uses a hybrid attention architecture that combines linear attention variants with a dynamic sparse retrieval mechanism. Kernel libraries optimized for standard Transformers cannot be reused directly. High-performance forward and backward kernels must be implemented separately for each attention form.
- Routing dynamics of the MoE mixture-of-experts architecture. Each token’s routing decision is determined at runtime. Imbalanced expert load can make some cards communication and computation bottlenecks. The discrete operations introduced by routing also impose additional requirements on correct gradient propagation.
- Memory pressure from joint image-text training. A complete vision encoder tower and cross-modal projection module on top of the language backbone make single-card memory far insufficient for full parameters, gradients, and optimizer states. A multi-dimensional parallel memory sharding strategy is therefore required.
II. Core Technical Path for Adaptation
1. Module-Level Integration into a Unified Training Workflow
The adaptation work was not simply about “getting the forward pass to run.” It centered on four core modules—attention computation, dynamic routing, visual encoding, and cross-modal projection—and integrated them one by one into a unified forward propagation, backward propagation, and parameter update workflow. This means every custom kernel must implement correct gradient backpropagation logic. Any break in the gradient chain will cause the corresponding module to “appear to be training while actually not updating.”
2. FSDP2 Fully Sharded Data Parallelism
The training plan retained the native model framework’s training workflow and used FSDP2 to shard model parameters, gradients, and optimizer states across different GPUs, greatly reducing per-card memory usage. Compared with traditional data-parallel replication, full sharding is almost the only viable memory strategy at trillion-parameter scale. Cross-card and cross-node collective communication is handled by a unified communication library, covering key primitives such as All-Gather and Reduce-Scatter.
A typical sharding configuration is shown below:
from torch.distributed.fsdp import fully_shardfor block in model.layers:fully_shard(block, mesh=mesh) # Shard layer by layer to reduce peak memoryfully_shard(model, mesh=mesh) # Root-module fallback sharding
3. Coordination of Expert Parallelism and Communication Scheduling
In MoE scenarios, FSDP2 must work together with expert parallelism: non-expert weights are sharded by layer, while expert weights are split across devices along the expert dimension. Parameter prefetch and gradient communication scheduling overlap optimization were also completed—prefetching the next layer’s sharded parameters while the current layer is computing, thereby hiding communication time within the computation window. This is a key source of throughput in large-scale training.
4. Chunked Loss Computation
Cross-entropy computation under very long sequences and large batches can instantly produce huge intermediate activations. Chunk Loss splits the computation of logits and loss into multiple chunks processed segment by segment, significantly reducing peak memory without changing precision. The 400-step test actually enabled this optimization, and together with high-performance attention kernels, it supported stable training.
III. Validation Method: How to Prove That “Training Is Really Happening”
The most instructive part of this validation is its rigorous approach to functional correctness verification, rather than merely looking at loss decline:
- Training configuration: Two servers with 16 accelerators in total; a pruned 13-layer language backbone; 16 routed experts with Top-8 routing; the full 27-layer vision tower and cross-modal projection module were retained; an image-text question-answering dataset was used; global batch size was 16; sequence length was 1024.
- Convergence evidence: Average training loss from steps 21 to 70 was 8.9365 and dropped to 2.1802 over the last 50 steps. Validation loss fell from 6.5297 at step 100 to 4.6873 at step 400. Training and validation curves declined together, ruling out false convergence caused by overfitting or data leakage.
- Memory level: Sampled device memory peak was 44.80 GiB, indicating that the sharding strategy effectively controlled per-card occupancy.
- Gradient-level validation: The technical team checked module by module the gradients and parameter updates of the vision tower image embeddings, the first and last layers, and the cross-modal projection, confirming that all were non-zero. This proved that the vision branch truly participated in end-to-end training rather than serving only as an input placeholder.
It should be emphasized that the validation used a randomly initialized pruned configuration. Its purpose was to verify the functional correctness and stability of the training pipeline, not to perform full-scale pretraining of the complete model. This progressive methodology—“first validate the pipeline with a small pruned configuration, then scale to full training”—is highly valuable for any team adapting to new hardware.
IV. Summary and Takeaways
This practice yields a general checklist for adapting large-model training to heterogeneous hardware. First, the kernel layer must cover non-standard structures such as hybrid attention and sparse routing. Second, the parallel strategy requires deep coordination among FSDP, expert parallelism, and communication scheduling. Third, validation must go down to the gradient level to confirm that each module is “really learning.” As the domestic compute ecosystem continues to mature, this kind of end-to-end training pipeline validation will become an important measure of software and hardware stack maturity, and it provides a practical engineering reference for model training under diversified compute supply.
