Trillion-Parameter Model Training on Chinese AI Computing Platforms

    Adapting trillion-parameter models to Chinese-developed AI accelerators requires coordinated work across model loading, parameter sharding, gradient synchronization, and the supporting software stack. This article explains how fully sharded data parallelism combines with expert parallelism to support large MoE models, outlines multimodal training considerations, and discusses the monitoring and recovery capabilities needed for stable long-running training.

    1. Training Challenges at the Trillion-Parameter Scale

    Large language models have continued to grow, with flagship open-source models reaching several trillion total parameters. These models typically use a Mixture-of-Experts (MoE) architecture: only a small subset of expert subnetworks is activated during each forward pass, expanding model capacity while keeping computation costs under control. Many also support multimodal inputs, such as text and images, which further complicates the training system.

    At this scale, conventional data parallelism is no longer sufficient. A single accelerator cannot hold a complete model replica, let alone its gradients and optimizer states. In mixed-precision training, parameters, gradients, momentum, and other training states can together require many times the memory occupied by the model weights alone. For a trillion-parameter model, the resulting memory requirement is enormous.

    Building a complete, efficient, and stable training workflow on Chinese-developed accelerators designed for both training and inference therefore requires close coordination between hardware, distributed training strategies, and the software stack.

    2. The Core Approach: Fully Sharded Data Parallelism

    2.1 From Data Parallelism to Full Sharding

    Conventional data parallelism stores a complete copy of the model parameters and optimizer states on every accelerator, with communication concentrated around gradient aggregation. This approach breaks down when the model exceeds the memory capacity of a single device.

    Fully Sharded Data Parallel (FSDP) addresses this limitation by partitioning parameters, gradients, and optimizer states across the devices in a sharding group. Each device retains only its assigned shards. When computation requires complete parameters, collective communication temporarily gathers them; the gathered copies are released when no longer needed.

    Newer sharding designs, commonly associated with FSDP2, introduce several important improvements:

    • Per-parameter sharded tensor representation: Parameters are represented as sharded tensors, separating their representation from parallelism strategies and making it easier to combine sharding with pipeline parallelism, expert parallelism, and other approaches.
    • More flexible communication scheduling: Parameter all-gather and gradient reduce-scatter operations can overlap with computation at finer granularity, helping hide communication latency.
    • Support for heterogeneous multimodal and MoE structures: Different modules can use different sharding and parallelism strategies, avoiding the inefficiencies of a uniform policy.

    2.2 Three Critical Stages in the Training Workflow

    Adapting trillion-parameter models requires solving engineering challenges across three closely connected stages.

    1. Model loading

    Trillion-parameter model checkpoints are too large to load in full onto every accelerator. Lazy loading and shard-aware loading provide a more practical approach: each process reads only the shards it needs. Combined with a sharded checkpoint format, this helps control both loading time and peak device memory usage.

    2. Sharding and parallelism scheduling

    Different model components require different parallelism strategies. Attention and feed-forward layers can use fully sharded data parallelism. MoE expert layers are better suited to expert parallelism, which distributes experts across devices and uses all-to-all communication to route tokens.

    Multimodal encoders and the language-model backbone may also require different sharding granularities. The objective is to maximize communication–computation overlap while minimizing peak memory usage.

    3. Gradient synchronization

    In fully sharded training, reduce-scatter aggregates gradients and places the resulting shards on their assigned devices. Communication must be scheduled carefully to overlap with backward computation. Gradient bucketing and, where appropriate, mixed-precision communication can further reduce bandwidth pressure.

    2.3 Illustrative Configuration

    The following pseudocode illustrates how different parallelism policies can be applied by module type. It is a conceptual example, not an interface from any specific framework.

    1. # Apply different sharding strategies according to module type
    2. for module in model.layers:
    3. if isinstance(module, ExpertLayer):
    4. apply_expert_parallel(module, ep_group=expert_group)
    5. else:
    6. apply_full_shard(module, mesh=device_mesh)
    7. # Main training loop
    8. for batch in dataloader:
    9. loss = model(batch) # Gather parameter shards during the forward pass
    10. loss.backward() # Reduce-scatter gradients during the backward pass
    11. optimizer.step() # Update only the local parameter shards
    12. optimizer.zero_grad()

    3. Special Considerations for Multimodal Training

    Multimodal models introduce heterogeneous components, such as vision encoders, whose computational characteristics differ substantially from those of the language backbone. Image resolution can cause significant variation in batch shapes and processing costs, while the interface between vision and language components must support feature alignment.

    An end-to-end multimodal training workflow should address three areas:

    • Balanced data delivery: Multimodal samples have uneven preprocessing costs, which can create pipeline bubbles. Asynchronous prefetching and dynamic batching help provide a steadier supply of training data.
    • Independent parallelism for heterogeneous modules: Separate parallel groups for the vision encoder and language backbone allow their execution strategies to be configured independently, reducing mutual constraints.
    • Coordinated gradient scales: Gradient magnitudes may differ substantially across modality branches. Layer-wise learning rates and gradient clipping may be needed to manage these differences.

    4. Software Stack Integration and Training Stability

    Hardware alone does not determine training efficiency. The maturity of the supporting software stack sets practical limits on how effectively the hardware can be used.

    A complete training stack needs:

    • Programming interfaces compatible with mainstream training frameworks.
    • Operator libraries optimized for the accelerator’s instruction set.
    • Efficient collective communication libraries.
    • Fault-tolerance capabilities, including checkpoint recovery and health checks.

    Trillion-parameter training jobs can run for weeks, making monitoring and recovery essential. Memory usage, communication bandwidth, and throughput trends should be monitored continuously, with alerts for abnormal behavior.

    The system should also support rapid isolation of failed nodes and recovery of interrupted jobs. These capabilities help prevent a single failure from invalidating a substantial amount of training work.

    5. Conclusions and Outlook

    Adapting models with several trillion total parameters for training on Chinese-developed training-and-inference platforms demonstrates the feasibility of combining fully sharded data parallelism, expert parallelism, and multimodal training within a locally developed hardware and software stack.

    Establishing the complete workflow—from model loading and sharding orchestration to gradient synchronization—shows that these platforms can support frontier-scale model training workloads.

    Further progress in automated parallelism strategy search and tighter integration of communication with computation offers room for additional efficiency gains. These improvements could help lower the computing barriers to large-model development for more enterprises and research institutions.