Large Model Training Adaptation on Domestic AI Accelerators: Full-Stack Engineering Practices
This article explains how to evaluate and implement large model training adaptation on domestic AI accelerators. It clarifies the difference between Day 0 inference adaptation, training adaptation, and foundation-model pretraining; walks through an FSDP2 sharded training path; discusses cross-node multi-accelerator stability, numerical safeguards, operator coverage, parallelism strategies, and automation tooling; and provides practical guidance for teams moving from barely trainable setups toward more repeatable, out-of-the-box training environments.
1. Clarifying the Concepts: Training Adaptation, Day 0 Adaptation, and Foundation-Model Pretraining Are Not the Same
In discussions about domestic large-model infrastructure, three concepts are often confused: training adaptation, Day 0 adaptation, and foundation-model pretraining. When people see that an AI accelerator has “supported” or “adapted” a model, they may assume that the model was trained from scratch on that hardware. This is a common misunderstanding.
The three concepts can be separated as follows:
Day 0 adaptation (inference onboarding): This means that a newly released open-source model can run inference on the target hardware on the day of release. The main goal is to verify that the model can load, perform a forward pass, and produce correct outputs. This usually only requires validating inference-side operator coverage and numerical correctness. It does not involve backpropagation or parameter updates.
Training adaptation: This is a higher-level requirement. The model must not only run a forward pass on the target accelerators, but also complete the full loop of forward computation, backpropagation, gradient synchronization, and optimizer updates. It must also continue updating parameters stably in a multi-GPU or multi-node environment. Training adaptation validates the usability of the training pipeline, not the original source of pretraining compute.
Foundation-model pretraining: This refers to training a model from random initialization using massive amounts of data. It is the most compute-intensive stage and the one that most strongly tests cluster stability and parallelism strategies. Whether a model was pretrained on a particular hardware platform should be determined by its technical report and compute disclosure, not inferred from the fact that it passed training adaptation.
This distinction is important. A successful training adaptation demonstrates that the target hardware is capable of supporting the full training workflow for this type of model. It does not mean that the model was originally created on that hardware. In industry practice, a technical report may validate operator implementations and parallel strategies across multiple hardware routes. That is a verification of training feasibility and inference operators, which is a separate issue from where the foundation-model pretraining compute originated.
2. FSDP2 Sharded Training Path: From Model Loading to Gradient Synchronization
Once the requirement is to perform training adaptation, the first major engineering challenge is: how to fit models with hundreds of billions or even trillions of parameters into limited accelerator memory.
Sharded training solutions, represented by Fully Sharded Data Parallel (FSDP), are one of the standard approaches for handling ultra-large models. The core idea can be summarized in one sentence: shard the model parameters, gradients, and optimizer states by rank, so that each GPU only keeps the portion it is responsible for, and temporarily reconstructs a layer only when that layer is needed.
A complete FSDP2 training path usually contains four key stages:
Model loading and sharding: After loading the weights, immediately split the parameters along the rank dimension. This prevents any single GPU from holding a full model replica and reduces per-GPU memory pressure from the beginning.
On-demand aggregation during the forward pass: When the forward computation reaches a given layer, collective communication such as
all-gathertemporarily reconstructs the complete parameters for that layer. Once the computation is done, the gathered parameters are released. This creates a pattern of “use one layer, gather one layer, release one layer.”Gradient sharding during the backward pass: During backpropagation, each layer’s gradients are processed with
reduce-scatter. This both sums gradients across GPUs and redistributes the result, ensuring that each GPU only keeps its own gradient shard.Sharded optimizer updates: Each rank updates only the parameter shard it owns, and the optimizer state is also sharded. This further reduces memory usage and computational overhead.
Below is a framework-agnostic example that shows the main logic of this training path:
# FSDP2 training loop illustration# Goal: shard parameters, gradients, and optimizer states by rank# to reduce per-GPU memory usagefor step, batch in enumerate(dataloader):# 1. Forward pass: all-gather the full parameters of the current layer# on demand, and release them immediately after computationloss = model(batch).loss# 2. Backward pass: reduce-scatter sums gradients and re-shards themloss.backward()# 3. Gradient clipping: aggregate the global norm first, then clip# uniformly to maintain numerical stabilitygrad_norm = clip_grad_norm_(model.parameters(), max_norm=1.0)# 4. Optimizer update: each rank updates only its own parameter shardoptimizer.step()optimizer.zero_grad()# 5. Monitoring: record loss and grad_norm to catch NaN / Inf earlyif step % 50 == 0:log_metrics(step, loss.item(), grad_norm)
What really determines whether this path can run stably is the underlying operator coverage and collective communication efficiency. Sharded training relies heavily on collective communication primitives such as all-gather and reduce-scatter. If there is a missing operator, a numerical precision issue, or a communication bottleneck anywhere in the pipeline, it can directly show up as a training interruption or abnormal loss behavior.
Therefore, the first priority of training adaptation is often not merely “can it run for one step,” but rather: Are the underlying operators complete, and is communication efficient enough?
3. Cross-Node Multi-Accelerator Training and Numerical Stability
Being able to run on a single node does not mean that training will remain stable across multiple nodes. The real engineering challenge is: how to maintain continuous training over hundreds or thousands of steps in a multi-node, multi-accelerator environment without crashing.
A convincing cross-node training validation usually focuses on two dimensions:
Scale dimension: Use two machines with a total of 16 accelerators to form a training cluster. The 16 training processes should join the same data-parallel or sharded group through high-speed interconnects. This verifies whether cross-node communication and scheduling are correct.
Stability dimension: Let all processes complete hundreds of consecutive optimizer updates, for example 400 updates. Throughout the run, monitor two critical signals: loss and gradient norm.
The core indicators for judging stability are clear:
Loss remains finite and follows a reasonable trend: There should be no
NaNorInfvalues, and the loss curve should behave as expected. This indicates that the forward and backward numerical paths are healthy.Gradient norm remains bounded: The gradient norm should not explode due to numerical overflow, nor collapse to abnormal values. This indicates that mechanisms such as gradient clipping and mixed-precision loss scaling are working properly.
In this context, mixed-precision training is a double-edged sword. It can significantly reduce memory and compute overhead, but it is also more sensitive to numerical instability. If certain operators overflow under lower precision, the loss may suddenly become NaN.
Common engineering guardrails include:
# Numerical stability guardrail illustrationimport mathdef check_and_guard(loss_value, grad_norm_value):# Detect abnormal loss or gradient norm valuesif math.isnan(loss_value) or math.isinf(loss_value):raise NumericalError(f"Non-finite loss: {loss_value}")if math.isnan(grad_norm_value) or math.isinf(grad_norm_value):raise NumericalError(f"Non-finite gradient norm: {grad_norm_value}")# Trigger clipping or skip the step when gradient norm explodesif grad_norm_value > 1e4:return "clip_or_skip"return "ok"
A result such as “400 consecutive steps completed without abnormal interruption” is meaningful because it elevates training from “can run one step” to a level of reproducible and sustainable engineering credibility. This is exactly what distinguishes training adaptation from inference onboarding.
4. Engineering System: Operator Adaptation, Multi-Accelerator Coordination, and Automation Tooling
A one-time successful experiment may depend on tuning and luck. Sustained success depends on an engineering system. A mature training adaptation capability is usually built on three layers:
Operator adaptation layer: This is the lowest and most labor-intensive layer. Every custom operator used in the model—such as attention variants, normalization layers, activation functions, and mixture-of-experts routing—must be implemented on the target hardware and pass precision-alignment tests to ensure numerical consistency with the reference implementation.
Multi-accelerator coordination layer: This includes parallelism strategies such as data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism; communication topology optimization; overlap between computation and communication; and fault tolerance mechanisms such as checkpointing and resuming training. As scale increases, the complexity of this layer grows nonlinearly.
Automation toolchain layer: This includes job orchestration, log collection, metric monitoring and alerting, hyperparameter management, and automatic rescheduling after failures. With this layer in place, training shifts from “people constantly watching the run” to “the system provides automatic safeguards.”
Within this framework, practices such as training domestic models on domestic chips are valuable because they cover scenarios with increasing levels of difficulty:
End-to-end training of medium-scale models from scratch: This validates the full pipeline in a real training scenario, not just fine-tuning.
Full-stack native training of novel model architectures: For example, world models that involve multiple physical laws often include unconventional structures. They act as stress tests for both the breadth and depth of operator adaptation.
Full-pipeline training of embodied or multimodal brain models: These models combine vision, language, and action, placing higher demands on sharding schedules, memory management, and multimodal data pipelines.
Joint training of trillion-parameter models: This represents the current engineering frontier. The main bottlenecks are cross-node communication efficiency and stability at extremely large scale.
For teams that want to build or evaluate this kind of training capability, the recommendation is to start with small, fast iterations: first run the full training pipeline with small or medium-sized models and perform numerical alignment, then gradually increase model size and parallelism. At each step, use loss and gradient-norm stability as the release criterion.
5. From “Trainable” to “Trainable Out of the Box”: Practical Path and Recommendations
Domestic full-function GPUs supporting large-model training are undergoing a capability transition—from “barely trainable after extensive adaptation” to “mainstream models can be trained out of the box.” To close this gap, several areas need continuous improvement:
Operator library completeness and precision consistency: Cover common operators used in mainstream model architectures as much as possible, and establish automated precision regression tests so that new models can be aligned quickly.
Generalization of parallelism strategies: Turn common parallel combinations for complex models into configurable and reusable templates, reducing the cost of tuning each model from scratch.
Toolchain maturity and usability: Make logging, monitoring, alerting, and checkpoint/resume capabilities available out of the box, lowering the barrier for users.
Elastic cloud resource support: Mature cloud AI compute platforms, combined with general capabilities such as containerized scheduling, object storage, logging services, and monitoring/alerting, can significantly simplify the deployment and operations of large-scale training.
For developers, the practical recommendation is this: when evaluating the training capability of a domestic AI accelerator, do not only ask whether it can run inference or complete one training step. Instead, use cross-node execution, continuous multi-step training, finite loss and gradient norms throughout, and reproducibility as the acceptance baseline. At the same time, prefer solutions with broad operator coverage, a mature toolchain, and well-developed community documentation, so that engineering effort can be focused on models and data rather than endless low-level adaptation.
6. Conclusion
Training adaptation of large models on domestic AI accelerators is fundamentally a systems engineering problem, not a single-point technical problem. It requires solving three layers of issues simultaneously:
- At the conceptual level, clearly distinguish between training adaptation, inference onboarding, and foundation-model pretraining.
- At the technical level, enable the full sharded training pipeline based on FSDP2 and maintain numerical stability of loss and gradient norms in cross-node, multi-accelerator environments.
- At the engineering level, build complete capabilities around operator adaptation, multi-accelerator coordination, and automation tooling.
When these three layers mature together, frontier large models on domestic hardware will move beyond “barely trainable” and gradually approach “trainable out of the box.” For developers and teams, understanding every stage of this pipeline is the key to making rational and practical technology decisions in the domestic compute ecosystem.
