Practical Guide to Bridging the LLM Training Pipeline on Domestic GPUs
This article walks through the engineering practice of running a full pre-training pipeline for a large language model on domestic GPUs, using two servers and 16 accelerators across 400 stable training steps. It focuses on closing the loop across data loading, forward and backward passes, gradient synchronization, optimizer updates, and checkpoint save and restore. The article breaks down four common blockers—driver and runtime consistency, multi-node communication topology, parallelism strategy, and numerical stability—and outlines observability metrics, fault-tolerance design, and acceptance criteria for validating that the pipeline is truly production-ready.
1. Background and Why This Matters
A notable engineering milestone has emerged in the industry: a full pre-training pipeline for a large-scale language model has been run end to end on domestic graphics processors, using two servers with 16 accelerators in total and advancing stably through 400 training steps. The key point is not simply that it “runs,” but that the loop is closed—data loading, forward computation, backward propagation, gradient synchronization, optimizer updates, and checkpoint saving and restoration are all complete, with no missing stages and no silent errors.
Why is 400 steps a meaningful threshold? Failures in large model training often do not appear at step one; they surface gradually after dozens of steps: communication timeouts, numerical overflow, accumulating memory fragmentation, data pipeline jitter, and corrupted checkpoints. Advancing several hundred steps continuously with a smoothly decreasing loss curve indicates that the pipeline has a solid foundation for further scaling.
It is worth emphasizing that this type of validation falls within general engineering practice, and any domestic computing platform needs to go through a similar stage. This article does not target any specific product; instead, it abstracts a reusable methodology.
2. Four Key Blockers in Bridging the Pipeline
2.1 Driver and Runtime Consistency
The first hurdle for heterogeneous computing is software stack alignment. Driver versions, runtime libraries, communication libraries, and compiler versions need to form a validated combination, avoiding scenarios where “it runs on a single machine but crashes across multiple machines.” A recommended approach is to lock the version matrix into a container image and prohibit drift between nodes.
2.2 Multi-Node Communication Topology
Two nodes with 16 cards mean cross-node bandwidth becomes the bottleneck. You need to confirm the communication path of each card, topology-aware process binding, and whether hierarchical reduction is enabled (aggregate within a node first, then exchange across nodes). Without topology awareness, traffic will take detours and efficiency will drop significantly.
# Example: run a communication self-check and topology confirmation before launchrun_comm_check --topology=auto --report=./comm_report.jsonbind_procs --numa-aware --gpu-aware
2.3 Parallelism Strategy Partitioning
Data parallelism, tensor parallelism, and pipeline parallelism need to match the number of cards, memory capacity, and layer structure. Splitting too finely amplifies the proportion of communication; splitting too coarsely triggers memory overflow. A practical approach is to first get it running with the minimum viable parallelism, then scale up gradually.
2.4 Numerical Stability
Mixed-precision training requires reasonable loss scaling and gradient clipping strategies to avoid loss spikes or prolonged stagnation. Within 400 steps, the loss should show a monotonically decreasing trend; if a plateau appears, prioritize checking learning rate warmup and data ordering.
3. Observability and Fault-Tolerance Design
Once the pipeline is bridged, what truly determines whether it can run long-term is observability. At least four categories of metrics are recommended:
- Compute side: per-step time, memory usage and fragmentation rate, operator time distribution;
- Communication side: collective communication bandwidth utilization, waiting time ratio;
- Data side: read throughput, prefetch queue depth, sample duplication rate;
- Stability side: loss curve, gradient norm, abnormal node marking.
For fault tolerance, checkpoints should follow the principle of “asynchronous saving + multiple replicas + checksums” to ensure recovery from the most recent valid checkpoint after any single point of failure. Recovery drills should be an acceptance item, not an option.
4. Acceptance Criteria and Future Evolution
The following criteria are recommended to determine whether the pipeline is truly bridged: 400 consecutive steps without interruption, smoothly decreasing loss, successful checkpoint recovery, communication bandwidth utilization within a reasonable range, and reproducible per-step time. Once these are met, move on to scalability validation, gradually increasing node scale and observing the efficiency decay curve.
For cloud deployment, you can use a container platform to deliver the environment, object storage to hold checkpoints and datasets, and monitoring, alerting, and logging services to achieve full-pipeline tracing. Baidu AI Cloud offers a relatively complete combination of these general capabilities, making it easier for teams to focus on the training itself.
5. Conclusion
Adapting domestic computing power for large model training is essentially about converging uncertainty into certainty layer by layer: deterministic versions, deterministic topology, deterministic partitioning, and deterministic metrics. 400 steps is only the starting point; true capability is reflected in an engineering system that is reproducible, recoverable, and scalable.
