A Practical Guide to Bringing Up LLM Training on Two 8-GPU Nodes
This guide walks through the process of validating a two-node, 16-GPU distributed training setup for large language models, using 400 training steps as the verification target. It covers hardware and network topology planning, layered software stack validation, distributed launch configuration, parallelism strategy selection, data pipeline and checkpoint management, and milestone design for the 400-step validation run, with the goal of making the entire training pipeline repeatable and observable.
1. Why Validate the Training Pipeline First
The parameter scale and data volume of large models exceed the capacity of a single machine, so multi-node distributed training has become standard practice. However, a setup that runs on one node does not guarantee stable operation across multiple nodes. Inter-node networking, software versions on each node, data loading, and checkpoint saving can all cause training to hang, slow down dramatically, or produce non-reproducible results if any link in the chain fails. Therefore, “bringing up the pipeline” means the entire workflow—from environment preparation through several hundred consecutive training steps—can be executed repeatedly, with the state of every stage observable.
Using “two nodes with 16 GPUs, 400 steps” as the validation target offers two benefits. First, 16 accelerator cards already cover the basic scenarios of cross-node communication, exposing topology and network-level issues. Second, 400 steps is enough for training to enter a stable iteration phase and to cover key moments such as learning rate warmup and the first checkpoint write.
2. Hardware and Network Topology Planning
Two nodes with 16 GPUs typically means 8 accelerator cards per machine. When planning, confirm the following:
- Whether the accelerator model, memory capacity, and card count are identical on both machines. Mismatched configurations cause load imbalance, with the faster node waiting on the slower one.
- The gap between intra-node interconnect bandwidth and inter-node network bandwidth. Inter-node communication is often the performance bottleneck, so prioritize a high-bandwidth, low-latency network path.
- System time synchronization, hostname resolution, and port connectivity. Large time drift makes logs hard to align and can trigger incorrect timeout behavior.
- The shared storage mount path must be identical on both machines; otherwise, data loading will fail due to differing paths.
Before launching training, test intra-node and inter-node bandwidth and latency separately. If inter-node bandwidth is clearly below expectations, troubleshoot NIC bonding, MTU settings, and switch configuration first—do not rush to adjust training parameters.
3. Layered Software Stack Management
The training environment can be split into layers, each validated independently, which greatly speeds up troubleshooting:
- Driver and firmware layer: the accelerator driver version must match the runtime version.
- Runtime and communication library layer: handles device management and multi-GPU collective communication; versions must be strictly identical on both machines.
- Deep learning framework layer: handles model definition, automatic differentiation, and distributed wrappers.
- Training code layer: includes the data pipeline, optimizer, learning rate scheduling, and logging.
The recommended validation order is: first run a single forward and backward pass on one GPU to confirm the operators work; then run an 8-GPU collective communication test on a single node; finally perform the two-node integration. Pass each layer before moving to the next, so you are not debugging all problems at once.
4. Distributed Launch Configuration
The core of multi-node training is letting each process know its global rank, its node, and the master node address. Below is a generic launch parameter example; the exact variable names depend on the launcher you use, so refer to the official documentation:
# Run on the master node (node 0) and node 1 respectively; only NODE_RANK differsexport NNODES=2export NPROC_PER_NODE=8export NODE_RANK=0 # set to 1 on node 1export MASTER_ADDR=10.0.0.10 # internal address of the master nodeexport MASTER_PORT=29500export WORLD_SIZE=$((NNODES * NPROC_PER_NODE)) # equals 16# Illustrative only—replace with the actual training entry command<training launch command> --config train.yaml --world-size ${WORLD_SIZE}
Points to note when configuring:
MASTER_ADDRmust be an internal address reachable from both machines; do not use a loopback address, or the other node will not be able to find the master.- The port must be open on both machines and not occupied by other processes.
WORLD_SIZEmust equal the total number of GPUs participating in training. If the values are inconsistent, some processes will wait indefinitely, appearing as a long period with no log output after startup.
After the processes start, have each process print a self-check message once to confirm the topology matches expectations:
def self_check(global_rank, local_rank, world_size, node_name):# Run once per process at startup to verify the rank range is validassert 0 <= global_rank < world_size, "global rank out of range"print(f"[rank {global_rank}] node={node_name} "f"local={local_rank} world={world_size}")
If the logs show fewer than 16 ranks, or the same rank appears twice, stop training immediately and check the launch parameters.
5. Choosing a Parallelism Strategy
The 16 GPUs can be combined through different parallelism approaches:
- Data parallelism: each GPU holds a complete model replica and processes a different data batch. This is the simplest to implement and suits cases where the model fits in a single GPU’s memory.
- Tensor parallelism: splits the matrix operations of a single layer across multiple GPUs. Suitable for models with large per-layer parameters, but demanding on communication bandwidth, so the sharding scope is usually confined to a single node.
- Pipeline parallelism: splits the model by layers into stages distributed across devices. Cross-node communication volume is relatively small, but it introduces pipeline idle time (bubbles), which requires a reasonable number of micro-batches to reduce its proportion.
For two nodes with 16 GPUs, a common rule-of-thumb configuration is 8-way tensor parallelism within a node and 2-way data parallelism across nodes. This keeps the most frequent communication inside the node and places only gradient synchronization on the inter-node network. This ratio must be determined based on the model architecture and memory usage calculations—do not apply it blindly.
Memory estimation can be broken into four parts: model parameters, gradients, optimizer states, and activations. Make a rough estimate of the total first; if it exceeds roughly 80% of a single GPU’s memory, mitigate it through sharding, activation recomputation, or reducing the micro-batch size.
6. Data Pipeline and Checkpoint Management
Data loading should be sharded so that each process reads a different subset of the data, avoiding duplicate reads of the same data. Random seeds can be differentiated by process rank while keeping the data order reproducible under the same configuration.
Checkpoints are the only basis for resuming after an interruption, and should include:
- Model parameters and optimizer states;
- The current state of the learning rate scheduler;
- The state of the random number generators;
- The current training step and data reading position.
When writing a checkpoint, write to a temporary file first and then replace the official file. This way, even if power is lost or the process is killed mid-write, no half-written corrupted file is left behind:
import osdef save_checkpoint(state, path):tmp_path = path + ".tmp"save_state_to_file(state, tmp_path) # implemented via the framework's save APIos.replace(tmp_path, path) # atomic replace to avoid partial reads
It is recommended to deliberately interrupt training once around step 200, resume from the most recent checkpoint, and confirm that the loss curve after resuming is continuous with the curve before the interruption. This step surfaces incomplete checkpoints or incorrectly saved states early.
7. Milestone Design for the 400-Step Validation
With 400 steps as the validation target, the process can be divided into several explicit checkpoints:
| Stage | What to Check | Pass Criteria |
|---|---|---|
| Step 0 | All processes initialized, topology printed | 16 processes, no duplicate ranks |
| Steps 1–10 | Per-step duration | After excluding the first step, duration stabilizes |
| Step 50 | Loss and gradient norm | Loss decreases overall, no sudden spikes in gradient norm |
| Step 100 | First checkpoint save | Fil |
