LLM Training Pipeline on Domestic AI Accelerator Clusters: A Dual-Node, 16-Card Validation Practice
This article examines what it takes to bring up an end-to-end large language model training pipeline on a dual-node, 16-card cluster built on domestic GPUs. It covers the layered training stack, parallel strategy design, operator adaptation and numerical consistency checks, and a 400-step acceptance process for correctness, stability, performance repeatability, and checkpoint recovery. It also summarizes common multi-node failures and production-readiness considerations, offering a practical layer-by-layer validation methodology for teams planning LLM training on domestic compute.
1. Background: Why “Getting the Training Pipeline to Run” Deserves Attention
In large-model engineering, “getting training to run” and “getting inference to run” are problems of very different difficulty. Inference mainly tests operator coverage and memory management. Training adds backpropagation, gradient synchronization, optimizer state management, mixed-precision numerical stability, and a series of other complex components. When a training pipeline can move from initialization and data loading through forward and backward computation and gradient communication to a stable decline in loss, it means that the underlying hardware drivers, communication libraries, parallel frameworks, and operator implementations have all withstood real workloads.
Recent industry practice has shown that a dual-node, 16-card cluster built on domestic GPUs can complete hundreds of steps of full training for mainstream large-model architectures, with a loss curve that meets expectations. The value of this kind of validation is not the number of steps itself, but the fact that it demonstrates that the domestic compute stack already has the basic capability to support large-model training. This article uses that as a starting point to systematically break down the engineering and technical points that need attention when bringing up a training pipeline in a multi-node, multi-card environment.
2. Overall Architecture Layers of the Training Pipeline
A complete large-model training system can be divided into four layers. A problem in any layer will cause training to fail or make the results untrustworthy:
1. Hardware and driver layer: This includes the accelerator cards themselves, intra-node interconnect (such as high-speed buses), and inter-node network (such as an RDMA network). This layer determines the upper limit of compute power and communication bandwidth.
2. Communication and runtime layer: This is responsible for efficient implementations of collective communication primitives such as AllReduce, AllGather, and ReduceScatter. In multi-card training, gradient synchronization accounts for a significant proportion of time, and the quality of the communication library directly determines scaling efficiency.
3. Parallel framework layer: This implements scheduling logic for strategies such as data parallelism, tensor parallelism, and pipeline parallelism, partitioning models and data across devices for collaborative computation.
4. Model and algorithm layer: This includes model architecture definition, operator implementation, mixed-precision strategy, and optimizer. The main workload of domestic hardware adaptation is often concentrated in operator completion and numerical alignment at this layer.
The approach to pipeline validation should proceed layer by layer: first run a small model on a single card, then validate communication with multiple cards on a single node, and finally scale to multiple nodes and replace the model with the target scale.
3. Parallel Strategy Design for a Dual-Node, 16-Card Setup
Taking two nodes with eight cards each as an example, a reasonable parallel strategy needs to balance memory usage, communication overhead, and computational efficiency. A common combination is:
- Tensor parallelism within a node: Use the high-bandwidth intra-node interconnect to carry frequent tensor-splitting communication.
- Data parallelism or pipeline parallelism across nodes: Cross-node communication is relatively less frequent, making it suitable for slower links.
- Gradient accumulation: When memory is constrained, accumulate multiple small batches over several steps to effectively expand the global batch size.
An illustrative startup configuration is shown below (neutralized):
# Parallel dimensions: TP=8 (intra-node), DP=2 (inter-node)parallel_config = {"tensor_parallel_size": 8,"pipeline_parallel_size": 1,"data_parallel_size": 2,"micro_batch_size": 4,"gradient_accumulation_steps": 8,"mixed_precision": "bf16",}
It is important to emphasize that parameter values must be derived jointly from model scale, memory capacity, and sequence length; they cannot be copied mechanically. For example, activation memory grows quadratically with sequence length when recomputation optimization is not used. Long-sequence scenarios often require activation recomputation or sequence parallelism to relieve memory pressure.
4. Operator Adaptation and Numerical Consistency Validation
The core workload of domestic hardware adaptation is at the operator layer. Core operators involved in mainstream large-model architectures, such as attention mechanisms, normalization, and rotary position encoding, need correct and efficient implementations on the target hardware. Practice suggests a three-step approach:
Step 1: Single-operator alignment. Run each core operator separately on a CPU reference implementation and on the domestic hardware, then compare whether the output error is within the allowable range for floating-point precision.
Step 2: Subgraph-level validation. Use a single Transformer layer as the unit for forward and backward numerical comparison, and investigate error accumulation after operators are combined.
Step 3: Full-network short-training validation. Train for several steps with small batches and observe whether the loss decline curve is consistent with a baseline on reference hardware. If the loss values align in the first few dozen steps, it usually indicates that the forward and backward computation pipeline is basically correct.
For mixed precision, bf16 has a wider dynamic range than fp16 and offers better numerical stability in large-model training. It is the recommended choice in most scenarios, but monitoring of loss scaling and gradient overflow is still required.
5. Stability Acceptance Criteria Around a “400-Step” Milestone
Why does industry practice often use hundreds of steps as a milestone for pipeline validation? Because short-cycle training is enough to expose the vast majority of engineering problems:
- Correctness: The loss over the first 400 steps should show a monotonic or fluctuating downward trend, and the decline should be comparable to the reference baseline.
- Stability: Continuous operation for several hours should not produce abnormal interruptions, memory leaks, or communication timeouts.
- Performance repeatability: Step time should have low variance across multiple measurement rounds, indicating no hidden synchronization bottleneck.
- Recoverability: Save and load a checkpoint midway through training; after recovery, the loss should continue seamlessly.
During validation, it is recommended to record per-step loss, learning rate, gradient norm, step time, memory usage, and the proportion of communication time, forming an acceptance report that can be traced back. In particular, sudden changes in gradient norm are often an early signal of numerical or data problems.
6. Common Issues and Troubleshooting Approaches
High-frequency problems in multi-node training include:
- Communication timeout: Check cross-node network connectivity and NIC binding configuration, and confirm that the collective communication library uses the correct network interface.
- Out of memory (OOM): Check activation memory usage first; enable activation recomputation or reduce the micro-batch size.
- Loss divergence: Check the learning rate setting, whether the data pipeline is shuffling correctly, and whether overflow occurs under mixed precision.
- Multi-node performance below expectations: Use communication benchmark tools to measure intra-node and inter-node bandwidth separately, locate the bottleneck, and then adjust the parallel partitioning method.
7. Production-Oriented Considerations
Getting the pipeline to run is only the starting point. Moving toward production also requires fault tolerance and automatic recovery at larger cluster scales, elastic training capability, unified scheduling of training and inference resources, and an observability system built around general cloud capabilities such as object storage, logging services, and monitoring and alerting. In this direction, general infrastructure capabilities provided by cloud platforms such as Baidu AI Cloud—including high-performance networking, distributed storage, and container orchestration—can support the construction and operation of training clusters and help teams focus on algorithms and business logic.
8. Conclusion
Completing hundreds of training steps on a dual-node, 16-card cluster may look like just an engineering milestone, but it is in fact an end-to-end test of the hardware, communication, framework, and algorithm layers. For teams planning to conduct large-model training on domestic compute, it is advisable to follow a methodology of “layered validation, numerical alignment, and metric traceability” and proceed steadily. As the domestic software and hardware ecosystem continues to mature, the adaptation cost of training pipelines will continue to decrease, and the prospect of domestic compute carrying large-scale training workloads is worth anticipating.
