Training Trillion-Parameter Models on Chinese-Developed AI Accelerators: Key Technical Pathways

    This article explains how AI accelerators are adapted to train trillion-parameter models. It covers three core challenges (compute supply, memory and communication bottlenecks, and software stack compatibility), then walks through model loading, FSDP2-based sharding, shard scheduling and gradient synchronization, a general methodology for heterogeneous platforms, and engineering practices for stability, observability, and unified training and inference.

    1. Background: Why Trillion-Parameter Models Are a Litmus Test for Training Adaptation

    An open-source multimodal flagship model with 2.8 trillion parameters has recently been released. A model of this scale places strict demands on training infrastructure. For any AI compute chip vendor, completing full training adaptation on a model this size is an important indicator of how mature its hardware design and software ecosystem are.

    From a general technical perspective, adapting a very large model for training requires solving three types of problems. First, compute supply: per-device compute and cluster size must reach a sufficient scale. Second, memory and communication bottlenecks: even with mixed-precision training, the weights, gradients, and optimizer states of a trillion-parameter model far exceed the memory capacity of a single device. Third, software stack compatibility: mainstream training frameworks and parallelism strategies must run stably on the target compute platform.

    2. Core Technical Chain of Training Adaptation

    A complete training adaptation typically connects three key stages: model loading, shard scheduling, and gradient synchronization. If any one of these stages is missing, the training loop cannot close.

    1. Model Loading and Parameter Initialization

    The weight files of a trillion-parameter model can reach several terabytes. The loading stage needs to support chunked reading, lazy loading, and on-demand sharding, so that the memory of the master control node does not become a bottleneck. A common approach is to parse the model structure from metadata first. Each training process then pulls the parameter fragments that match its own sharding plan.

    2. Fully Sharded Data Parallel (FSDP)

    FSDP (Fully Sharded Data Parallel) is a widely adopted memory optimization approach in the industry. Its second-generation implementation, FSDP2, shards at per-parameter granularity. Compared with module-level sharding, it offers finer memory control and better ease of use. The core idea is to split model parameters, gradients, and optimizer states across compute devices. During forward and backward computation, parameters are gathered on demand through all-gather operations. After computation, the non-local shards are released.

    Illustrative sharding pseudocode:

    1. # Generic FSDP sharding logic (illustrative)
    2. for layer in model.layers:
    3. shard_parameters(layer) # Split parameters across devices
    4. register_prefetch_hook(layer) # Schedule prefetch before the forward pass
    5. offload_stale_shards(layer) # Release non-essential shards after computation

    For multimodal models, the vision encoder and the language model have different parameter scales and activation characteristics. Designing separate sharding granularity and recomputation strategies for each component is part of building what is known as a “multimodal training path.”

    3. Shard Scheduling and Gradient Synchronization

    Shard scheduling determines which device holds which parameters at each point in time. Gradient synchronization relies on efficient collective communication. After backpropagation, each device performs a reduce-scatter on the gradients of its shard. Combined with overlapping communication and computation, this effectively hides communication overhead. Common engineering optimizations include:

    • Gradient bucketing, which merges small gradients to improve bandwidth utilization;
    • Pipelined overlap of communication with backward computation;
    • Master weight maintenance and gradient scaling under mixed precision, which preserve numerical stability.

    3. A General Methodology for Heterogeneous Platform Adaptation

    Adapting large model training to Chinese-developed or non-mainstream accelerators typically follows these steps:

    1. Operator coverage: Compare against the operator list that the training framework depends on. Implement or optimize each underlying operator, and verify its accuracy with numerical consistency tests.
    2. Communication library adaptation: Implement collective primitives such as all-gather, reduce-scatter, and all-reduce on the platform’s own interconnect hardware, ensuring that bandwidth and latency meet targets.
    3. Framework integration: Connect the device abstraction to the backend interface of a mainstream training framework, so that FSDP, tensor parallelism, pipeline parallelism, and other strategies run transparently.
    4. End-to-end validation: Run convergence tests on public benchmark models. Compare loss curves with a baseline platform to confirm that the training pipeline is correct.

    In this adaptation, the vendor built a native FSDP2 multimodal training path on a flagship training-and-inference integrated AI accelerator and a self-developed unified software stack. This is a concrete application of the methodology above. The software stack provides the operator and communication foundation, the hardware provides compute and interconnect, and together they connect the full training pipeline.

    4. Key Engineering Considerations

    • Stability first: In long training runs, single-point failures and accuracy drift are very costly. Checkpoint snapshots, resumable training, and gradient anomaly detection should be in place.
    • Observability: Using monitoring, alerting, and logging services, track metrics such as memory usage, communication time, and MFU (Model FLOPs Utilization) in real time.
    • Unified training and inference: A hardware design that supports both training and inference on one platform reduces the cost of moving a model from training to deployment. This is an important direction for AI accelerators.

    5. Conclusion

    Adapting a trillion-parameter model for training is a systems engineering effort that requires coordination among compute hardware, parallelism strategies, and the software ecosystem. Full-sharding approaches such as FSDP2, combined with fine-grained scheduling and communication optimization, form a general technical foundation for large model training. As Chinese-developed compute platforms continue to build out their software stacks, developers will have more compute options. Mastering these general distributed training methods is key to working on any heterogeneous platform.