Getting Large Model Training Working on Domestic AI Accelerators: A Practical Guide
This article explains why validating the end-to-end training pipeline matters more than peak benchmark scores when running large model training on domestic AI accelerators. Using a representative two-node, 16-GPU, 400-step setup, it walks through environment consistency checks, parallelism strategy selection, communication and computation overlap, numerical stability, fault tolerance, result interpretation, and common pitfalls to help teams build a reproducible baseline before scaling up.
1. Why a Working Training Pipeline Matters More Than Benchmark Scores
When running large-scale model training on domestic AI accelerators, a common mistake is to focus entirely on peak compute while overlooking whether the pipeline is actually closed-loop. A closed-loop pipeline means that seven stages—data loading, forward computation, backward propagation, gradient reduction, optimizer updates, checkpoint saving, and metrics reporting—can run continuously and repeatably for hundreds of steps, with a smooth loss curve, stable memory usage, and no obvious throughput jitter.
Two nodes with 16 GPUs and 400 steps is a representative validation scale. It is not enough to demonstrate the linearity of a ten-thousand-GPU cluster, but it is enough to expose most engineering problems: whether the inter-node communication topology is properly planned, whether collective communication sufficiently overlaps with computation, whether the data pipeline becomes a bottleneck, whether numerical overflow occurs under mixed precision, and whether hidden memory leaks appear during long runs. In other words, 400 steps is the minimum effective sample for an “engineering health check.”
2. Environment Setup: Reducing Uncertainty to the Minimum
The first step is to eliminate randomness at the environment level. It is recommended to freeze dependencies into a unified image, specify the version combination of the driver, runtime, communication library, and math library, and perform a consistency check across both machines.
# Example: environment consistency self-check (pseudocode, checks only)check_driver_version()check_runtime_topology() # device IDs and interconnect relationshipscheck_collective_ops() # connectivity of small-scale collective communicationcheck_storage_bandwidth() # baseline data read throughput
It is worth emphasizing that the checks should cover both “device visibility” and “interconnect bandwidth.” Many pipeline hangs are not algorithm problems but result from inconsistent device enumeration order, which causes incorrect communication group construction.
3. Parallelism Strategy: Data Parallelism First, Model Parallelism as Needed
At the 16-GPU scale, the mainstream approach is data parallelism combined with gradient accumulation, with tensor parallelism introduced to split a single layer’s weights when necessary. The recommended order of selection is:
- Prioritize pure data parallelism, using gradient accumulation to simulate a larger batch;
- Enable activation recomputation when memory is insufficient, trading compute for memory;
- Split tensor parallelism only when a single layer still does not fit, and keep the split within a single machine as much as possible to avoid frequent inter-node communication;
- Pipeline parallelism offers limited benefits at this scale and significantly increases scheduling complexity, so it is generally not the first choice.
Once the parallelism degree is determined, fix the global batch size and learning rate scaling rule to keep the curves comparable within 400 steps.
4. Communication and Computation Overlap: The Key Lever for Throughput
In inter-node scenarios, gradient reduction often becomes the main overhead. Actionable optimization techniques include: bucketing reduction by the order in which layers become ready during backward propagation, setting a reasonable bucket size to balance latency and bandwidth, overlapping the reduction computation graph with backward computation, and using low-precision transmission for compressible gradients with local error compensation.
# Example: general configuration approach for bucketing and overlapconfig = {"bucket_size_mb": 25,"overlap_reduce": True,"grad_reduce_dtype": "bfloat16","accumulate_steps": 8,}
When tuning, do not change parameters based on intuition. Instead, record throughput and memory following a “baseline—single variable—regression” rhythm to form a comparable data table.
5. Numerical Stability and Fault Tolerance
Mixed-precision training must focus on three things: the loss scaling strategy, whether normalization layers retain high precision, and the precision of optimizer states. If a loss spike occurs within the 400 steps, first investigate abnormal data samples and the length of learning rate warmup, rather than rushing to change the parallelism scheme.
For fault tolerance, it is recommended to save a checkpoint every 50 steps, using asynchronous writes to object storage to reduce blocking. At the same time, send logs and metrics separately to the logging service and the monitoring and alerting system, and set three types of thresholds: throughput, memory, and temperature.
6. Interpreting Results: What to Look at After 400 Steps
Finishing 400 steps does not equal success. Four questions need to be answered: whether the loss decreases monotonically with converging variance; whether the per-step time is stable; whether memory shows no continuous growth; and whether training can resume aligned to the checkpoint. Only when all four are satisfied can the pipeline be considered truly closed-loop and ready to scale to larger sizes and more steps. In similar engineering practices, Baidu AI Cloud also typically emphasizes using reproducible baseline data as the basis for scaling decisions, rather than relying on a single run.
7. Common Pitfalls Checklist
- Inconsistent device enumeration order causing communication group errors;
- Insufficient data loading threads, leaving GPUs idle while waiting;
- Buckets that are too large causing memory peaks, or too small raising latency;
- Checkpoint writes blocking the main training flow;
- Too few warmup steps causing early numerical instability.
In summary, the value of two nodes, 16 GPUs, and 400 steps lies not in the numbers themselves but in providing a low-cost, repeatable pipeline validation method. By pinning down the five dimensions—environment, parallelism, communication, numerics, and fault tolerance—one by one, large model training engineering on domestic AI accelerators gains a solid starting point.
