Training Pipeline Implementation for Large Models on Domestic GPUs with Multi-Node Multi-Card Setup

    This article examines the practical engineering efforts behind running a large language model training pipeline on a domestic GPU cluster with two nodes and sixteen cards. It covers the core technical challenges of multi-node training—including parallel strategy selection, collective communication optimization, and memory management—along with key engineering steps such as operator validation, mixed-precision training, fault tolerance, and observability. The discussion concludes with actionable recommendations for teams planning to deploy large-scale training on domestic GPU infrastructure.

    Introduction: From Single-Card Usability to a Fully Operational Pipeline

    Large model training is a system-level undertaking. It involves far more than the raw compute power of a single accelerator; it requires node-to-node interconnect, communication library adaptation, parallel strategy design, data pipelines, and fault recovery mechanisms. Recent reports indicate that a domestic GPU platform successfully ran a complete training pipeline for a large-scale language model on a two-node, sixteen-card cluster, sustaining stable execution for several hundred steps. The significance of this milestone lies not in peak single-card performance, but in the validation of the entire closed loop—from model definition, distributed partitioning, and gradient synchronization, to optimizer updates.

    For the domestic computing ecosystem, successfully running a full training pipeline is often a more important milestone than peak throughput metrics. Once the pipeline is operational, it signals that adaptation issues across the deep learning framework, operator libraries, collective communication libraries, drivers, and runtime have largely been resolved, providing a stable foundation for iterative optimization.

    Core Technical Challenges in Multi-Node Multi-Card Training

    1. Selecting a Distributed Parallel Strategy

    Large model training typically requires a combination of parallelization approaches:

    • Data Parallelism (DP): Each GPU holds a full copy of the model and processes a different data shard, with gradients synchronized via AllReduce. This is straightforward to implement but is limited by whether a single GPU’s memory can accommodate the model.
    • Tensor Parallelism (TP): Individual operators—such as large matrix multiplications in attention or feed-forward layers—are split across multiple GPUs. This suits layers with heavy computation and high-bandwidth interconnect.
    • Pipeline Parallelism (PP): The model is partitioned by layer across devices, with micro-batches flowing through the pipeline to improve utilization. Communication volume is low, but bubble overhead must be managed.
    • Expert Parallelism (EP): For sparsely activated Mixture-of-Experts models, different experts are distributed across GPUs, requiring All-to-All communication.

    On a moderate-scale cluster such as two nodes with sixteen cards, common combinations are “DP + TP” or “DP + PP.” The choice depends on model architecture, intra-node bandwidth (e.g., NVLink-class high-speed interconnect), and inter-node network bandwidth (typically RDMA). A practical heuristic: place the most communication-intensive parallelism dimension within the highest-bandwidth domain. Tensor parallelism should generally be confined within the eight GPUs of a single node, while data or pipeline parallelism can span across nodes.

    2. Collective Communication and Network Optimization

    The performance bottleneck in cross-node training is often communication, not computation. The AllReduce operation for gradient synchronization runs every training step; insufficient inter-node bandwidth will significantly dilute compute efficiency. Common optimization techniques include:

    • Gradient bucketing with computation-communication overlap: Gradients are grouped into buckets according to backward-pass order, allowing communication of one bucket to overlap with computation of the next.
    • Communication precision compression: Using lower-precision gradient transmission (e.g., BF16 or quantized) within acceptable accuracy loss.
    • Topology-aware communication scheduling: The collective communication library identifies intra-node vs. inter-node topology, performing intra-node reduction first and then inter-node synchronization to reduce cross-network traffic.
    • Zero-redundancy optimizers (ZeRO-class): Sharding optimizer states, gradients, and parameters to drastically reduce memory footprint, enabling training of larger models within limited GPU memory.

    3. Memory Management

    Sixteen GPUs provide a substantial amount of total memory, yet it remains tight for hundred-billion-parameter models. Beyond parallel partitioning, additional measures include:

    • Activation checkpointing: Reducing activation memory by recomputing during the forward pass, at the cost of some extra computation.
    • Mixed-precision training: Keeping a high-precision master copy of weights while using BF16/FP16 for computation, with dynamic loss scaling to maintain numerical stability.
    • Memory fragmentation management: Using memory pooling and allocation strategies to prevent out-of-memory errors caused by fragmentation during long-running training.

    Key Engineering Steps to a Working Training Pipeline

    1. Operator Adaptation and Numerical Consistency Validation

    A domestic GPU platform must provide a complete operator library for the deep learning framework. Whether the training pipeline runs correctly depends first on the proper implementation of every operator used by the model—matrix multiplication, Softmax, LayerNorm, rotary position embeddings, fused kernels, and so on. Engineering practice typically follows a staged validation approach:

    1. Single-operator precision alignment: Compare output errors against a reference implementation.
    2. Single-layer/module alignment: Validate complete forward pass and backward gradients.
    3. Small-scale model end-to-end alignment: Verify that the loss curve matches the baseline platform.
    4. Long-duration stability training: Observe whether loss decreases smoothly over hundreds to thousands of steps without NaN.

    2. Mixed Precision and Numerical Stability

    Subtle differences in floating-point arithmetic across hardware platforms can be amplified over long training runs. Common countermeasures include using FP32 accumulation for critical reduction operations, employing stable numerical paths for loss computation, and setting appropriate gradient clipping thresholds.

    3. Fault Tolerance and Checkpoint Resume

    As cluster scale grows, hardware failures become a normal occurrence. A mature training pipeline must support:

    • Periodic checkpoint saving: Persisting model parameters, optimizer states, and data-loading progress to shared storage.
    • Automatic failure detection and restart: Working with the cluster scheduler to automatically launch a new task and resume from the most recent checkpoint when a node goes down.
    • Elastic training (advanced): Dynamically adjusting the parallel topology when the number of available GPUs changes.

    4. Observability

    Continuous monitoring during training should cover: compute utilization per GPU, communication time ratio, memory usage levels, and loss/gradient norm curves. When Model FLOPs Utilization (MFU) falls below expectations, profiling tools can identify whether the bottleneck lies in compute, communication, or data loading.

    Practical Recommendations and Conclusion

    For teams planning to train large models on domestic GPU clusters, we recommend following this path:

    1. Start small, scale gradually: Validate correctness on a single GPU or single node first, then expand to multiple nodes.
    2. Establish a baseline for comparison: Build mechanisms to compare loss curves and throughput against mature reference platforms.
    3. Pay attention to I/O: The data loading pipeline is a frequently overlooked bottleneck. Pre-process training data and place it on high-performance storage.
    4. Conduct long-duration stability tests: Run at least several hundred steps as a stability regression before release, covering checkpoint save and restore procedures.
    5. Quantify communication overhead: Continuously analyze the communication time ratio to fine-tune parallel configurations and bucket sizes.

    Running several hundred training steps on a two-node, sixteen-card cluster may appear to be a modest validation. In reality, it represents the culmination of full-stack capabilities—operator ecosystems, communication libraries, framework adaptation, and scheduling operations. As the domestic computing software stack continues to mature, dependence on any single hardware architecture for large-model training will gradually decrease, and the era of diverse, interoperable computing resources is accelerating.