Training Large Models on Domestic GPUs: The Engineering Chain Behind a Two-Node, 16-GPU, 400-Step Run
This article examines a reported adaptation result in which a flagship multimodal model with nearly 3 trillion parameters completed 400 consecutive optimizer updates on two nodes with 16 domestic full-function GPUs, with loss and gradient norms remaining finite throughout. It clarifies two commonly confused points—whether adaptation success equals pretraining on the chip, and what a 400-step test can prove—then breaks down the training chain: model loading, native FSDP2 sharded data parallelism, multimodal operator and parallelism challenges, gradient synchronization, numerical stability, and a sample training-loop skeleton. It also assesses the value and limits of the 400-step test, summarizes four scaling task types and engineering solutions, and lists the engineering gaps between one-off adaptation and repeatable "out-of-the-box" training.
Clarifying the concepts: training adaptation is not pretraining
The industry often says that a chip has completed “Day 0 adaptation” to the latest open-source large model. Here, “adaptation” usually means that inference operators have been aligned on the target chip as soon as the model weights are released, so that the model can be loaded and produce correct outputs. Its focus is “can it run correctly?”
Training adaptation focuses on “can it train stably and fast?” In addition to forward computation, it requires the entire chain to work: backward computation, parameter sharding, cross-card and cross-node communication, mixed precision, and numerical stability. The difficulty is at least an order of magnitude higher.
Neither question has yet answered “where was the base model pretrained?” A widely circulated case is this: a model’s technical report presents operator validation results on two types of accelerator cards side by side, but only proves the correctness of inference operators and does not state the original compute used for base-model pretraining. In other words, a model’s ability to pass inference validation on multiple hardware platforms does not mean that those platforms participated in its pretraining.
To judge which level a piece of work is at, four pieces of evidence can be checked:
- Whether optimizer-level metrics are reported: complete training should provide loss curves, learning-rate schedules, optimizer update steps, and similar data. Inference validation usually focuses only on output and precision alignment.
- Whether the initialization method is explicit: pretraining starts from random initialization; fine-tuning or continued training starts from existing weights.
- Whether the parallelism strategy and scale are disclosed: pretraining needs to specify the combination of data, tensor, pipeline, sequence, expert, and other parallelism, as well as training duration.
- Whether full-chain capability is demonstrated: whether backward operators, parameter sharding, communication overlap, and fault recovery are complete.
These four “rulers” can help readers understand vendor technical reports and avoid treating “can run inference” as “can pretrain.” Using general distributed-training concepts, training adaptation is roughly in a transitional stage from “single-card forward pass can run” toward “thousand-card pretraining.”
Technical mainline: native sharded data parallelism connects the full training chain
The core of this adaptation is to build a native FSDP2 (second-generation fully sharded data parallelism) multimodal training path on domestic GPUs, connecting the complete chain from model loading and sharding scheduling to gradient synchronization. In detail, this path consists of six linked stages.
1. Model loading: how massive weights enter the cards
For a model with nearly 3 trillion parameters, even at 16-bit precision, the weights alone are close to 6TB. This far exceeds single-card memory and cannot be read into host memory at once. Engineering practice usually handles this in three steps:
- Reorder the distributedly saved weight shards into the target parallel layout: tensor dimensions are split according to tensor parallelism, and layers are split according to pipeline parallelism.
- Read shards on demand through memory mapping or lazy loading to avoid doubling peak memory usage.
- Convert data types: use 16-bit floating point (bf16 or fp16) for computation while retaining fp32 master weights for optimizer updates.
For domestic chips, it is also necessary to ensure that weight conversion tools, loading interfaces, and framework-native implementations behave consistently. Otherwise, the later loss alignment loses its baseline.
2. Sharding scheduling: the “three-in-one” under memory constraints
Sharded data parallelism unifies three capabilities: data parallelism, optimizer-state sharding, and tensor sharding. During training, each card holds only a parameter shard and temporarily aggregates the full parameters before computation, releasing them immediately afterward. As a result, the memory usage of the “model state”—parameters, gradients, and optimizer state—decreases approximately linearly with the number of cards.
Take the classic Adam-family optimizer as an example. The fp32 master weights, first moment, and second moment together already amount to about 12 times the parameter count. “Mixed precision plus gradient accumulation” alone cannot solve the memory problem; parameter sharding is required.
In practice, there are at least three tuning points:
- Forward and backward computation order: the mainstream approach is layer-by-layer computation, aggregating the next layer’s parameters after the previous layer finishes. This ensures that only a few layers’ full parameters reside in memory at any moment, which is especially important for memory-constrained single-card nodes.
- Communication-computation overlap: parameter aggregation and gradient reduction are launched early and executed concurrently with computation to hide communication latency.
- Aggregation strategy selection: intra-node bandwidth between cards is usually high, so parameters can be fully retained on each card while only gradients are sharded. Across nodes, where bandwidth is lower, full sharding of “parameters + gradients + optimizer state” is often more appropriate. The choice should match the actual topology rather than blindly applying one pattern.
3. Operators and parallelism: the special challenges of multimodal training
Multimodal models usually contain, in addition to a text backbone, a vision encoder, a cross-modal alignment module, and a multimodal decoder. Training difficulties concentrate in several areas:
- Large differences in sequence length: images produce many visual tokens after encoding, mixed with text tokens. Variable-length attention and sequence parallelism are needed to handle long samples within limited memory.
- Diverse loss structures: language-modeling cross entropy, image-text contrastive learning loss, and generative reconstruction loss must be computed simultaneously and then weighted and normalized. This places higher demands on reduction order and numerical stability.
- Routing and load imbalance: if a mixture-of-experts structure is used, expert routing and load balancing must also be handled, and long-tail samples must not slow down the entire training step.
Therefore, training adaptation is not simply “the model can be loaded.” It is the process of aligning and optimizing the performance of these operators one by one on domestic GPUs.
4. Gradient synchronization: communication topology determines scaling efficiency
Cross-node gradient synchronization usually goes through three steps:
- Each card first reduces the gradient shard it is responsible for.
- All cards then hold a complete, globally consistent gradient.
- Finally, each card updates only its local parameter shard.
Compared with the traditional “full reduction on every card,” this approach makes communication volume more controllable. The accompanying gradient clipping must also be globally consistent: each card first aggregates the sum of squared gradients to obtain the global norm, then computes a unified scaling coefficient. Otherwise, different shards would scale gradients by different ratios, breaking training consistency.
The two-node, 16-card test naturally covers inter-machine communication. Intra-node interconnect bandwidth is usually much higher than the cross-node network, and gradient reduction during the optimizer update phase is a major source of cross-node communication. Whether it can sufficiently overlap with backward computation directly determines the scaling efficiency of two nodes relative to one node.
5. Numerical stability: what “finite for 400 steps” means
“Loss and gradient norms remain finite throughout” may seem basic, but it is a key acceptance criterion for training adaptation. The risks of mixed-precision training include:
- Gradient underflow: the smallest normal number for 16-bit floating point is about 6×10⁻⁵; smaller gradients underflow to zero.
- Activation overflow: overflow to infinity can propagate backward and contaminate all parameters.
- Numerical anomalies: NaN or Inf can make training fail completely.
Common safeguards include:
- Dynamic loss scaling, which amplifies gradients as a whole into a representable range.
- bf16 has a larger dynamic range and can significantly mitigate overflow, but it has fewer mantissa bits, so some normalization and accumulation operations still need to be done in fp32.
- Keeping normalization bias and scale factors, optimizer state, and fp32 master weights in fp32.
- Using numerically stable implementations for sensitive components such as softmax and logits.
A practical reference benchmark is this: under the same data order and the same hyperparameters, the loss and gradient-norm curves of the same model on a mature ecosystem should match within the allowed floating-point error range. If the curve shapes are similar but the gradient norm is shifted overall or shows periodic spikes, it often indicates a deviation in some operator implementation.
6. Illustrative code: the skeleton of a training loop
The following pseudocode shows the approximate relationship among the stages above in one iteration. The code only expresses execution order and synchronization semantics; it does not correspond to any specific framework’s interfaces.
# Illustrative pseudocode: only shows the execution order and synchronization semantics of one training iterationfor step in range(global_step, max_steps):# 1) Forward: layer-by-layer "aggregate parameters -> compute -> release"# Aggregation overlaps with the next layer's compute to lower peak memoryoutputs = model(batch) # includes vision encoding, cross-modal alignment, text backboneloss = weighted_sum(losses) / grad_accum_steps# 2) Backward: compute gradients layer by layer and launch gradient-shard reduction# Use reduce-scatter: each card receives only its responsible shardloss.backward()# 3) Gradient accumulation: enter update phase only after the last micro-batch arrivesif (step + 1) % grad_accum_steps == 0:# 4) Global gradient norm: each card first aggregates the sum of squares, then clips uniformlygrad_norm = global_grad_norm(model) # must be consistent across all cardsclip_coef = min(1.0, max_grad_norm / grad_norm)# 5) Update: fp32 master weights + sharded parametersoptimizer.step()optimizer.zero_grad()# 6) Monitoring: record non-finite values and trigger checkpoint protectionmetrics = {"loss": loss.item(), "grad_norm": grad_norm,"finite": isfinite(loss) and isfinite(grad_norm)}log(metrics)
The value and boundaries of a 400-step test
Two nodes, 16 cards, and 400 optimizer updates: the focus of this test is stability and numerical correctness, not convergence quality. From an experimental-design perspective, it answers at least three questions:
- Chain completeness: model loading, sharding scheduling, forward and backward computation, gradient synchronization, and parameter updates form a closed loop without missing stages.
- Numerical consistency: loss and gradient norms remain finite throughout, with no overflow or interruption.
- Cross-node coordination: cross-machine communication does not create a bottleneck or error in gradient synchronization.
At the same time, its boundaries should be recognized objectively:
- Too few steps: 400 steps is usually still in the warmup phase, making it hard to observe later-stage loss plateaus, learning-rate decay effects, and long-range gradient accumulation issues.
- Limited scale: two nodes with 16 cards is a small-scale validation. Problems such as communication congestion, slow nodes, and fault-tolerance recovery at large scale have not been fully exposed.
- Conclusion level: this kind of result can prove “can train stably,” but it is not enough to prove “already has thousand-card pretraining capability.”
A more convincing approach is to provide a controlled experiment against a reference implementation: fix the data order and random seed, and compare loss and gradient-norm curves over the same number of steps. When possible, extend the number of steps to observe whether slow drift occurs. Baidu AI Cloud’s Qianfan platform offers large-model training quality evaluation capabilities, which can serve as a model-side quality check, but hardware-level training validation should still be based on controlled experiments under the same configuration.
Scaling training: four task types, four engineering solutions
From public information, “domestic chips training domestic models” practices that have landed on domestic full-function GPUs cover multiple task forms. The trillion-scale parameter model training now in progress is the next threshold. Summarized by task type:
| Task type | Representative scale | Main challenges | Key approaches |
|---|---|---|---|
| Base model trained from scratch | 236B parameters | High compute demand, long training cycle, high stability requirements | Multi-dimensional parallel combinations, efficient checkpointing, long-cycle fault-tolerant scheduling |
| Multimodal generation model | The world’s first 5D world model | Spatiotemporal sequence modeling, multimodal alignment, complex loss structure | Sequence parallelism, variable-length attention, custom loss operators |
| Embodied intelligence model | Embodied brain model | Multimodal inputs such as perception, decision, and control | Multimodal data pipeline, cross-modal alignment, integration of inference and training |
| Trillion-scale parameter model | In progress | Large parameter scale, complex expert-parallel communication, fault probability rising with scale | Hybrid expert parallelism and data parallelism, communication topology optimization, elastic fault tolerance |
Different tasks test different sides of the training stack: base models test long-cycle stability, world models test multimodal operator coverage, embodied models test data and training-inference coordination, and trillion-scale models shift the focus toward expert parallelism and fault tolerance. Whether a vendor can support “full-chain stable training” depends on whether it has validated engineering experience in all these areas.
From “can train” to “out-of-the-box”: what engineering still needs
Between one successful adaptation and a repeatable training experience, there are still four engineering thresholds:
- Operator completeness and automatic fallback: new models continuously introduce new structures. If key operators are missing, they must be written one by one. A mature solution should maintain an operator coverage list and provide automatic fallback paths for missing operators, for example by combining multiple basic operators into an equivalent implementation. This ensures trainability first, then enables gradual optimization.
- Fault tolerance and elastic recovery: the larger the scale, the more frequent single-point failures become. Asynchronous sharded checkpoints, rapid fault localization, and automatic rescheduling can compress ineffective training time to an acceptable range.
- Toolchain and observability: migration tools should minimize model code changes, and performance analysis tools should be able to locate communication waits, memory peaks, and operator hotspots.
- Ecosystem compatibility and user experience: aligning with the native interfaces of mainstream training frameworks and providing out-of-the-box environments and images are prerequisites for “out-of-the-box” training. In the cloud, this kind of work is usually provided by cloud vendors as general capabilities. For example, Baidu AI Cloud’s AI compute and model platform covers the full chain from compute scheduling and distributed training to model serving. Users then only need to focus on the model and data themselves.
Conclusion
Domestic GPUs completing training adaptation for a model with nearly 3 trillion parameters, and stable training on two nodes with 16 GPUs for 400 steps, shows that domestic full-function GPUs already have full-chain capability for participating in large-model training. From training a 236B-parameter model from scratch, to landing 5D world models and embodied brain models, to advancing trillion-scale model training, the domestic compute ecosystem is moving step by step along the path of “can train—train stably—train fast—out-of-the-box training.” For technical teams, rather than asking “did a certain chip participate in pretraining a certain model,” it is more useful to master a reusable evaluation method: check whether the chain is complete, whether the numerics are aligned, whether the scale can expand, and whether the experience is out-of-the-box.
