Adapting Domestic GPUs for LLM Training: From Inference Verification to Stable Training

    Adapting large language models (LLMs) to run on domestic GPUs involves distinct challenges when moving from inference to training. This article explores why training adaptation is significantly harder than inference adaptation, detailing the technical breakdown of training a near-3 trillion parameter model. It covers the construction of native distributed training frameworks using FSDP2, the complete pipeline from model loading to gradient synchronization, and numerical stability validation. Finally, it outlines the evolution of the domestic training ecosystem toward an out-of-the-box experience across operators, parallelism, and toolchains.

    I. Why “Training Adaptation” is a Harder Watershed than “Inference Adaptation”

    In the LLM ecosystem, adaptation work for domestic compute vendors is typically divided into two tiers. The first is inference adaptation, which involves loading, forward computation, and inference output of the latest open-source LLMs on new hardware. Often referred to as “Day 0 adaptation,” it tests operator coverage, graph compilation capabilities, and the engineering maturity of the inference engine. The second is training adaptation, which demands far more than the former: not only must forward calculations be accurate, but backward propagation gradients, optimizer state updates, and multi-card communication and synchronization must maintain numerical correctness and system stability over long periods.

    Simply put, inference adaptation means “getting the model to run,” while training adaptation means “training the model from scratch to convergence or participating in stable training on this hardware.” The engineering chasm between the two is mainly reflected in:

    1. More complex precision pipeline. Training involves mixed precision (BF16/FP16) computation, high-precision maintenance of master weights, loss scaling, and gradient clipping. Any numerical anomaly in these stages will be amplified as training steps progress.
    2. More diverse communication patterns. Training requires frequent gradient synchronization (AllReduce/ReduceScatter+AllGather) and sharded broadcasting of parameters and optimizer states, putting comprehensive demands on the communication library and topology-aware scheduling.
    3. Higher fault tolerance requirements. Inference is a short, one-time task, whereas training runs continuously for days. Memory fragmentation, communication jitter, and numerical overflow can all cause interruptions, making stable uptime a core metric.

    A common industry misconception needs clarification: completing the training adaptation of an open-source LLM does not mean the model was pre-trained on these chips. Adaptation verification and pre-training are two different things; the former verifies “capability availability,” while the latter is the true test of large-scale compute. This distinction should be kept in mind when interpreting technical reports.

    II. Technical Breakdown of Trillion-Parameter Model Training Adaptation

    Based on public technical information, the adapted model has a parameter scale approaching 3 trillion (approx. 3T), representing the top tier among current frontier open-source models. Completing stable training on a scale of 16 training cards across two dual-node machines requires a complete engineering pipeline, which can be broken down into the following key stages.

    1. Construction of a Native Distributed Training Framework

    The adaptation team adopted a native training path based on the FSDP (Fully Sharded Data Parallel) concept. The core idea of FSDP2 is not to replicate the full model onto every card, but to shard all model parameters, gradients, and optimizer states, temporarily aggregating them via collective communication when needed and releasing them immediately after. Compared to traditional data parallelism, FSDP reduces memory footprint by an order of magnitude, making it the mainstream solution for training large-parameter models.

    For a 3-trillion-parameter model, the training path also requires the superposition of multi-dimensional parallel strategies such as Tensor Parallelism (TP), Pipeline Parallelism (PP), and Expert Parallelism (EP). Previous industry practices have demonstrated that verifying fine-grained expert parallel solutions concurrently on domestic NPUs and general GPUs is feasible. This indicates that parallel strategies themselves are cross-hardware portable, with the key lying in whether the software stack can efficiently support the corresponding collective communication primitives.

    A simplified illustration of FSDP sharding is as follows:

    1. # Pseudocode: FSDP sharding wrapper
    2. model = TransformerBlock(hidden=..., experts=...)
    3. fsdp_model = FSDP2(
    4. model,
    5. sharding_strategy="FULL_SHARD", # Fully shard parameters/gradients/optimizer states
    6. mixed_precision=bf16, # BF16 for computation, FP32 for master weights
    7. device_mesh=mesh_2d, # 2D mesh: Data Parallelism x Expert Parallelism
    8. )

    2. Complete Pipeline from Model Loading to Gradient Synchronization

    Loading a trillion-parameter model is a challenge in itself: checkpoint files are often measured in terabytes, requiring support for sharded loading, weight re-sharding, and seamless integration with data parallelism. The complete training pipeline can be summarized in four stages:

    • Model Loading: Mapping checkpoint shards to the memory space of each card according to the topology to avoid single-card peak overruns.
    • Sharding Scheduling: Determining the execution location and parallel splitting method for each operator based on the device mesh.
    • Forward and Backward Computation: Multimodal inputs pass through the vision encoder and language backbone, with activations recomputed on-demand to trade compute for memory.
    • Gradient Synchronization: After backward propagation, ReduceScatter is used to complete gradient shard reduction, followed by the optimizer performing updates on the sharded states.

    3. Numerical Stability Validation Methods

    A key metric in the technical report is that all 16 training processes completed 400 continuous optimizer updates, with loss and gradient norms remaining finite throughout, and no numerical overflow or abnormal interruptions. This seemingly simple statement actually validates multiple capabilities:

    • Loss curves descending smoothly or remaining finite indicates that the forward, backward, and gradient synchronization computations are consistent with reference implementations, without accumulated operator precision deviations.
    • Gradient norms remaining finite throughout indicates no gradient explosions or NaN propagation, confirming the mixed precision scaling strategy is functioning correctly.
    • 400 steps without interruption on a 16-card, dual-node scale means the inter-node communication links, task orchestration, and fault tolerance mechanisms have passed real-world tests.

    For a training system, “being able to run continuously and stably for hundreds of steps” is the necessary threshold for moving from small-scale functional verification to large-scale pre-training. When scaling to more nodes later, the focus shifts to linear speedup and MFU (Model Flops Utilization).

    III. From “Capable of Training” to “Out-of-the-Box”: The Evolution Path of the Domestic Training Ecosystem

    It is worth noting that this is not an isolated verification case. According to public information, relevant teams have previously implemented several LLM training achievements based on domestic compute, including the complete training from scratch of a hundred-billion-parameter scientific foundation model, the full-stack native training of a 5D world model, and the full-process training of an embodied intelligence brain model. They are currently advancing toward trillion-parameter model training.

    These cases collectively point to the three-layer capability building of the domestic training ecosystem:

    1. Operator Layer: Covering high-frequency operators for LLM training (attention, MoE routing, normalization, optimizer kernels, etc.) and ensuring precision alignment with mainstream deep learning frameworks.
    2. Parallelism and Communication Layer: Providing out-of-the-box capabilities for FSDP, TP, PP, and EP, accompanied by high-performance collective communication libraries and topology-aware scheduling.
    3. Toolchain Layer: Including distributed checkpoint management, automatic splitting strategy recommendation, training monitoring and alerting (metrics like loss, gradient norm, throughput, memory watermark), and automatic fault recovery.

    For technical teams, evaluating whether a domestic training platform is mature can refer to a checklist: Does it support native training scripts for the target model architecture? Is there public continuous training stability data? Are precision alignment verification tools provided? Are checkpoint saving and restoration reliable? Is there public speedup data for multi-node scaling?

    Conclusion

    LLM training capability is the touchstone for evaluating the level of software-hardware collaboration in domestic compute. From “getting inference to run” to “stable full-pipeline training,” and eventually to “out-of-the-box training,” each step requires systematic refinement across operators, frameworks, communication, and toolchains. It is foreseeable that as more trillion-level training cases are implemented and verified, the engineering credibility of domestic full-function GPUs in the LLM training domain will be gradually established, providing the industry with a richer array of compute choices.