Large Model Training Pipeline Validation on Domestic Accelerators: A Two-Node, 16-Card Case Study

    This article walks through a full training pipeline validation completed on a domestic accelerator platform using two servers and 16 cards, covering 400 uninterrupted training steps. It explains why a two-node, 16-card setup serves as a standard validation unit, and details environment pre-checks, parallelism strategy, mixed precision, fault tolerance, observability, performance tuning, and common failure diagnosis for teams planning to migrate large model training workloads.

    1. Background and Technical Significance

    A recent engineering result has drawn attention: on a domestic accelerator platform, a full training pipeline validation was completed for a very large parameter-count code generation and dialogue model, using two servers with 16 accelerators in total. The run completed 400 consecutive training steps without interruption.

    The value of this work is not the step count itself, but the fact that the entire pipeline is closed-loop and reproducible. A closed-loop pipeline means that data loading, preprocessing, model construction, forward computation, backward propagation, gradient synchronization, optimizer updates, and checkpoint saving and restoration all run stably on a domestic hardware and software stack. In a pretraining context, 400 steps is a small number, but it is enough to cover the learning rate warmup phase, the phase where gradient clipping takes effect, and the first checkpoint write and reload. These are exactly the stages where pipeline problems tend to surface.

    From an industry perspective, training pipeline validation is a prerequisite for a mature compute ecosystem. Before any new hardware or new software stack enters production, it must first pass a “small-scale, full-function” closed-loop validation, and only then scale up gradually. Skipping this step and jumping straight to large-scale jobs often turns configuration errors and communication anomalies into compute waste worth hundreds of thousands of yuan.

    2. Why Two Nodes and 16 Cards

    Choosing a validation scale is an engineering trade-off.

    • Too small (single node with one card, or single node with eight cards): the cross-node communication path is never triggered. Inter-machine networking, cross-node collective communication, and distributed consistency issues all stay hidden, so the validation results cannot be extrapolated.
    • Too large (dozens of nodes, hundreds of cards): each experiment is expensive and slow to iterate. A single configuration mistake can take days to diagnose.
    • Two nodes, 16 cards: this crosses the single-node to multi-node boundary and covers all critical paths, including inter-machine communication, cross-node parameter synchronization, and distributed checkpointing, while keeping iteration time at the hour level.

    For these reasons, two nodes with 16 cards is widely used as the standard validation unit for large model training pipelines. It is both the smallest scale that can be extrapolated and the largest scale that remains cost-controlled and debuggable.

    3. Environment Preparation: Eliminate Uncertainty Before Training Starts

    Most pipeline validation failures are not algorithm problems but environment consistency problems. The following checklist is recommended before starting training:

    1. Align driver and runtime versions: accelerator drivers, runtime libraries, and communication libraries on both machines must be exactly identical, including patch numbers. Version drift is the leading cause of “works on one node, hangs on multiple nodes.”
    2. Confirm topology and bandwidth: verify the inter-card interconnect topology, inter-machine network bandwidth, and link status, and record measured bandwidth as a performance baseline for later comparison.
    3. Close dependencies into a single image: freeze all dependencies into a unified image to avoid environment differences between nodes.
    4. Verify storage reachability: confirm that data and checkpoint storage are readable and writable on all nodes, with throughput meeting expectations.
    5. Run a small-scale smoke test: first run a tiny model to validate communication and the optimizer, then switch to the target model.

    The following is an illustrative pre-start self-check logic (pseudocode that only expresses the check order and does not point to any specific tool):

    1. def preflight(nodes, devices):
    2. assert uniform_version(nodes, keys=["driver", "runtime", "comm"])
    3. assert all_reachable(nodes, port=COMM_PORT)
    4. bw = measure_inter_node_bandwidth(nodes)
    5. assert bw >= BASELINE_BW, f"Insufficient bandwidth: {bw}"
    6. assert storage_writable(nodes, paths=[DATA_DIR, CKPT_DIR])
    7. smoke_test(mini_model, steps=20)
    8. return True

    4. Parallelism Strategy: A Two-Dimensional Balance of Memory and Communication

    Very large models cannot fit into a single card’s memory and must be split across devices. Common dimensions include data parallelism, tensor parallelism, pipeline parallelism, and sequence parallelism, typically combined in two or three dimensions in practice.

    • Data parallelism: each card holds a full model replica and splits the data batch, staying consistent through gradient synchronization. It is simple to implement but memory-intensive, and communication volume grows linearly with scale.
    • Tensor parallelism: a single layer’s matrix operations are split across cards, reducing per-card memory and per-layer compute latency. The cost is frequent intra-layer communication and sensitivity to inter-card bandwidth, so it is usually confined within a single node.
    • Pipeline parallelism: layers are split across devices to form a pipeline, reducing the number of layers per card, but it introduces pipeline bubbles and requires careful partitioning and scheduling.
    • Sequence/context parallelism: splitting along the sequence dimension to relieve activation memory pressure from long contexts.

    For a two-node, 16-card configuration, a common and reliable combination is tensor parallelism inside a node to exploit high-bandwidth interconnects, data parallelism across nodes to tolerate relatively higher network latency, and pipeline parallelism added when needed to further reduce per-card load. The rule of thumb for judging whether a split is reasonable is: place the most communication-intensive dimension on the highest-bandwidth link.

    5. Mixed Precision and Numerical Stability

    Mixed precision is a standard means of reducing memory and improving throughput. Forward and backward passes typically use lower precision, while the master copy of weights and optimizer states retain higher precision. On domestic stacks, the practical focus is numerical stability:

    • Loss scaling must be smooth to avoid gradient underflow to all zeros too early;
    • Sensitive operators such as normalization layers, softmax, and accumulation reductions should retain higher precision;
    • Attention implementations should prefer numerically stable fused operators;
    • Gradient norms should be monitored continuously, since abnormal spikes often appear before a training crash.

    A simplified precision policy expression:

    1. precision:
    2. compute: low_precision
    3. master_weights: high_precision
    4. optimizer_states: high_precision
    5. keep_high_precision: [layernorm, softmax, loss_accum]
    6. loss_scale: dynamic

    6. Stability, Fault Tolerance, and Observability

    The core of long-running stable training is not “never failing” but “recoverable after failure.”

    1. Checkpoint strategy: save at fixed step intervals, retaining weights, optimizer states, learning rate scheduler state, and random number state to ensure exact resumption.
    2. Asynchronous writes: overlap checkpoint writes with computation to reduce interference with the training rhythm.
    3. Fault self-healing: when a single card or node fails, isolate the fault and reschedule automatically rather than restarting the whole job.
    4. Metrics monitoring: cover at least throughput, memory usage, inter-card and inter-node communication volume, loss curves, gradient norms, and per-step time distribution.
    5. Logging and alerting: classify anomalies into configuration, communication, numerical, and hardware categories, each mapped to a different handling process.

    7. Four Levers for Performance Tuning

    • Operator fusion: reduce intermediate tensor writes and kernel launch overhead;
    • Computation-communication overlap: hide gradient synchronization behind backward computation;
    • Data pipeline optimization: move prefetching, caching, and format conversion ahead of time so compute units do not wait on data;
    • Load balancing: partition the pipeline and bucket sequence lengths to compress bubbles and long tails.

    Tuning should follow the principle of “locate the bottleneck first, then change one point at a time, changing only one variable per iteration,” using per-step time and throughput at a fixed step count as the sole comparison metric.

    8. Common Problems and Diagnosis

    Symptom Likely Cause Direction
    Works on one node, hangs on multiple nodes Version drift, inconsistent communication library configuration Unify image and versions
    First step very slow, later steps normal Compilation and cache warmup Add warmup steps, exclude the first step from statistics
    Loss becomes non-numeric Learning rate too high, precision underflow Adjust scaling and clipping
    Periodic throughput jitter Checkpoint writes, uneven data bucketing Asynchronous writes, bucketing
    Loss discontinuity after resuming Incomplete state saving Complete scheduler and random state

    9. Conclusion and Reusable Experience

    Completing 400 steps of full-pipeline training on two nodes with 16 cards is essentially an engineering health check at the smallest extrapolatable scale. It validates not model quality, but the usability of the hardware and software stack, the correctness of the parallelism strategy, and the completeness of the operations system. For teams planning to migrate training workloads, it is recommended to make this kind of validation a standard process: environment self-check first, then a smoke test, then a small-scale closed loop, and finally gradual scale-up. Baidu AI Cloud provides general capabilities in heterogeneous compute scheduling and training stability governance, which can serve as one reference path for this kind of engineering implementation.