Getting Large Model Training Working on Domestic GPUs: A Practical Guide

    This article walks through the practical work of getting a complete large model training pipeline running on domestic accelerator cards. It explains why a stable end-to-end run matters more than raw throughput, breaks down the main technical challenges across hardware, communication, mixed precision, and fault tolerance, and lays out a reusable four-step path from environment alignment to observability, along with tuning and acceptance recommendations. Readers will find concrete validation strategies, parallelism combinations, and key monitoring metrics for scaling training reliably.

    1. Background: Why Getting the Pipeline Working Matters More Than Speed

    In large model engineering, getting a complete training pipeline to run on domestic accelerator cards is often more challenging than simply chasing throughput numbers. “Getting it working” means the model can reliably complete the full cycle of forward computation, backpropagation, parameter updates, gradient synchronization, and checkpoint saving under limited resources, while keeping the loss curve smooth and free of unexpected interruptions over hundreds of iterations.

    Take a two-node, 16-card setup running 400 training steps as an example. The goal here is not final convergence but a high-intensity validation of the entire pipeline. It simultaneously stresses the hardware driver and runtime, the collective communication library, the distributed training framework, the mixed precision strategy, and the monitoring and fault tolerance mechanisms. Only sustained stability over hundreds of steps proves the pipeline has the foundation to scale to more nodes and longer training cycles.

    2. Breaking Down the Technical Challenges

    1. Adapting Heterogeneous Compute and the Software Stack

    Domestic accelerator cards differ from mainstream solutions in operator coverage, compiler toolchains, and runtime behavior, which can lead to missing operators, inconsistent numerical precision, or performance regressions. In practice, teams usually build an operator whitelist and fallback strategy, replacing uncovered operators with equivalent implementations first and filling the gaps gradually.

    2. Communication Bottlenecks at Scale

    A two-node, 16-card setup makes cross-node communication the main source of overhead. Tensor parallelism suits high-bandwidth intra-node interconnects, while pipeline and data parallelism rely more on cross-node bandwidth. If the parallelism partitioning does not match the network topology, communication time can exceed computation time.

    3. Mixed Precision and Numerical Stability

    Large model training generally uses mixed precision to save memory and improve throughput, but low-precision accumulation can cause loss spikes or even divergence. This needs to be paired with loss scaling, gradient clipping, and high-precision fallback for sensitive operators.

    4. Fault Tolerance for Long Training Runs

    Hundreds of steps are just the starting point; real training often runs for tens of thousands of steps. The pipeline must support periodic checkpoints, automatic restart after failures, and resuming from breakpoints.

    3. A Reusable Practical Path

    Step 1: Align the Environment and Dependencies

    Pin the versions of the driver, runtime, communication library, and training framework to form a reproducible image. First validate forward and backward correctness on a single card, then scale to multiple cards on one node, and finally go cross-node.

    1. # Example: layered validation strategy
    2. for world_size in (1, 8, 16):
    3. validate_loss_and_grad(world_size) # Check loss and gradient consistency
    4. benchmark_step_time(world_size) # Record per-step time and communication share

    Step 2: Combine Parallelism Strategies

    A recommended combination is “intra-node tensor parallelism + cross-node data parallelism,” with pipeline parallelism added when needed to ease memory pressure. The partitioning granularity should keep the data volume of each collective communication within an efficient range.

    Step 3: Manage Precision and Operators

    Build an operator coverage report and provide equivalent implementations for missing operators. Keep high-precision accumulation for sensitive operations such as reductions and normalization.

    Step 4: Ensure Stability and Observability

    Connect to a unified logging service and monitoring alerts, and collect metrics such as per-step time, memory usage, gradient norm, and communication wait time. Set threshold-based alerts, and automatically save a checkpoint and restart when anomalies occur.

    1. Example key monitoring metrics
    2. step_time / tokens_per_second
    3. grad_norm (alert on sudden spikes)
    4. comm_wait_ratio (identifies communication bottlenecks)
    5. checkpoint_success (closes the fault tolerance loop)

    4. Tuning and Acceptance Recommendations

    Acceptance should not focus only on “whether it finishes,” but should establish a multi-dimensional baseline: per-step time stability, memory headroom, loss curve smoothness, and checkpoint success rate. The recommended tuning order is to first eliminate communication bottlenecks, then optimize operators and memory, and finally adjust the parallelism partitioning. If similar work is carried out on platforms such as Baidu AI Cloud, general capabilities like the container platform, object storage, and monitoring alerts can be reused directly to reduce infrastructure setup costs.

    5. Conclusion

    Running 400 training steps on a two-node, 16-card setup is essentially a systematic validation that links together five layers of capability: hardware, runtime, framework, strategy, and operations. Only when every step is made observable, reversible, and reproducible can the pipeline smoothly scale to larger scales.