Bringing Up Large-Model Training on Domestic GPUs: A Practical Guide to a Stable 400-Step Run

    This article walks through the practical work of running large-scale pretraining on domestic accelerator cards, using a stable 400-step run on two nodes with 16 cards as the milestone that separates a demo from real pretraining. It covers why long-horizon validation matters, how to build a reproducible environment with aligned driver, runtime, and framework versions, a layered parallel strategy that keeps tensor parallelism inside a node and data or pipeline parallelism across nodes, tactics for numerical stability, the minimum observability set for fault localization, and a checklist of common pitfalls such as data-pipeline bottlenecks, shared random seeds, and incomplete checkpoints. Readers will come away with a methodology for converging version, communication, numerical, and observability uncertainty before scaling to more nodes.

    1. Why a Stable 400-Step Run Is the Key Milestone for Domestic Hardware

    When adapting large-scale pretraining to domestic accelerator cards, the industry generally treats “completing several hundred training steps without interruption” as the dividing line for pipeline usability. The reason is straightforward: getting a single forward and backward pass to run only shows that operators and communication are basically functional. Running 400 consecutive steps without interruption, without numerical anomalies, and with stable memory usage and throughput is what demonstrates engineering credibility under real workloads. This validation reflects the combined result of operator coverage, communication stability, memory management, numerical consistency, and fault-recovery capability.

    It is worth stressing that short-range and long-range validation serve different goals. The former asks “can it compute,” while the latter asks “can it keep computing.” Four hundred steps are enough to expose problems that only appear along the time dimension, such as accumulated memory fragmentation, communication handle leaks, abnormal optimizer state, and ineffective gradient clipping. That makes it a necessary threshold on the path from demo to small-scale pretraining.

    2. Environment Setup: Narrowing Down Uncertainty

    2.1 Aligning Driver, Runtime, and Framework Versions

    The first principle of adapting to domestic hardware is keeping the version matrix controllable. Pin a compatible combination of four layers — driver, runtime, accelerator libraries, and the deep learning framework — and keep it exactly identical across both machines. Even a minor difference on one side can surface as a random hang during collective communication.

    2.2 Dependency Isolation and Reproducibility

    Package the training image with containers and lock dependencies to immutable versions to avoid the “it runs on my machine” trap. Prebuild compiled artifacts inside the image to reduce the uncertainty introduced by compiling on the fly at runtime.

    2.3 Network and Interconnect Self-Checks

    Two-node training is sensitive to both intra-node and inter-node bandwidth. Before going live, run a point-to-point bandwidth and latency baseline, then a collective communication self-check to confirm there is no packet loss and no degraded link. A sketch of the self-check logic:

    1. # Pseudocode: environment and link self-check before training
    2. assert backend_available(), "communication backend unavailable"
    3. assert allreduce_smoke_test(world_size=16), "collective communication self-check failed"
    4. assert memory_headroom_ratio() > 0.1, "insufficient memory headroom"

    3. Parallel Strategy: Splitting Across Two Nodes and 16 Cards

    With a topology of eight cards per node and 16 cards across two nodes, a common approach is to confine tensor parallelism within a single node to make full use of high-bandwidth interconnects, while using data parallelism or pipeline parallelism across nodes to reduce dependence on inter-node bandwidth. This layered strategy of “split the model inside the node, split the data across nodes” is the core idea for controlling communication overhead.

    The exact split depends on model size and the memory budget. If activation values for a single layer are too large, increase the tensor parallel degree and pair it with sequence parallelism. If memory is consumed mainly by optimizer state, introduce sharded optimizer state management to spread that state across cards. Mixed precision is the default choice, but keep higher-precision accumulation on critical paths to avoid precision drift during long training runs.

    4. Numerical Stability: What Keeps 400 Steps from Breaking

    The most common failure mode in long training runs is the loss suddenly becoming non-numeric. Countermeasures include setting a reasonable gradient clipping threshold, keeping normalization layers and attention scaling factors at higher precision, and monitoring whether the optimizer’s first- and second-order momenta are abnormally amplified. Also turn on anomaly detection so the first non-numeric value is localized immediately, instead of backtracking dozens of steps later.

    Log three metrics for every training step: loss, gradient norm, and parameter update norm. If the gradient norm keeps climbing while the loss stays flat, that usually points to a learning rate that is too high or anomalous data. If the parameter update norm drops sharply, gradients may have been zeroed out incorrectly.

    5. Observability and Fault Localization

    Training on domestic hardware requires three general capabilities: monitoring and alerting, log services, and metric collection. A recommended minimum metric set includes per-card memory usage and fragmentation rate, share of time spent in inter-card communication, data loading wait time, and end-to-end time per step. Comparing compute time against wait time quickly reveals whether the bottleneck lies in operators, communication, or the data pipeline.

    Logs should carry a global step number and device ID so the timeline can be reconstructed from multi-process output. When a hang occurs, collect the call stacks and communication state of each process first rather than restarting immediately, otherwise localization clues are lost.

    6. Common Pitfalls

    • The data pipeline becomes an invisible bottleneck: preprocessing runs inside the training thread and leaves the accelerator idle, so use separate processes for prefetching with local caching.
    • Random seeds are not set per layer: data shuffling and model initialization share a seed, which hurts reproducibility.
    • Checkpoints are incomplete: saving only parameters while omitting optimizer state and learning rate scheduler state causes a loss jump after resuming.
    • Clock and configuration drift between nodes: inconsistent node environments trigger occasional communication timeouts.

    7. Conclusion

    Completing large-scale pretraining on domestic accelerator cards is essentially about converging four kinds of uncertainty one by one: versions, communication, numerics, and observability. The significance of finishing 400 steps on two nodes with 16 cards is that it proves, at controllable cost, that the pipeline has the foundation to scale further. From there, the same methodology can extend to more nodes, with fault-tolerant training and elastic scheduling introduced gradually, shifting the engineering focus from “getting it to run” to “running it longer and more efficiently.”