Training Large Language Models on Domestic GPUs: From Operator Alignment to End-to-End Stability
This article explains why inference compatibility does not equal training compatibility, and outlines the engineering work required to train large models on domestic GPU platforms. It covers operator validation, distributed training, collective communication, numerical stability, small-cluster testing, and the engineering practices needed to evolve from one-off adaptation projects to a reusable “train out of the box” platform.
1. Training Adaptation and Inference Adaptation: Two Frequently Confused Concepts
In the large-model ecosystem, it is common to hear that “a chip has been adapted for a particular model.” However, the term adaptation can refer to very different types of technical work. Clarifying this distinction is essential to understanding the challenges discussed in this article.
Inference adaptation aims to enable a model to perform forward computation on a specific hardware platform. Core tasks include mapping model operators—such as attention, normalization, and activation functions—to the target hardware’s compute libraries; handling data-type conversion and operator fusion; and optimizing memory usage and throughput for inference workloads. Because inference involves only forward propagation, without backpropagation, gradient synchronization, or parameter updates, its engineering complexity is relatively manageable. Many “Day 0 adaptations” announced by chip vendors fall primarily into this category.
Training adaptation, by contrast, requires the complete training loop to run on the target platform. This includes forward computation, backpropagation, gradient calculation and aggregation, optimizer-state updates, distributed communication, and checkpoint-based resumption.
Training is highly sensitive to numerical precision. In mixed-precision training, any deviation in loss scaling, the accumulation order used during gradient reduction, or the rounding behavior of an operator at different precisions can accumulate over tens of thousands of steps. Eventually, these deviations may cause the loss to diverge or gradients to overflow.
Therefore, the ability to produce inference results on a chip does not mean that a model can be trained on that chip, let alone that the model was pretrained there. In practice, many claimed adaptations between chips and open-source models stop at inference-operator validation. To assess the quality of a training adaptation, it is necessary to determine whether the complete training pipeline has been connected and whether reproducible experimental data is available to support the claim.
2. The Core Engineering Pipeline for Training Adaptation
A complete adaptation of a large-model training workload usually needs to cover the following areas.
2.1 Operator-Level Alignment
Large-model training involves a substantial number of operators. Mixture-of-Experts (MoE) architectures add further complexity through expert routing, load balancing, and expert-parallel communication.
The first requirement is to ensure that every operator produces results on the target hardware that are consistent with the reference implementation. This is typically verified through per-operator numerical-error tests: random inputs are generated, the target output is compared with the reference output, and the relative error is kept within a threshold permitted by the numerical precision.
Fused operators also require validation to ensure that their numerical behavior is consistent with the corresponding unfused operations.
2.2 Deployment of Distributed Training Strategies
Models with trillions or tens of trillions of parameters cannot be trained on a single device or even a single machine. They require combinations of data parallelism, tensor parallelism, pipeline parallelism, expert parallelism, and sharded parameter-parallel approaches commonly associated with Fully Sharded Data Parallel (FSDP).
Sharded approaches divide model parameters, gradients, and optimizer states across compute nodes. During training, the required data is gathered as needed and then sharded again. This communication pattern is considerably more complex than traditional data parallelism.
The adaptation effort must establish a native sharded-training path that covers the entire process:
- Model loading
- Parameter-shard scheduling
- On-demand communication during forward and backward propagation
- Gradient reduction
- Optimizer updates
For complex architectures, including multimodal models, the correctness of sharding boundaries must also be verified.
2.3 Communication Libraries and Collective Operations
Cross-node training depends on efficient collective communication primitives such as AllReduce, AllGather, and ReduceScatter.
The adaptation team must verify both the correctness and performance of the communication library on the target hardware. It must also address optimizations such as topology awareness and overlap between communication and computation. Otherwise, communication overhead may consume the benefits gained from scaling to multiple devices.
2.4 Numerical Stability
Mixed-precision training requires mechanisms for loss scaling, gradient-norm monitoring, and overflow detection.
The adaptation process should establish observability for numerical health. Key indicators include:
- Whether the loss decreases smoothly
- Whether gradient norms remain finite and within a reasonable range
- Whether abnormal spikes occur
These indicators provide direct evidence of whether the training pipeline is functioning correctly.
3. How to Validate Training Adaptation: A Small-Cluster Stability Testing Method
During the adaptation phase, compute resources are often limited, making it impractical to run full pretraining on thousands of GPUs. A more appropriate approach is to design a small-scale, end-to-end, long-duration stability test.
A representative methodology includes the following:
- Use a cross-node configuration with two machines and 16 training GPUs. This covers both intra-node and inter-node communication paths, allowing the network and collective communication to be tested under realistic conditions.
- Require all training processes to complete hundreds of consecutive optimizer updates—for example, 400 steps—instead of merely verifying that a few steps can run. Numerical issues often appear only after errors accumulate.
- Monitor the loss and gradient norms throughout the run. Both should remain finite, with no NaN or Inf values, abnormal termination, or stalled processes.
- Record the duration and throughput of every step to evaluate whether multi-GPU scaling efficiency remains within a reasonable range.
Although this test is relatively small, it covers all critical components of the training pipeline. If 16 processes can complete hundreds of optimization steps continuously and stably, this indicates that the complete path—from operators and sharding to communication and optimizer updates—is functioning. Further scaling is then primarily an engineering-tuning challenge rather than a fundamental pipeline-correctness issue.
Small-cluster validation is only the starting point. As the system scales, production-grade requirements must also be addressed, including fault recovery and checkpoint-based resumption, elastic scheduling, checkpoint save and load efficiency, and automatic isolation of nodes that exhibit long-tail failures. These capabilities determine whether domestic compute infrastructure can support truly long-running, large-scale pretraining workloads.
4. From “Can Train” to “Train Out of the Box”: Building an Engineering System
Completing the training adaptation of a single model demonstrates a project-specific capability. The greater industry value lies in building a reusable engineering system that enables new models to be migrated quickly and at lower cost.
This requires sustained investment at three levels.
4.1 Operator and Compiler Layer
The platform needs an operator library covering mainstream large-model architectures, along with compiler capabilities such as automatic mixed precision, operator fusion, and graph optimization. These capabilities reduce the amount of manual work required for each model.
4.2 Framework and Toolchain Layer
The platform should provide interfaces compatible with mainstream training frameworks, automated tools for configuring distributed strategies, training-performance profilers, and numerical-diagnostics tools. These capabilities reduce the learning curve for users migrating from conventional GPUs to domestic platforms.
In cloud-based deployments, training platforms can also combine container orchestration, logging, monitoring, and alerting services to support lifecycle management and observability for training jobs. Building a training platform on top of general cloud capabilities provided by vendors such as Baidu AI Cloud is one common industry approach.
4.3 Methodology and Knowledge Accumulation
Issues discovered during each model adaptation, along with optimization experience, should be documented and converted into automated test cases. Over time, this creates a regression-testing system that helps ensure software-stack upgrades do not compromise the training correctness of models that already work.
5. Conclusion
Domestic compute platforms are evolving from being “usable for inference” to supporting “functional training,” and eventually to delivering training that is reliable and convenient in production.
The quality of an adaptation should not be judged by the phrase “adaptation completed” in a press release. The more important questions are:
- Has the complete training pipeline been connected?
- Is reproducible stability data available?
- Has a reusable engineering system been established?
When training adaptation evolves from project-based troubleshooting into a standardized capability, the goal of training advanced large models on domestic GPUs out of the box becomes achievable. Only then can the domestic compute ecosystem build a strong and sustainable position in the era of large models.
