Training Trillion-Parameter Open-Source LLMs on Domestic Chinese AI Chips: An Adaptation Practice

    This article describes a practical engineering effort to adapt the training of a 2.8-trillion-parameter open-source Mixture-of-Experts (MoE) model to a Chinese-made, unified training-and-inference AI accelerator and its software stack. It covers the key challenges of memory pressure, collective communication, and software ecosystem maturity; the design of a native Fully Sharded Data Parallel (FSDP2-style) training path combined with expert parallelism; and the complete training pipeline from distributed weight loading to sharded checkpointing, offering reusable guidance for teams working with ultra-large-scale model training.

    Training Trillion-Parameter Open-Source LLMs on Domestic Chinese AI Chips: An Adaptation Practice

    Background: The Practical Challenges of Ultra-Large-Scale Model Training

    In recent years, the parameter count of open-source large language models has continued to climb. Recently, one open-source model team released a flagship Mixture-of-Experts (MoE) model with roughly 2.8 trillion total parameters. Its sparsely activated architecture significantly reduces compute cost at inference time, but during training it places extreme demands on memory capacity, interconnect bandwidth, and software stack maturity.

    For teams looking to train on domestically produced Chinese compute platforms, the challenges concentrate on three levels:

    • Memory pressure: With trillions of parameters, model weights alone require several terabytes of memory even in mixed precision. Once optimizer states and gradients are included, a single card or single node cannot possibly hold the model.
    • Communication pressure: Expert parallelism (EP) in MoE architectures introduces heavy All-to-All communication, which is highly sensitive to inter-node interconnect topology and the efficiency of the collective communication library.
    • Software ecosystem: The depth of adaptation among the training framework, operator libraries, communication libraries, and hardware instruction sets directly determines training throughput and stability.

    Against this backdrop, completing the training adaptation of this model on a unified training-and-inference AI accelerator with its companion software stack became a representative engineering practice.

    How the Unified Training-and-Inference Accelerator Works with Its Software Stack

    The accelerator used in this adaptation offers large-capacity, high-bandwidth memory and inter-chip interconnect optimized for large-model workloads, covering both training and inference. Its companion software stack provides end-to-end support, from low-level drivers, operator libraries, and collective communication libraries up to framework adaptation layers.

    The key value of this combination is that the software stack remains compatible with the programming models of mainstream training frameworks. Developers can migrate from the general GPU ecosystem to this platform without extensively rewriting model code. In practice, the adaptation work typically includes:

    1. Operator coverage verification: Checking one by one that the model’s core operators—attention, normalization, routing gating, and expert feed-forward layers—are implemented on the target platform with correct numerical precision.
    2. Communication primitive alignment: Ensuring the correctness and performance of collective primitives such as AllReduce, AllGather, ReduceScatter, and All-to-All under multi-node, multi-card topologies.
    3. Memory management strategy: To address memory fragmentation during large-model training, enabling scalable segmented memory allocation and activation recomputation.

    Building a Native Fully Sharded Data Parallel Training Path

    The core of the adaptation is building a native Fully Sharded Data Parallel (the second-generation FSDP mechanism) multimodal training path. Unlike the first generation, which shards by wrapping entire layers, the new mechanism manages parameters at the granularity of parameter groups (parameter slices), offering several advantages:

    • Finer-grained memory control: Parameters, gradients, and optimizer states are sharded and gathered on demand, keeping peak memory usage more manageable.
    • Compute-communication overlap: During backpropagation, gradient ReduceScatter can overlap with the computation of subsequent layers, hiding communication latency.
    • Natural compatibility with hybrid parallelism: It can be readily combined with tensor parallelism, expert parallelism, and context parallelism to form multi-dimensional parallelism schemes.

    Given the characteristics of MoE models, the engineering team typically applies different sharding strategies to dense-layer parameters and expert parameters: the dense portion follows the standard fully sharded path, while experts are partitioned along the expert dimension with All-to-All routing communication, striking a balance between memory footprint and communication overhead.

    End-to-End Training Pipeline: From Loading to Gradient Synchronization

    A production-ready training pipeline needs to cover the following key stages:

    1. Model loading and weight sharding

    The weight files of a trillion-parameter model are enormous, and reading them from a single point becomes a startup bottleneck. The practical approach is distributed loading: each training process loads only the parameter shards it owns, combined with asynchronous I/O and prefetching, compressing cold-start time from hours to minutes.

    2. Sharded scheduling of forward and backward passes

    During the forward pass, the required parameter shards are temporarily gathered via AllGather on demand and released immediately after computation. During the backward pass, gradients are reduced directly to their shard owners via ReduceScatter. The scheduler must precisely orchestrate when these communication operators fire in order to maximize compute-communication overlap.

    3. Gradient synchronization and optimizer updates

    After gradient synchronization, each process runs the optimizer update only on the shards it holds, avoiding a full-parameter broadcast. Together with gradient clipping, loss scaling, and other numerical stability techniques, this ensures convergence quality under mixed-precision training.

    4. Fault tolerance and checkpointing

    Ultra-large-scale training jobs run for long periods, so the pipeline must support incremental saving and fast recovery of sharded checkpoints, ensuring that training can resume from the latest checkpoint after a single-point failure rather than wasting compute.

    Outcomes and Broader Implications

    This adaptation demonstrates that Chinese-made unified training-and-inference compute is now fully engineering-viable for training models at the trillion-parameter scale. Its significance goes beyond getting a single model running: it validates a reusable technical path in which a native fully sharded data parallel backbone, combined with expert parallelism and communication optimizations on top of a mature software stack, can support training and fine-tuning of frontier open-source models.

    For developers and enterprise users, this means more options when selecting training infrastructure. Whether building domain-specific large models or further training open-source models, teams can draw on the parallelism design, memory optimization techniques, and training pipeline engineering methods described here, tailoring an implementation plan to their own compute resources. As the software ecosystem continues to mature and parallelism techniques evolve, the barrier to ultra-large-scale model training will keep falling.