Large-Scale MoE Training: Adapting the Software Stack to Chinese AI Accelerators
Training trillion-parameter mixture-of-experts models requires more than sufficient hardware capacity. This article examines the engineering work involved in adapting large-scale MoE training to Chinese-developed AI accelerators, including FSDP2-based sharding, expert parallelism, communication optimization, multimodal data handling, memory management, and fault recovery. It also outlines why software maturity and end-to-end observability are essential to stable training at scale.
At Scale, the Question Is No Longer Whether Training Runs, but Whether It Runs Reliably
Open-source sparse mixture-of-experts (MoE) models have reached the trillion-parameter range. For AI infrastructure teams, adaptation now means more than loading a model and starting a training job. It requires computation-graph optimization, throughput and stability under large-scale parallelism, and an integrated workflow for model partitioning, gradient synchronization, and data movement.
The criteria for evaluating Chinese-developed AI accelerators are changing accordingly. Peak chip performance matters, but training outcomes also depend on software tooling, multi-accelerator interconnects, and scalable parallelization strategies.
One publicly reported example involves a Chinese AI infrastructure vendor that adapted training for a multimodal MoE model with approximately 2.8 trillion parameters using its training-and-inference accelerator cards and proprietary software stack. Specific metrics should be checked against the vendor’s official disclosures. Drawing on publicly available material, this article examines the engineering requirements behind such an adaptation.
Three Pressures MoE Models Place on Training Systems
In a dense model, each token uses the parameters in every layer it passes through. An MoE model instead uses a router to direct tokens to selected experts, activating only part of its parameter set for each token. This reduces floating-point computation relative to activating all parameters, but makes distributed training substantially more complex.
- Uneven expert utilization. Experts are typically distributed across devices. When routing becomes imbalanced, devices hosting popular experts can become overloaded while others wait.
- Distinctive communication patterns. Token dispatch in distributed MoE layers requires all-to-all communication, potentially across nodes. Its frequency and bandwidth requirements differ from those of all-reduce and all-gather operations.
- Early-training instability. Routing decisions can fluctuate significantly early in training. Load-balancing losses may require dynamic adjustment, while the framework needs mechanisms for fault tolerance and rebalancing.
Multimodal inputs add another layer of complexity. Text, image, and audio encoders may use different degrees of parallelism, while alignment and fusion modules require data synchronization across devices. The training framework must therefore support flexible coordination across parallel dimensions.
FSDP2: A Per-Parameter Tensor Sharding Approach
FSDP2 is the newer implementation of PyTorch Fully Sharded Data Parallel. Its central change is DTensor-based, per-parameter sharding rather than flattening parameters into larger buffers before partitioning them. This avoids flattening and unflattening overhead and makes sharding rules easier to express and inspect.
Before computing a layer, FSDP2 still needs to all-gather the required parameter shards. Those gathered parameters can then be released after use. Finer-grained sharding and gathering can help control peak device-memory usage.
Actual benefits depend on the PyTorch version, model architecture, and communication bandwidth. Teams should benchmark the configuration in their own environment before scaling it up.
Model Loading: Avoid a Single Read Bottleneck
Loading tens of terabytes of weights into a primary node before redistributing them creates memory and I/O bottlenecks.
A common alternative is distributed loading: each node reads the shards it needs in parallel, with coordination focused on metadata rather than funneling all weights through one machine. This requires a storage system capable of handling concurrent reads and a framework that can consistently interpret the model definition and produce a shard mapping.
Declarative sharding rules used with FSDP2 can help derive loading plans from the parallel configuration, reducing the amount of manually written partitioning logic.
Shard Scheduling: Choose Parallelism by Layer
A common layout applies different parallelization strategies to different parts of the model:
- MoE layers: Partition along the expert dimension so that each node holds a group of local experts.
- Dense layers, including attention: Apply tensor parallelism to weights such as Q, K, V, and output projections to keep per-device memory requirements manageable.
- Router and shared layers: Use FSDP to reduce parameter replication across nodes.
If routing patterns shift, the load balancer may need to redistribute experts. That process must be coordinated with memory management and communication scheduling; otherwise, rebalancing can stall the compute pipeline.
Gradient Synchronization: Limit the Communication Scope
Conventional data parallelism synchronizes gradients through an all-reduce across its data-parallel group on each iteration. With FSDP2, gradient aggregation is organized around parameter shards, leaving each device responsible for its assigned portion rather than a fully replicated gradient set.
For MoE training, the synchronization group is especially important. A global approach that aggregates and redistributes all expert gradients can incur growing communication volume and latency as the cluster expands.
Restricting synchronization to devices holding replicas of the same expert group makes the overhead depend more directly on that group’s size than on the total number of nodes. The resulting communication behavior depends on how expert parallelism and sharded data parallelism are combined.
The Software Stack: Kernels, Communication, and Observability
Compatibility with mainstream framework interfaces reduces the script changes needed to migrate a model. Performance, however, usually depends on deeper framework and library optimizations in three areas.
- Operator fusion and kernel tuning. Routing, token dispatch, and expert feed-forward operations are candidates for optimization and, where appropriate, fusion. The goal is to reduce kernel launches and idle gaps.
- Communication-path optimization. Message scheduling and protocol-stack efficiency often limit distributed training. Reducing CPU-mediated transfers and optimizing paths between accelerators and network interfaces can lower latency. Implementations must be validated against the communication-library version and hardware topology.
- End-to-end profiling. A profiler should separately quantify time spent on data loading, computation, communication, and synchronization. In a multimodal MoE system, these measurements are essential for finding bottlenecks.
Four Engineering Requirements for an End-to-End Training Workflow
1. Data Preprocessing and Routing Alignment
Image, text, and audio samples vary substantially in length and shape. Padding everything to a fixed size can waste significant compute, so the framework should support modality-aware dynamic shapes and padding strategies.
Where routing information is available during data partitioning, it can also help align sample groups with expected routing distributions. This can reduce the amount of redistribution needed after routing decisions during the forward pass.
2. Coordinated Device and Host Memory Management
Out-of-memory failures are common in very large model training. Activation recomputation, often implemented through gradient checkpointing, is a standard way to reduce memory pressure.
FSDP2 also provides a consistent sharding approach for parameters, gradients, and optimizer state. With suitable framework support, shard placement can be coordinated between accelerator memory and host memory according to the computation phase.
For large-batch training, coordinated management of these resources can help improve throughput and stability. The outcome still depends on the workload and configuration.
3. Fault Recovery and Checkpoint Resumption
Training a trillion-parameter model can take weeks or months, making failures an expected operating condition rather than an exceptional event.
The training workflow needs asynchronous checkpointing, adaptive recomputation, and fast recovery mechanisms. With sharded checkpoints, each worker writes the shards it owns, and workers reload their portions in parallel during recovery.
This approach can shorten recovery time, but the actual duration depends on checkpoint size, storage bandwidth, and cluster scale. Recovery performance should be measured in the target environment.
4. Comprehensive Monitoring and Diagnosis
Engineers need simultaneous visibility into memory usage, communication latency, per-expert compute distribution, and filesystem read throughput.
Monitoring dashboards should help answer practical questions:
- Is a particular layer creating a communication hotspot?
- Is one expert receiving a disproportionate share of the workload?
- Has data loading become the bottleneck?
The easier these conditions are to diagnose, the faster teams can tune the system.
Three Observations on Adapting Chinese AI Accelerators
Software Maturity Is Becoming a Central Differentiator
Hardware specifications alone are an incomplete measure of training capability. As Chinese-developed accelerators narrow gaps in individual compute metrics, toolchain maturity and the depth of full-stack optimization become increasingly important differentiators.
Support for mainstream approaches such as FSDP2 is one useful indicator of software integration, though it is not a substitute for workload-specific testing.
Workloads Are Moving Beyond Conventional Vision Tasks
The focus is expanding from standard computer vision workloads to very large generative models. A toolchain capable of supporting models with hundreds of billions or trillions of parameters demonstrates a degree of architectural flexibility in its backend framework.
Chip Vendors Need to Participate Beyond Drivers
Providing hardware and basic drivers is not enough to realize the available compute performance. Accelerator vendors also need to contribute to framework integration and model-training workflows.
Participation in the training ecosystem helps translate hardware capabilities into usable training performance.
Conclusion
Mature large-model training infrastructure depends on coordinated model parallelism, communication optimization, memory management, and fault recovery. Improvements in a single hardware specification cannot deliver that capability on their own.
The reported adaptation discussed here is an engineering example based on public disclosures, not an independently verified performance benchmark. Its specific metrics and implementation details should be checked against official information and practical testing.
For teams planning large-model training on Chinese-developed AI accelerators, a sensible starting point is to validate the FSDP2 version, communication configuration, and profiler results on a smaller model, then expand progressively to the full cluster.
