LLM Training on Domestic AI Accelerators: A Practical Guide to Bringing Up the Full Training Pipeline

    Bringing up the complete LLM training pipeline on domestic AI accelerator cards is more than a matter of scale or convergence; it requires hardware, drivers, compilers, operator libraries, collective communication libraries, and training frameworks to work together end to end. This article explains why "getting the pipeline running" is an engineering threshold in its own right, then breaks down the three core challenges of migrating to new accelerators: software stack adaptation, distributed parallelism, and numerical stability under mixed precision. It recommends two nodes with 8 accelerators each (16 cards total) as a practical minimal validation environment and 400 training steps as a meaningful milestone, and outlines a step-by-step bring-up path from a single card to multi-node runs, a troubleshooting reference for common failures, and the engineering principle behind it all: validate layer by layer, design parallelism around the hardware topology, and test operators for numerical consistency.

    1. Why “Getting the Training Pipeline Running” Is an Engineering Hurdle of Its Own

    In large model training, results are usually measured by metrics such as parameter count, number of training steps, and loss convergence. On domestic AI accelerator cards, however, whether a complete training pipeline can run end to end often deserves more attention than these metrics, because it is a prerequisite for all subsequent work.

    A “training pipeline” is the full closed loop: data loading, forward computation, backward propagation, gradient synchronization, optimizer updates, and periodic checkpoint saving. This loop spans multiple layers, including hardware, drivers, compilers, operator libraries, communication libraries, and the training framework itself. Even a minor mismatch in any one of them can cause the job to hang, produce incorrect results, or crash outright. As a result, “getting it running” means more than making the program run without errors. The entire pipeline must meet usable standards for functionality, stability, and numerical correctness.

    This work is complex because large-scale training is essentially a systems engineering effort that tightly couples software and hardware, not simply application development. Understanding this is the foundation for the practical work that follows.

    2. Three Core Challenges When Migrating to New AI Accelerators

    2.1 Software Stack Adaptation: From Operators to Compilers

    Accelerators built on different architectures differ in their instruction sets, the organization of their compute units, and their memory hierarchies. Operators used in mainstream training frameworks, such as matrix multiplication, attention, LayerNorm, and AllReduce, must be reimplemented on the new hardware or optimized through compilation. Adaptation typically involves:

    • Operator coverage: Training a large model can involve hundreds of operators. A single missing forward or backward operator will break the pipeline.
    • Computation graph compilation: The framework’s computation graph must be compiled correctly into instructions the target hardware can execute. This involves graph optimization, memory planning, and operator fusion.
    • Numerical alignment: Some operators may produce results that deviate from the reference implementation at lower precision. Each one needs to be verified through unit tests.

    In practice, it is advisable to establish a suite of operator-level consistency tests. For the same input, compare the maximum and relative error between the target hardware’s output and the reference implementation. Only move on to full-pipeline validation once these deviations fall within an acceptable range.

    2.2 Distributed Parallelism: Coordinating Data, Tensor, and Pipeline Strategies

    A large model often does not fit on a single card, so distributed parallelism becomes necessary. Three common strategies are usually combined:

    • Data parallelism: Different cards process different data batches, and gradient synchronization keeps the model replicas consistent.
    • Tensor parallelism: Large matrices within a single layer are split across cards to reduce memory pressure on each card.
    • Pipeline parallelism: The model is split by layer so that different cards handle different stages of it.

    The right choice of parallel strategy depends heavily on hardware interconnect bandwidth. Inter-card interconnect bandwidth determines how finely tensor parallelism can be split. Inter-node network bandwidth affects the efficiency of gradient synchronization for data parallelism. If parallelism degrees are configured without accounting for the topology, performance can degrade significantly even when the pipeline runs successfully.

    2.3 Numerical Stability: Hidden Risks Under Mixed Precision

    Large model training commonly uses mixed precision, such as BF16/FP16 for computation and FP32 for master weight updates, to save memory and bandwidth. On new hardware, mixed precision can introduce problems such as gradient overflow, loss spikes, and division by zero. A common approach is to use loss scaling to adjust the scaling factor dynamically and to retain higher precision for critical reduction operations.

    3. Two Nodes × 8 GPUs: A Practical Minimal Validation Environment

    Before committing to large-scale training, it is essential to choose a validation cluster of moderate size. Two nodes with 8 accelerators each (16 cards total) is a widely adopted, reasonable starting point for three reasons:

    1. It covers multi-node communication. The setup includes both intra-node (8 cards) and inter-node interconnect, forming a two-level topology. This exposes real-world problems such as cross-node gradient synchronization in data parallelism and cross-node transfers in pipeline parallelism.
    2. It is manageable in scale. Compared with larger clusters, 16 cards provide faster debugging feedback and a lower cost of diagnosing problems.
    3. It is representative. 8-way parallelism within a single node is a standard industry configuration. Combining two nodes verifies the correctness of multi-node scaling.

    When setting up this environment, focus on:

    • Physical topology: Confirm how cards are interconnected within a node and the bandwidth of the inter-node network, then design the parallel split accordingly.
    • Communication backend: Collective communication operations (AllReduce, AllGather, ReduceScatter, and others) must be verified for correctness on the target hardware.
    • Environment isolation: Use containerization to standardize dependency versions across nodes and avoid environment drift that leads to issues which are hard to reproduce.

    4. 400 Training Steps: Why It Is a Milestone, Not the Finish Line

    Completing 400 training steps is commonly treated as an important validation milestone because it:

    • Verifies pipeline completeness: 400 steps are enough for the optimizer to perform multiple rounds of parameter updates. This can expose intermittent issues such as memory leaks, communication timeouts, and corrupted checkpoints.
    • Reveals loss trends: The loss curve over several hundred steps provides an initial indication of whether training is converging normally rather than diverging from the outset.
    • Verifies periodic tasks: Step-triggered logic, including learning rate scheduling, gradient clipping, log reporting, and checkpoint saving, can only be thoroughly exercised over a sufficient number of steps.

    Importantly, successfully running 400 steps does not mean the setup can scale indefinitely. Going from 16 cards to hundreds or thousands brings new challenges in communication overhead, fault tolerance, and checkpoint strategies, all of which must be validated again.

    5. Implementation Path: Scaling Up Step by Step

    It is advisable to adopt a “start small, validate layer by layer” engineering approach:

    1. # Illustrative configuration for distributed training startup (pseudocode
    2. # explaining the parallelism setup and initialization flow)
    3. # 1. Initialize the distributed environment: each process needs a unique rank
    4. # and a world size
    5. dist.init_process_group(backend="collective_comm_backend")
    6. # 2. Design parallelism degrees based on the hardware topology
    7. tensor_parallel_size = 2 # intra-node tensor parallelism
    8. pipeline_parallel_size = 2 # inter-node pipeline parallelism
    9. data_parallel_size = world_size // (tensor_parallel_size * pipeline_parallel_size)
    10. # 3. Set up mixed precision and gradient synchronization
    11. model = build_model(parallel_config=...)
    12. scaler = DynamicLossScaler(init_scale=..., growth_factor=2.0) # prevent gradient overflow
    13. # 4. Main training loop: advance step by step and save checkpoints periodically
    14. for step in range(max_steps):
    15. loss = model.forward_backward(data_loader)
    16. scaler.step(optimizer, grad_sync=True) # gradient synchronization across cards/nodes
    17. if step % checkpoint_interval == 0:
    18. save_checkpoint(step) # exercise periodic tasks

    The progression should follow this order:

    1. Single-card validation: Confirm that the basic operators and data loading work correctly.
    2. Single-node, multi-card validation: Bring up intra-node data and tensor parallelism, and verify intra-node collective communication.
    3. Multi-node, multi-card validation: Introduce inter-node communication and verify cross-node gradient synchronization and pipeline transfers.
    4. Performance profiling: Use standard performance analysis techniques to identify communication, memory, or compute bottlenecks.
    5. Extended stability testing: Run for longer than the milestone number of steps to verify fault tolerance and recovery.

    6. Common Issues and Troubleshooting

    Symptom Possible cause Where to investigate
    Job hangs immediately after launch Collective communication initialization failure or incorrect topology configuration Check network connectivity, ports, and rank configuration
    Loss becomes NaN Mixed precision overflow or abnormal data Adjust loss scaling and inspect the data pipeline
    Results differ across nodes Gradient synchronization or random seed issues Use consistent random seeds and verify AllReduce correctness
    Memory usage keeps growing Memory leaks or unreleased cached memory Check computation graph caching and checkpoint release logic
    Speed far below expectations Parallel strategy does not match the topology Redesign tensor and pipeline split granularity

    The key troubleshooting principle is isolate first, then localize. Fix the input, compare results layer by layer, and execute step by step. These techniques break complex problems down into the smallest reproducible unit.

    7. Conclusion

    Bringing up the full LLM training pipeline on domestic AI accelerators is a classic example of hardware–software co-engineering. The core difficulty lies not in any single technology, but in integrating three elements as a system: software stack adaptation, distributed parallelism, and numerical stability. Using two nodes with 8 accelerators each (16 cards total) as the minimal validation environment and 400 training steps as the pipeline milestone is a pragmatic approach with manageable cost, comprehensive coverage, and room for scaling.

    For teams that want to run LLM training on this type of hardware, the methodology presented here—validate layer by layer, profile performance, and run extended stability tests—works together with operator-level consistency testing, topology-aware parallel design, and a disciplined troubleshooting process. Together, they can help teams cross the critical gap from “it starts” to “usable and scalable” with lower trial-and-error costs and greater stability.