End-to-End Training Adaptation of Chinese-Developed AI Accelerators for Trillion-Parameter LLMs

    This article explains how a Chinese-developed AI accelerator was adapted to train a near-3-trillion-parameter open-source model, including a 400-step stable run on two nodes with 16 cards in total. It distinguishes inference adaptation, training adaptation, and the origin of pretraining compute, then walks through the FSDP2 training path, communication overlap, gradient synchronization, multimodal challenges, and the engineering practices behind the work.

    1. Background: A New Stage in Adapting Domestic Compute to LLM Training

    As open-source large language models grow toward the trillion-parameter scale, training them places unprecedented demands on compute infrastructure. For a long time, large-scale pretraining and fine-tuning relied heavily on high-end overseas GPUs, while domestic AI chips were mostly used for inference. Recently, a Chinese GPU vendor used its flagship AI card, which supports both training and inference, together with its in-house software stack to complete training adaptation for a near-3-trillion-parameter flagship open-source model from a leading AI company. The work included a continuous, stable training run of 400 steps across two nodes with 16 cards in total. This marks a shift for domestic compute from “capable of inference” to “capable of training, and training stably.”

    It is important to clarify upfront that “completing training adaptation” and “pretraining the model on that chip” are two very different things. The two are often conflated inside and outside the industry.

    2. Clarifying the Concepts: Inference Adaptation, Training Adaptation, and Pretraining Compute Origin

    2.1 Three Levels of Adaptation

    In the relationship between large models and compute chips, there are typically three levels:

    1. Inference adaptation (Day 0 adaptation): After a new model is released, the chip vendor quickly completes compatibility and optimization of inference operators so the model runs on the hardware. This is the lowest bar and the most common type. Most “Day 0 support” announcements in the industry fall into this category.
    2. Training adaptation: Enabling a complete training pipeline on the hardware, including forward computation, backpropagation, gradient synchronization, and optimizer updates, while ensuring numerical correctness and long-running stability. This requires deep support in the software stack for distributed training frameworks, communication libraries, and memory management. The engineering complexity is far higher than inference adaptation.
    3. Pretraining compute origin: The hardware on which a model’s base weights were actually trained from scratch. This is an internal engineering decision of the model developer. Unless the developer officially discloses it, outsiders cannot infer that a model was born on a chip from news that the chip “completed adaptation.”

    2.2 A Typical Case of Industry Misreading

    A well-known open-source model’s technical report validated domestic NPUs and overseas GPUs side by side, along with a fine-grained expert parallelism (EP) approach. Some public commentary read this as evidence that the model was pretrained on domestic NPUs. Industry consensus, however, holds that listing two hardware types side by side reflects cross-validation of inference operators and parallelism strategies, not proof of where pretraining compute came from. The model developer has never officially announced the source of compute for its base pretraining.

    This case shows that when evaluating any news about a chip adapting to a large model, you should first ask: Is the adaptation for inference or training? Does it verify operator correctness or full-pipeline convergence? How many steps were run, and was the run continuous and stable? Only by breaking these questions down can you make an objective judgment about technical progress.

    3. The Technical Core of Training Adaptation: A Native FSDP2 Multimodal Training Path

    The core result of this adaptation is a native FSDP2 (Fully Sharded Data Parallel 2) multimodal training path, which connects the full training pipeline from model loading and shard scheduling to gradient synchronization. The key points of each stage are below.

    3.1 Model Loading and Parameter Sharding

    A trillion-parameter model cannot fit into the memory of a single card, so it must rely on a fully sharded data parallel strategy. Compared with the first-generation FSDP, FSDP2 shards parameters, gradients, and optimizer states at a finer granularity across devices. It materializes parameter shards on demand, temporarily gathering them before computation and releasing them immediately afterward, which minimizes per-card memory usage.

    An illustrative initialization example:

    1. # Illustrative code: parameter sharding wrapper based on the FSDP2 approach
    2. from torch.distributed.fsdp import fully_shard
    3. for layer in model.transformer.layers:
    4. fully_shard(layer, mesh=device_mesh) # shard layer by layer
    5. fully_shard(model, mesh=device_mesh) # top-level fallback
    6. # On-demand loading: map the sharded checkpoint directly to each rank
    7. load_sharded_checkpoint(model, ckpt_dir, strict=True)

    On the domestic software stack, the main challenge lies in the underlying runtime. It must efficiently support irregular tensor partitioning and cross-device handle management, and it must provide a compatibility layer with mainstream deep learning frameworks so that upper-level training scripts can be migrated with few or no changes.

    3.2 Shard Scheduling and Overlapping Communication with Computation

    A key performance technique in FSDP2 is overlapping parameter prefetching and gradient reduce-scatter with computation. Before backpropagation starts, the scheduler issues the all-gather for the next layer’s parameters in advance, so communication is hidden behind computation. This requires the communication library to support asynchronous primitives and to coordinate closely with the operator scheduler. This is often the area where domestic software stacks lag most behind mature ecosystems, and it is where the value of “training adaptation” lies.

    3.3 Gradient Synchronization and Numerical Correctness

    Under mixed-precision training, gradients are typically communicated in low precision and accumulated in high precision. During adaptation, the team had to verify three things: whether rounding error from low-precision communication stays within an acceptable range, whether the loss scaling strategy matches the framework’s default behavior, and whether cross-card reduction is deterministic.

    In practice, the acceptance criteria are per-step loss alignment and multi-step loss curve alignment. First, the losses for the first few steps are compared bit by bit against a reference implementation on one card or a few cards. Then the setup is scaled to the target cluster size to verify that the loss curve matches.

    3.4 Additional Challenges in the Multimodal Pipeline

    The target model is multimodal. Besides the language model backbone, it includes heterogeneous submodules such as a vision encoder. This adds requirements for sharding. The vision encoder and the language backbone differ significantly in compute density and activation memory distribution, so each needs its own sharding granularity and checkpointing (activation recomputation) strategy. The data loading side must also keep throughput balanced across mixed image-text samples, so the data pipeline does not become a bottleneck.

    4. Stability Verification: What a 400-Step Run on Two Nodes with 16 Cards Means

    The metric of a continuous, stable 400-step run on two nodes with 16 cards deserves a closer look. For training adaptation, completing a single step only shows that the operators work. Running hundreds of steps without interruption indicates the following:

    • No memory leaks: Over long runs, activation memory and communication buffers do not fragment or grow slowly enough to cause out-of-memory errors.
    • Reliable communication links: Cross-node RDMA and high-speed interconnects do not produce timeouts, dropped steps, or hangs under high load.
    • Fault tolerance and monitoring: The training framework has heartbeat detection and fault localization, so anomalies can be traced quickly.

    That said, 400 steps falls under functional and stability validation. It remains far from a complete, long-running pretraining job at ten-thousand-card scale. Such a job