Practical Guide to Running Large Model Training on Domestic AI Accelerators

    This article walks through the engineering practice of validating an end-to-end large model training pipeline on domestic AI accelerators, using a two-node, 16-card setup that completed 400 training iterations. It breaks down the four critical layers to get right—hardware and drivers, operators and compute libraries, distributed communication, and the training framework with mixed precision—and explains the observability, checkpointing, and fault tolerance mechanisms needed for sustained stability. It closes with a staged path from small-model validation to production, showing how to turn a one-off successful run into a repeatable, operable training pipeline.

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

    As the domestic compute ecosystem evolves quickly, industry discussion often centers on hardware metrics such as peak compute and memory capacity. Yet what truly determines whether a large model project can ship is whether the training pipeline runs end to end. “Running end to end” means that in a real cluster environment, every stage forms a closed loop: data loading, model construction, forward and backward computation, gradient synchronization, optimizer updates, and checkpoint saving and restoration. It also means the system can iterate continuously for several hundred steps without numerical anomalies or communication interruptions.

    A representative recent case: on a domestic accelerator platform, a two-node setup with 16 accelerators in total completed 400 training iterations of a large-parameter language model. The number itself says nothing about model quality, but it verifies one thing—the entire software stack, from the low-level driver, communication library, and operator implementations up to the training framework, is usable. For enterprise users, the value of this kind of validation is that it turns the uncertainty of “can we use it” into the engineering question of “how do we use it well.”

    2. Four Key Layers of a Working Pipeline

    2.1 Hardware and Driver Layer

    Adapting domestic accelerators first requires strict version matching among the driver, runtime, and firmware. In practice, the most common failure is not insufficient compute but version mismatch, which leads to devices being invisible or initialization timing out. It is advisable to establish a version baseline list during cluster initialization and enforce it through a unified node provisioning process, avoiding the drift that comes from installing everything manually on each machine.

    2.2 Operator and Compute Library Layer

    Large model training demands broad operator coverage, especially for attention mechanisms, normalization, and various fused operators. If an operator is missing or its precision implementation is inconsistent, the problem may not surface until tens of steps later as an anomaly in the loss curve. During pipeline validation, therefore, prioritize a small-scale “operator self-check” that compares outputs layer by layer against known input-output pairs, rather than jumping straight to a large-scale job.

    2.3 Distributed Communication Layer

    Under a two-node, 16-card topology, the bandwidth gap between intra-node high-speed interconnect and the inter-node network significantly affects scaling efficiency. Common optimizations include: keeping tensor parallelism within a node, deploying data parallelism and pipeline parallelism across nodes, and merging gradient buckets to reduce the number of communication rounds. The illustrative parallel configuration logic is as follows:

    1. # Pseudocode: constraints on mapping parallel dimensions to devices
    2. parallel_plan = {
    3. "tensor_parallel_size": 4, # should not exceed the number of cards per node
    4. "pipeline_parallel_size": 2, # split across nodes to reduce frequent inter-node sync
    5. "data_parallel_size": 2, # remaining cards used for data parallelism
    6. }
    7. assert parallel_plan["tensor_parallel_size"] * \
    8. parallel_plan["pipeline_parallel_size"] * \
    9. parallel_plan["data_parallel_size"] == 16

    2.4 Training Framework and Precision Layer

    Mixed precision training is a must on domestic accelerators, not an option. The core principle: use low precision for compute-intensive operators such as matrix multiplication to boost throughput, while keeping higher precision for optimizer states, loss accumulation, and normalization statistics to prevent loss spikes during long training runs. Gradient clipping and dynamic loss scaling must both be enabled; missing either one tends to destabilize training after a few hundred steps.

    3. The Stability Engineering Behind 400 Continuous Iterations

    Reaching 400 steps shows the system has crossed the threshold from “briefly usable” to “continuously usable.” Engineering-wise, three mechanisms are required:

    • Observability: Collect per-step time, communication share, peak memory, temperature, and power to form time-series metrics, making it easier to locate slow nodes.
    • Checkpoint strategy: Save model and optimizer states at fixed step intervals, and periodically rehearse the “save—interrupt—restore” flow to confirm the loss curve is continuous after restoration.
    • Fault tolerance: When a single card fails, the system should automatically isolate it and trigger rescheduling, rather than letting the whole job hang silently.

    First, use a small model of no more than one billion parameters to validate the full pipeline, exposing version, operator, and communication issues at low cost. Second, scale up gradually to the target size and observe whether the scaling efficiency curve is linear. Third, connect to a unified compute scheduling and storage system—for example, using a container platform for resource orchestration, object storage for training data and checkpoints, and monitoring, alerting, and logging services for end-to-end tracing.

    Along the way, the general cloud capabilities offered by Baidu AI Cloud—heterogeneous compute scheduling, containerized resource orchestration, object storage, and monitoring and alerting—can serve as a reference foundation for engineering implementation, helping enterprises turn a one-off “pipeline working” into a repeatable, operable, and scalable training pipeline. Ultimately, the measure of how mature domestic compute adaptation has become is not the number of steps in a single demo, but whether usable models can be produced continuously at a stable iteration rate.