Adapting Domestic AI Chips to Train Trillion-Parameter Open-Source LLMs: A Full-Pipeline Breakdown
A domestic AI chip vendor recently completed training adaptation of a flagship open-source large language model with nearly 3 trillion parameters, then validated it on a two-node, 16-card cluster across 400 consecutive optimizer updates while keeping loss and gradient norms finite. This article explains what such a milestone actually demonstrates and what it does not. It clarifies the often-conflated concepts of inference adaptation, training adaptation, and base pre-training; breaks down the seven stages of a native fully sharded data parallel (FSDP) training pipeline, from weight loading and sharding strategy through backward pass, gradient synchronization, optimizer updates, and observability; assesses what a 400-step run can and cannot prove about trillion-parameter training; and closes with a practical stability-engineering checklist and cloud-deployment guidance for teams running large-model training on domestic or heterogeneous compute.
1. What Happened: From “Runs Inference” to “Trains, and Trains Reliably”
A domestic AI chip vendor recently disclosed that its flagship training-and-inference accelerator, together with its software stack, had completed training adaptation for a flagship open-source large language model. The model comes from a Chinese large-model startup, has close to 3 trillion parameters, and follows a typical ultra-large-scale dense or mixture-of-experts architecture.
For validation, the vendor ran a cross-node joint training test on a small cluster of two nodes and 16 accelerators:
- 16 training processes completed 400 consecutive optimizer updates in sync;
- Loss and gradient norms stayed finite throughout;
- No numerical overflow occurred, and no training interruption took place.
On the surface, this looks like just another “chip X adapted to model Y” announcement. But viewed through the lens of how compute infrastructure evolves, the signal is worth reading carefully: domestic compute’s support for open-source large models is moving from “good enough for inference” to “good enough for training” and “stable enough to train on.”
2. Clarifying Concepts: Training Adaptation vs. Inference Adaptation vs. Base Pre-Training
Before diving into the technical detail, it helps to separate three ideas that are often blurred together. Getting their boundaries right is the prerequisite for evaluating domestic compute capabilities accurately.
2.1 Inference Adaptation: Is It Correct, and Is It Fast?
The core of inference adaptation is the forward pass. The questions it answers are:
- Can the model load correctly on the target chip?
- Is output accuracy within an acceptable range?
- Do throughput and latency meet business needs?
Inference needs only forward propagation. It usually does not need to store activations for backpropagation, nor maintain optimizer state. Its memory pressure therefore comes mainly from model weights and the KV cache, which keeps the engineering effort relatively manageable. Common industry techniques include operator-level replacement, computation-graph rewriting, low-precision quantization, and operator fusion.
2.2 Training Adaptation: Does It Learn, and Does It Stay Stable?
Training adaptation must close a complete loop: forward pass → backpropagation → gradient reduction → optimizer update. Missing any stage means a full parameter update cannot complete.
Compared with inference, training is harder in at least four dimensions:
- Operator coverage: The backward pass involves many operators that inference never touches, such as various gradient operators, the backward of the loss function, and regularization terms. A single missing operator can cause graph compilation to fail or produce wrong results.
- Memory pressure: Beyond weights, memory must also hold activations, gradients, and optimizer state. Take the AdamW optimizer, common under mixed precision, as an example: for each parameter, besides its own weight, you must also store the first moment, the second moment, and a master-weight copy. Even ignoring gradients and activations, per-parameter memory overhead grows by a multiple.
- Communication patterns: Scaling from one card to many, and from one machine to many, requires collective communication, point-to-point communication, and overlapping scheduling with computation. Cross-node communication is also directly affected by network bandwidth and congestion.
- Numerical stability: Low-precision arithmetic, overflow handling, and mixed-precision strategies can all surface problems that only become visible after hundreds or thousands of iterations.
2.3 “Adaptation Succeeded” Is Not the Same as “This Model Was Pre-Trained on Domestic Chips”
When discussing progress in domestic compute, people often conflate “adaptation completed” and “inference validation completed” with “base pre-training completed on that chip.” This is a misconception worth correcting.
- Adaptation / validation: Usually done on top of existing open-source weights, verifying whether the target chip can correctly load the model and run the forward or training pipeline.
- Base pre-training: Requires starting from massive raw corpora and training continuously for weeks or even months on tens of thousands or hundreds of thousands of accelerators. It involves data cleaning and mixing ratios, curriculum learning, large-scale parallelism tuning, resumable training, fault self-healing, and an entire body of systems engineering.
From public information, several large-model teams, domestic and international, present validation results from different vendors’ chips side by side in their technical reports to show that a model is usable across multiple hardware platforms. For example, one team’s technical report for a new-generation model showed inference validation on both a domestic NPU and a mainstream GPU, and disclosed a fine-grained expert-parallelism scheme.
Two points deserve special emphasis:
- This kind of validation usually focuses on the inference-operator level;
- The team never publicly disclosed the original compute composition used for base pre-training.
Industry observers citing such information should therefore strictly distinguish “the model can run on hardware X” from “the model was trained to produce on hardware X.” For developers, the significance is this: do not equate the result of one small-scale training adaptation with proof of large-scale pre-training capability.
3. Breaking Down the Training Pipeline: Seven Stages a Native FSDP Path Must Connect
After completing a training adaptation, the vendor described building a native fully sharded data parallel training path, connecting the full chain from model loading and shard scheduling to gradient synchronization. From an engineering standpoint, this path contains at least seven key stages.
Stage 1: Model Definition and Weight Loading
Model loading is where training begins. It looks simple, but it hides risks.
- Configuration consistency: The model configuration (number of layers, hidden dimensions, attention heads, expert count, normalization scheme, etc.) must correspond strictly to the weight file. Any mismatched field can cause a load failure or a semantic misalignment.
- Weight-format compatibility: Open-source weights are usually published in specific formats (such as safetensors or sharded checkpoints). The loader must correctly parse tensor-name mappings, shard indices, and metadata.
- dtype conversion: When weights are converted from high precision to BF16/FP16, some layers (such as normalization, embedding, and output layers) often need to retain higher precision.
- Initialization scheme: For models trained from scratch, the initialization method (Xavier, Kaiming, scaled initialization, etc.) directly affects the early gradient scale. An inappropriate choice can trigger early divergence.
Engineering recommendation: build a “weight-loading self-check” mechanism. After loading, randomly sample several tensors, verify that their mean, variance, and norm fall within reasonable ranges, and write the results to the log.
Stage 2: Parallelism Strategy and Shard Scheduling
When the model’s parameters exceed a single card’s memory capacity, you must use a parallelism strategy to split them across multiple cards. The mainstream options are:
| Parallelism | What It Splits | Communication Pattern | Typical Use Case |
|---|---|---|---|
| Data Parallel (DDP) | Data, not the model | All-Reduce on gradients each step | Small and medium models that fit on one card |
| Fully Sharded Data Parallel (FSDP) | Parameters, gradients, optimizer state | All-Gather parameters + Reduce-Scatter gradients | The main scheme for large-model training |
| Tensor Parallel (TP) | Matrix operations within a single layer | All-Reduce (per layer forward/backward) | A single layer too large, split within a node |
| Pipeline Parallel (PP) | Layers split across device groups | Point-to-point Send/Recv of activations | Cross-node, very deep models |
| Sequence/Context Parallel | The sequence dimension | Communication related to attention computation | Long-context training |
| Expert Parallel (EP) | Experts in a MoE model | All-to-All routing and dispatch | Mixture-of-experts models |
Real training often combines multiple parallelism strategies, commonly called “3D parallelism” or “multi-dimensional hybrid parallelism.” The shard scheduler must weigh several factors to automatically produce the split with the lowest communication overhead and the most balanced load:
- Device topology (intra-node interconnect bandwidth is far higher than inter-node network);
- Differences in per-layer compute;
- Estimated memory usage;
- The degree of overlap between communication and computation.
Stage 3: Forward Pass and Computation-Graph Construction
Once the sharding strategy is set, the framework builds the computation graph accordingly and inserts the required communication primitives. The key design points here include:
- Automatic insertion of communication primitives: Under a fully sharded strategy, an All-Gather of full parameters is needed before the forward pass, and non-local shards are released immediately after computation. During backpropagation, parameters are All-Gathered again, followed by a Reduce-Scatter on gradients.
- Recomputation (activation checkpointing): By “saving only layer-boundary activations and recomputing intermediate activations during the backward pass,” you trade extra computation for memory savings.
- Operator fusion: Fusing operators such as normalization, activation, and attention reduces memory read/write counts and kernel-launch overhead.
The advantage of the native path is that framework developers can directly call the high-performance communication and operator libraries provided by the chip vendor, rather than “translating” execution on a generic compatibility layer. This avoids extra performance loss and potential semantic drift.
Stage 4: Backpropagation and Gradient Computation
Backpropagation is the most essential difference between training and inference. This stage must accomplish:
- Gradient operator coverage: Every forward operator should have a numerically validated backward implementation;
- Mixed-precision gradient accumulation: Under FP16/BF16, gradient accumulation usually needs to be promoted to FP32, otherwise small gradients can be “swallowed” during accumulation;
- Gradient scaling: FP16 training commonly uses loss scaling to prevent underflow; BF16 has a wider dynamic range and generally needs no scaling, though precision loss still warrants attention.
# Illustration: gradient accumulation under mixed precision (pseudocode, not tied to any specific framework API)accum_steps = 8scaler = GradScaler(enabled=use_fp16) # can disable scaling in the BF16 casefor step, batch in enumerate(dataloader):# 1) Forward: autocast runs matrix-heavy ops in lower precisionwith autocast(dtype=bf16 if use_bf16 else fp16):outputs = model(**batch)# 2) Divide the loss by the accumulation steps so the accumulated gradient keeps the right scaleloss = outputs.loss / accum_steps# 3) Backward: unscale first when scaling is enabled, then accumulate gradientsscaler.scale(loss).backward()grad_accum += loss.detach() * accum_steps # for logging only# 4) Update parameters once every accum_steps stepsif (step + 1) % accum_steps == 0:if use_fp16:scaler.unscale_(optimizer)torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0)scaler.step(optimizer)scaler.update()optimizer.zero_grad(set_to_none=True)
Two easily overlooked details:
- Loss scaling: Before accumulation, divide uniformly by the number of accumulation steps; otherwise the effective learning rate after the update is amplified.
- Gradient clearing: Use
set_to_nonerather than zeroing values, to release memory and save one kernel call.
Stage 5: Gradient Synchronization and Communication Optimization
In distributed training, gradient synchronization is a frequent performance bottleneck. A native training path usually has to solve the following:
- Communication primitive choice: Reduce-Scatter saves more bandwidth than traditional All-Reduce and is the standard approach under a fully sharded strategy.
- Communication-computation overlap: Bucket parameters so that while the current bucket communicates, the next bucket’s computation runs in parallel, hiding communication latency.
- Topology-aware scheduling: Keep tensor parallelism within a node’s high-bandwidth domain as much as possible, and deploy pipeline parallelism across nodes.
- Inter-node network adaptation: Tune for high-speed network features such as RDMA, including message aggregation, multi-channel operation, and congestion control.
- Gradient accumulation boundaries: Do not trigger communication during gradient accumulation; synchronize only at the actual update, reducing communication frequency.
Stage 6: Optimizer Update
Under a native fully sharded path, each process holds the optimizer state for only a subset of parameters, so the optimizer step runs only on the local shard, reducing optimizer-state memory overhead to 1/N. The implementation also needs care with:
- Master-weight maintenance: Under low-precision training, keep an FP32 master weight and convert back to low precision after the update;
- Shard-state consistency: Every process must keep hyperparameters such as learning rate and weight decay strictly identical, or the parameter shards will be updated inconsistently;
- Optimizer-state initialization: Before the first step, the first and second moments are usually initialized to zero, and you must handle the memory jitter from “lazy state allocation.”
Stage 7: Logging, Monitoring, and Checkpoints
Large-scale training is a long-running task, and observability directly determines how fast you can locate problems. Recommended metrics to collect:
- Training metrics: loss, gradient norm, learning rate, parameter update magnitude, tokens/s;
- System metrics: per-card memory usage, utilization, temperature, and power;
- Communication metrics: time spent and bandwidth utilization of each collective communication operation;
- Numerical metrics: location and frequency of NaN/Inf occurrences, and how often gradient clipping triggers.
At the same time, implement periodic checkpoint saving with asynchronous writes, and resume from the most recent valid checkpoint to minimize the compute wasted on failures.
4. A Methodology for Stability Validation: What 400 Steps Can and Cannot Show
4.1 Is the Validation Design Reasonable?
This public validation used a design of “16 cards across two nodes, 400 consecutive updates,” which is methodologically sound:
- Cross-node validation: A single 8-card machine cannot expose cross-node communication and network-congestion problems; a two-machine setup covers them effectively.
- Process-level validation: The 16 training processes map one-to-one onto the 16 cards, exercising basic capabilities such as distributed initialization, process-group creation, and rank consistency.
- Step-count choice: While 400 steps is only a warm-up in large-scale pre-training, it is enough to cover:
- the learning-rate warmup phase;
- optimizer-state initialization and the first update;
- several loops of the data loader;
- the basic flow of checkpoint saving and restoration.
4.2 Is the Pass Criterion Rigorous?
The statement “loss and gradient norms stayed finite throughout, with no numerical overflow or abnormal interruption” corresponds to clear engineering pass criteria:
- Numerical finiteness: Every step must check whether loss and gradient norm are finite values (not NaN, not Inf);
- Trend reasonableness: Loss should trend downward overall, or at least not keep rising; the gradient norm should stay in a reasonable range rather than oscillating wildly;
- No interruption: The training processes must not crash, time out, hang on communication, or trigger a watchdog.
# Illustration: stability checks in the training loop (pseudocode)for step in range(total_steps):loss, grad_norm = train_one_step(batch)# Check that values are finiteif not (math.isfinite(loss) and math.isfinite(grad_norm)):raise NumericalError(f"step={step}, loss={loss}, grad_norm={grad_norm}")# Check for abnormal gradient norm (e.g., above threshold for 3 consecutive steps)if grad_norm > grad_norm_threshold:consecutive_high += 1if consecutive_high >= 3:logger.warning("grad_norm stays high; check the learning rate and data distribution")else:consecutive_high = 0# Save to disk periodicallyif step % save_interval == 0:save_checkpoint(step)
4.3 Limitations: What 400 Steps Cannot Prove
To be objective, 400 consecutive stable steps only prove that “the chip and software stack have the basic capability to complete the training loop.” They do not directly support the following conclusions:
- That the chip can sustain full pre-training of a trillion-parameter model;
- That the chip maintains a linear speedup when scaled to a large cluster of many machines and cards;
- That the chip’s failure rate is acceptable over long runs (thousands of hours).
Answering these requires larger-scale, longer-duration validation. For developers, viewing incremental results rationally — neither underestimating their milestone significance nor overestimating their scope of applicability — is what sound technical judgment looks like.
5. Levels and Paths of “Domestic Chips Training Domestic Models”
From public information, domestic compute has accumulated practical cases on the training side. Drawing on the common descriptions of such work in the industry, they fall into four levels:
Full training of a scientific foundation model from scratch
A roughly 200-billion-parameter scientific foundation model completed full training from zero. This kind of work usually requires continuous operation for weeks or even months and places extremely high demands on cluster stability, data-pipeline throughput, and checkpoint fault tolerance.Full-stack native training that supports an innovative architecture
Full-stack native training of a 5D world model involves fusing multimodal data such as video, time series, and physical simulation. Its structure differs substantially from mainstream language models, raising the bar for the breadth of operator coverage and customization.End-to-end embodied-AI training with a research institution
An embodied “brain” model trained end to end with a research institution covers the whole chain — data processing, pre-training, fine-tuning, and evaluation — reflecting the completeness of the training pipeline and the maturity of the toolchain.Advancing trillion-parameter model training
Trillion-parameter model training advanced with partners marks domestic compute moving from “usable” to “good to use” and “usable at scale.”
What these cases share is a shift away from merely “getting a demo to run” toward “full-pipeline controllability,” “full-stack reproducibility,” and “full-lifecycle maintainability.”
6. Domestic Compute Training from a Cloud-Platform Perspective
For most enterprises and developers, the barrier to building a large-scale GPU/accelerator cluster in-house is extremely high. Elastic compute, managed services, and operational capabilities on cloud platforms are becoming an important path for putting domestic compute into practice. The following offers practical guidance grounded in general cloud-product capabilities.
6.1 Choosing Compute Resources
- GPU cloud servers: Suitable for small- and mid-scale training, fine-tuning, and inference validation, with on-demand elastic scaling;
- Bare-metal / high-performance computing instances: Suitable for large-scale distributed training, offering higher network bandwidth and lower latency;
- Containerized training platforms: Suitable for job scheduling, resource isolation, and multi-tenancy, paired with job queues to manage priorities.
6.2 Storage and the Data Pipeline
- Object storage: Holds training data, checkpoints, and model artifacts, leveraging high durability and low cost;
- Parallel file systems: Large-scale training needs high-throughput, low-latency shared storage; prefer products that support a POSIX interface and offer data-caching acceleration;
- Data preprocessing: Complete cleaning, deduplication, tokenization, and shard packing before training so the pipeline does not become an I/O bottleneck.
6.3 Monitoring and Observability
- Metrics monitoring: Collect GPU utilization, memory, temperature, and network bandwidth, and set threshold alerts;
- Log service: Centrally collect training logs, system logs, and communication logs, with full-text search and correlation analysis;
- Distributed tracing: Perform fine-grained tracing of communication and operator time in distributed training to locate performance bottlenecks.
6.4 Cost-Optimization Strategies
- Spot instances: Suitable for interruptible training jobs, paired with checkpointing to reduce losses from interruption;
- Reserved resources: Long-running, stable training can choose annual/monthly commitments or reserved instances to lower cost;
- Elastic scaling: Adjust resources dynamically by training phase — for example, CPU instances for data preprocessing and GPU instances for the training phase.
6.5 A Reference to Baidu AI Cloud Capabilities
As one of the major cloud providers in China, Baidu AI Cloud offers general cloud products such as GPU cloud servers, high-performance bare-metal servers, object storage, a container engine, and monitoring and logging services, and it has formed a fairly complete training and inference toolchain with the PaddlePaddle deep learning framework. For teams that want to run large-model training on domestic or heterogeneous compute, it can serve as one reference direction for infrastructure selection. Specific capabilities and quotas should be confirmed against the official documentation.
7. A Practical Stability-Engineering Checklist
Building on the analysis above, here is an actionable stability-engineering checklist for developers running large-model training on domestic compute.
7.1 Numerical Stability
- Prefer BF16 mixed precision; if using FP16, pair it with loss scaling;
- Keep normalization, embedding, and output layers at FP32 or higher precision;
- Tune the gradient-clipping threshold to the model scale, generally between 0.5 and 2.0;
- Monitor the finiteness of loss and gradient norm; stop immediately and capture the state on anomaly;
- Run numerical comparison tests on key operators (such as attention and normalization) to ensure the error against a reference implementation stays within an acceptable range.
7.2 Communication Stability
- Set a reasonable timeout during distributed initialization to avoid one slow node hanging the whole job;
- Enable debug logs for NCCL/the vendor communication library (such as
NCCL_DEBUG=INFO) to help diagnose communication problems; - Run bandwidth and latency benchmarks on inter-node communication to confirm it meets expectations;
- Implement automatic retry on communication timeouts and automatic job restart.
7.3 Fault Tolerance and Recovery
- Save checkpoints regularly, roughly every 50–200 steps, balancing training duration against storage cost;
- Save checkpoints asynchronously to avoid blocking the main training loop;
- Implement checkpoint integrity checks (such as checksums and shard-consistency checks);
- Support automatic resumption from the most recent valid checkpoint, recording the position of consumed data.
7.4 Performance Optimization
- Use profiling tools to locate bottlenecks (compute, communication, I/O);
- Enable optimizations such as operator fusion, recomputation, and communication overlap;
- Tune the data loader’s worker count and prefetch strategy to avoid data starvation;
- Monitor memory fragmentation, and if necessary set memory-pool parameters or defragment periodically.
8. Conclusion: View Progress Rationally, Advance Implementation Steadily
A domestic AI chip completing training adaptation for a trillion-parameter open-source large model, and achieving 400 consecutive stable steps on 16 cards across two machines, is a positive signal for building the domestic compute ecosystem. It shows that:
- The software stack of domestic chips is evolving from “runs” to “runs well” and “runs stably”;
- Establishing the native training path reduces reliance on compatibility layers and improves performance and maintainability;
- “Domestic chips training domestic models” is moving from isolated cases toward the norm.
At the same time, we should stay clear-headed. From “training adaptation” to “large-scale pre-training,” from “400 stable steps” to “tens of thousands of stable steps,” and from “two-machine validation” to “a thousand-card cluster,” many engineering problems still need to be solved. For developers and enterprises, a rational stance is:
- Don’t mythologize: Treat training adaptation as a starting point, not a finish line, and keep tracking its performance in large-scale, long-duration scenarios;
- Don’t dismiss it: Seriously assess the advantages of domestic compute in cost, supply, and compliance, and adopt a diversified compute strategy;
- Prioritize practice: Accumulate reusable engineering experience through small, fast iterations (from single machine to multiple machines, from hundreds to thousands of steps, from one model to many);
- Leverage platforms: Make full use of the elastic compute and managed services on cloud platforms to lower the barrier to using domestic compute.
Compute is the infrastructure of the AI era. The maturity of domestic compute needs not only advances in chip hardware but also coordinated effort across software ecosystems, developer tools, and community collaboration. Every successful training adaptation is another paving stone on this road.
