Running Large Model Training on Domestic GPU Clusters: Practices and Lessons Learned
Training large language models on domestic GPU clusters is becoming increasingly practical as domestic hardware matures. This article walks through the key steps of validating an end-to-end training pipeline using a representative scenario: a two-node, 16-GPU setup running 400 training steps. It covers environment adaptation and operator alignment, parallelism strategy design (tensor, pipeline, and data parallelism), memory optimization, communication tuning, key metrics to monitor during validation, and the challenges involved in scaling from small-scale validation to large-scale training—offering engineering teams a practical methodology for building diversified AI compute infrastructure.
Running Large Model Training on Domestic GPU Clusters: Practices and Lessons Learned
In recent years, the parameter scale of large language models has continued to grow, placing extremely high demands on compute infrastructure. As domestic GPU capabilities improve, more and more teams are attempting to run large model training workloads on domestic compute platforms. Using a representative validation scenario—a two-node, 16-GPU setup completing 400 training steps—this article systematically reviews the key technical steps required to bring up a large model training pipeline on domestic GPU clusters, providing a reference for engineering teams pursuing compute diversification.
1. Why “Completing 400 Steps” Is an Important Milestone
In the engineering practice of large model training, “running” does not mean “running well.” When a training job executes hundreds of steps stably, it usually indicates that the following core issues have been resolved:
- Software and hardware stack compatibility: The entire technology stack—from drivers, operator libraries, and communication libraries to the deep learning framework—works correctly together on the target hardware, with no blocking defects.
- Reasonable memory and compute resource configuration: Model parameters, gradients, optimizer states, and activations are distributed sensibly within per-GPU memory constraints, without frequent out-of-memory errors.
- Stable distributed communication: Gradient synchronization and parameter sharding communication across multiple nodes and GPUs runs stably for extended periods, with no obvious throughput degradation.
- Initial numerical correctness: The loss curve decreases as expected, with no obvious gradient explosions, numerical divergence, or precision anomalies.
Therefore, while “two nodes, 16 GPUs, 400 steps” is modest in scale, it constitutes a complete end-to-end validation: it proves that every stage of the training pipeline—from data loading and forward/backward computation to parameter updates—forms a closed loop.
2. Pre-Training Environment Adaptation and Operator Alignment
The first step in training on domestic GPUs is usually environment adaptation, which is also the most commonly underestimated stage.
1. Framework and Operator Library Matching
Mainstream training frameworks typically provide adaptation layers for specific hardware backends. Engineering teams need to confirm:
- Whether the combination of framework version, GPU driver, and runtime library versions has been validated;
- Whether the core operators involved in the model (such as attention computation, normalization, and activation functions) have efficient implementations on the target hardware;
- For operators without native support yet, whether to substitute equivalent operator combinations or fill the gaps with custom operators.
A common practice is to build an “operator coverage checklist,” verifying the support status and performance of every operator in the model’s computation graph on the target platform, to avoid problems surfacing mid-training.
2. Precision Strategy Confirmation
Large model training commonly uses mixed-precision schemes. Teams need to confirm the hardware’s support for half-precision floating-point formats (such as FP16 and BF16), and choose an appropriate master weight format and gradient scaling strategy accordingly. BF16, with its larger dynamic range, is generally more robust for large model training—but only if the hardware and operator libraries provide full support for it.
3. Parallelism Strategy Design: How 16 GPUs Collaborate
The scale of two nodes and 16 GPUs means the parallelism strategy must balance data parallelism, tensor parallelism, and pipeline parallelism. For a model in the tens-of-billions to hundred-billion-parameter range, a common design approach is as follows:
1. Tensor Parallelism (TP)
Matrix multiplications within a single layer are split across multiple GPUs. Tensor parallelism has the highest communication frequency (communication is required in both the forward and backward passes of every layer), so it is typically confined within a single machine with high-bandwidth interconnects—for example, TP=8 or TP=4 across 8 GPUs within one node.
2. Pipeline Parallelism (PP)
The model is split by layers across different devices, with each device handling a different stage of the model. Pipeline parallelism has lower communication volume and suits cross-node deployment, but it introduces pipeline bubbles; increasing the number of micro-batches helps amortize the bubble overhead.
3. Data Parallelism (DP)
Data parallelism is applied across the remaining dimensions, combined with parameter sharding (distributing optimizer states, gradients, and parameters across GPUs) to further reduce memory usage. This is the key technique for fitting large models into limited GPU memory.
A typical combination example (for illustration only):
Total GPUs = 16 (2 nodes × 8 GPUs)TP = 4 (intra-node high-speed interconnect)PP = 2 (cross-node, layers evenly split)DP = 2 (TP × PP × DP = 16)Global batch size = micro-batch size × DP × gradient accumulation steps
The core principle when choosing a parallelism configuration is: place the parallelism dimension with the most frequent communication within the highest-bandwidth interconnect domain, and run small-scale experiments to sweep throughput across different configurations, selecting the optimal combination.
4. Memory Optimization: Making the Model “Fit and Run”
GPU memory is the primary constraint in large model training. Beyond parameter sharding, several industry-standard optimization techniques apply:
- Activation checkpointing: Only a subset of intermediate activations is saved during the forward pass and recomputed during the backward pass, trading roughly 30% additional computation for substantial memory savings. This is highly cost-effective when compute is relatively abundant but memory is tight.
- Selective recomputation: Recompute only layers with large memory footprints and low computational cost (such as certain intermediate results in attention), balancing time and space overhead.
- Micro-batch tuning: Larger micro-batches reduce the pipeline bubble ratio but increase activation memory, requiring repeated experimentation to balance throughput and memory.
- Optimizer state sharding: Distributing optimizer states such as momentum and second moments evenly across GPUs in the data-parallel group reduces this memory overhead to 1/N of the original.
5. Communication Tuning and Cluster Interconnects
In cross-node training, the performance bottleneck often lies in communication rather than computation. Engineering teams should focus on:
- Matching the communication library to the network topology: Confirm that the collective communication library (primitives such as AllReduce and AllGather) has topology-aware optimizations on the target network (RoCE, InfiniBand, or intra-node high-speed interconnects), so that communication takes the shortest paths.
- Overlapping communication and computation: Overlap gradient communication with backward computation to hide communication latency; most modern frameworks achieve this through bucketing, and bucket size settings significantly affect overlap effectiveness.
- Bandwidth benchmarking: Before formal training, use standard collective communication benchmarks to verify actual intra-node and cross-node bandwidth, compare against theoretical values, and troubleshoot NIC and switch configuration issues.
6. What to Observe During the 400-Step Validation
Completing the run is only the starting point; the 400-step validation itself serves as a systematic health check. Key metrics to monitor include:
- Loss curve: Whether it decreases smoothly, without spikes or plateaus; it can be aligned against the same configuration on reference hardware (the loss curves should largely overlap, allowing for small deviations at floating-point error magnitude).
- Throughput metrics: Tokens processed per GPU per second, total training throughput, and whether hardware utilization (MFU) falls within a reasonable range.
- Memory usage: Whether memory is balanced across GPUs, and whether a safe margin remains below the limit.
- Gradient norms: Whether abnormal fluctuations occur, and whether gradient clipping is triggered frequently.
- Communication share: The proportion of end-to-end time spent on communication, to determine whether the parallelism strategy needs further adjustment.
Additionally, it is advisable to deliberately include fault-tolerance tests during these 400 steps—for example, verifying that checkpoint saving and resumption correctly restore the training state, which is critical for subsequent long-duration training.
7. From Validation to Scale-Up: Challenges Ahead
After passing the two-node, 16-GPU, 400-step validation, scaling to larger training runs requires addressing:
- Scaling efficiency: As GPU counts increase, the share of communication overhead rises, requiring a re-evaluation of the parallelism strategy;
- Long-duration stability: Continuous runs spanning thousands to tens of thousands of GPU-hours impose higher requirements on hardware failure rates and automatic recovery mechanisms;
- Data pipeline: At large scale, data loading must not become a bottleneck, requiring an efficient data supply chain that combines object storage, caching, and prefetching mechanisms;
- Observability: Using logging services and monitoring/alerting systems, observe compute, communication, memory, temperature, and other metrics across all nodes in the training cluster end to end, enabling rapid anomaly diagnosis.
Conclusion
Bringing up a large model training pipeline on domestic GPU clusters is a systematic engineering effort involving operator adaptation, parallelism design, memory optimization, communication tuning, and stability validation. Validation milestones like “two nodes, 16 GPUs, 400 steps” mark a platform’s transition from “it runs” to “it is usable.” For engineering teams, what matters most is distilling a reusable methodology from this process: validate in small steps first, then scale up gradually, and let data drive every configuration decision. As the domestic compute ecosystem continues to mature, such practices will help more enterprises build diversified, controllable, and sustainable infrastructure for large model training.
