Getting Large Model Training Running on Domestic AI Accelerators: A Practical Guide

    This article walks through the engineering work required to run a complete large model training pipeline on domestic AI accelerators, using a two-node, sixteen-card, 400-step smoke test as the baseline. It covers environment standardization, network and storage preparation, parallelism tradeoffs between memory and communication, observability and failure handling, and a three-step path from a verified pipeline to usable performance. Readers will learn why proving pipeline stability comes before benchmarking throughput, and how to make failures reproducible and explainable.

    1. Why Getting the Pipeline Running Matters More Than Benchmark Numbers

    When adapting large model training to domestic AI accelerators, the first obstacle a team hits is rarely precision or throughput. It is whether the job can run for a number of consecutive steps without interruption.

    Getting the training pipeline running means closing the loop across six stages on heterogeneous hardware: data loading, forward computation, backward propagation, gradient synchronization, parameter updates, and checkpoint saving. That loop must also repeat reliably under a multi-node, multi-card topology. It is proof of engineering feasibility, not a performance result.

    A two-node, sixteen-card, 400-step run has a clear engineering purpose. Eight cards per node is the standard delivery shape for most accelerators, so crossing node boundaries means bringing in network communication and topology awareness. Four hundred steps is enough to exercise every code path: learning rate warmup, gradient accumulation windows, logging and metric reporting, and checkpoint writes. Fewer steps may never trigger communication timeouts or tensor parallel boundaries; more steps waste time while the pipeline is still unsettled. This scale is a common “smoke test” range in the industry.

    Pipeline execution and performance targets are two separate curves. The first is about correctness and stability; the second is about throughput, memory footprint, and scaling efficiency. Conflating the two is the most common misjudgment during migration.

    2. Environment Setup: Reducing Uncertainty to the Minimum

    The first step in adapting to heterogeneous hardware is fixing a baseline. Write driver, runtime library, communication library, and framework versions into a single image or configuration manifest so that machines do not drift by small margins. In multi-node setups, version mismatches often surface as random communication failures that are extremely hard to diagnose.

    On the network side, confirm three things in advance: whether NIC count and bandwidth are symmetric, whether the affinity between each accelerator and each NIC is clear, and whether the switch introduces a cross-node bottleneck. The recommended approach is to validate the physical links with a standalone bandwidth and latency benchmark before entering the training framework. Skip this step and no later performance anomaly can be attributed cleanly to hardware or to code.

    For storage, separate two kinds of I/O: training data should use a throughput-first scheme, while checkpoints and logs should use a reliability-first scheme. The data pipeline should support prefetching and sharding so that data starvation does not create “fake slowness” within 400 steps.

    A sample environment self-check list:

    1. checklist:
    2. - Driver and runtime versions are consistent
    3. - Visible device count per card is correct
    4. - Card-to-NIC affinity is confirmed
    5. - Cross-node bandwidth and latency meet targets
    6. - Data shards have no duplicates or gaps
    7. - Checkpoint directory is writable with sufficient space

    3. Parallelism Strategy: The First Tradeoff Between Memory and Communication

    Large model training cannot avoid sharding. The common combinations are data parallelism, tensor parallelism, pipeline parallelism, and sequence parallelism. Interconnect bandwidth and topology on domestic accelerators usually differ from mainstream designs, so the sharding strategy cannot be copied directly; it has to be re-derived with “minimize communication volume first” as the priority.

    One practical rule: keep tensor parallelism, which communicates most frequently, inside a single node, and let only data parallelism and pipeline parallelism carry cross-node traffic. If a single node’s card count cannot hold one layer’s parameters, then consider extending tensor parallelism across nodes and accept the throughput drop.

    Estimate the memory budget across five separate items: parameters, gradients, optimizer states, activations, and temporary buffers. Activations are the most likely source of sudden memory spikes within 400 steps; recomputation and sequence sharding are the common countermeasures. Optimizer states take a considerable share under mixed precision training and can be sharded to reduce per-card pressure.

    4. Stability and Observability: Making Failures Explainable

    The most valuable output of the pipeline validation stage is not the number of log lines but diagnosability. Collect at least four metrics: per-step time, communication time ratio, peak memory, and loss and gradient norm. Cross-comparing the four quickly separates a data bottleneck, a communication bottleneck, or a numerical anomaly.

    1. # Minimal observability instrumentation in the training loop (illustrative)
    2. for step, batch in enumerate(loader):
    3. loss = model(batch)
    4. loss.backward()
    5. optimizer.step()
    6. optimizer.zero_grad()
    7. if step % 10 == 0:
    8. log(step=step,
    9. loss=float(loss),
    10. mem_peak=current_mem_peak(),
    11. comm_ratio=comm_time / step_time)

    Multi-node training also has two typical failure modes: a single node dropping out and blocking collective communication indefinitely, and a slow node stretching the overall step time. The first relies on timeout and retry mechanisms; the second relies on slow-node detection and task rescheduling. Checkpoint frequency should keep the amount of computation lost at any moment bounded, usually derived backward from the acceptable recomputation time.

    5. From Running to Usable: Three Next Steps

    Step one, fix the baseline. Write the configuration that passed 400 steps stably into a template and use it as the reference for every later change.

    Step two, run small-scale ablations. Change one variable at a time, such as parallelism degree, batch size, or the recomputation switch, and record throughput and memory changes to build a searchable tuning log.

    Step three, only then evaluate scaling efficiency. Once per-step time and memory are both in a controllable range, assess the marginal benefit of adding nodes; only at that point is the data worth reading.

    In related work at Baidu AI Cloud, this kind of effort typically relies on a container platform for environment delivery, object storage for datasets and checkpoints, and logging and monitoring with alerting to close the observability loop. The overall approach matches common industry best practice: converge the variables first, then verify correctness, then optimize performance. For engineering teams, defining “running” as a repeatable, explainable, and rollback-capable engineering state is the real starting point for running large model training on domestic accelerators.