Practical Guide to Running Large Model Training on Domestic GPUs
This article explains how to validate and stabilize large model training on domestic GPU platforms, using a 400-step run on 16 GPUs across two nodes as an end-to-end acceptance milestone. It covers the main migration challenges—operator coverage, coupling between parallel strategies and interconnect topology, and numerical consistency—then outlines a reusable path from single-operator and single-layer alignment to multi-node training, along with topology matching, data pipeline design, fault tolerance, and a bottom-up method for performance tuning.
1. Why “Running 400 Steps” Is a Key Milestone
In large-scale pretraining, a complete training job often consists of thousands of iterations. Whether the pipeline is considered usable usually does not depend on peak compute ratings, but on whether it can advance several hundred iterations continuously and stably under a real parallel strategy. Choosing 400 steps as the validation window has clear engineering rationale:
- It covers the compilation and graph construction overhead during initialization, warm-up jitter in the first few steps, and throughput behavior after the system reaches steady state.
- It is enough to expose issues that only appear after multiple steps, such as memory leaks, gradient accumulation misalignment, and abnormal optimizer state updates.
- It makes the numerical convergence trend observable. Whether the loss curve decreases smoothly is a direct indicator of correctness in the compute graph and data pipeline.
Therefore, “completing 400 steps on 16 GPUs across two nodes” is essentially an end-to-end usability acceptance test, not merely a performance benchmark.
2. Where the Core Migration Challenges Lie
Migrating a training job from a mature hardware and software stack to a new accelerator platform concentrates the difficulty at three levels.
The first level is operator coverage. Using mainstream dense large model architectures as an example, high-frequency operators in the compute graph include normalization, element-wise multiply-add, scaled dot-product attention with masking, and various reduction operations. Any missing operator or semantic deviation will show up as numerical mismatch rather than a direct error, making troubleshooting extremely costly.
The second level is the coupling between communication and parallel strategies. Tensor parallelism is the most sensitive to bandwidth and is usually confined to the high-speed interconnect domain within a single node. Pipeline parallelism tolerates bandwidth better but is sensitive to bubbles. Data parallelism depends on the bucket size and overlap strategy for gradient reduction. Once these three are combined, a communication topology that does not match the physical interconnect can reduce throughput by a multiple.
The third level is numerical consistency. In mixed-precision training, loss scaling, reduction order, and accumulation precision all affect the final numerical trajectory. Migration validation must be measured against alignment with a reference implementation, not against whether the code simply runs.
3. A Reusable Implementation Path
1. Establish a Correctness Baseline on a Single GPU and a Single Layer First
Do not jump straight to multi-node, multi-GPU setups. A recommended order is: single-operator precision alignment → single-layer forward and backward alignment → single-GPU full-model overfitting on a small dataset → single-node multi-GPU → two-node multi-GPU. Keep an automatically executable validation script at each level, for example:
# Example: layer-by-layer numerical alignment checkdef check_layer(layer, x, ref_out, atol=1e-3, rtol=1e-3):out = layer(x)max_diff = (out - ref_out).abs().max().item()assert max_diff < atol + rtol * ref_out.abs().max().item(), \f"layer mismatch: {max_diff}"return max_diff
Small-dataset overfitting is the most valuable criterion: if the model cannot push the loss close to zero on a very small number of samples, the problem almost certainly lies in the pipeline rather than in the hyperparameters.
2. Match Parallel Strategies to the Interconnect Topology
At the scale of 16 GPUs across two nodes, a safe default configuration is: tensor parallelism no greater than the number of accelerators in a single node, pipeline parallelism corresponding to the number of nodes, and data parallelism carrying the remaining dimensions. Also pay attention to:
- Whether communication overlap between gradient reduction and backward computation is actually effective.
- Whether pipeline stage partitioning is balanced; the embedding layer and output layer in the first and last stages tend to become load hotspots.
- The memory budget must accommodate parameters, gradients, optimizer states, and activations at the same time; activation recomputation is an adjustable knob.
3. Keep the Data Pipeline from Becoming a Bottleneck
In large-scale training, common input-side problems include insufficient preprocessing threads, tail latency from uneven sample length distributions caused by the longest sequences, and checkpoint writes blocking the main training loop. In engineering practice, decouple data loading from training, use prefetching with a tiered local cache, write checkpoints asynchronously to high-throughput storage, and continuously observe throughput, memory usage, and temperature with logging services and monitoring alerts.
4. Fault Tolerance and Long-Run Stability
400 steps is only the starting point; real production training must deal with hardware failures and preemption. The system needs periodic checkpoints, automatic recovery from the latest checkpoint, faulty-card isolation, and job rescheduling. If running on a container platform and scheduling system, elastic fault tolerance should be a default capability rather than an add-on.
4. A Methodology for Performance Positioning
When throughput falls short of expectations, a bottom-up approach is the most efficient way to locate the issue: first look at the share of time spent on single-GPU operators, then the share of intra-node communication, and finally cross-node communication and waiting bubbles. There are three common conclusions: operators are not fused, which amplifies launch overhead; communication is not overlapped with computation and is therefore exposed; and load imbalance causes synchronization waits. The corresponding remedies are operator fusion and graph optimization, adjusting overlap and bucket strategies, and re-partitioning pipeline stages.
5. Conclusion
Running a large model training pipeline on a domestic accelerator platform is more about methodology than parameters: build confidence in correctness through layered alignment, unlock parallel efficiency through topology matching, and ensure long-run stability through data and fault tolerance. Baidu AI Cloud’s accumulated capabilities in heterogeneous compute scheduling, container platforms, object storage, and monitoring and alerting can provide engineering support for this kind of migration validation, helping “getting it running” move faster toward “running stably and cost-effectively.”
