16 GPUs Across Two Nodes: Practical Lessons from a 400-Step LLM Training Run

    This article explains how to validate a complete large-model training pipeline across two 8-GPU servers. It covers topology planning, environment consistency, distributed process configuration, collective communication tests, memory budgeting, monitoring, checkpoint validation, and the limits of using a 400-step run as a functional test.

    1. Background and Validation Goals

    The main challenge in large-model training is often not single-GPU computation, but coordination across multiple GPUs and machines. As model sizes grow, the compute and memory capacity of one server may no longer be sufficient, making multi-node parallelism a standard approach.

    Extending a training pipeline from one node to two requires device discovery, process orchestration, network communication, and storage I/O to work together. A failure in any of these areas can prevent training from starting or cause it to fail midway.

    The goal of this exercise was to verify whether a complete training pipeline could run reliably across two servers with 16 GPUs in total. In this context, “working” means that training can start, execute iterations, and save checkpoints successfully, completing a total of 400 training steps.

    A 400-step run is a functional validation, not a convergence evaluation. It can show whether the pipeline is connected and operational, but it cannot be used to infer model quality or long-term stability.

    2. Topology Planning: Decide Which GPUs Communicate

    The 16 accelerators are distributed across two machines, with eight GPUs per machine. Topology planning should answer three questions:

    1. Which GPUs are assigned to each machine?
    2. What are the intra-node and inter-node communication paths?
    3. How will the parallelism strategy map onto those GPUs?

    Communication bandwidth between GPUs on the same machine is usually higher than bandwidth across machines. Therefore, the parallel dimension with the most frequent communication should preferably remain within a node. Cross-node communication should be reserved for synchronization tasks with lower frequency and manageable data volume.

    Before starting a run, it is useful to list the GPUs included in each parallel group. This helps prevent discovering only after launch that a communication group is crossing a slower network link.

    Parallelism dimension Recommended placement Communication characteristics
    Tensor parallelism Eight GPUs within a single node Frequent communication with large data volumes per operation
    Data parallelism Across the two nodes Gradient synchronization once per training step

    The exact combination should be adjusted based on the model architecture and memory budget. The table provides only a common starting point.

    3. Environment Consistency: The First Gate for Multi-Node Training

    The driver versions, runtime libraries, deep learning framework versions, and dependency packages must be consistent across both machines. When versions differ, processes may start successfully but hang during collective communication or report difficult-to-diagnose shape and type errors.

    Before launching training, perform the following checks:

    • Compare driver and runtime versions on both machines.
    • Use the same container image or the same dependency lock file.
    • Confirm that each machine exposes the expected number and identifiers of accelerators.
    • Compare the hashes of the training code and configuration files to ensure that both sides use identical content.

    The following example shows how to check the number of local devices. The device-query interface depends on the hardware platform and is represented here by a placeholder function:

    1. def check_local_devices(expected_per_node: int) -> None:
    2. visible = get_visible_device_count() # Provided by the runtime for the target platform
    3. if visible != expected_per_node:
    4. raise RuntimeError(
    5. f"Visible device count is {visible}; expected {expected_per_node}"
    6. )

    This check should run before each process starts. Exiting immediately on failure is easier to troubleshoot than discovering the problem after training has already progressed.

    4. Distributed Launch: Give All 16 Processes an Explicit Position

    In multi-node training, every process must know the global process count, its global rank, and the address and port of the master node. Incorrect launch parameters are among the most common causes of two-node training failures.

    A typical parameter layout is shown below:

    1. # Master node (node 0)
    2. MASTER_ADDR=<master-node-private-IP>
    3. MASTER_PORT=29500
    4. WORLD_SIZE=16
    5. NODE_RANK=0
    6. LOCAL_PROCESSES=8
    7. # Worker node (node 1)
    8. MASTER_ADDR=<master-node-private-IP>
    9. MASTER_PORT=29500
    10. WORLD_SIZE=16
    11. NODE_RANK=1
    12. LOCAL_PROCESSES=8

    Three points require particular attention:

    1. MASTER_ADDR must point to the same master node on both machines and should use its private network address.
    2. Confirm that the port is not already in use and is allowed by the firewall.
    3. WORLD_SIZE must equal the total number of processes across both machines, while NODE_RANK must be different on each node.

    5. Communication Validation and Tuning

    Before formal training, run a collective communication benchmark across all 16 GPUs. The validation should focus on three areas:

    • Communication operations complete successfully without timeouts.
    • Intra-node and inter-node bandwidth fall within a reasonable range.
    • Results are consistent across nodes.

    If inter-node bandwidth is significantly lower than expected, several causes are common. On machines with multiple network interfaces, communication may be bound to a management network instead of the intended training network. Inconsistent maximum transmission unit settings can also reduce throughput. Incorrect routing may cause traffic to take an indirect path.

    The usual response is to explicitly select the network interface used for training communication and standardize network parameters across nodes. After making changes, rerun the benchmark and confirm that the results are reasonable before starting the full training job.

    This article does not provide specific bandwidth figures because no corresponding measurements are available in the source data.

    6. Memory Budgeting and Parallelism Strategy

    Per-GPU memory usage is primarily made up of four components:

    • Model parameters
    • Gradients
    • Optimizer states
    • Activations

    A rough estimate is:

    1. Per-GPU memory usage ≈ parameters + gradients + optimizer states + activations

    Common ways to reduce memory usage include gradient accumulation, activation recomputation, and mixed-precision training. Each introduces a trade-off:

    • Gradient accumulation increases the time required for each effective training step.
    • Activation recomputation uses additional computation in exchange for lower memory usage.
    • Mixed precision requires attention to numerical stability to prevent gradient underflow or overflow.

    A practical approach is to start with a smaller batch size, measure peak memory usage, and then increase it gradually. This makes it possible to determine which memory-saving technique is most appropriate for the model before the full training run.

    7. Training Monitoring and Checkpoints

    During training, continuously monitor the following metrics:

    • Loss
    • Gradient norm
    • Learning rate
    • Step time
    • Memory usage on each GPU

    Logs from each process should be stored separately. This makes it easier to identify which process first encountered an anomaly.

    Numerical errors should be detected and stopped as early as possible. The following illustrates a simple check for non-finite values:

    1. if not is_finite(loss):
    2. save_debug_snapshot(step)
    3. stop_training()

    The checkpoint location must either be accessible from both machines or allow each node to save its own shard while recording the complete mapping between shards and processes.

    After saving a checkpoint, test the restore procedure. Confirm that continuing from the checkpoint preserves the correct step count and that the loss values connect properly with the previous run. Saving checkpoint files without testing recovery does not prove that the checkpoints are usable.

    8. What a 400-Step Validation Can and Cannot Prove

    A 400-step run can establish several pipeline-level facts:

    • The two machines can communicate over the network.
    • Multi-node processes can complete synchronization.
    • The training data pipeline can continuously provide data.
    • Checkpoints can be written successfully.

    However, it cannot establish the following:

    • Whether the model will converge effectively
    • Whether the system will remain stable during long-running training
    • Whether fault recovery works correctly
    • How throughput will scale to additional nodes

    These conclusions require longer training runs, complete step-time measurements, and fault-injection testing.

    9. Common Troubleshooting Checklist

    • No output for an extended period after launch: Check the master address and port, verify that the firewall allows the connection, and confirm that WORLD_SIZE is consistent across both machines.
    • A node reports an unexpected device count: Check driver versions and device-visibility settings, and confirm that no GPUs are missing or unexpectedly exposed.
    • Out-of-memory errors on the first step: Reduce the micro-batch size and enable activation recomputation.