Training Large Models on Dual-Node 16-GPU Domestic Accelerators: A Pipeline Practice
Large model training often requires multi-node expansion due to single-machine memory and compute limits. The primary challenge lies in maintaining correct communication, stable computation, and reproducible results over extended periods. This article details a verification process of completing 400 training steps on a dual-node setup with 16 domestic accelerators. It outlines a reusable technical pipeline covering six aspects: environment, topology, parallelism, data, checkpointing, and troubleshooting, focusing on engineering issues at the training infrastructure level rather than specific model performance.
Background and Objectives
Large model training is limited by the memory and compute power of a single machine, making multi-node expansion a standard practice. The difficulty of multi-node training lies not in merely starting the task, but in maintaining correct communication, stable computation, and reproducible results over an extended period. This article centers on a verification process of completing 400 training steps across 16 accelerators on two machines. It organizes a reusable technical pipeline covering six aspects: environment, topology, parallelism, data, checkpointing, and troubleshooting.
This article does not evaluate the effectiveness of specific models; instead, it focuses on engineering issues at the training infrastructure level.
1. Define Verification Objectives
When verifying a training pipeline, objectives must be specific. It is recommended to break down the goals into three layers:
- Functional Layer: The task can be launched, all processes complete initialization, and nodes can communicate with each other.
- Correctness Layer: Forward and backward computations have no numerical anomalies, the loss exhibits reasonable changes as steps progress, and gradient synchronization executes as expected.
- Stability Layer: Continuous operation reaches the agreed-upon number of steps, with no process exits, out-of-memory (OOM) errors, or communication timeouts during the run.
Completing 400 steps represents a milestone in the stability layer. It demonstrates that the pipeline is usable for a certain period but does not alone prove convergence quality. Teams should incorporate the checklist items from all three layers into an acceptance checklist and verify them item by item.
2. Hardware and Network Topology Planning
A typical dual-node 16-GPU layout features 8 GPUs per machine. When planning, the following must be confirmed:
- The number of accelerators, memory capacity, and inter-card interconnect method on each machine must be consistent. Heterogeneous configurations can cause uneven loads and slow down the slowest node.
- Whether nodes have a high-speed RDMA network. If only standard Ethernet is available, cross-node gradient synchronization will become a bottleneck.
- Whether the CPU, memory, and local storage capacity of each machine meet the needs of data loading and log writing.
Topology dictates parallelism strategies. Intra-node communication bandwidth is typically higher than inter-node bandwidth. Therefore, limiting the most communication-intensive parallel dimensions to a single machine is a common practice.
A schematic topology is as follows:
Node 0: GPU0 ~ GPU7 (High-speed intra-node interconnect)Node 1: GPU0 ~ GPU7 (High-speed intra-node interconnect)↑ Inter-node RDMA Network
3. Consistency of the Runtime Environment
The most common failures in multi-node training stem from environmental inconsistencies. As long as one item differs between the two machines—such as driver versions, runtime versions, deep learning framework versions, or dependency libraries—it can cause errors during initialization or produce difficult-to-trace numerical deviations during execution.
Recommended practices include:
- Deploy all nodes using the same image or the same set of installation scripts, and record the version number of each component.
- Run a check script before launch to compare the driver versions, device counts, and key environment variables across nodes.
- Fix random seeds and key operator configurations to facilitate issue reproduction.
Schematic check logic:
def check_env(node_info: dict, reference: dict) -> list:"""Compare node environment with reference configuration, return list of mismatched fields."""mismatches = []for key, expected in reference.items():actual = node_info.get(key)if actual != expected:mismatches.append(f"{key}: expected {expected}, actual {actual}")return mismatches
4. Distributed Parallelism and Communication Configuration
Multi-node training typically combines multiple parallelism methods. Data parallelism splits the batch across different cards; tensor parallelism splits a single layer’s matrix computation across multiple cards; pipeline parallelism places different layers on different devices; if the model uses a Mixture of Experts (MoE) structure, expert parallelism is also required.
When configuring, three points must be noted:
- The product of parallelism dimensions must equal the total number of cards. For example, with 16 cards, a tensor parallelism of 4, pipeline parallelism of 2, and data parallelism of 2 yields a product of 16.
- Communication-intensive parallel dimensions should be prioritized within the node.
- The global batch size equals the single-card micro-batch multiplied by the gradient accumulation steps, and then by the data parallelism degree. When modifying any of these, the other two must be verified synchronously.
Communication timeout is a high-frequency issue in dual-node scenarios. It is recommended to set a reasonable timeout threshold and record the time consumed by each collective communication operation in the logs. If the communication time of a certain step spikes, it usually indicates a network or device anomaly on one node.
Schematic launch parameters (pseudo-code):
# Execute on each node, set NODE_RANK to 0 and 1 respectivelyexport NUM_NODES=2export GPUS_PER_NODE=8export NODE_RANK=<current_node_rank>export MASTER_ADDR=<master_node_internal_ip>export MASTER_PORT=29500launch_training --config train_config.yaml
5. Data Pipeline and Checkpointing
The data pipeline must ensure that each data-parallel replica reads different samples and that the read position can be recovered. Common practices include:
- Splitting data by global sample index rather than having each node perform independent random sampling, to avoid sample duplication or omission.
- Completing data preprocessing before training, performing only lightweight reads during training.
- Recording the data read position so that it can resume from that point after a checkpoint recovery.
The checkpointing strategy determines the fault tolerance of long tasks. The following practices are recommended:
- Save a complete state at fixed step intervals, including model parameters, optimizer state, learning rate scheduler state, and random number states.
- Use atomic writes. Write to a temporary file first, verify the checksum, and then rename it to prevent corrupted files caused by interrupted writes.
- Retain the most recent checkpoints and periodically clean up old files to prevent storage from filling up.
Schematic save logic:
def save_checkpoint(state, path_dir, step):tmp = f"{path_dir}/step_{step}.tmp"final = f"{path_dir}/step_{step}"write_state(state, tmp)verify_checksum(tmp)rename(tmp, final)
6. Verification Path: From Small Scale to 400 Steps
Directly launching a full 400-step task incurs high troubleshooting costs. It is recommended to proceed in three stages:
The first stage is a single-node small-batch run. Confirm that the model can complete forward and backward computations and that memory usage is within the expected range.
The second stage is a dual-node short run. Run for dozens of steps to check whether communication time, peak memory, and loss curves are consistent across nodes.
The third stage is a dual-node long run. Continuously run to the target step count under a fixed configuration, monitoring throughput, communication time, and node health status during the process.
Recommended monitoring metrics include per-step time, per-card memory usage, the proportion of inter-node communication time, loss values and gradient norms, and process survival status. When a metric deviates from the baseline by more than an agreed-upon threshold, an alert should be triggered.
7. Common Issues and Troubleshooting Order
When troubleshooting, following an outside-in order can significantly shorten the time to locate the issue:
- Process Layer: Confirm whether all processes have started, whether any have exited, and what the exit code is.
- Communication Layer: Confirm whether nodes are connected, whether ports are open, and on which collective communication operation the timeout occurred.
- Device Layer: Check for OOM, whether devices are offline, and whether temperature and power consumption are abnormal.
- Data Layer: Check if data reading is blocked and whether samples are duplicated or missing.
- Numerical Layer: Check if the loss is NaN or experiences sudden changes, and if the gradient norm grows abnormally.
A practical principle is to first confirm that all nodes see a consistent state before analyzing the anomaly of a single node.
8. Summary
Successfully running through the training pipeline on dual-node 16-GPU setups relies on making the five aspects—environment, topology, parallelism, data, and checkpointing—verifiable and reproducible steps. Completing 400 steps indicates that the pipeline possesses a certain degree of stability under this configuration. Before formal deployment, it is necessary to supplement this with longer run tests, convergence evaluations, and fault injection tests.
