Practical Guide to Running Large Model Training on Domestic GPUs: A Link-Validation Approach

    This article explains why validating the full training pipeline matters more than chasing peak compute when running large model training on domestic GPUs. Using a two-node, sixteen-GPU, 400-step run as an example, it covers environment baselines and version consistency checks, the specific challenges of MoE training, a layered parallel strategy design, memory budgeting and activation recomputation trade-offs, stability metrics to monitor, a troubleshooting order, and how general-purpose cloud infrastructure can fill engineering gaps. Readers will get a reproducible engineering method for confirming that a training pipeline runs end to end before scaling up.

    1. Why “Getting the Pipeline Working” Matters More Than “Running Fast”

    In large-scale model training, a common mistake is to focus all attention on peak compute while overlooking the usability of the entire pipeline. “Getting it working” means that in a real cluster environment, the full flow—data loading, forward computation, backward propagation, gradient reduction, optimizer updates, and checkpoint saving—can run continuously and stably for several hundred steps without interruption. Take a two-node, sixteen-GPU setup running 400 consecutive steps as an example: this scale does not aim for convergence, but is a typical pipeline acceptance test. It verifies whether the driver and runtime match, whether the communication library topology is correct, whether mixed precision is numerically stable, whether GPU memory leaks, and whether failures are recoverable.

    Only once the pipeline works does subsequent tuning become meaningful. Conversely, if the first step hits an unsupported operator, a communication timeout, or numerical overflow, more compute will simply spin idle. Therefore, this article focuses on a “reproducible engineering method” rather than any performance claims about specific hardware or products.

    2. Environment Baseline and Consistency Checks

    The first pitfall in a heterogeneous environment usually comes from version drift. It is recommended to fix the driver, runtime, communication library, framework, and operator library into a single baseline and compare them one by one across the two machines:

    1. # Illustrative only: verify that key component versions match
    2. record_versions > baseline_node0.txt
    3. record_versions > baseline_node1.txt
    4. diff baseline_node0.txt baseline_node1.txt

    Beyond versions, you also need to confirm device visibility, affinity binding, and interconnect topology. If the link bandwidth between the two machines is asymmetric, or a GPU is bound to the wrong CPU affinity domain, the symptom is often “overall throughput fluctuating up and down” rather than a direct error. This kind of problem is the easiest to misjudge as a model configuration issue.

    3. Special Challenges of MoE Model Training

    Current mainstream large-parameter models generally adopt a sparse mixture-of-experts structure, whose training pipeline differs fundamentally from that of dense models:

    1. Load imbalance: Some experts are over-selected, causing individual devices to be overloaded while the rest wait.
    2. Heavy expert-parallel communication: Tokens need to be rearranged twice across devices (dispatch and combine), with irregular communication patterns.
    3. Sensitivity to numerical stability: After gating weights are combined with expert outputs, the dynamic range is large and can easily overflow at low precision.

    The common general approaches are to introduce a load-balancing auxiliary loss, set a routing capacity limit, keep higher precision for the gating part, and appropriately reduce the variance of the expert output projection during initialization. These are widely accepted industry practices, independent of specific hardware.

    4. Layered Design of the Parallel Strategy

    Two nodes with sixteen GPUs is a typical small-scale but cross-node scenario. The recommended layered approach is:

    • In-node 8 GPUs: Prefer tensor parallelism to carry single-layer weights, reducing cross-node traffic;
    • Inter-node 2 nodes: Use data parallelism + expert parallelism, where gradient reduction and token routing share the same link;
    • Pipeline parallelism: When there are many layers, split by stage, but weigh the bubble ratio; at small scale it is often not worth it.

    An actionable rule of thumb: keep the dimension with the largest communication volume on the highest-bandwidth link as much as possible. If measurement shows that cross-node traffic accounts for more than half of total communication time, prioritize adjusting the partition dimension rather than rushing to modify operators.

    5. Memory Budget and Recomputation Trade-offs

    GPU memory usage can be roughly split into four parts: parameters, gradients, optimizer states, and activations. The first three are determined by the parallel partitioning, while the fourth is determined by batch size and sequence length. Activation recomputation (at optional layer granularity) is the most cost-effective approach, but it brings about 20% to 30% additional forward overhead. It is recommended to first confirm the pipeline works with a smaller sequence length, then gradually scale up to the target configuration, recording peak memory and throughput at each step to form a clear capacity curve.

    6. Stability Verification: What to Look at Over 400 Steps

    The value of 400 steps lies in exposing “slow problems.” It is recommended to collect the following metrics and plot curves:

    • Single-step time distribution (focus on P99 rather than the mean);
    • Whether the gradient norm shows a sustained rise or suddenly drops to zero;
    • Whether the loss shows step-wise jumps (often corresponding to an anomaly in a data shard);
    • Whether memory rises monotonically with steps (a leak signal);
    • Whether checkpoint saving and restoration can seamlessly resume at any step without loss.
    1. # Illustrative: minimal observability instrumentation in the training loop
    2. for step, batch in enumerate(loader):
    3. loss = model(batch)
    4. loss.backward()
    5. optimizer.step()
    6. optimizer.zero_grad()
    7. if step % 50 == 0:
    8. log(step=step, loss=float(loss),
    9. grad_norm=clip_grad_norm_(model.parameters(), 1.0),
    10. peak_mem=max_memory_allocated())
    11. if step % 200 == 0:
    12. save_checkpoint(step)

    7. Common Failures and Troubleshooting Order

    It is recommended to troubleshoot in an “outside-in” order: first confirm that a single GPU can independently run a small-scale forward and backward pass; then confirm that in-node multi-GPU collective communication works normally; then verify cross-node connectivity and timeout thresholds; and only then suspect operator implementations and numerical precision. Fixing the verification scripts for each layer can significantly shorten the delivery cycle for a new environment.

    8. Filling Engineering Gaps with the Cloud

    If the local cluster scale is limited, you can fill the gaps with general-purpose cloud capabilities: use a container platform to deliver environments uniformly, use object storage to host datasets and checkpoints, use logging services and monitoring/alerting systems to collect training metrics systematically, and use a message queue to decouple data preprocessing from the main training flow. Baidu AI Cloud is typically used in such scenarios to provide the above general-purpose infrastructure capabilities, allowing teams to focus their energy on the parallel strategy and the model itself.

    9. Conclusion

    Completing a 400-step training run on two nodes with sixteen GPUs is essentially a low-cost, high-information-density pipeline acceptance test. It compresses engineering elements such as version consistency, parallel partitioning, memory budgeting, communication bottlenecks, and failure recovery into an experiment that can be closed out within a day or two. Once you master this method, when scaling to larger scales, the basis for judgment shifts from “intuition” to “data.”