Bringing Up Large-Scale Model Training on Domestic GPUs: A Two-Node, 16-GPU Practice Guide

    This article walks through a practical end-to-end bring-up of large-model pretraining on a two-node, 16-GPU cluster built with domestic accelerators. It explains why this configuration is a typical validation unit, how to eliminate environment uncertainty before training, how to balance memory and communication across parallelism strategies, and which numerical stability and observability practices matter once training passes the first few hundred steps. It also covers common failure modes with troubleshooting paths and a staged rollout approach for building a reusable training pipeline template.

    1. Background and Technical Value

    A recent engineering milestone is worth attention: in a two-node, 16-GPU environment built from domestic accelerator cards, the pretraining pipeline for a large dense model (hundreds of billions of parameters, with a mixture-of-experts design and long context) was brought up end to end and advanced stably for 400 iterations.

    “Brought up” here does not mean a single card can produce a forward result. It means the full loop is closed: data loading, computation graph construction, distributed communication, optimizer updates, checkpoint saving and restoration, and metric collection all work, with the loss curve decreasing monotonically within an acceptable range.

    The value of this kind of validation lies in three points. First, it separates “can it compute” from “can it train.” Correct single operators only solve the former; training stability, communication efficiency, and memory usage control determine the latter. Second, 400 steps is a meaningful engineering threshold. It is enough to expose problems that only surface after dozens of steps, such as learning rate warmup, gradient clipping, mixed-precision scaling, and data shard misalignment. Third, it shows that the software stack adaptation methodology is reusable, so larger tasks can follow the same process.

    2. Why “Two Nodes, 16 GPUs” Is a Typical Validation Unit

    Two servers with eight accelerator cards each is a common mid-scale validation configuration in the industry, for three reasons.

    • Moderate scale: a single node with eight cards only covers intra-node interconnect and cannot validate cross-node communication, while debugging at a scale of dozens of nodes is costly and slow to localize. Two nodes can stress cross-node bottlenecks while keeping iteration fast.
    • Complete topology: intra-node traffic usually runs over high-bandwidth interconnect, while inter-node traffic runs over network interfaces. The difference between these two tiers directly affects the choice of parallelism strategy.
    • Controllable cost: before scaling up, using the smallest reproducible unit to confirm that scripts, configurations, and monitoring are correct is standard practice for avoiding large wasted compute.

    3. Environment Preparation: Eliminate Uncertainty Up Front

    Most training pipeline failures are not model problems but environment details. It is worth checking the following in order.

    1. Driver and runtime consistency: accelerator drivers, communication libraries, and runtime versions must be strictly aligned across all nodes. A mismatch on any single node can show up as a random hang.
    2. Communication backend connectivity: run a standalone collective communication self-check first, confirming that all-reduce, all-gather, and point-to-point send/receive meet expected bandwidth and latency in the cross-node case.
    3. Storage and data path: training data is best placed in a two-tier structure of a shared file system or object storage plus local cache, avoiding cross-node read amplification on every step.
    4. Dependency locking: use a lock file to pin dependency versions and eliminate “works on my machine” drift.

    A schematic self-check flow can be written as:

    1. # 1) Version consistency check (example approach; actual commands depend on the environment)
    2. node_check_version
    3. # 2) Cross-node collective communication self-check
    4. collective_allreduce_bench --nodes 2 --gpus_per_node 8
    5. # 3) Data read throughput stress test
    6. dataloader_bench --workers 16 --prefetch 4

    4. Parallelism Strategy: A Three-Way Balance of Memory and Communication

    Training a hundred-billion-parameter model requires a combination of multiple parallelism dimensions, with the core being a balance among memory capacity, compute efficiency, and communication overhead.

    • Data parallelism: splits the batch, and needs gradient accumulation and a suitable reduction method; cross-node bandwidth is the main bottleneck.
    • Tensor parallelism: splits a single layer’s matrix multiplication, communicates frequently, and is generally confined to the intra-node high-bandwidth domain to avoid crossing nodes.
    • Pipeline parallelism: splits layers across devices, requires handling bubbles and micro-batch scheduling, and too few micro-batches significantly lowers utilization.
    • Sequence/context parallelism: reduces per-card activation pressure in long-context scenarios, often combined with recomputation.
    • Expert parallelism: distributes experts across devices in a mixture-of-experts structure, and requires attention to load skew caused by uneven routing.

    A rule of thumb: place the most communication-intensive parallelism dimension inside the node, and spread the relatively communication-sparse dimensions across nodes. If the cross-node link utilization stays saturated while compute utilization remains low, it usually means the parallelism split does not match the topology.

    5. Numerical Stability: The Real Test Comes After 400 Steps

    Mixed-precision training often behaves normally within dozens of steps, with problems tending to appear in the middle and later stages. The mechanisms to watch closely include:

    • Loss scaling: dynamic scaling avoids gradient underflow, while the oscillation range of the scaling factor also needs monitoring.
    • Gradient clipping: clip by global norm to prevent abnormal batches from causing parameter jumps.
    • Optimizer state consistency: when a distributed optimizer shards state, ensure that the update order on each rank corresponds strictly to the parameter shard mapping.
    • Randomness management: random sources such as data shuffling, mask generation, and dropout need unified seeding to guarantee reproducibility.
    • Checkpoint atomicity: saving and restoration must include the model, optimizer, random state, and training progress; missing any one of them breaks the curve after restoration.

    6. Observability: Catch Problems Before They Grow

    It is advisable to collect at least four categories of metrics and set threshold alerts: throughput (samples per second), memory usage and fragmentation, communication time share, and loss and gradient norm. Logging and monitoring alerts should cover single-card granularity to make it easy to locate slow nodes quickly. In practice, a slow node often shows up as an overall throughput drop while a few cards show abnormal utilization, and comparing per-card metrics is enough to pinpoint it.

    7. Common Failures and Troubleshooting Paths

    • Hang with no error: suspect cross-node communication or a driver issue on some node first, and use bisection to disable parallelism dimensions one segment at a time to localize.
    • Out of memory: first reduce activations (recomputation, sequence parallelism), then adjust micro-batch and parallelism split, and finally consider offloading optimizer state.
    • Loss spikes: check whether data shards are misaligned, whether learning rate warmup is too short, and whether the clipping threshold is too loose.
    • Inconsistency after restoration: verify checkpoint completeness and random state, and confirm that the data loader progress is synchronized.

    8. Implementation Recommendations

    In cloud environments with complete compute and supporting capabilities, such as Baidu AI Cloud, this kind of validation is typically delivered through a container platform for environment provisioning, with shared storage and object storage carrying data, and full-pipeline observability achieved through monitoring alerts and logging services. A suggested practice path: first validate script correctness with a small model, then gradually scale up parameters and parallelism, keeping a rollback-capable checkpoint at each step, and finally form a standardized training pipeline template for the team to reuse.