Training a 400-Step Large Model on Two Nodes with 16 Domestic Chinese GPUs: A Practical Guide
This guide walks through running 400 training steps of a large language model on two servers with 16 domestic Chinese GPUs. It covers checking hardware and network, aligning the software stack, choosing a parallelism strategy and estimating memory, tuning cross-node communication, and validating correctness and performance. It also explains what to measure at each stage and how to locate problems when they occur.
Large model parameter counts and training datasets keep growing. A single server no longer provides enough compute or memory, so multi-node distributed training has become standard practice. With domestic Chinese GPUs, the main challenge is getting the hardware, communication libraries, and mainstream training frameworks to work together reliably. This guide uses a two-node, 16-GPU setup that completed 400 training steps as its example. It explains what to confirm at each stage, how to measure it, and how to troubleshoot problems.
1. Confirm the Hardware and Network
Two nodes with 8 accelerator cards each means 16 cards in total. Before starting, record three types of information: the accelerator model, its memory capacity and rated peak compute; the interconnect method within each node and its measured bandwidth; and the network type between nodes (RoCE v2 or InfiniBand), along with the NIC model and bandwidth.
Tensor parallelism within a node is the most sensitive to bandwidth. Measure the actual values with the vendor’s bandwidth test tool or collective communication test cases. Do not use the rated values directly. The two nodes can be connected directly or through a switch. When choosing between them, compare bandwidth, latency, and cost. Then run AllReduce and AllGather tests to confirm that cross-node communication meets expectations before starting training.
2. Adapt the Software Stack
Software stack issues are usually harder to troubleshoot than hardware issues. Start by listing a version matrix that includes the driver, runtime library, operator library, training framework, and collective communication library, and confirm that these versions are compatible with each other. Whenever you upgrade any of them, rerun the baseline tests.
The LayerNorm, Attention (such as FlashAttention), and rotary position embedding (RoPE) operators in Transformers require the closest checks. Fix the random seed, then run the same input through a reference implementation and the domestic backend to compute forward outputs and backward gradients. Record the maximum absolute error and relative error. Operators whose errors exceed the preset thresholds need separate fixes.
Mixed-precision training commonly uses BF16. Confirm that the hardware natively supports BF16 computation, and that accumulation and parameter updates stay in FP32. Otherwise, gradient underflow or accumulated error may not appear until hundreds of steps later.
3. Choose a Parallelism Strategy and Estimate Memory
This example uses TP=8 and a data parallel (DP) size of 2. Tensor parallelism is limited to a single node, so large tensor transfers do not cross the network between nodes. Data parallelism runs across the two machines, and each step only needs to synchronize gradients.
The three ZeRO stages shard different ranges of state. ZeRO-1 shards only the optimizer states. ZeRO-2 also shards the gradients. ZeRO-3 further shards the model parameters. ZeRO sharding only happens within the data parallel group. In this example, each data parallel group contains only 2 cards, so sharding saves at most half of the memory.
Under mixed-precision Adam, each parameter needs about 16 bytes: 2 bytes for the BF16 parameter, 2 bytes for the gradient, and 12 bytes for the FP32 master weight and two Adam states. Take a 10B-parameter model as an example. Under ZeRO-1, each parameter takes about 10 bytes (4P plus 6P, with DP=2). Under ZeRO-2, each parameter takes about 9 bytes. Dividing by TP=8 gives about 12.5 GB and 11.25 GB of model-related memory per card. These estimates do not include activations, communication buffers, or memory fragmentation. Measure the actual usage with a memory monitoring tool.
Activation recomputation discards some intermediate activations and recalculates them during the backward pass, trading compute for memory. Recomputation adds roughly one forward pass of computation and reduces throughput, so weigh the memory savings against that cost. Memory pooling reduces fragmentation caused by frequent allocations. Enable it after training is stable, and record how the fragmentation rate changes.
4. Tune Cross-Node Communication
In two-node training, most performance loss comes from cross-node communication. Three common techniques help reduce it.
Overlapping communication with computation: Group gradients into buckets, and start communicating a bucket as soon as its gradients are ready. Buckets that are too small increase the startup overhead of communication. Buckets that are too large reduce the benefit of overlapping. Test several candidate sizes, record the time per step, and choose the best one.
Gradient accumulation: When cross-node bandwidth is limited, accumulate gradients across several micro-batches locally, then synchronize once. This reduces communication frequency but increases the effective batch size, so the learning rate needs adjusting accordingly.
Communication algorithms: Ring and tree algorithms suit different scenarios. Most communication libraries select an algorithm automatically based on the topology. Confirm which algorithm is actually in use with a test tool or the logs instead of assuming it based on experience.
5. Verify Correctness and Performance
Completing 400 training steps shows only that the pipeline runs stably. It does not prove that accuracy is correct throughout. Verification should cover the following three areas.
First, align loss and gradients. With the same data and random seed, compare the loss and gradient norms for the first several steps against a reference implementation or a small-scale single-machine experiment. Keep checking for NaN and Inf values. A smooth loss curve is necessary but not sufficient. The results must also match the reference to show that accuracy is correct.
Second, measure throughput and MFU. Throughput is measured in Tokens/
