Running LLM Training on Domestic AI Chips: A Complete Multi-GPU Cluster Walkthrough
This article explains how a 16-card cluster of domestically developed AI accelerators was used to run an end-to-end large language model training pipeline, covering the hardware setup, software stack layers, hybrid parallelism strategy, operator adaptation, numerical alignment, communication optimization, and checkpoint-based fault tolerance, along with lessons learned for teams validating training on alternative accelerators.
1. Background: Why Validate LLM Training on Domestic Chips
Training large language models is expensive and time-consuming, and mainstream solutions have long depended on a specific vendor’s accelerators and their accompanying software stack. As demand for self-sufficient compute grows, being able to run the complete LLM training pipeline on domestically developed general-purpose GPU chips has become a key litmus test for the maturity of the domestic compute software ecosystem.
A representative validation effort looks like this: using two servers with 16 domestic AI accelerator cards in total, running the training workflow of an open-source large language model (here referencing one of the well-known “K-series” models in the community), and completing several hundred consecutive training steps. The point of such validation is not to produce a final model, but to prove that the full pipeline—data loading, tokenization, distributed parallelism, forward and backward passes, optimizer updates, and checkpoint resumption—can run stably on domestic hardware.
2. Validation Environment and Overall Architecture
2.1 Hardware and Network Configuration
A typical two-node, sixteen-card setup looks like this:
- Each server carries 8 domestic AI accelerator cards, connected by a high-bandwidth interconnect bus for intra-node communication;
- The two servers are linked via high-speed Ethernet or a dedicated interconnect fabric, ensuring sufficient throughput for cross-node gradient and parameter synchronization;
- Each node is equipped with large-capacity memory and NVMe storage for the training dataset and checkpoints.
2.2 Software Stack Layers
The training software stack for domestic chips typically consists of four layers:
- Driver and runtime layer: handles device management, memory allocation, and compute stream scheduling;
- Compute library layer: provides high-performance implementations of operators such as matmul, convolution, and normalization;
- Distributed communication layer: implements collective communication primitives such as AllReduce, AllGather, and ReduceScatter;
- Training framework adaptation layer: plugs the hardware into mainstream deep learning frameworks through their device plugin mechanism, so upper-layer training code requires little or no modification.
# Example: specifying the domestic accelerator via a framework device pluginimport frameworkframework.set_device("gcu") # Register the device typestrategy = framework.DistributedStrategy()strategy.pipeline_parallel_degree = 2strategy.tensor_parallel_degree = 2strategy.sharding_parallel_degree = 2
3. Key Techniques and Adaptation Points
3.1 Designing the Hybrid Parallelism Strategy
At the 16-card scale, a common partitioning scheme combines data parallelism, tensor parallelism, and pipeline parallelism:
- Tensor parallelism: splits the weight matrices of attention and feed-forward layers by column or by row; communication happens between cards and depends on the high-bandwidth interconnect;
- Pipeline parallelism: partitions by Transformer layer depth; when deploying across nodes, it is preferable to split along pipeline stage boundaries to minimize cross-node traffic;
- Data parallelism / ZeRO sharding: shards optimizer states and gradients across cards to reduce peak memory usage.
A reference configuration is: tensor parallelism degree 2 × pipeline parallelism degree 2 × data parallelism degree 4, totaling 16 cards. This partitioning strikes a balance between cross-node and intra-node communication.
3.2 Operator Adaptation and Numerical Alignment
Whether the training pipeline can actually run comes down to the operator level:
- Operator coverage: fused operators commonly used in LLMs—such as FlashAttention-style kernels, RMSNorm, and SwiGLU—must have equivalent implementations;
- Precision strategy: adopt BF16 mixed-precision training while keeping master weights and optimizer states in FP32 to avoid low-precision accumulation error;
- Numerical alignment verification: with identical data and hyperparameters, compare the loss curve on domestic cards against reference hardware step by step, checking whether the loss over the first few hundred steps shows a consistent convergence trend. This is the gold standard for judging whether the pipeline truly works end to end.
3.3 Communication Optimization
Cross-node AllReduce is often the bottleneck. Common optimization techniques include:
- Gradient bucketing with computation-communication overlap, so backpropagation and gradient synchronization proceed in parallel;
- Enabling compression or hierarchical aggregation for cross-node communication (reduce within the node first, then AllReduce across nodes);
- Tuning communication timeout and retry parameters to improve robustness during long training runs.
3.4 Fault Tolerance and Checkpoint Resumption
Several hundred consecutive training steps demand high stability. In practice, this requires:
- Saving checkpoints at fixed intervals—the trio of model weights, optimizer states, and dataloader position;
- Performing a dry run on a small dataset before training to verify the full load–save–restore workflow;
- Monitoring metrics such as memory usage, card temperature, and communication latency to detect abnormal nodes early.
4. Validation Results and Observations
In the two-node, sixteen-card environment, the validation completed several hundred consecutive training steps, the loss curve followed the expected downward trend, and no process crashes or out-of-memory errors occurred throughout. Several observations are worth noting:
- Software stack maturity is decisive: meeting hardware compute targets is only the foundation; operator completeness and framework adaptation quality directly determine whether training can run at all;
- Do numerical alignment early: completing numerical alignment at the single-card, small-model stage dramatically reduces the cost of multi-node debugging;
- Ecosystem compatibility lowers migration cost: if training code needs no large-scale rewriting, community models and toolchains can be reused quickly, which is critical for the adoption of domestic compute.
5. Implications for Developers
For teams planning to train LLMs on domestic compute platforms, the following progression is recommended:
- Start small, scale up: validate step by step from single-card inference, to single-card training, to multi-card within one node, then expand to multiple nodes;
- Build an alignment baseline: keep a record of loss and gradient norms from reference hardware for quantitative verification;
- Invest in tooling: the quality of supporting tools—performance profiling, communication analysis, log collection—often affects real-world efficiency more than peak compute;
- Track community progress: adaptation announcements for mainstream open-source models usually document verified parallelism configurations and known issues, and can be referenced directly.
6. Conclusion
Running several hundred LLM training steps on a two-node, sixteen-card cluster is an important step for domestic AI chips on the path from “usable” to “practical.” What it validates is not just hardware compute, but the coordinated capability of the entire software stack—drivers, operator libraries, communication libraries, and framework adaptation. As the ecosystem continues to mature, the usability and efficiency of domestic compute in LLM training scenarios will keep improving, giving developers a broader range of compute options.
