Getting the Training Pipeline Working on Domestic GPUs: A Practical Guide

    This article explains why validating the full training pipeline matters more than chasing benchmark numbers when running large model pretraining on domestic accelerator hardware. It covers environment preparation, choosing a parallel strategy, observability and checkpoint recovery checks, and a troubleshooting order for common failures, using a two-node, sixteen-GPU, 400-step run as the acceptance baseline. Readers will learn how to build a reproducible, observable, and recoverable engineering baseline without relying on vendor-specific capabilities.

    1. Why Getting the Pipeline Working Matters More Than Chasing Metrics

    When running large model pretraining on domestic accelerator hardware, teams typically go through three stages: single-GPU functional validation, single-node multi-GPU validation, and multi-node multi-GPU pipeline validation. Many teams make smooth progress in the second stage but fail repeatedly in the third. The cause is often not a miscalculated operator, but a link in the chain that was never fully validated.

    “Getting the training pipeline working” means that in a real distributed environment, the entire closed loop—data loading, forward computation, backward propagation, gradient synchronization, optimizer updates, and checkpoint saving and restoration—can run continuously and stably for several hundred steps, with the loss curve in a reasonable downward range. It validates engineering completeness, not final model quality. Using two nodes with sixteen GPUs and 400 consecutive steps as the acceptance criterion is a common engineering practice: enough steps to expose hidden issues such as communication jitter, memory fragmentation, and data shard misalignment, without consuming too much compute budget.

    It is worth emphasizing that the pipeline validation stage should not introduce any unconfirmed performance promises. Interconnect topology, inter-GPU bandwidth, and storage throughput vary greatly across clusters, so any claim that “a certain hardware reaches a certain metric” lacks general applicability. A more reliable engineering approach is to establish your own baseline: record the per-step time distribution, communication share, and peak GPU memory, and judge whether an optimization is effective by relative changes rather than absolute numbers.

    2. Environment Preparation: Narrowing Down Uncertainty

    A significant share of pipeline validation failures originate at the environment layer. It is recommended to narrow down problems in the following order:

    1. Driver and runtime consistency. The accelerator driver, runtime libraries, and communication libraries on all nodes must be strictly identical in version, including patch numbers. Version drift shows up as random communication timeouts and is extremely hard to diagnose.
    2. Network and topology confirmation. Make clear which physical machine each GPU belongs to, what interconnect is used between GPUs, and what network is used across machines. Topology information should be written into a configuration file and placed under version control to avoid “configuring from memory.”
    3. Storage and data readiness. Training data needs to be pre-sharded and placed on shared storage or object storage to ensure consistent read paths across nodes; also verify that the number of shards matches the parallelism degree.
    4. Dependency pinning. Use a container image to package all dependencies, orchestrated uniformly by a container platform, to eliminate the “runs on one machine but fails on another” problem.

    Illustrative pre-launch self-check logic can be written as:

    1. # Pseudocode: environment consistency self-check before pipeline launch
    2. def preflight(nodes, world_size, shards):
    3. assert len(nodes) * gpus_per_node == world_size
    4. assert shards % world_size == 0, "The number of data shards must be divisible by the global parallelism degree"
    5. for n in nodes:
    6. assert n.driver_version == baseline_driver
    7. assert n.runtime_image == baseline_image
    8. return True

    Such assertions may look simple, but they can catch a large number of “mysterious failures” in advance.

    3. Parallel Strategy: A Two-Dimensional Trade-off Between Memory and Communication

    Two nodes with sixteen GPUs is a small-scale configuration that already exhibits cross-machine communication characteristics, making it well suited for validating the correctness of a parallel strategy. There are three common combinations:

    • Pure data parallelism: the simplest to implement, with the highest GPU memory usage; cross-machine communication volume grows linearly with the number of parameters.
    • Tensor parallelism combined with data parallelism: splits single-layer operators across multiple GPUs, reducing per-GPU memory, but introduces high-frequency synchronization and is sensitive to inter-GPU bandwidth; tensor splitting is usually done only within a single node.
    • Pipeline parallelism combined with data parallelism: splits by layer across devices with small communication volume, but has pipeline bubbles, so the number of micro-batches needs to be set reasonably.

    The recommended engineering path is to first get the pipeline working with pure data parallelism and confirm numerical correctness; then gradually introduce tensor or pipeline splitting, rerunning the full 400 steps each time a layer is added. Avoid enabling all optimizations at once; otherwise the cost of fault attribution rises sharply.

    Regarding mixed precision, it is recommended to enable it during pipeline validation to ease memory pressure, but a full-precision or high-precision master weight copy must be kept for optimizer updates, and the loss scaling strategy should be fixed to avoid dynamic scaling masking real numerical problems.

    4. Stability and Observability: Making the 400 Steps Explainable

    The value of 400 steps lies in exposing long-tail problems, provided you can see them. It is recommended to collect at least the following dimensions:

    • Metrics: per-step loss, learning rate, gradient norm, and loss scaling factor.
    • Performance: per-step time, data wait time, communication time share, and peak GPU memory and fragmentation.
    • Reliability: checkpoint write time, and whether the first-step loss after restoration matches the value before the interruption.

    Checkpoints must undergo “restoration consistency validation”: after saving, actively interrupt, then restart from the checkpoint and compare the loss over several steps with the corresponding steps of the original run. This step is the core evidence of pipeline trustworthiness. Many teams overlook it and later cannot tell whether fault recovery is safe during large-scale training.

    When deploying in the cloud, object storage can hold checkpoints and datasets, a logging service can aggregate output from all nodes, and monitoring and alerting can set threshold notifications for GPU memory overflow, sudden per-step time spikes, and node loss. These are all general capability categories and do not involve any vendor-proprietary interfaces.

    5. Common Failures and Troubleshooting Order

    Symptom Priority Investigation Direction
    Hangs at startup with no output Communication initialization, network connectivity between nodes, port occupancy
    Normal for the first dozens of steps, then slows down GPU memory fragmentation, data loading bottleneck, log synchronization blocking
    Loss becomes non-numeric Mixed-precision scaling, learning rate too high, abnormal data shards
    Loss discontinuous after restoration Optimizer state not saved, random seeds not aligned, data cursor not persisted

    For diagnosis, “binary convergence” is recommended: first fix the random seed and data order, disable asynchronous and overlap optimizations, and get the minimal configuration working; then enable optimizations one by one and compare per-step time and loss curves.

    6. Conclusion

    Completing pretraining pipeline validation with two nodes and sixteen GPUs over 400 steps on domestic accelerator hardware is essentially about establishing a reproducible, observable, and recoverable engineering baseline. It does not depend on any unique capability of a specific product, but is guaranteed by strict environment consistency, gradual introduction of parallel strategies, and complete checkpoint restoration checks. By consolidating this baseline into an automated pipeline and pinning it down with general cloud capabilities such as container orchestration, shared storage, and monitoring and alerting, teams will face a purely scale-related problem when expanding to larger scale later, rather than the unknown of “whether it can run at all.”