Large Model Training on AI Accelerators: From "Can Train" to Out-of-the-Box Ready

    As large models scale to hundreds of billions or even trillions of parameters, the training demand on a compute foundation shifts from "having GPUs that can run" to "able to train reliably, stably, and for the long haul." This article clarifies the difference between inference adaptation, training adaptation, and native training; breaks down the complete training adaptation pipeline across the operator, parallelism/memory, data, and engineering layers; and explains how to verify stability, using the case of a domestic GPU completing 400 consecutive optimizer updates across 16 cards in a dual-node setup. It closes with a selection checklist and a gradual migration path for teams moving training workloads to domestic AI accelerators.

    1. Introduction: Training adaptation is the real dividing line for domestic compute taking on large models

    As large model parameter counts enter the hundreds-of-billions to trillions range, the training-side demand for a compute foundation is shifting from “having cards that can run” to “able to train, train stably, and train for the long haul.” The current mainstream approach in AI training is general-purpose accelerator cards represented by full-function GPUs, paired with distributed training frameworks. In recent years, domestic AI accelerators have continued to mature across both the software and hardware ecosystems, and many model teams have begun evaluating the feasibility of migrating pretraining, continued pretraining, and post-training onto domestic compute platforms.

    Recently, a domestic GPU vendor announced that it had completed training adaptation for an open-source flagship large model with close to a trillion parameters, based on a flagship AI training-and-inference accelerator card. In a cross-node environment with two nodes and 16 cards, all 16 training processes completed 400 consecutive optimizer updates, with the loss and gradient norm remaining finite throughout, and with no numerical overflow or abnormal interruption. The vendor also disclosed several from-scratch or full-stack native training cases, covering foundation models, multimodal world models, and embodied intelligence models, and is currently advancing training for trillion-parameter-class models.

    From an engineering perspective, the reference value of this progress lies not in any single result, but in that it answers a key question about domestic compute taking on frontier models: can it not only “run,” but “run correctly and run long-term”? This article first distinguishes several easily confused concepts, then breaks down the complete training adaptation pipeline, and finally provides verification methods and implementation recommendations for reference in technology selection and migration evaluation.

    2. First, clarify: the difference between inference adaptation, training adaptation, and native training

    2.1 The three types of work have different goals

    Dimension Inference Adaptation Training Adaptation Native Training
    Core goal Can load, can forward, correct output Correct and stable forward + backward + optimizer update throughout Complete pretraining from scratch on the target hardware
    Key pipeline Forward operators, memory, and throughput Backward operators, gradient communication, numerical stability Full pipeline plus long-cycle engineering support
    Typical verification Output aligned with the reference implementation, first-token latency, throughput Loss curve, gradient norm, cross-card consistency, checkpoint resume Full-process loss curve and model quality

    2.2 “Successful adaptation” does not mean “pretrained on that hardware”

    There is a common misreading in the industry: seeing that a model has “completed adaptation” and assuming it was pretrained on that chip. This is not the case.

    • Adaptation solves the “usable” problem. Adaptation means the model can correctly load, forward-compute, and backward-compute on the target hardware, and stably complete parameter updates. Where the pretraining compute for the original base model came from is a separate question.
    • Industry cases serve as corroboration. Some vendors have listed verification results for two different hardware routes in the same technical report, but the verification content was mainly correctness alignment of inference operators, and the source of pretraining compute for the base model was not disclosed.
    • The value of adaptation is irreplaceable. It is the prerequisite for continued pretraining, domain incremental training, post-training, and training framework migration, and is the core basis for judging whether an accelerator card can move from “usable for inference” to “usable for training.”

    2.3 Why training is much harder than inference

    1. Backpropagation brings dual pressure on operators and numerics. Inference only needs forward computation. Training additionally covers backward operators and must maintain numerical precision across gradient accumulation, cross-card reduction, and mixed precision. These steps are extremely sensitive to rounding errors; tiny deviations may be amplified over thousands of iterations.
    2. Distributed coordination introduces systemic risk. Correct on a single card does not mean correct on a cluster. Any shortfall in inter-node bandwidth, collective communication implementation, or inter-process synchronization may surface during long runs.
    3. Long cycle and high fault-tolerance requirements. Large-scale pretraining often lasts weeks or even months. A single numerical anomaly or one round of inter-card communication timeout can interrupt training and waste significant compute.
    4. More sensitive to precision and numerical range. Training’s tolerance for numerical range is far smaller than inference. “Roughly correct” during inference may show up as loss oscillation or even divergence during training.

    3. Breaking down the training adaptation pipeline: four key checkpoints

    3.1 Operator layer: from forward coverage to backward alignment

    The forward operator set needed for training is usually already validated through inference adaptation; the real new work is on the backward side:

    • Backward operator coverage and precision. A complete forward operator set does not mean backward is equally complete. Backward implementations must strictly match forward; any implementation deviation translates into gradient error.
    • High-precision accumulation. Reduction operators (such as various normalizations and the reductions inside attention) are best accumulated in FP32 internally, to reduce the error accumulation caused by low-precision accumulation.
    • Optimizer and mixed precision. States such as the momentum and second moment of adaptive optimizers usually need to be maintained in FP32. BF16 has a wide dynamic range and usually needs no loss scaling; FP16 relies on dynamic loss scaling to prevent gradient underflow. The two place different requirements on operator numerical behavior.

    It is recommended to establish a three-level “forward-backward-update” check during adaptation: first align single-step forward output, then align backward gradients, and finally verify parameter differences after N-step updates. Locating issues level by level is more efficient than troubleshooting overall deviation all at once.

    3.2 Parallelism and memory layer: parallel strategy combinations and memory management

    Large model training commonly uses multi-dimensional parallel combinations:

    • Data parallelism: splits the training data.
    • Tensor parallelism: splits single-layer computation across multiple cards.
    • Pipeline parallelism: splits the model by layer.
    • Sequence parallelism: splits the activations of long sequences along the sequence dimension.
    • Expert parallelism: distributes the experts of a Mixture-of-Experts (MoE) architecture across different devices.

    Different strategies differ greatly in the frequency and data volume of collective communication primitive calls. Data parallelism emphasizes gradient All-Reduce or Reduce-Scatter, while tensor parallelism relies more on high-frequency All-Gather and Reduce-Scatter. There are also several common difficulties:

    • Memory optimization. Activation recomputation, sharding of parameters and optimizer states, and host-side offloading are common means to control memory usage. But recomputation increases computation, and offloading introduces PCIe transfer overhead, requiring a tradeoff between throughput and memory.
    • Communication-computation overlap. If the framework uses asynchronous reduction, once backward finishes a layer’s gradient, the corresponding reduction can be triggered to overlap with subsequent layer computation. This relies on good cooperation between the reduction implementation and stream scheduling on the target hardware.
    • Topology awareness. Cross-node All-Reduce typically goes through a combination path of “intra-node Reduce-Scatter + inter-node All-Reduce + intra-node All-Gather,” and the placement order of processes onto devices directly affects communication efficiency.

    3.3 Data layer: difficulty of training adaptation for multimodal workloads

    Text models use autoregressive next-token prediction as the training objective. Multimodal models add a visual encoder on this basis, plus the loading and preprocessing of multiple data types such as images, video, and audio, so the heterogeneity of the training workload increases significantly:

    • Sample heterogeneity. A batch may contain both pure-text and image-text samples, and the effective sequence length per card may differ. Sampling must follow the modality ratio, and sequence packing with intra-sample attention masks is used to avoid cross-sample interference while reducing padding waste.
    • The data pipeline becomes a bottleneck. Reading, decoding, augmenting, and preprocessing high-resolution images or video frames are significant CPU and IO overheads. Multi-threaded prefetching, caching decoded results, and staggered preprocessing scheduling are common mitigations.
    • Unstable single-step time. The length distribution of data shards and the modality ratio jointly determine single-step time fluctuation, which can interfere with performance observation based on a fixed sampling window.

    3.4 Engineering layer: checkpoints, resume, and observability

    Long-cycle training must have complete fault tolerance:

    • Sharded checkpoints. After sharding parameters, gradients, and optimizer states, checkpoints need to be saved by shard and support re-splitting and loading after changing the parallel scale (elastic loading).
    • Atomic writes. It is recommended to “write a temporary file first, then atomically rename,” to avoid leaving corrupted files when a process exits abnormally.
    • Asynchronous saving. Put saving operations in a background thread to reduce blocking of training.
    • Observability. Continuously collect loss, gradient norm, learning rate, throughput, memory usage, and communication time. Abnormal fluctuations are the earliest signals of numerical or communication problems.

    4. Practical reference: sharded data parallel training path and stability verification

    4.1 Build a sharded data parallel training path

    Take sharded data parallelism as an example. It usually splits parameters, gradients, and optimizer states by the data parallel group, with each process holding only part of the full model state. During training, parameters are temporarily aggregated on demand, and gradients are reduced by shard during backward. It is a classic approach for controlling large model memory usage. The complete pipeline generally includes:

    1. Model loading: Load the full weights, split parameters by the sharding strategy, and initialize each shard’s optimizer state onto the corresponding process.
    2. Sharded scheduling: During forward, aggregate parameter shards layer by layer and release non-current-layer shards after computation; during backward, aggregate parameters layer by layer and reduce gradient shards. Both parameter aggregation and gradient reduction should overlap with computation to reduce communication exposure.
    3. Gradient synchronization: After backward, complete gradient shard reduction within the data parallel group. For global gradient clipping, each process also needs to first sum its local gradient squares, then take the square root after a global reduction, to ensure a consistent clipping threshold.
    4. Parameter update: Each process updates based on its held shards. Before entering the next training step, aggregate the updated parameters on demand.

    For multimodal models, you can add modality-ratio sampling, per-modality loss computation with weighted summation, and differentiated sharding for cold and hot parameters. For example, if the visual encoder is frozen, its parameters and gradients can skip aggregation and reduction directly.

    1. import math
    2. # Illustrative pseudocode: sharded data parallelism + mixed precision + gradient accumulation
    3. model = build_model(config) # Multimodal model: visual encoder + language backbone + modality projection layers
    4. shard(model, group=data_parallel_group) # Split parameters, gradients, and optimizer states by the sharding strategy
    5. optimizer = AdamW(model.parameters(), lr=2e-4, weight_decay=0.1)
    6. model.train()
    7. for step, batch in enumerate(dataloader):
    8. # Gradient accumulation: shorten the effective learning rate warmup length and appropriately lower the learning rate peak
    9. loss = compute_loss(model, batch) / accumulation_steps
    10. loss.backward() # Sharded data parallelism internally handles parameter aggregation and gradient shard reduction
    11. if (step + 1) % accumulation_steps == 0:
    12. # Global gradient norm: the local sum of squares is globally reduced first, then square-rooted, ensuring consistency across cards
    13. local_sq = sum(p.grad.detach().float().pow(2).sum() for p in trainable_params(model) if p.grad is not None)
    14. grad_norm = math.sqrt(global_reduce_sum(local_sq, group=data_parallel_group))
    15. if grad_norm > max_grad_norm:
    16. for p in trainable_params(model):
    17. if p.grad is not None:
    18. p.grad.mul_(max_grad_norm / (grad_norm + 1e-6))
    19. optimizer.step()
    20. optimizer.zero_grad(set_to_none=True)
    21. # Stability observation: prioritize recording loss, gradient norm, throughput, memory, and communication time
    22. metrics.record(step=step, loss=loss.item() * accumulation_steps, grad_norm=grad_norm)

    4.2 Two nodes, 16 cards, 400 consecutive updates: what to verify and what it shows

    “Completing 400 consecutive optimizer updates on two nodes and 16 cards” can be viewed as a cross-node short-range stability test, with the evaluation points as follows:

    Evaluation dimension Observation target Reference criteria
    Numerical validity Loss, gradient norm Finite throughout, no NaN/Inf, no abnormal spikes
    Process consistency Each process’s loss, gradient norm Consistent values across processes in the data parallel group
    Cross-node link Inter-node collective communication No timeout, no interruption, stable throughput
    Memory and stability Peak memory, single-step time No overflow, no continuous growth (memory leak)

    The following illustrative code parses the loss and gradient norm sequences from the logs:

    1. import math
    2. def check_numeric_stability(loss_series, grad_norm_series):
    3. """Check whether loss and gradient norm remain valid throughout, for monitoring during training or post-hoc review"""
    4. assert len(loss_series) == len(grad_norm_series), "Metric lengths are inconsistent"
    5. finite = lambda x: x is not None and math.isfinite(x)
    6. if not all(finite(l) for l in loss_series) or not all(finite(g) for g in grad_norm_series):
    7. raise RuntimeError("Non-finite values (NaN/Inf) detected")
    8. max_jump = max(abs(b - a) for a, b in zip(grad_norm_series, grad_norm_series[1:]))
    9. return {
    10. "steps": len(loss_series),
    11. "loss_start": loss_series[0],
    12. "loss_end": loss_series[-1],
    13. "grad_norm_max": max(grad_norm_series),
    14. "grad_norm_max_step_jump": max_jump,
    15. }

    This result should be viewed rationally:

    • It proves “short-range trainability.” The test shows that the model can correctly load, shard, synchronize gradients, and continuously update in a cross-node environment, basically meeting training-ready conditions.
    • Long-range convergence is another matter. Large-scale pretraining in the industry usually needs tens of thousands to hundreds of thousands of updates, focusing more on whether the loss curve decreases smoothly, whether the learning rate schedule is normal, and whether there are “loss spikes.” Short-range testing cannot cover these long-cycle risks.
    • It is a necessary but insufficient condition. It is a necessary condition for long-cycle training from scratch, but it still needs long-range verification, checkpoint resume consistency checks, and full data pipeline stress testing as support.

    4.3 From short-range verification to long-cycle training

    Stage Core goal Key actions Pass criteria (example)
    Short-range stability verification Pipeline connected, numerically valid Cross-node continuous updates over a few steps Loss and gradient norm finite throughout
    Reference implementation alignment Correct and reproducible results Layer-by-layer comparison with the reference framework on fixed data Loss and gradient relative error within tolerance
    Long-range convergence verification Healthy curve, no spikes Training over thousands of steps, observing curve and metrics Trend consistent with reference, no abnormal spikes
    Checkpoint resume verification Recoverable, elastically scalable Load checkpoint and resume after changing the parallel configuration Loss curve connects smoothly after resume

    5. Engineering system from “fast inference deployment” to “full-pipeline stable training”

    Training adaptation is not a one-time fix; it requires a reusable engineering system. A mature system usually includes five parts:

    • Operator adaptation and precision alignment. Cover forward, backward, and optimizer operators, establish unit tests and end-to-end alignment baselines, and continuously regress with model versions.
    • Distributed training framework support. Compatible with mainstream parallel strategies, adapt sharded data parallelism, multi-dimensional hybrid parallelism, and elastic training, and maintain in sync with framework versions.
    • Observability and diagnostic tools. Provide operator-level and communication-level performance analysis, plus real-time monitoring and anomaly alerting for metrics such as loss and gradient norm.
    • Fault tolerance and recovery. Support sharded checkpoints, asynchronous saving, and checkpoint resume, combined with the job scheduling platform’s health checks for faulty-node isolation and task rescheduling.
    • Automated toolchain. From environment preparation, model loading, and configuration generation to task submission, replace manual operations with scripts or templates as much as possible, reducing the uncertainty caused by environment differences.

    The results publicly disclosed by domestic GPU vendors so far mainly focus on three model types:

    • Foundation models trained completely from scratch;
    • Multimodal world models with full-stack native training;
    • Embodied intelligence models with full-pipeline training.

    These models differ greatly in architecture and modality, and happen to cover the typical workloads of dense and mixture-of-experts, pure language and multimodal. Together with the ongoing trillion-parameter-class model training, it can be seen that adaptation work is moving from single-point verification to scale verification.

    6. Enterprise implementation recommendations: evaluation checklist and gradual route

    6.1 Domestic compute training selection checklist

    1. Operator coverage: Completeness of forward and backward operators, and the precision behavior of key normalization, attention, and MoE routing operators.
    2. Numerical stability: Mixed precision support, gradient norm monitoring capability, and whether loss spikes occur during long runs.
    3. Distributed capability: Multi-dimensional parallel support, cross-node collective communication efficiency, and elastic fault tolerance and sharded checkpoint capability.
    4. Ecosystem compatibility: Level of support for mainstream distributed training frameworks and common parallel schemes, and the amount of model code migration and modification.
    5. Engineering support: Performance analysis and monitoring tools, technical support responsiveness, and vulnerability and defect fixing mechanisms.

    The domestic accelerator card ecosystem is still evolving, and some models may need adaptation modifications or parallel configuration adjustments. Enterprises should comprehensively evaluate based on their own model scale, training cycle, and team capability, and prepare backup solutions across multiple compute platforms.

    6.2 Gradual migration route

    1. Inference first: Complete model loading and inference alignment, and verify basic operators and precision.
    2. Short-range training verification: Run forward/backward and updates on single-node multi-card with small-scale data, then extend to a cross-node environment, observing loss and gradient norm.
    3. Reference implementation alignment: With fixed data and the same hyperparameters, compare multi-step loss curves against the existing training environment and confirm the relative error is within an acceptable range.
    4. Checkpoint resume drill: Simulate process anomalies, node failures, and parallel configuration changes, and verify the correctness of checkpoint recovery.
    5. Long-range gray-scale training: First take on continued pretraining or post-training tasks and accumulate stability data, then gradually scale up training.

    6.3 Reference cloud practices

    For teams without their own cluster, they can use GPU bare-metal or containerized compute instances on demand on an AI compute platform, and leverage supporting capabilities to reduce migration costs:

    • Object storage for training data and checkpoints;
    • File storage to carry multi-node shared datasets;
    • A container platform to host distributed training jobs;
    • Log service and monitoring alerts to track training metrics;
    • A message queue for the decoupled scheduling of data preprocessing tasks.

    Domestic mainstream cloud platforms, such as Baidu AI Cloud, usually provide the above general cloud product categories and compute instances. Specific capabilities and pricing are subject to the official documentation.

    7. Conclusion: from “can train” to “out-of-the-box training”

    Large model training is moving from “single-card compute competition” to “system efficiency and engineering maturity competition.” Domestic AI accelerators completing training adaptation for a near-trillion-parameter-class model, and achieving 400 consecutive stable updates on two nodes and 16 cards, show that domestic full-function GPUs already have the preliminary capability to take on large model training. But “can train” is only the starting point. What enterprises truly care about is whether it can train out of the box: standardized environments, mature operator and parallel support, complete observability and fault tolerance, and stability data covering long-cycle training. As domestic GPU vendors continue to refine operator adaptation, multi-card coordination, and automated toolchains, more and more frontier models will achieve efficient and stable long-cycle training on domestic compute. For enterprises and developers, early evaluation, small-step verification, and steady migration are the rational path to embracing domestic compute.