Trillion-Parameter LLM Training Adaptation on a Domestic AI Chip: Challenges, Validation, and the Path to Reliable Training
A domestic AI chip vendor recently completed a training-adaptation effort for a flagship large language model with nearly 3 trillion parameters. Across 16 accelerators on two nodes, all training processes completed 400 consecutive optimizer updates with the loss and gradient norms staying finite throughout, with no numerical overflow or abnormal interruption. This article explains how training adaptation differs from inference adaptation and from base-model pretraining, breaks down the five core challenges (operator coverage and numerical alignment, parallel strategy and communication efficiency, memory management, numerical stability, and observability and fault tolerance), and shows how to design a credible training-stability validation around a representative dual-node, 16-card, 400-step configuration. It includes the core metrics to track, sample monitoring code, a troubleshooting reference, the stages from "can train" to "train out of the box," and cloud deployment considerations.
1. Reading the News: From “Running Fast” to “Training Stably”
A domestic AI compute chip vendor recently announced that, using its flagship training-and-inference accelerator and its self-developed software stack, it had completed training adaptation for a flagship large model with nearly 3 trillion parameters. On 16 accelerators across two nodes, all training processes completed 400 consecutive optimizer updates. The loss and gradient norms stayed finite throughout, with no numerical overflow or abnormal interruption.
The value of this adaptation does not lie in “running one forward and backward pass.” It lies in three points:
- Large scale span. Nearly 3 trillion parameters means the model codebase runs into the hundreds of thousands of lines, involving complex attention, expert routing, and long-context modules. Training additionally introduces logic such as optimizer states, mixed precision, and gradient synchronization. For a development team to understand the code structure quickly and fill in missing operators is itself a demanding engineering task.
- Complete training pipeline. The adaptation covered the full flow of model loading, parameter-shard scheduling, backward computation, and gradient synchronization, not just the operators needed for inference.
- Verified stability. 400 consecutive steps without overflow or interruption shows that the numerical behavior is controllable and that multi-card coordination is stable, providing a basis for scaling up further.
1.1 Clarifying the Concepts: Training Adaptation Is Not Base-Model Pretraining
The claim that “a chip completed adaptation for a large model” is easy to misread. Three levels need to be distinguished:
- Inference adaptation (often called “Day 0 adaptation” in the industry): On the day a model is released, weight loading, operator replacement, and performance tuning are completed, with the goal of getting the new model running—and running fast—on domestic hardware.
- Training adaptation: Beyond inference, this adds backward operators, mixed precision, sharded parallelism, checkpointing, and fault tolerance, with the goal of letting an existing model train completely and stably on domestic hardware.
- Base-model pretraining: Training from random initialization over months on tens of thousands of accelerators. Which class of hardware provides the base compute is information confirmed jointly by the model developers and the compute providers; an adaptation announcement by itself is not a basis for a conclusion.
To judge whether training adaptation is mature, start with three questions:
- Does it cover the complete training pipeline?
- Does it run stably at multi-node scale?
- Does it have the engineering foundation to scale to larger sizes?
1.2 Reference Value of Similar Work
There is precedent in the industry: the technical report from one large-model vendor validated a fine-grained expert-parallel scheme for two different hardware routes side by side, and published performance data such as throughput. This is a standard validation process for a training framework across hardware backends, meant to demonstrate that the framework does not depend on a single piece of hardware. However, the report did not publicly state the compute source used for base-model pretraining.
This shows that “a framework can complete validation on a given piece of hardware” and “a base model was pretrained on a given piece of hardware” are two different propositions. To evaluate the training capability of domestic compute, it is better to focus on three points: training scale, number of sustained steps, and stability metrics—as well as whether it can support a complete training flow.
2. Technical Breakdown: Where Training Adaptation Gets Hard
Take the “FSDP multimodal training path” as an example. Fully Sharded Data Parallel (FSDP) splits model parameters, gradients, and optimizer states across training processes, so each card holds only part of the full model. When the forward or backward pass reaches a given layer, the framework temporarily gathers that layer’s parameters and releases them once they are used. This greatly reduces per-card memory usage and supports training models far larger than a single card’s capacity.
Moving from inference to training mainly involves five categories of challenges.
1. Operator coverage and numerical alignment
- Filling in operators: Inference only needs forward operators; training also needs the corresponding backward operators. Modules such as attention, normalization, activation functions, and MoE routing all need to be implemented in pairs—any missing piece will break graph construction.
- Precision strategy: Parameters, gradients, and optimizer states must be planned together in terms of precision. A common approach is to use BF16 or FP16 for matrix computation while keeping FP32 master weights and FP32 optimizer states. Once precision strategies are mixed, precision problems tend to surface in the middle-to-late stages of training.
2. Parallel strategy and communication efficiency
- Combined sharding: Real training usually combines several parallelism methods. Tensor parallelism (TP) splits the computation within a single layer, pipeline parallelism (PP) splits across layers, data parallelism (DP) replicates the model and splits the data, and expert parallelism (EP) distributes MoE experts across cards.
- Communication-intensive: Every update includes communication such as gradient reduction, parameter gathering, and expert routing; communication has become one of the main overheads.
- Topology awareness: Once pipeline parallelism becomes unbalanced, all cards wait on the slowest stage; when expert-parallel load skews, individual cards become the long tail. This calls for techniques such as overlapping computation with communication, and tuning communication groups and collective-communication algorithms, which place high demands on high-speed interconnects and collective-communication libraries.
3. Memory and memory management
- Memory composition: Training memory consists of four parts: parameters, gradients, optimizer states, and activations.
- Optimizer-state overhead: Taking an Adam-family optimizer as an example, with the conventional scheme of “BF16 parameters + FP32 master weights + FP32 first moment + FP32 second moment,” each parameter needs about 12 bytes. For 3 trillion parameters, the optimizer states alone reach about 36 TB, which must be sharded across 16 or more cards.
- Activation management: Activations grow with batch size, sequence length, and layer count. Without gradient accumulation, activation recomputation, operator fusion, memory defragmentation, and memory-pool optimization, it is easy to trigger out-of-memory errors in a multi-card environment.
4. Numerical stability
- Numerical risk: BF16 has the same number of exponent bits as FP32, giving ample dynamic range, but lower mantissa precision. In large-model training, problems such as loss spikes, gradient explosion, and attention-score overflow can all occur.
- Common techniques: The industry typically combines loss scaling, gradient clipping, sensible initialization, learning-rate warmup, initializing the embedding layer with a smaller standard deviation, and applying z-score normalization to outputs.
- Hardware-related risk: Non-deterministic reduction order and hardware-characteristic differences can introduce fine-grained numerical issues. Such issues are often masked in short tests.
5. Observability and fault tolerance
- Opaque training state: The training process is a black box; anomalies often manifest as individual processes hanging or exiting, which requires robust metric collection, exception capture, and log-based diagnosis.
- Long-run training requirements: Continuous training over thousands of cards for weeks or months requires the framework to provide elastic fault tolerance, resume-from-checkpoint, and faulty-node isolation.
3. Practical Guide: Designing a Credible Training-Stability Validation
Dual-node, 16-card, 400 steps is a fairly representative validation configuration for the training-adaptation stage.
3.1 Why Choose Dual-Node, 16 Cards
- Moderate count: 16 cards is enough to expose issues such as cross-node communication, data loading, and network bottlenecks, without occupying a large-scale cluster.
- Representative scale: If a single node has 8 cards, then the dual-node scale covers typical parallel combinations such as TP×DP (e.g., 8×2) and TP×PP (e.g., 4×2×2), and can also introduce EP.
- Clear upgrade path: Once the dual-node validation passes, scaling up to 32, 64, or more cards mainly concentrates problems around communication topology and parallel sharding, with clearer boundaries for diagnosis.
3.2 What 400 Steps Cover
400 steps is not an arbitrary number; it covers the key early phases of training:
| Phase | Step range (illustrative) | Main observation points |
|---|---|---|
| Warmup | Steps 1–50 | Learning-rate ramp-up, rapid loss decline, whether loss scale is stable |
| Steady state | Steps 50–400 | Whether the loss is stable, whether the gradient norm converges, any spikes or peaks |
In scenarios using gradient accumulation and expert parallelism, the effective optimizer-update frequency is lower than the compute steps, and expert-routing load also changes dynamically during training. 400 consecutive updates are enough to expose such issues.
Note: 400 steps is a preliminary validation of stability and functionality and cannot replace the conclusion from ten-thousand-card long-run stability training.
3.3 Core Judgment Metrics
| Metric | What to watch | Anomaly signals and diagnosis directions |
|---|---|---|
| Loss value | Finite throughout, trending down overall | Spikes or turning into NaN/Inf—check learning rate, data anomalies, and mixed precision |
| Gradient norm | Finite throughout, controllable fluctuation | Sustained increase or peaks—check clipping threshold, initialization, and anomalous samples |
| Parameter update magnitude | Finite, reasonable in scale | Abnormal amplification—check optimizer-state precision |
| Process liveness | All processes stay engaged | A process exits or is unresponsive for a long time—check memory, communication timeouts, and the OOM killer |
| Iteration time | Stable overall | Periodic jitter—check data loading, checkpoint writes, and communication contention |
| Scaling efficiency | Throughput grows close to linearly as cards are added | Efficiency drops markedly—check parallel sharding and communication share |
| Memory usage | Peak leaves headroom | Gradual climb—check fragmentation and memory leaks |
| Recovery | Can resume from a checkpoint | Loss jumps after resuming—check whether optimizer states were saved completely |
3.4 Sample Code
# Fully Sharded Data Parallel training loop with stability monitoring (illustrative pseudocode)for step in range(max_steps):# 1. Data loading and shardingbatch = next_train_batch()# 2. Forward pass: enable activation recomputation if needed to save memorywith autocast(dtype=bf16):loss = model(batch)# 3. Backward pass and gradient reductionloss.backward()# 4. Gradient clipping and norm logginggrad_norm = clip_grad_norm_(model, max_norm=1.0)# 5. Optimizer stepoptimizer.step()# 6. Stability checks: recommended every step, negligible overheadassert math.isfinite(loss.item()), f"loss invalid at step {step}"assert math.isfinite(grad_norm), f"grad norm invalid at step {step}"# 7. Periodic checkpoint (model, optimizer states, and data loader progress)if step % ckpt_interval == 0:save_checkpoint(model, optimizer, dataloader_state, step)# 8. Metric collection and comparisonmetrics = {"step": step,"loss": loss.item(),"grad_norm": grad_norm,"iter_time": timer.elapsed(),"mem_peak": device.memory_peak(),}report(metrics)expect_step_time(metrics["iter_time"], baseline, threshold=1.2)
3.5 Common Issues and How to Handle Them
| Symptom | Priority diagnosis directions |
|---|---|
| First-step loss after loading differs from the reference implementation | Weight mapping, tokenizer and data preprocessing, initialization random seed |
| Normal for the first few dozen steps, then a loss spike | Insufficient learning-rate warmup, anomalous samples, gradient-clipping threshold |
| Occasional NaN or Inf | Mixed-precision strategy, normalization-layer implementation, attention numerical range |
| An individual rank hangs and then times out and exits | Whether collective-communication calls are paired, inter-node network, slow nodes |
| Memory keeps rising with steps | Memory fragmentation, unreleased cache, uncleared gradient accumulation |
4. Advanced Practice: From “Can Train” to “Train Out of the Box”
Training adaptation usually goes through three stages:
| Stage | Core goal | Key actions |
|---|---|---|
| Can train (usable) | Get the complete training pipeline running | Fill in operators, connect sharding and synchronization, validate single-step and hundred-step training |
| Train stably (usable in practice) | Scaled and long-run training | Performance tuning, long-run stability testing, fault tolerance and resume-from-checkpoint |
| Train out of the box | Ready to use immediately | Prebuilt images, one-click launch, default configurations, and automated diagnosis |
1. Algorithm- and model-side coordination
- Use techniques such as operator fusion, structured sparsity, quantization-aware training, and sequence parallelism to reduce memory and compute overhead.
- Check device-related implementations in the model code, such as hardcoded device numbers, conditional branches for unsupported backends, and implicit type conversions—these are the most common blockers when migrating across hardware.
- Clarify the coverage of backward operators, and prepare equivalent substitute implementations for operators that are not covered.
2. System-level tuning
- Parallel-strategy search: Within memory and communication budgets, automatically search for sharding combinations across dimensions such as TP, PP, DP, and EP.
- Computation-communication overlap: Overlap gradient communication with backward computation; use interleaved scheduling in pipeline parallelism to reduce waiting.
- Data-loading optimization: Use prefetching and shard caching; in sample organization, balance sequence-length distribution with domain mix.
3. Engineering assurance
- Establish a baseline-comparison mechanism, comparing metrics under the same configuration against a mature hardware platform to quickly determine whether an issue is a model problem, a data problem, or a hardware problem.
- Make stability checks, metric collection, and checkpoint saving a standard process enabled by default.
- In continuous integration, automatically perform operator-coverage scanning, small-model regression training, and performance-baseline checks to prevent regressions introduced by version upgrades.
- Distill tuning experience into parameter templates and troubleshooting manuals to lower the barrier to use.
4. Cloud deployment key points
| Cloud product category | Role | Key considerations |
|---|---|---|
| Compute instances (GPU cloud servers, bare metal) | Host the training processes | High-speed interconnect, per-card memory, topology |
| Container platform and scheduling system | Multi-node task orchestration, failure restart | Topology-aware scheduling, task priority, task-level isolation |
| Object storage and parallel file systems | Store datasets and checkpoints | Aggregate bandwidth, metadata performance, same region as compute |
| Log service and monitoring/alerting | Metric collection and anomaly warnings | High-cardinality metrics, real-time alerts, long-term data retention |
| Image service | Pin driver, runtime, and framework versions | Environment consistency, version traceability |
For long-run stability training in the cloud, the following supporting mechanisms also need attention:
- Elastic fault tolerance: Automatic isolation of faulty nodes and automatic task resume from checkpoints.
- Cost optimization: Mix subscription, pay-as-you-go, and preemptible instances, combined with budget alerts to control spending.
- Efficiency measurement: Measure compute-use efficiency with per-card effective compute and overall utilization (e.g., MFU), rather than looking only at card count.
Taking Baidu AI Cloud as an example, its general cloud capabilities—such as GPU cloud servers, bare metal servers, container platforms, object storage, log services, and monitoring/alerting—can cover the resource-delivery and environment-preparation stages described above. For specific specifications and support scope, refer to the official documentation.
5. Summary and Outlook
From single-card inference adaptation, to dual-node 16-card 400-step stable training, and then to multi-node long-run stability training, the training capability of domestic compute is advancing along a clear path. A nearly 3-trillion-parameter model completing training adaptation shows that domestic compute has the potential to support the full training pipeline of frontier large models. Going from “can train” to “train out of the box” still requires continued refinement in operator coverage, parallel strategy, numerical stability, and tooling.
For developers and enterprise users running large-model training on domestic compute, work through the following checklist item by item:
- Clarify the model architecture, parallel strategy, and memory and communication budgets;
- Check device-related implementations and custom operators in the training code;
- Validate the mixed-precision strategy and gradient-clipping configuration;
- Run stability tests in graduated stages of hundreds, thousands, and ten-thousands of steps;
- Connect checkpoints, resume-from-checkpoint, and elastic fault tolerance;
- Establish baseline comparisons and performance measurement against mature hardware platforms.
By insisting on “validate first, then scale; stabilize first, then speed up,” large-model training on domestic compute can be made both to run and to run stably.
