Training Adaptation for Ultra-Large-Scale Models on a Chinese AI Compute Cluster
This article describes how a team adapted a multimodal model with tens of trillions of parameters for training on a Chinese-developed AI accelerator designed for both training and inference, along with its software stack. It covers hardware evaluation, software stack requirements, a native fully sharded data parallel training path with lazy initialization, shard scheduling and gradient synchronization, and validation of correctness, scalability, and stability. Readers get a practical framework for planning large-model training adaptation on new compute platforms.
Training Adaptation for Ultra-Large-Scale Models on a Chinese AI Compute Cluster
1. Background: Training Adaptation Challenges in the Era of Tens of Trillions of Parameters
Recent open-source large models have kept growing in parameter count, and some flagship multimodal models now reach tens of trillions of total parameters. These models often use a Mixture of Experts (MoE) architecture, where each forward pass activates only a subset of the parameters. Even so, storing the full set of parameters, optimizer states, and gradients places very high demands on hardware resources.
Moving a model of this scale to a new compute platform is far more than getting the code to run. It involves systematic engineering across three layers:
- Hardware: Accelerator memory capacity, interconnect bandwidth, and support for large-model operators determine the design space of the training scheme.
- Software stack: Drivers, operator libraries, communication libraries, compilers and toolchains, and upper-layer training frameworks must work together. Their coordination determines whether the distributed strategy can be implemented efficiently.
- Algorithm engineering: Model loading, parameter sharding, gradient synchronization, and activation management form one closed loop. That loop determines whether training can converge stably.
This article uses a typical practice as an example. Based on a Chinese-developed flagship AI accelerator that supports integrated training and inference, along with its supporting software stack, the team adapted a multimodal model with tens of trillions of parameters for training. The work built a native fully sharded data parallel (FSDP) training path for multimodal models and connected the full training pipeline, from model loading and shard scheduling to gradient synchronization.
2. Selecting an Integrated Training and Inference Hardware Platform
The first step in training adaptation is assessing the capability limits of the target hardware. Current high-end AI accelerators generally move toward integrated training and inference. The same card supports large-scale distributed training and high-throughput inference deployment. Such platforms typically have the following characteristics:
- Large, high-bandwidth memory: The memory capacity of a single card determines how many parameters and activations one device can hold. This directly affects the granularity of the sharding strategy.
- High-speed interconnect: Whether between cards in one server or across servers, communication bandwidth is the main performance bottleneck for gradient synchronization and expert-parallel communication.
- Complete training precision support: This includes mixed-precision training with FP16 and BF16, as well as low-precision formats such as FP8. These formats reduce memory usage and communication volume while preserving convergence.
In the early stage of adaptation, the engineering team profiles the resource needs of the target model. This means estimating the totals for parameters, gradients, optimizer states, and activations. For Adam-type optimizers, optimizer states typically add about twice the parameter count in extra overhead. The team then works backward from the cluster size to find a feasible parallelism and partitioning scheme. For a model with tens of trillions of parameters, pure data parallelism is not feasible, even with mixed precision and 8-bit optimizer state compression. Parameter sharding is therefore mandatory.
3. Software Stack Coordination: The Core Challenge of Adaptation
Hardware capability is only the foundation. The maturity of the software stack determines whether the adaptation succeeds. A complete AI software stack typically includes a driver layer, operator libraries, collective communication libraries, graph compilation and runtime, and an adaptation layer for training frameworks. For ultra-large-scale training, the following capabilities need focused verification.
1. Operator coverage and numerical consistency
Multimodal models use many attention variants, normalization layers, gated activations, and operators related to MoE routing. The adaptation team checks how each operator is implemented on the new platform. For missing operators, the team can fill the gaps through operator fusion, operator decomposition, or custom implementations. Layer-by-layer numerical comparison against a reference implementation then confirms that the error stays within an acceptable range.
2. Collective communication performance
Fully sharded data parallelism introduces large volumes of parameter aggregation (all-gather) and gradient reduction (reduce-scatter) operations. The communication library needs to support hierarchical communication and overlap communication with computation, so that communication does not become a throughput bottleneck. In practice, the team can adjust the topology mapping of shard groups so that high-frequency communication mostly runs over the high-bandwidth interconnect within a server.
3. Framework-level compatibility
The second-generation fully sharded data parallel interface in mainstream distributed training frameworks moves sharding from flattened parameters to fine-grained, tensor-level management. Combined with an explicit device mesh abstraction, this interface makes it easier to combine data parallelism, tensor parallelism, and expert parallelism. The software stack must ensure that these framework-level interfaces behave consistently on the Chinese-developed compute backend and meet performance targets.
4. Building a Native Fully Sharded Multimodal Training Path
The core result of this adaptation is a native fully sharded data parallel training path for multimodal models. Here, “native” means the design does not rely on add-on memory offloading or layer-by-layer recomputation as a fallback. Sharded training is the default path, and it runs efficiently. Key design elements include:
1. Model loading and lazy initialization
A model with tens of trillions of parameters cannot be fully instantiated on one card and then distributed. In practice, the team uses lazy initialization on the meta device. The model structure is first built from meta tensors, which occupy no device memory. Parameters are then materialized layer by layer according to the sharding plan and loaded directly from the corresponding shards of the checkpoint. This keeps peak memory during loading within the size of one card’s shard.
2. Shard scheduling strategy
Shard scheduling answers two questions: which tensors participate in sharding, and how shard groups are divided. For MoE models, a common approach shards the dense parts with standard full sharding. Expert parameters are partitioned two-dimensionally, combining the sharding dimension with the expert parallel dimension. This avoids communication hotspots that a single parallel dimension would create. The scheduler also triggers parameter aggregation early, at the start of the forward pass, so that communication and computation run in a pipelined overlap.
3. Gradient synchronization and optimizer sharding
After backpropagation, reduce-scatter writes gradients directly into the shards held by each device. Optimizer states are also maintained per shard. After each update, parameters are aggregated again in the next forward pass. This closed loop means no complete copy of the parameters exists at any moment. Memory usage therefore falls approximately linearly as the number of devices increases.
4. Special handling for the multimodal pipeline
Multimodal models combine heterogeneous components, including a vision encoder, a cross-modal projection layer, and a language backbone. Their computational density differs significantly. In practice, the vision encoder can use a separate shard group or an independent data-parallel replica, with activation checkpointing to control its peak memory. This keeps smaller modules from reducing the efficiency of the whole sharded system.
5. End-to-End Validation of the Training Pipeline
After adaptation, the complete pipeline needs systematic validation:
- Correctness: On a small-scale configuration, compare the loss curve against a reference implementation to confirm that the first several steps follow the same trajectory.
- Scalability: Gradually expand the cluster, measure how throughput grows with the number of cards, and locate communication or scheduling bottlenecks from the scaling efficiency curve.
- Stability: Run long continuous training and use checkpoint-based resumption to verify that sharded checkpoints are saved and restored correctly.
Adaptation is complete only when all three dimensions meet their targets. After that, the model can enter routine training on the compute platform.
6. Summary and Outlook
Training adaptation for ultra-large-scale models on a Chinese compute platform is a systems engineering effort that spans hardware, the software stack, and algorithm engineering. This practice shows that, with an integrated training and inference AI accelerator and a mature software stack, the training pipeline can be fully connected, from model loading and shard scheduling to gradient synchronization. The techniques used include native fully sharded data parallelism, fine-grained shard scheduling, and communication-computation overlap. Together, they support efficient training of a multimodal model with tens of trillions of parameters. As the software and hardware ecosystem in China continues to evolve, experience from adaptations like this can become reusable engineering methods that give more large-model training tasks a solid found
