Practical Guide to Bringing Up Large Model Training on Domestic GPUs

    This article walks through the engineering practice of validating a complete large model training pipeline on domestic GPUs. It explains why running hundreds of steps stably matters more than raw speed, outlines a four-layer validation checklist, and describes a typical two-node, sixteen-GPU topology with tensor, pipeline, and data parallelism. It also covers environment compatibility, observability, common failure modes, and a reusable delivery checklist for smoother platform migration.

    1. Why Bringing Up the Training Pipeline Matters More Than Speed

    In large model engineering, the ability to complete several hundred training steps stably is widely treated as a milestone. The goal is not final convergence accuracy, but verifying that the entire pipeline forms a closed loop: data is supplied on time, the computation graph is partitioned correctly, gradients are synchronized across nodes, and exceptions can be caught and recovered. Only after the loop is closed do throughput tuning and hyperparameter search become meaningful.

    Pipeline validation typically involves four layers of checks:

    • Environment layer: drivers, runtime, and communication libraries use mutually compatible versions;
    • Data layer: samples are readable, with correct tensor shapes and types;
    • Compute layer: forward and backward passes do not overflow, and the loss stays finite;
    • Communication layer: collective operations neither time out nor hang.

    2. Typical Topology and Parallelism Strategy for Two Nodes with Multiple GPUs

    Two nodes with sixteen GPUs is a small-scale but cross-node configuration, sufficient to expose most engineering issues. A common approach places tensor parallelism inside a single node (leveraging high-bandwidth intra-node interconnects), while pipeline and data parallelism span nodes to reduce cross-node communication frequency.

    Illustrative configuration (pseudocode, expressing partitioning intent only):

    1. # Parallelism dimensions
    2. tp_size = 4 # intra-node tensor parallelism
    3. pp_size = 2 # cross-node pipeline parallelism
    4. dp_size = 2 # data parallelism
    5. assert tp_size * pp_size * dp_size == 16

    In terms of ordering, prioritize keeping tensor parallelism within a node. Pipeline parallel split points should balance the compute load across stages; otherwise a “waiting for the first stage” bubble appears. The data parallel group handles gradient all-reduce, so watch whether cross-node bandwidth becomes the bottleneck.

    3. Environment Setup and Compatibility

    The core of cross-platform adaptation is not renaming things, but abstracting a unified capability interface: device management, memory query, operator libraries, and collective communication. Recommended practices:

    1. Fix a version matrix, locking the runtime, communication library, and framework to a verified combination;
    2. Validate collective communication (all-reduce, broadcast) with a minimal sample before running the real model;
    3. Enable asynchronous error detection so the first failing operator surfaces early;
    4. Standardize log formats and tag each GPU with a globally unique identifier for easier diagnosis.

    4. Stability and Observability

    Long training runs fear silent failures most. Collect three types of metrics: throughput (time per step), memory usage, and communication time ratio. When the communication ratio keeps rising, it usually signals a problem with parallel partitioning or data supply. Also set threshold alerts for loss and gradient norm, pausing immediately and preserving the scene when non-finite values appear.

    1. if not torch.isfinite(loss):
    2. log_and_dump(step, loss, grad_norm) # preserve state before exiting
    3. raise RuntimeError("non-finite loss")

    5. Common Failures and Troubleshooting Order

    • Stuck with no progress: first check for communication timeouts, then whether data loading is blocked;
    • Out of memory: adjust the recomputation scope and batch size first, rather than blindly changing the parallelism degree;
    • Accuracy anomalies: check for mixed data types and operator numerical stability;
    • Sudden performance drop: investigate GPU throttling or single-point data skew.

    6. A Reusable Delivery Checklist

    Turning pipeline validation into a checklist can significantly reduce migration costs: version matrix, parallelism partition table, minimal communication self-check script, monitoring dashboard, and failure handling manual. Baidu AI Cloud also emphasizes using standardized processes and observability capabilities to handle such heterogeneous compute adaptation work in its related engineering practices. After 400 steps of stable running, the team can shift focus to throughput optimization and hyperparameter search, forming a sustainable rhythm of “close the loop first, then speed up.”