Getting Large Model Training Working on Domestic AI Accelerators: A Practical Guide
This article walks through the practical steps for validating an end-to-end large model training pipeline on domestic AI accelerators, using a two-node, sixteen-card, 400-step run as the baseline. It explains why closing the training loop matters more than peak throughput, how to check environment consistency before training, how to choose parallelism strategies, how to overlap communication with computation, and how to build observability and checkpoint validation for long-running stability. It also outlines a troubleshooting order for common failures. Readers will get a reusable methodology for moving from "it ran once" to a training setup they can depend on.
1. Why Closing the Training Loop Matters More Than Raw Speed
In large model engineering, many teams focus on peak compute and overlook a more fundamental question: whether the training loop is actually closed. A closed loop means the full path—data loading, preprocessing, forward pass, backpropagation, gradient synchronization, optimizer updates, and checkpoint saving and restoration—runs continuously, stably, and reproducibly. Only after this path is working do throughput tuning and parallelism adjustments become meaningful.
Take a two-node, sixteen-card run of 400 steps. The value of those 400 steps is not a usable model; it is verification that the system holds together under a real workload. Such a run covers several typical risks: whether multi-node communication initializes reliably, whether GPU memory leaks slowly after a number of steps, whether the data pipeline stalls, and whether checkpoints are written and loaded correctly. Many “intermittent failures” only surface after dozens of steps, which makes a short continuous run the most economical way to validate the system.
2. Environment Preparation: Move Uncertainty Earlier
The root cause of pipeline failures is usually not the compute cores but the environment layer. Three checks are recommended before any formal training.
First, consistency of driver, runtime, and communication library versions. Multi-node training is sensitive to versions: a mismatch on any single node can show up as a hang during initialization or intermittent communication errors. In practice, pin one validated version combination and verify consistency across all nodes.
Second, the actual reachability of network topology and bandwidth. The performance ceiling of multi-node training is often set by inter-node interconnect, so even at a small validation scale you should confirm real bandwidth and latency between nodes rather than assuming “the configuration should be fast.”
Third, the stability of storage and the data path. Large-scale training needs sustained high-throughput reads, so place data on storage with high-concurrency read capability and use local caching to reduce repeated fetches.
A schematic environment consistency check can look like this:
# Collect key version info per node and diff the resultsfor host in $(cat hosts.txt); dossh "$host" "runtime --version; comm-lib --version; driver --version" \| sed "s/^/[$host] /"done | sort | uniq -c | sort -rn
If any entry shows a count of 1, the nodes differ and that should be fixed before continuing.
3. Parallelism Strategy: Correct First, Efficient Second
When training on domestic AI accelerators, choose the parallelism strategy in the order of “correct first, efficient second.” Common combinations include data parallelism, tensor parallelism, and pipeline parallelism, each with distinct communication characteristics: data parallelism is dominated by gradient synchronization, tensor parallelism is most sensitive to inter-card bandwidth, and pipeline parallelism introduces bubbles and scheduling complexity.
For a two-node, sixteen-card setup, a safe starting point is data parallelism combined with gradient accumulation, which compresses cross-node communication to once every several steps. When a single card’s memory cannot hold the model and optimizer states, add tensor parallelism and try to keep the parallel group within one machine to avoid carrying tensor traffic across nodes. A schematic configuration:
config = dict(parallel=dict(data=8, tensor=2, pipeline=1),micro_batch=1,grad_accum=16,precision="bf16",checkpoint=dict(interval=50, keep_last=3),)
The key parameters need to be clear: grad_accum sets the tradeoff between effective batch size and communication frequency; precision at a lower precision significantly reduces memory and bandwidth pressure but requires confirming numerical stability during validation; checkpoint.interval should not be too large, or a single failure can waste a large amount of compute.
4. Overlapping Communication and Computation: Hide the Waiting
Once the loop is closed, the first bottleneck is usually communication wait time. There are three levels of improvement. The first is topology-aware communication group partitioning, so high-frequency communication stays inside a machine. The second is overlapping computation and communication, splitting gradient reduction into buckets and transferring while backpropagating. The third is matching communication primitives to data layout to avoid unnecessary reordering and copies.
Any overlap strategy must be premised on correctness. During validation, enable gradient norm logging and confirm that per-step gradient statistics match before and after overlap, then evaluate the performance gain.
5. Stability and Observability: The Real Test After 400 Steps
A short run that works does not mean long stable training is risk-free. At minimum, establish four kinds of observability: throughput and memory curves, communication time share, data pipeline wait time, and node health. Once metrics are collected into a unified monitoring and alerting system, you can distinguish “slowing down” from “hanging”—the former is usually resource contention or data stalls, the latter usually communication or a single-point failure.
The checkpoint mechanism must be validated as a pair: not only that it saves, but that it loads and resumes with a continuous loss curve. The following pseudocode expresses a resume consistency check:
loss = train(steps=50, seed=0)save_checkpoint(loss, path="ckpt_a")train(steps=50, seed=0) # return to the same starting pointload_checkpoint(path="ckpt_a")loss_resumed = train(steps=50, seed=0)assert abs(loss - loss_resumed) < 1e-4 # trajectories should match before and after resume
6. Common Failures and Troubleshooting Order
Troubleshoot from the outside in: first confirm node and network connectivity, then confirm storage reads are not blocked, then check that communication initialization and collective operations complete in pairs, and only then suspect operators or numerical issues. For logs, unify timestamps and a global step number; otherwise multi-node logs are hard to align and debugging cost multiplies.
7. Conclusion
A two-node, sixteen-card, 400-step run is essentially a low-cost, high-information pipeline health check. Make these five things solid—environment consistency, parallelism strategy, communication overlap, observability, and checkpoint validation—and large model training on domestic AI accelerators can move from “it ran once” to something you can rely on long term. In related practice at Baidu AI Cloud, a training foundation built from a general container platform, object storage, and monitoring and alerting is a common form that supports putting this methodology into practice.
