Two-Node, 16-GPU Training Validation Guide for Chinese-Developed GPUs
A practical guide to validating a two-node, 16-GPU training pipeline on Chinese-developed GPUs. It covers environment consistency, data loading, parallelism, mixed precision, communication, optimizer behavior, and checkpoint recovery, with framework-independent pseudocode and acceptance criteria for a reproducible 400-step validation run. This guide provides a validation procedure, not benchmark results.
1. Define the Acceptance Criteria First
A 400-step validation run should answer three questions:
- Can the training loop complete without interruption?
- Are the performance measurements reproducible?
- Can training resume from a checkpoint after an interruption?
It does not establish whether the model meets quality targets or predict convergence during full-scale training.
Before starting, document the model size, compute precision, global batch size, gradient accumulation steps, parallelism strategy, communication library version, network type, and checkpoint storage path. Without this information, others will struggle to reproduce the results, and the validation record will be less useful for later comparisons.
This guide provides a validation procedure and a framework for recording results. It contains no measured performance figures; those must be collected in your own environment.
2. Check the Environment and Dependencies
Start by checking both nodes. Driver, firmware, and runtime versions should match. Otherwise, identical code may behave differently across the two machines.
Record the following:
- Software stack: The deep learning framework and version supported by the GPUs, plus the vendor-provided operator and collective communication library versions. Software stack names vary by vendor; refer to the official documentation.
- Inter-node network: Network type, bandwidth per link, and MTU settings. These parameters strongly affect cross-node communication efficiency.
- Shared storage: Mount path, read/write permissions, and available capacity. Storage configuration is a common cause of checkpoint write failures.
- Environment variables and communication settings: Include communication timeouts and network interface bindings. Put these settings in the launch script rather than relying on manual configuration.
Once dependency versions are fixed, save them in a file alongside the validation results.
3. Prepare Data Loading and Preprocessing
Split the training data into shards in advance, and have each node read only its assigned shards. Record the shard indices so that data positions can be verified during recovery.
Data loading should overlap with computation. Start with a small number of prefetch threads, then adjust while monitoring GPU idle time. If GPUs are waiting for input, prefetching may be insufficient.
Memory mapping and shared-memory caching can reduce repeated disk reads. However, size caches carefully relative to system memory so they do not consume memory needed for computation.
To keep inputs consistent across validation runs, fix the data random seed and record the sample ID ranges read by each node at every step.
Also check for data imbalance. If some GPUs receive substantially more valid tokens per step, they can slow down the entire iteration.
4. Choose a Parallelism Strategy
The parallelism strategy directly affects cross-node traffic in a two-node, 16-GPU configuration.
| Strategy | Per-GPU memory usage | Where communication occurs | Suitable use case |
|---|---|---|---|
| Data parallelism | Each GPU holds a complete model replica | Gradient reduction associated with backward propagation | The model fits on one GPU |
| Tensor parallelism | Each GPU holds a subset of the parameters | Within layers during forward and backward computation | Individual layers are too large, and intra-node bandwidth is high |
| Pipeline parallelism | Each GPU holds a subset of the layers | Activation transfers between adjacent stages, with pipeline bubbles | The model has many layers, and bubble overhead is acceptable |
One common configuration uses tensor parallelism within each node, taking advantage of high-speed interconnects for intra-layer communication, and data parallelism between nodes for gradient synchronization. This keeps cross-node communication focused on gradient synchronization.
Choose a configuration based on the measured communication share of step time, not theoretical bandwidth alone.
During validation, run at least two parallelism combinations for a full 400 steps each. Compare step time and the proportion of time spent on communication.
5. Validate Forward Passes, Backward Passes, and Mixed Precision
Mixed precision can reduce memory usage and communication volume. Loss scaling helps protect small gradients from underflow in low-precision computation by scaling up the loss.
A common dynamic loss-scaling policy works as follows:
- If gradient overflow is detected through Inf or NaN values, skip the parameter update and reduce the scale factor.
- After a specified number of consecutive steps without overflow, try increasing the scale factor.
Record skipped updates and changes in the scale factor. If updates keep being skipped, investigate numerical issues in the model or learning-rate configuration before proceeding.
Gradient accumulation also requires loss normalization. When accumulating across N microbatches, divide each microbatch loss by N; otherwise, the effective learning rate will be larger than intended.
6. Measure Gradient Synchronization and Communication
Gradient synchronization is a common bottleneck in multi-node training. Record these metrics:
- Communication share of step time: The fraction of total step time spent on communication. This is a key indicator of whether the topology can support further scaling.
- Total gradient volume in MB: Larger gradients increase the transfer load for each reduction.
- Gradient bucket size: Buckets that are too small increase communication launch overhead. Buckets that are too large limit overlap with backward computation.
Overlapping communication with computation is a common optimization. Once a layer’s gradients are ready during backpropagation, their reduction can begin without waiting for the entire backward pass to finish.
Frameworks typically provide settings for gradient bucketing and asynchronous reduction. Enable these options individually during validation and compare their effects.
Set communication timeouts before the run. A timeout that is too short can turn transient network delays into training failures. A timeout that is too long can delay detection of genuine faults.
7. Check the Optimizer and Learning-Rate Schedule
Optimizer states, such as first- and second-moment estimates, can consume substantial GPU memory. In data-parallel training, these states can be sharded across GPUs so that each device stores only a portion.
The sharding scheme must be consistent with checkpoint saving and loading.
Explicitly verify the learning-rate schedule. Record the learning rate at step 0, at the end of warmup, and at steps where the schedule changes. Confirm that the values match the intended schedule.
Also verify gradient clipping. Record the gradient norm before clipping and the percentage of steps on which clipping occurs. If clipping is applied at nearly every step, the clipping threshold or learning rate may be inappropriate.
8. Validate Checkpoint Saving and Recovery
A checkpoint should contain:
- Model parameters
- Optimizer state
- Current training step
- Random number generator state for every GPU
- Data loader position
Without random number generator states or data positions, the resumed training trajectory will differ from the uninterrupted run.
Write checkpoints to a temporary path first, then rename them to the final path after writing completes. This prevents an interrupted write from leaving a partial checkpoint that appears valid.
Asynchronous saving can reduce training pauses, but saving must finish before an older checkpoint is overwritten.
Use the following recovery test:
- Save a checkpoint at step 200.
- Terminate the training processes.
- Resume from that checkpoint.
- Run steps 201 through 210.
- Compare the results with the corresponding steps from an uninterrupted run.
GPU computation and communication may be nondeterministic, so the results may not match exactly. Define an acceptable tolerance before validation and use it to judge recovery success.
9. Example Training Loop
The following framework-independent pseudocode illustrates the basic structure of gradient accumulation and checkpointing. Adapt it to the interfaces provided by your framework.
accum_steps = grad_accumulation_stepsoptimizer.zero_grad()for step in range(1, 401):for micro in range(accum_steps):batch = data_loader.next_batch()# Skip cross-node gradient synchronization for intermediate# microbatches; synchronize only on the final microbatch.sync_ctx = model.no_sync() if micro < accum_steps - 1 else nullcontext()with sync_ctx:loss = model.forward(batch) / accum_stepsloss.backward()grad_norm = clip_grad_norm(model.parameters(), max_norm)optimizer.step()optimizer.zero_grad()logger.log(step, loss, grad_norm, comm_time_ratio, gpu_memory)if step % checkpoint_interval == 0:saver.save_async(step, model, optimizer, rng_state, data_loader.state())
Exception handling, communication timeout handling, and GPU memory cleanup are omitted from this example. Add these to the actual implementation, and ensure asynchronous saves finish before subsequent operations overwrite a checkpoint.
10. Troubleshoot Common Failures
- Out-of-memory errors: Reduce the microbatch size first, then increase gradient accumulation steps. Check whether activation recomputation is enabled and whether intermediate tensors are being retained unnecessarily.
- Communication timeouts: Check network link health, MTU settings, and network interface bindings. Confirm that both nodes use the same communication library version.
- Checkpoint write failures: Check available storage capacity, write permissions, and mount status. Stop training if checkpoint writing fails rather than continuing to overwrite older checkpoints.
- Loss discontinuity after recovery: Verify that random number generator states, data loader positions, and optimizer states were all saved and restored correctly.
- Data imbalance: Measure valid sample counts and token counts per GPU per step, then adjust the sharding strategy.
- Frequent NaN or Inf values: Check loss scaling, learning rate, and gradient clipping settings. Record the first step where the problem occurs to help locate its source.
11. Decide Whether Validation Passes
Evaluate the results against the following criteria.
Pass
- All 400 steps complete without unhandled exceptions.
- Logs contain all required fields: loss, gradient norm, learning rate, step time, communication share, and GPU memory usage.
- Loss after checkpoint recovery remains within the tolerance agreed upon before validation.
Fail
- Any step is interrupted and training cannot recover automatically.
- Loss shows a discontinuity after recovery beyond the agreed tolerance.
- Checkpoint files are corrupted or cannot be loaded.
Prerequisites for Larger-Scale Testing
- Two runs with the same configuration produce throughput differences within the agreed range, demonstrating a reproducible baseline.
- Changes in communication share as node count increases have been measured, providing a basis for estimating scaling efficiency.
These checks establish whether the current training pipeline is stable and help the team decide whether communication or computation should be the next optimization priority.
