Large-Model Training on New Accelerators: From Integration to Stable Operation
This article distinguishes inference integration, training adaptation, and pretraining from scratch, then outlines five key areas for adapting training to new accelerators: environment alignment, operator and computation-graph coverage, parallelism design, numerical consistency, and multi-node communication. It also describes how to validate sustained stable operation, common failure modes and troubleshooting approaches, and practical recommendations for documentation and release gating.
1. Clarify Three Concepts: Integration, Training Adaptation, and Pretraining
Technical reports often describe several types of work together. From an engineering perspective, at least three layers of meaning should be distinguished.
The first layer is inference integration: model weights can be loaded on new hardware and complete inference, with the core requirements being basic operator coverage and runtime availability. The second layer is training adaptation: the training chain—framework, communication library, optimizer, mixed precision, and related components—can run on the new hardware, and training or fine-tuning can continue from existing weights. The third layer is pretraining from scratch: model parameters are learned entirely on that hardware starting from random initialization.
The validation cost and conclusions differ significantly among the three. Successful training adaptation means the training chain is usable, but it does not imply that the model was pretrained on that hardware. In external documentation or internal project proposals, teams should use precise terms such as “completed inference integration,” “completed training adaptation,” and “completed pretraining,” and note the validation scope, including the number of nodes, number of accelerators, number of steps, and precision type.
2. Five Key Areas of Training Adaptation
2.1 Software and Hardware Environment Alignment
The first step in training adaptation is to establish a version matrix. Drivers, runtimes, collective communication libraries, deep learning frameworks, and compiler toolchains have strict version dependencies. A mismatch in any component can cause silent errors, such as biased gradient results, rather than an immediate error.
A recommended approach is to first fix a baseline version, record the version number and build parameters of each component, and then run a minimal training job on the baseline. After upgrading any component, rerun the baseline job and compare the results with historical results.
2.2 Operator and Computation Graph Coverage
Large-model training involves many operators, including attention computation, normalization, activation functions, positional encoding, fused optimizers, and mixed-precision type conversions. During adaptation, each operator must be checked to confirm that it is implemented on the target hardware and supports the required data types and tensor shapes.
For operators that are not yet covered, a common approach is to combine basic operators to implement equivalent computation. This fallback preserves functional correctness but usually introduces extra memory usage and computation time, so the fallback locations and performance loss should be recorded in documentation.
The following is an illustrative coverage-check flow:
for op in model_graph.operators():if not target_backend.supports(op.type, op.dtype, op.shape_class):record_fallback(op, reason="unsupported_kernel")report.summarize(fallback_ratio)
2.3 Parallelism Strategy Design
When parameter scale reaches the trillions, a single accelerator cannot hold the full model. Training requires combinations of data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism (for mixture-of-experts architectures). Parallelism strategy design should first estimate memory usage and then decide how to partition the model.
Taking mixed-precision training as an example, each parameter typically requires multiple copies during training—weights, gradients, optimizer states, and master weights—amounting to roughly a dozen bytes or more in total. At three trillion parameters, the training state alone reaches tens of terabytes, so multi-accelerator partitioning is required to fit it.
An illustrative configuration is shown below (the values are only for explaining the structure and must be adjusted for the actual model and hardware):
parallel:data_parallel_size: 2tensor_parallel_size: 4pipeline_parallel_size: 2 # total accelerators = 2 * 4 * 2 = 16micro_batch_size: 1global_batch_size: 64activation_recompute: selective
When tuning, first ensure that memory does not overflow, and then optimize throughput. The finer the tensor-parallel split, the more frequent the communication, so tensor parallelism is usually placed on high-bandwidth links within the same node. Pipeline parallelism has less cross-node communication and is suitable for cross-node deployment.
2.4 Numerical Consistency Validation
Adaptation correctness cannot be judged only by “it runs.” It is recommended to use the same data, random seed, and initial weights in both the reference environment and the target environment, and compare forward outputs, single-step loss values, and gradient norms layer by layer.
When comparing, set error thresholds by data type. Low-precision formats have larger rounding errors, so thresholds should be calibrated separately for each operator type and precision rather than applying one fixed number.
An illustrative check function is shown below:
def check_tensor_close(ref, tgt, rel_tol, abs_tol):diff = tensor_abs(ref - tgt)max_err = tensor_max(diff)ref_scale = tensor_max(tensor_abs(ref))ok = max_err <= abs_tol + rel_tol * ref_scalereturn ok, max_err
Layer-by-layer localization is key. If the final loss curve deviates, compare layer by layer starting from the input layer, find the first operator whose deviation exceeds the threshold, and then test that operator separately.
2.5 Multi-Node Communication and Topology
Multi-node training relies on collective communication for gradient synchronization and parameter aggregation. During adaptation, three things must be confirmed: whether the actual intra-node and inter-node bandwidth reaches the design value; whether collective communication results are consistent across all nodes; and whether timeout and retry policies can handle occasional network jitter.
It is recommended to start with small-scale communication tests. For example, perform a reduction on the same tensor on each node, check whether the result matches single-node computation, and then gradually expand to all nodes.
3. Validation Methods for Continuous Stable Operation
Correct single-step computation does not mean that training can run stably for a long time. Memory fragmentation, occasional communication timeouts, data-loading bottlenecks, and numerical overflow often appear only after hundreds of steps. Therefore, continuous-running tests are a necessary part of adaptation validation.
3.1 Define Validation Goals
Validation goals should be written as checkable conditions, for example: continuous operation for a specified number of steps without interruption; the loss curve follows the same trend as the reference curve in the first several steps; throughput fluctuations stay within an agreed range; and checkpoint save and restore procedures execute correctly.
3.2 Establish Metric Collection
During continuous operation, key metrics should be collected continuously, and anomaly criteria should be defined.
| Metric | Collection frequency | Typical anomaly signal |
|---|---|---|
| Single-step loss | Every step | NaN or sudden jump |
| Gradient norm | Every step or every few steps | Continues to increase or frequently triggers clipping |
| Per-accelerator memory usage | Every minute | Continues to grow or approaches the limit |
| Single-step latency | Every step | Periodic spikes |
| Communication time | Every step | One node remains consistently high |
| Checkpoint write | Every save | Failure or significantly longer duration |
3.3 Checkpointing and Recovery Drills
Checkpoints should be saved regularly to persistent services such as object storage, and hash values should be recorded for integrity verification. Saving only model weights is insufficient; optimizer state, RNG state, and data-reader progress must also be saved. Otherwise, the training trajectory after recovery will not match the original trajectory.
Regular recovery drills are recommended: interrupt training, restore from the latest checkpoint, and confirm that the loss curve can continue seamlessly.
3.4 Health-Check Script
A lightweight script can periodically check the above metrics and raise alerts when anomalies are found:
every interval:metrics = collect_metrics()if metrics.loss is NaN or metrics.loss_jump > threshold:alert("loss_anomaly", metrics)if metrics.memory_growth_rate > limit:alert("memory_leak_suspect", metrics)if metrics.comm_time_max > 3 * metrics.comm_time_median:alert("slow_node", node_id(metrics))
4. Common Issues and Troubleshooting
Loss becomes NaN: first check mixed-precision loss scaling settings, gradient clipping thresholds, and recently changed operators. Save intermediate tensors a few steps before and after the anomaly for layer-by-layer comparison.
Throughput is significantly lower than expected: first check whether data loading keeps up with computation, then check whether communication and computation overlap effectively, and finally check the idle-time ratio in the pipeline.
Occasional timeouts: distinguish whether they are caused by a single slow node or by global network jitter. The former requires locating and isolating the node; the latter requires adjusting timeout thresholds and checking link quality.
Memory grows with the number of steps: check for unreleased caches or references, and whether the activation recomputation configuration matches the memory budget.
Loss jumps after recovery: this is usually because optimizer state, RNG state, or data-reader position was not fully saved. Check the checkpoint contents item by item.
5. Practical Recommendations
First, both external and internal wording should distinguish “integration,” “training adaptation,” and “pretraining,” and note the validated number of nodes, number of accelerators, number of steps, and precision type to avoid overstating the scope.
Second, keep an adaptation checklist for every software version change and rerun the baseline job.
Third, include continuous-running validation in release gating. Only when metrics remain normal within the agreed number of steps should the next stage be allowed.
