End-to-End LLM Training on China-Developed GPU Clusters: A Technical Walkthrough of 400 Training Steps on 2 Nodes with 16 GPUs
This article explains the technical work required to run a complete large language model training pipeline on a cluster of China-developed GPUs. Using a two-node, 16-GPU setup as the case study, it covers operator and computation graph adaptation, hybrid parallelism strategies (DP/TP/PP/ZeRO), collective communication optimization, memory management, numerical correctness validation, and the engineering value of completing 400 training steps as a stability and performance baseline. Readers will learn the general methodology for getting LLM training working on any new accelerator platform.
1. Background: Why LLM Training Depends on a Complete Compute Stack
LLM training is not as simple as “having GPUs means you can train.” A complete training pipeline involves many interconnected components: operator adaptation, distributed sharding strategies, collective communication libraries, memory scheduling, data pipelines, checkpointing and resume, and monitoring/alerting. A weakness in any single link can at best degrade training efficiency and at worst crash the job or produce untrustworthy results.
In recent years, as the compute density and software-stack maturity of China-developed GPUs have continued to improve, using domestic accelerators for large-scale language model training has become a focus of industry attention. The goal of this practice was clear: on a cluster of two machines with a total of 16 accelerator cards, bring up a complete training pipeline for a large-parameter language model and stably complete 400 training steps as validation.
Choosing “400 steps” as the validation target has engineering significance: it covers every training stage—forward pass, backward pass, optimizer updates, and gradient synchronization—while running enough iterations to expose potential problems such as memory leaks, communication deadlocks, and numerical anomalies. It is a representative benchmark for validating training pipeline usability.
2. Core Technical Steps in Bringing Up the Training Pipeline
2.1 Operator and Computation Graph Adaptation
To run a training framework on heterogeneous hardware, the first problem to solve is operator coverage. The core structures of large language models include multi-head attention, feed-forward networks, and layer normalization. Among these, the attention mechanism (especially efficient attention implementations for long sequences) and fused operators require the most adaptation effort.
A typical adaptation workflow looks like this:
- Inventory the operators used by the model architecture and confirm, one by one, whether the target hardware provides an equivalent implementation;
- For missing operators, use a “high-precision decomposed implementation” as a fallback, prioritizing correctness;
- Perform targeted fusion and optimization on hotspot operators—for example, fusing bias addition and activation functions into a single kernel to reduce memory access overhead.
2.2 Choosing a Distributed Parallelism Strategy
Sixteen GPUs constitute a small-to-medium cluster, but a single card’s memory cannot hold a large model’s full parameters, gradients, and optimizer states. Multiple parallelism strategies must therefore be combined:
- Data Parallelism (DP): Each card holds a full model replica and processes a different data batch, with gradient synchronization at the end of each step;
- Tensor Parallelism (TP): Weight matrices in attention and feed-forward layers are sharded by rows or columns across multiple cards—well suited to intra-node setups with high-bandwidth interconnects;
- Pipeline Parallelism (PP): The model is split by layers across devices, with micro-batch pipelining to reduce bubble overhead—well suited to cross-node scenarios;
- Optimizer state sharding (ZeRO-style schemes): Optimizer states, gradients, and even parameters are sharded and stored in partitions, dramatically reducing memory usage.
On a two-node, 16-GPU topology, a common approach is to use tensor parallelism within each 8-GPU node (where intra-node interconnect bandwidth is high), data parallelism or pipeline parallelism across nodes (to reduce cross-node traffic), and optimizer state sharding to relieve memory pressure.
An illustrative parallelism configuration looks like this:
# Illustrative pseudo-code: parallelism dimension configurationparallel_config = {"tensor_parallel_size": 4, # Intra-node tensor parallelism"pipeline_parallel_size": 2, # Cross-node pipeline parallelism"data_parallel_size": 2, # Remaining dimension for data parallelism"zero_stage": 2, # Optimizer state and gradient sharding}
2.3 Optimizing Collective Communication
In cross-node training, the performance bottleneck is often communication rather than computation. During gradient synchronization, the data volume of AllReduce/ReduceScatter operations scales with parameter count. Common engineering optimizations include:
- Overlapping communication with computation: Interleave backward computation with asynchronous communication of gradient buckets to hide communication latency;
- Gradient bucketing: Group gradients into buckets for batched communication, reducing the number of communication calls;
- Quantized or compressed communication: Downgrade gradient precision during transmission when it does not noticeably affect convergence;
- Topology-aware routing: Route intra-node traffic over high-bandwidth links and inter-node traffic over dedicated links to avoid contention.
2.4 Memory Management and Training Stability
Activation memory overhead in long-sequence training is enormous. In practice, the following techniques are typically combined:
- Activation checkpointing: Save only key checkpoints and recompute intermediate activations during the backward pass, trading compute time for memory;
- Mixed-precision training: Perform matrix multiplications in low precision while maintaining high-precision master weights and loss scaling, balancing speed and numerical stability;
- Dynamic loss scaling: Automatically adjust the scaling factor to avoid training stalls caused by low-precision gradient underflow.
2.5 Numerical Consistency and Correctness Validation
Getting the training pipeline running cannot be judged by the absence of errors alone; computational correctness must also be verified. Common validation methods include:
- Single-GPU baseline alignment: Run a baseline on a single GPU with small-scale data and a few steps, and check whether the loss curve decreases reasonably;
- Multi-GPU equivalence verification: Compare loss curves for the same configuration under different parallelism partitions; deviations should remain within numerical error bounds;
- Long-run stability observation: Continuously monitor gradient norms, loss spikes, and NaN detection throughout the 400 steps to confirm the numerical path is healthy.
3. The Engineering Value of a 400-Step Training Validation
The significance of completing 400 training steps can be summarized in three points:
- Pipeline completeness: From data loading, tokenization, and batching to forward/backward passes, optimizer updates, log persistence, and checkpoint saving, the entire flow runs without blockage—proving that all layers of the software stack work together;
- Stability validation: Smooth memory usage across many iterations, no communication deadlocks, and no precision anomalies indicate that the system has a reliable foundation for long-duration training;
- Performance baseline establishment: Throughput statistics from the 400 steps can be used to estimate the total time required for training convergence, providing a data basis for scaling the cluster and planning future training runs.
4. The Evolution Path from Validation to Large-Scale Training
Successful validation on two nodes and 16 GPUs is only the starting point. Moving toward larger-scale training introduces new challenges:
- Fault tolerance: The larger the scale, the higher the probability of hardware failure. Mechanisms for automatic checkpointing and fast training recovery are needed, typically combined with object storage for model snapshots and monitoring/alerting services for real-time anomaly detection;
- Communication scaling efficiency: As parallelism increases, the communication share rises, requiring parallel strategies and sharding granularity to be retuned;
- Elastic scheduling: Use container platforms and cluster scheduling capabilities to achieve resource isolation and priority management across multiple jobs;
- Data pipeline scaling: Use message queues and distributed caching to guarantee throughput and ordering for large-scale data supply.
5. Conclusion
Completing a 400-step training validation on two nodes with 16 GPUs is essentially an end-to-end health check of the entire technical chain—“compute hardware, software stack, and parallel framework.” It demonstrates that domestically developed compute already has a usable engineering foundation for LLM training scenarios. For developers, understanding the general methodology—parallelism strategy selection, communication optimization, memory management, and numerical validation—is more valuable than remembering any single benchmark result. These are core capabilities required for LLM training on any compute platform. Looking ahead, as the software ecosystem continues to mature and cluster interconnect technology evolves, the path for domestically developed compute to support larger-scale and longer-duration training workloads is already clearly visible.
