Large Model Training on Domestic AI Accelerators: A Dual-Node, 16-Card Walkthrough

    Migrating large model training from mainstream international accelerators to domestic AI hardware is not a matter of "just working." It requires clearing barriers across drivers, software stacks, parallel frameworks, operator libraries, communication libraries, and numerical precision. This article breaks a training pipeline into its core stages, explains the typical dual-node, 16-card topology, and walks through software adaptation, hybrid parallel strategy, operator support, communication optimization, and stability validation. It also explains why completing a fixed run such as 400 consecutive steps serves as a meaningful acceptance milestone, and closes with a reusable rollout checklist.

    Introduction: Why “Getting the Pipeline to Run” Is Itself a Hurdle

    In the era of large models, attention tends to go to model scale, parameter counts, and final results, while a more fundamental and thornier engineering problem is overlooked: whether a complete training pipeline can run stably on the target hardware. When training migrates from mainstream international accelerators to domestic AI accelerators, “being able to run” is not a given. It is a systems-engineering effort that spans hardware drivers, software stacks, parallel frameworks, operator libraries, communication libraries, and even numerical precision.

    “Getting the training pipeline to run” usually means that in a multi-node, multi-card distributed environment, the full flow—from data loading, forward computation, and backpropagation to gradient synchronization and parameter updates—can iterate continuously for several training steps without blocking, while the loss curve stays in a reasonable range. Using a dual-node, 16-card setup that completes 400 consecutive steps as an example, this is both a check on hardware availability and a stress test of the entire software adaptation under load.

    1. The Key Stages of a Training Pipeline

    To understand where adaptation gets hard, break the pipeline into clear stages:

    1. Data side: dataset loading, tokenization, batch assembly, and distributed sampling;
    2. Model side: architecture definition, weight initialization, and precision strategy (e.g., mixed precision);
    3. Compute side: forward propagation, loss computation, backpropagation, and gradient accumulation;
    4. Synchronization side: cross-card and cross-node gradient reduction and parameter updates;
    5. Stability side: learning rate scheduling, gradient clipping, numerical overflow detection, and checkpoint resume.

    If any stage becomes incompatible or suffers a performance collapse on domestic accelerators, the pipeline either fails to run or runs unstably. The core of the adaptation work, then, is to make these five categories of stages semantically equivalent, behaviorally consistent, and performant on the target platform.

    2. Hardware Topology: A Typical Dual-Node, 16-Card Layout

    Dual-node, 16-card usually means two servers, each configured with 8 accelerator cards. What matters is not just “having enough cards,” but “whether the interconnect topology is sound”:

    • Intra-node interconnect: the 8 cards are typically connected directly through a high-bandwidth interconnect bus, well suited to the communication-heavy tensor parallelism;
    • Inter-node interconnect: the two machines connect through a high-speed network (such as an RDMA-class network), where bandwidth and latency are generally inferior to the intra-node link, making it suitable for the lighter-communication pipeline parallelism;
    • Affinity binding: placing communication-intensive parallel dimensions intra-node and communication-sparse dimensions inter-node is the first principle of topology design.

    Before starting, always use collective communication bandwidth/latency tests to confirm the actual capability of the physical links, so you don’t misdiagnose a software problem as a hardware problem, or vice versa.

    3. Software Stack and Training Framework Adaptation

    For domestic accelerators, the software stack is the biggest variable and usually needs to cover:

    • Drivers and runtime: ensure the accelerator is correctly recognized by the operating system, and that basic capabilities such as device queries and memory allocation work;
    • Compute libraries: high-performance implementations of core operators such as matrix operations and attention;
    • Framework adaptation: mainstream training frameworks need backend support for the domestic hardware so that operator scheduling lands on the domestic accelerators;
    • Distributed communication libraries: implementing and optimizing collective communication primitives (e.g., all-reduce, all-gather, reduce-scatter).

    The goal of adaptation is to make upper-layer scripts “transparent”: model code and training loops written by users should run without changing the business logic, while seamlessly offloading computation to the domestic hardware. In practice, this often means handling specific issues such as missing operators, precision inconsistencies, and differences in communication interfaces.

    4. Parallel Strategy: Combining Data, Tensor, and Pipeline

    When a single machine’s memory can’t hold a large model, hybrid parallelism becomes necessary. A typical partitioning approach on a dual-node, 16-card setup:

    1. # Distributed parallelism configuration sketch (pseudo-config, not tied to a specific framework)
    2. WORLD_SIZE = 16
    3. parallel = {
    4. "tensor_parallel_size": 8, # Intra-node tensor parallelism, splits single-layer weights
    5. "pipeline_parallel_size": 2, # Inter-node pipeline parallelism, splits by layers
    6. "data_parallel_size": 1, # Derived from WORLD_SIZE / (tp * pp)
    7. }
    • Tensor parallelism: splits a large single-layer matrix across multiple cards for parallel compute; it is communication-heavy and suited to high intra-node bandwidth;
    • Pipeline parallelism: splits the model into segments by layer across devices and executes them as a micro-batch pipeline; it has low communication but is subject to “pipeline bubbles”;
    • Data parallelism: different data shards run in parallel on model replicas and are synchronized via gradient reduction at the end, usually layered on top of tensor/pipeline parallelism.

    The core trade-off is balancing memory constraints, communication overhead, and compute utilization. Slicing too finely amplifies communication and scheduling overhead; slicing too coarsely can trigger memory overflow.

    5. Operator and Compute Kernel Adaptation

    A prerequisite for the model to run is that every operator has a correct and efficient implementation on the target hardware. Common problems include:

    • Missing operators: an operator the framework defaults to is not yet implemented in the domestic backend, requiring a fallback to an equivalent composition or a custom operator;
    • Precision differences: different backends accumulate floating point in a different order, introducing slight numerical deviations—usually harmless in early training, but worth watching for loss drift;
    • Performance collapse: an operator that is correct but poorly implemented becomes a bottleneck for the entire pipeline.

    The approach is layered troubleshooting: first verify a single operator’s correctness on one card, then verify overall numerical consistency after multi-card stacking, and finally use performance profiling to locate hot operators and optimize them specifically.

    6. Distributed Communication and Gradient Synchronization Optimization

    The efficiency of distributed training is often constrained by communication. Areas to focus on include:

    • Overlapping communication with compute: asynchronously launching gradient reduction while backpropagation is computing, to hide communication latency;
    • Gradient bucketing: merging scattered small gradients into larger blocks before communicating, reducing the number of communication rounds;
    • Communication primitive selection: choosing the right reduction method based on the parallel dimension to avoid unnecessary data movement;
    • Topology-aware scheduling: keeping communication on high-bandwidth intra-node channels to reduce inter-node data volume.

    In a dual-node, 16-card scenario, the inter-node bandwidth is usually the bottleneck, so keeping communication-intensive dimensions intra-node and placing communication-sparse dimensions across nodes is often the key to usable performance.

    7. Training Stability, Numerical Precision, and Convergence Validation

    Running does not equal running correctly. After iterating for a number of steps, you must answer:

    • Does the loss decrease smoothly? Are there numerical overflows such as NaN/Inf?
    • Under mixed precision, does loss scaling work properly?
    • Are the gradient clipping thresholds reasonable, and can they suppress gradient explosion?
    • Can checkpoint resume correctly restore optimizer state and learning rate scheduling?

    A robust practice is to set up a “baseline comparison”: under the same data and hyperparameters, compare the loss curve on domestic hardware against a known-correct baseline by trend. If the trends match and the magnitudes agree, the numerical pipeline is trustworthy.

    8. Completing 400 Steps: What This Actually Validates

    Using 400 consecutive steps as an acceptance milestone is not about the “number”—it is that the run covers enough iterations to surface a range of problems:

    • Stability: can it iterate continuously without crashing and without manual intervention;
    • Convergence: does the loss enter a reasonable downward range rather than oscillating or diverging;
    • Recoverability: are mid-run checkpoint saves and loads reliable;
    • Sustainability: do memory, compute, and communication remain stable over a long run.

    400 steps is a pragmatic scale between a “smoke test” and a “stability test”—long enough to expose hidden issues, short enough to keep debugging costs under control.

    9. A Reusable Rollout Checklist

    1. First run a minimal single-card model to verify operators and precision;
    2. Use a communication benchmark to gauge the real intra-node/inter-node bandwidth;
    3. Start from data parallelism, then progressively layer on tensor and pipeline parallelism;
    4. Fix the random seeds and hyperparameters, and establish a loss baseline;
    5. Get checkpoint saving and resume working;
    6. Use a fixed step count (e.g., 400 steps) as the acceptance milestone, performing both stability and convergence checks;
    7. Use performance profiling to locate bottlenecks and iteratively optimize communication and operators.

    Conclusion

    Getting large model training to run on domestic AI accelerators is, at its core, a systems-engineering effort spanning hardware, drivers, frameworks, operators, communication, and numerical precision. Completing 400 consecutive steps on a dual-node, 16-card setup is both an achievable engineering milestone and a reproducible methodological template. What really determines success is not any single isolated technique, but the overall engineering capability of making each layer work in concert—observable and traceable. Master this “break down—adapt—validate” approach, and the work of landing training on a domestic hardware platform becomes steadier, faster, and more predictable.