Training a Trillion-Parameter Model on a Domestic Chinese GPU: 400 Stable Steps End to End
This article examines what a 400-step training run on a domestic Chinese GPU platform can and cannot validate for trillion-parameter large model training. It distinguishes training adaptation from base-model pretraining, explains key challenges around MoE architectures, parallelization, operator coverage, and numerical precision, and outlines a native FSDP2 path from model loading to gradient synchronization. It also provides practical engineering guidance for moving from one-off stability to reproducible and production-ready training.
1. Introduction: What Does 400 Stable Steps Actually Mean?
A domestic Chinese GPU vendor recently announced that it had completed training adaptation for an open-source flagship large model at the trillion-parameter scale. The test used two nodes with 16 accelerators in total. All training processes completed 400 consecutive optimizer updates. During training, the loss values and gradient norms remained finite throughout. There was no numerical overflow and no abnormal interruption.
The announcement quickly led to two opposing views. One view is that domestic chips can already train large models. The other emphasizes that successful adaptation does not mean the model was originally pretrained on this chip. Both views contain partial truth, but neither captures the full picture.
For algorithm and infrastructure teams, the more useful questions are:
- What are the main technical difficulties in training trillion-parameter models across multiple nodes and multiple accelerators?
- What can 400 stable steps prove, and what can they not prove?
- What engineering work remains between “it can train” and “ready to train out of the box”?
This article addresses these questions and provides a framework for evaluating the maturity of domestic compute for large-model training.
2. Clarifying the Concept: Training Adaptation Is Not Base-Model Pretraining
Before discussing conclusions, it is important to distinguish two concepts that are often mixed: training adaptation and base-model pretraining.
| Dimension | Training adaptation | Base-model pretraining |
|---|---|---|
| Starting point | Existing weights and a known model architecture | Random initialization, requiring large-scale raw corpus |
| Core objective | Ensure the model can continue updating correctly and stably on new hardware and software stacks | Train high-quality base-model weights |
| Data scale | Relatively small, focused on covering model structures and edge cases | Usually requires trillions of tokens of training data |
| Runtime | Hundreds to thousands of validation steps | Weeks or even months of continuous training |
| Key challenges | Operator coverage, numerical consistency, parallelism strategies, communication correctness | Long-run stability, convergence quality, data mixture, fault recovery, total cost |
| Main deliverables | Availability verification reports and engineering capability | Model weights, technical reports, and evaluation results |
The two activities are related, but they are not equivalent. Training adaptation answers whether a model can train. Base-model pretraining answers how well it trains.
Some technical reports for frontier models may list fine-grained expert parallelism schemes validated across different hardware routes. Such work is generally related to operator or solution validation on the inference or training side. It does not, by itself, reveal where the original pretraining compute for the base model came from.
Similarly, a successful training adaptation should not be interpreted as proof that the base model was pretrained on that hardware. A more accurate statement is: the hardware and its accompanying software stack have demonstrated the engineering capability to support training of this type of model architecture, providing a foundation for domestic compute to move from “can train” to “trains well.”
3. Key Challenges in Training Adaptations for Trillion-Parameter Models
3.1 Model Architecture: From “Model as Product” to “Integrated Capability”
Trillion-parameter flagship models rarely use traditional dense architectures in which all parameters are activated for every token. Instead, sparse Mixture-of-Experts (MoE) architectures are commonly used. Only a small number of experts are activated for each token, decoupling total parameter count from per-token computation. This design makes trillion-parameter inference more practical, but it also makes training adaptation more complex:
- Total parameter count: A single model may contain trillions of parameters. The combination of weights, gradients, and optimizer states places enormous memory pressure on any single machine.
- Communication patterns: Expert parallelism relies on All-to-All communication to dispatch tokens and aggregate results. Communication volume grows rapidly with the number of experts and sequence length, making it highly sensitive to inter-node bandwidth.
- Load balancing: Expert routing imbalance also exists during training. It can cause some devices to become stragglers and slow down the entire training step.
- Architectural variants: Attention mechanisms and positional encoding schemes continue to evolve. Long contexts introduce longer sequence dimensions and larger activation memory. Some models also combine multimodal encoders, such as vision encoders, forming hybrid structures that mix heterogeneous modules with unified training.
For adaptation teams, the challenge is not only whether each individual operator computes correctly. It is also whether dozens of parallelism strategies can be combined while maintaining numerical correctness and efficient communication.
3.2 Parallelism Strategies: Combinatorial Explosion Across Sharding Dimensions
A single accelerator cannot hold the entire model, and a single machine cannot contain the full workload. The model must therefore be split across multiple accelerators and multiple nodes. Common sharding dimensions include:
| Parallelism dimension | Sharding target | Main communication pattern | Main constraint |
|---|---|---|---|
| Sharded data parallelism (FSDP / ZeRO-3-like schemes) | Parameters, gradients, optimizer states | All-Gather / Reduce-Scatter | Inter-node bandwidth |
| Tensor parallelism (TP) | Internal operations within a single layer | All-Reduce / All-Gather | High-bandwidth interconnect between cards |
| Pipeline parallelism (PP) | Layer-based stages | Point-to-point send/receive | Pipeline bubbles and load balancing |
| Expert parallelism (EP) | Expert subnetworks | All-to-All | Routing balance and inter-node bandwidth |
| Sequence/context parallelism (SP / CP) | Sequence dimension | All-Gather / ring communication | Activation memory for long sequences |
In practice, multiple parallelism dimensions are often combined into two-dimensional or even higher-dimensional strategies. Techniques such as gradient accumulation, activation recomputation, and overlapping communication with computation are then used to reduce memory and communication overhead.
The “optimal” parallelism strategy depends heavily on hardware topology. Intra-node interconnect bandwidth, inter-node network bandwidth, per-card memory capacity, and compute-to-memory ratios all affect the best sharding approach. Therefore, adaptation is not a matter of directly reusing existing configurations. It is a systematic reconstruction based on the characteristics of the target hardware. Even data-parallel-oriented schemes such as native FSDP require repeated tuning around the trade-off between “memory for compute.”
3.3 Operators and Frameworks: A 1% Gap Can Cause 100% Failure
The real bottlenecks in a training pipeline are often not mature operators such as matrix multiplication. They are the long-tail components:
- Normalization layers, attention masks, and positional encodings;
- Loss functions, gradient clipping, mixed-precision conversion, and optimizer state updates;
- Format conversion between sharded weights and full weights;
- Distributed collective communication and data movement between devices.
Most of these components do not appear in public performance benchmarks. However, if even one operator is missing or behaves slightly differently, the entire training job may stop abruptly at a certain layer and a certain step.
Therefore, a large part of adaptation work is “filling long-tail gaps.” The training engine needs automatic operator dispatch and fallback mechanisms: high-frequency operators should use vendor-optimized implementations, while missing operators should automatically fall back to generic framework implementations and leave logs. This helps ensure that the pipeline runs first, while also creating a checklist for later replacement and performance optimization.
3.4 Numerical Precision: Finite Numbers from Step 1 to Step N
Modern large-model training commonly uses mixed precision with BF16/FP16 and FP32. BF16 has a large dynamic range and often does not require loss scaling, making it one of the mainstream choices for trillion-parameter model training.
However, using the same precision mode does not guarantee identical numerical behavior. Differences can arise from:
- Accumulation order inside operators;
- Reduction implementations;
- Variance computation in normalization layers;
- Implementation details in softmax.
These differences may be negligible for a single input on different hardware.
- Mild scenario: The difference may be ignored within a single step.
- Deep scenario: In backpropagation across hundreds or thousands of layers, it may be amplified continuously.
- Training scenario: Combined with gradient clipping and learning-rate scheduling, it may evolve into loss spikes or even NaNs after hundreds of steps.
Therefore, the quality of training adaptation cannot be judged only by whether training starts. It must also be evaluated by whether the loss curve remains smooth and controllable after continuous iteration over thousands or tens of thousands of steps.
4. Native FSDP2 Training Path: From Loading to Gradient Synchronization
The adaptation described a “native FSDP2 multimodal training path,” covering the complete chain from model loading and sharded scheduling to gradient synchronization. Three key terms deserve closer examination.
4.1 The Weight of the Word “Native”
The basic idea of sharded data parallelism comes from the ZeRO family of zero-redundancy optimizer approaches: each card keeps only 1/N of the parameters, gradients, and optimizer states. When computation is needed, the required shards are temporarily gathered and then released immediately after use.
“Native” here means that the adaptation does not rely on external parallelism libraries or manual rewriting of model code. Instead, it uses the sharded data parallelism capability built into the training framework. Next-generation FSDP2 has a clearer design in this area:
- It uses a single Transformer layer as the sharding unit, replacing large flattened parameter blocks. This makes it easier to work with meta-device model construction, tensor-sharding descriptions, and computation-graph compilation.
- Sharding information is expressed as standard tensors. Checkpoints can be saved and loaded directly in sharded format, without repeated conversion between full weights and sharded weights.
- Explicit module wrapping makes debugging and performance profiling more intuitive.
For complex multimodal models, native approaches are especially valuable. Visual encoders, projection layers, and language-model backbones often have different precision requirements and preferences for parallelism. Native capabilities allow these components to be configured separately within the same training path.
4.2 Memory Accounting: Why Sharding Is Mandatory
Under BF16 mixed-precision training, a single parameter typically requires approximately:
- 2 bytes for BF16 weights;
- 4 bytes for FP32 master weights, used to maintain numerical stability during parameter updates;
- 4 bytes for first-order momentum and 4 bytes for second-order momentum, assuming an Adam-like optimizer;
- 2 to 4 bytes for gradients.
The total is approximately 16 bytes per parameter. A model with 1 trillion parameters would require roughly 16 TB of memory just for model states. A model with 3 trillion parameters would require roughly 48 TB. No single-machine cluster can contain that. Sharding is the only viable path.
4.3 One Pipeline, Four Stages
The path can be summarized as the following four stages, shown in pseudocode:
import osimport torchimport torch.distributed as distimport torch.distributed.checkpoint as dcpfrom torch.distributed.fsdp import MixedPrecisionPolicy, fully_shard# 1) Initialize the distributed environment: 16 processes = 2 nodes x 8 cards per nodedist.init_process_group(backend="nccl") # Replace the backend with the vendor software stackrank = dist.get_rank()local_rank = int(os.environ["LOCAL_RANK"])torch.cuda.set_device(local_rank) # Replace the device interface name as needed# 2) Build the model skeleton on a meta device: define structure only, without allocating memorywith torch.device("meta"):model = build_model(config) # build_model is a custom modeling function# 3) Sharding scheduling: shard one Transformer layer at a time# Parameters participate in computation as BF16; gradient reduction and optimizer states remain FP32mp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16,reduce_dtype=torch.float32)for layer in model.layers: # Multimodal models can handle vision and language modules separatelyfully_shard(layer, mp_policy=mp_policy)fully_shard(model, mp_policy=mp_policy)# 4) Model loading: each process reads and places only its assigned shardstate = {"model": get_model_state_dict(model)}dcp.load(state_dict=state, checkpoint_id=ckpt_dir)set_model_state_dict(model, state["model"])
The key points for each stage are as follows:
Model loading
- First build the model skeleton on a much larger meta device to avoid every card temporarily hosting full weights.
- Then load weights layer by layer from a sharded checkpoint. Each process handles only its assigned shard, so loading time decreases as the number of cards increases.
Sharded scheduling
- Parameters, gradients, and optimizer states are all sharded across cards.
- During forward computation, when execution reaches a certain layer, the full parameters of that layer are temporarily gathered through All-Gather and released immediately after computation. The backward pass repeats this process. Therefore, peak memory depends mainly on the size of a single layer rather than the total model size.
Gradient synchronization
- After backward computation, Reduce-Scatter sums gradients and performs gradient averaging. Each card directly obtains its own gradient shard and passes it to the optimizer to update the corresponding parameter shard.
- Compared with “first using All-Reduce to obtain full gradients and then splitting them,” the communication volume is reduced by approximately half. This is particularly valuable in cross-node scenarios.
- Gradient reduction is performed in FP32, reducing accumulation error.
- Reduction is overlapped with backward computation, hiding most communication overhead.
Parameter update
- Each card updates only its own shard.
- At the beginning of the next iteration, shards are gathered again as needed.
Repeating these four steps forms a complete closed loop: loading, sharding, synchronization, and updating. Understanding this loop explains why vendors emphasize the complete training pipeline “from model loading and sharded scheduling to gradient synchronization.” Without any one of these components, so-called “training adaptation” is merely an extension of inference deployment.
5. 400 Stable Steps: What It Proves and What It Does Not
5.1 Test Environment and Observed Metrics
The test used two nodes with 16 accelerators in total. Each card corresponded to one training process. Cross-node collective communication was used for parameter aggregation and gradient reduction. The core observation metrics were:
- Loss: Reflects numerical correctness in forward computation and backward propagation;
- Gradient norm (grad norm): Reflects the health of backward propagation and gradient reduction.
All 400 optimizer updates completed successfully. Both metrics remained finite throughout. There were no NaN/Inf values, no process crashes, and no communication deadlocks.
5.2 The Criterion Is Simple, but the Underlying Pipeline Is Not
The criterion of “finite values” seems simple, but it represents a layered chain of evidence:
- Finite loss: Forward computation did not overflow;
- Finite grad norm: Gradients for all parameters across all data-parallel ranks were reduced completely and numerically correctly;
- Both finite at the same time: The parameter update process did not enter an unrecoverable divergent state;
- No interruption throughout: Device scheduling, memory allocation, cross-node communication, and checkpoint mechanisms worked together over hundreds of steps.
The following pseudocode represents this “numerical guardrail during training”:
max_norm = 1.0rank = dist.get_rank()for step in range(1, total_steps + 1):# All ranks use the same seed and data order to ensure reproducibility for cross-hardware comparisonsloss = compute_loss(model, next_batch()) / grad_accum_stepsloss.backward()# Gradient clipping: compute the global gradient norm and scale proportionally if the threshold is exceeded# The returned value is also one of the most important stability metricsgrad_norm = clip_grad_norm_(model.parameters(), max_norm=max_norm)optimizer.step()optimizer.zero_grad(set_to_none=True)scheduler.step()# Numerical guardrail: raise an exception immediately if non-finite values appear,# preventing errors from propagating silentlyif not torch.isfinite(loss) or not torch.isfinite(grad_norm):raise RuntimeError(f"step={step}, rank={rank}, "f"loss={loss.item()}, grad_norm={grad_norm.item()}")if rank == 0 and step % log_interval == 0:print(f"step={step} loss={loss.item():.4f} grad_norm={grad_norm.item():.4f}")
In engineering practice, additional monitoring items may be added, such as per-layer gradient norm statistics, parameter update magnitude relative to weights, and others. These help distinguish among three cases: abnormal gradients in individual layers, global gradient explosion, and improper learning-rate settings.
5.3 Why 400 Steps?
For pretraining measured in trillions of tokens, 400 steps is only a fraction. However, as a validation run for adaptation, it has practical value:
- It crosses key windows: It covers the warm-up phase, early momentum accumulation, and several learning-rate transition points. Many numerical issues appear precisely when gradient scales begin to change rapidly.
- It is low-cost and repeatable: An adaptation validation often needs to be repeated across different parallelism configurations and precision settings. A duration of hundreds of steps allows regression testing to iterate on an hourly or daily basis.
- It follows industry practice: Compatibility testing and precision regression testing for frameworks commonly use short runs of hundreds to thousands of steps to determine whether a result is acceptable.
5.4 What It Cannot Prove
At the same time, it is important to remain clear about limitations:
- 400 steps cannot prove the final convergence quality of the model, because convergence depends on data, hyperparameters, and longer training.
- It also cannot prove linear scaling efficiency, because larger-scale and longer-duration controlled experiments are required.
- It certainly cannot prove that the base model was pretrained on this hardware.
A more accurate conclusion is: at the scale of two nodes and 16 accelerators, the hardware and software stack have demonstrated the engineering capability to execute the complete training loop of forward computation, backward propagation, synchronization, and updating for a trillion-parameter model.
6. From “Occasionally Runs” to “Reproducibly Stable”
6.1 Stability in Cross-Node Training Depends on Details
Cross-node training differs from single-node multi-card training primarily because the communication path is longer and the failure surface is larger. Turning “hundreds of stable steps” into “thousands or tens of thousands of stable steps” usually requires careful attention to the following points:
Data and initialization reproducibility
- Fix the global random seed and ensure that every data-parallel replica uses the same data sampling order.
- Otherwise, even if the loss decreases overall, curves across different hardware may not be directly comparable.
Cross-hardware numerical comparison
- Fix the input and seed, then compare loss curves and per-layer gradient norms between the target hardware and a reference platform at the same step count.
- Differences should fall within a reasonable floating-point error range, not show systematic deviation.
Communication timeouts and fault tolerance
- Set reasonable timeouts for collective communication to prevent a slow node from dragging down the entire job.
- Combine health checks to exclude abnormal nodes and support automatic recovery from the latest checkpoint.
Sharded checkpoints
- Decouple checkpoints from the parallelism strategy so that jobs can migrate flexibly and resume training across different card counts and parallelism configurations.
Full-pipeline observability
- Collect metrics such as loss, gradient norm, throughput, memory usage, and communication time in a unified way. Only then can a “sudden failure at a certain step” be traced back to a specific module or specific communication primitive.
6.2 Advancing Adaptation Through a Stepwise Approach
Instead of directly targeting the final configuration, it is better to follow a stepwise scaling process:
- Run forward and backward passes on the target hardware, and compare single-step loss and gradients against a reference platform;
- Expand to single-node multi-card training and validate the correctness of collective communication operations such as All-Reduce and Reduce-Scatter;
- Expand to multi-node training and validate cross-node gradient synchronization and sharded weight loading;
- Gradually increase global batch size and parallelism dimensions, observing changes in loss curves and throughput;
- Finally, perform continuous stability tests lasting hundreds of steps or longer.
By setting clear numerical criteria at each stage, problems can be located and fixed at minimal cost.
7. From “Can Train” to “Ready to Train Out of the Box”: Four Stages of Engineering Capability
A single successful adaptation is only the beginning. Making mainstream open-source models ready to train out of the box on domestic compute usually requires four levels of maturity:
| Stage | Core question | Key construction |
|---|---|---|
| L1: Operator availability | Are all operators available? | Fill long-tail operator gaps; build operator coverage lists and automatic fallback mechanisms |
| L2: Numerical alignment | Do results match? | Cross-hardware numerical comparison; layer-by-layer gradient comparison; mixed-precision strategy validation |
| L3: Efficient parallelism | Is it fast enough? | Multi-dimensional parallelism tuning; overlap of communication and computation; memory optimization |
| L4: Out-of-the-box training | Is it easy to use? | Model structure recognition; automatic parallelism recommendation; one-click launch; fault tolerance and self-healing |
For L4, one can imagine the following workflow:
- Preparation: The user places model weights and training data into the training environment through object storage and loads a preconfigured training image through a container platform.
- Launch: The platform recognizes the model structure, such as the number of Transformer layers, attention type, whether it is MoE, and whether it is multimodal. Combined with the current resource topology, it automatically proposes a parallelism plan.
- Execution: The training job is submitted as a fault-tolerant task. Logging and monitoring services display key metrics such as loss and gradient norm in real time. If an exception occurs, the job automatically recovers from a checkpoint.
- Tuning: Operator lists, parameter combinations, and fault cases accumulated from each adaptation are stored in a knowledge base and reused when new models are onboarded.
Platforms such as Baidu AI Cloud, with general capabilities in object storage, container platforms, logging, and monitoring, can provide infrastructure support for this engineering loop in domestic compute scenarios.
At present, domestic compute has already been applied to domestic models across several categories:
- Scientific foundation models trained from scratch;
- World models trained with full-stack native training;
- Embodied-brain models that require end-to-end training.
From complete training of small and medium-sized models to training adaptation for trillion-parameter models, the training capability of domestic full-featured GPUs is advancing along two dimensions: model scale and training-pipeline completeness. The next key step is to work with industry partners to advance large-scale pretraining of trillion-parameter models, converting examples of “can train” into results of “trains well.”
8. Conclusion: Three Takeaways for Technical Teams
- When assessing maturity, first ask “how far did training go?” Inference deployment, training adaptation, and base-model pretraining represent three different levels of capability. When reading any announcement of “adaptation completed,” ask: how many steps were run, which metrics were observed, and under what parallelism configuration was it completed?
- When designing domestic compute training, prioritize numerical correctness. Make it correct first, then make it fast. Use short-run, high-frequency regression tests to maintain a quality baseline.
- When building platforms, turn adaptation experience into tooling. Operator lists, numerical baselines, parallelism strategy libraries, and fault cases only become scalable when they are productized. This is how isolated cases of “manually got it running” become widespread “ready to train out of the box.”
The 400-step stable run is a convincing starting point, not an endpoint. As operator adaptation, multi-card coordination, and automated toolchains continue to mature, the transition from “can train” to “ready to train out of the box” for frontier large models on domestic full-featured GPUs will no longer be an exception. It will become the norm.
