Training Adaptation for Trillion-Parameter MoE Models on Domestic GPUs
A practical analysis of what large-scale training adaptation demonstrates—and what it does not. This article explains FSDP2-based sharding, MoE communication bottlenecks, numerical stability, the meaning of a 16-GPU 400-step validation, and the engineering metrics enterprises should evaluate before adopting a training stack.
According to publicly available information from a domestic GPU vendor, the company used its flagship AI training-and-inference accelerator and proprietary software stack to complete training adaptation for an open-source large language model with nearly three trillion parameters. The validation included an end-to-end native FSDP2 training path covering model loading, parameter sharding, and gradient synchronization. It also completed 400 consecutive optimizer updates across 16 GPUs distributed over two nodes.
This article does not repeat the announcement. Instead, it explains what this type of validation demonstrates, what it does not prove, and which metrics developers and enterprises should examine when evaluating a training solution.
Is training adaptation the same as pretraining?
No.
Training adaptation means running the complete training workflow for a target model on specific hardware and a software stack, then verifying correctness and stability. Pretraining consumes large-scale compute to learn model parameters from scratch. These are separate questions, particularly when it comes to the source and scale of the compute resources.
The industry term “Day 0 adaptation” usually refers to integrating a newly released model for inference as quickly as possible. Inference integration has a much lower engineering threshold than end-to-end training. Training adaptation requires more than a working forward pass. It must also support backpropagation, gradient reduction, mixed precision, checkpoint saving, and failure recovery.
Why can’t a trillion-parameter model fit on a single GPU?
Consider a model with three trillion parameters. Storing the weights alone in FP16 requires approximately 6 TB of memory:
3 × 10^12 parameters × 2 bytes ≈ 6 TB
This calculation excludes gradients and optimizer states. With an Adam-style optimizer, optimizer states typically consume even more memory. A single GPU—or even a single server—therefore cannot hold the complete model.
The mainstream approach is Fully Sharded Data Parallelism, or FSDP. Parameters, gradients, and optimizer states are distributed across devices and gathered only when required during forward and backward computation. FSDP2 is built on DTensor and allows sharding policies to be configured at the module level, which is particularly useful for MoE and multimodal models.
The following is an illustrative FSDP2 configuration. It assumes PyTorch 2.6 or later and is launched with torchrun. In a real deployment, follow the documentation for the exact version in use and replace the device type with the name required by the target GPU software stack.
import torchfrom torch.distributed.device_mesh import init_device_meshfrom torch.distributed.fsdp import fully_shard, MixedPrecisionPolicy# Two nodes with 16 GPUs: the device mesh spans 16 processesmesh = init_device_mesh("cuda", (16,))mp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16, # Parameter precision used during forward computationreduce_dtype=torch.float32, # Higher precision for gradient reduction)model = build_moe_model() # Placeholder; replace with the actual model construction logic# Shard each Transformer layer first, then shard the root modulefor layer in model.layers:fully_shard(layer,mesh=mesh,mp_policy=mp_policy,reshard_after_forward=True, # Release non-local shards after forward to save memory)fully_shard(model, mesh=mesh, mp_policy=mp_policy)
Two details are important.
First, FSDP2 uses fully_shard and reshard_after_forward to control sharding behavior. It does not use the ShardingStrategy.FULL_SHARD enumeration from FSDP1. Mixing the two APIs will generally prevent the code from running correctly.
Second, MoE expert parameters may require a separate device mesh so that expert parallelism can be integrated properly. The single-mesh example above cannot be applied without modification.
Why can communication become a bottleneck in MoE training?
An MoE model routes different tokens to different experts. When expert parallelism is enabled, this routing generates All-to-All communication. The cost of All-to-All is highly sensitive to network topology, bandwidth utilization, and latency variation.
In cross-node training, insufficient optimization in the communication library or collective communication implementation can offset the computational benefits of expert parallelism. It may also cause significant fluctuations in training efficiency.
A practical troubleshooting sequence is:
- Measure the time spent on All-to-All as a percentage of each training step. If the proportion remains high, inspect the communication path first.
- Measure the number of tokens received by each expert. Severe imbalance indicates routing hotspots, which can cause some GPUs to wait for others.
- Compare intra-node and cross-node bandwidth, and verify that process placement matches the physical network interface and GPU topology.
- Observe step-time variation. Large fluctuations are often caused by network congestion or collective communication scheduling.
- If NaNs appear, first inspect routing weights, the load-balancing loss, and precision settings, then trace the issue back to the communication path.
How should numerical stability be evaluated?
Keeping loss and gradient norms finite throughout training is necessary, but it is not sufficient. A run can avoid NaNs while already diverging from the convergence trajectory of the reference implementation.
A more complete evaluation should include:
- Step-by-step comparison of the loss curve against the reference implementation under the same configuration.
- The distribution of gradient norms, especially maximum values and the number of sudden spikes—not only the average.
- The number of skipped optimizer steps and overflow events.
- Resuming training after saving a checkpoint and verifying whether the loss continues from the previous curve.
The precision used for reduction also requires an explicit trade-off analysis. BF16 reduces storage and computation costs, but accumulation error is generally larger. Using FP32 for reduction can reduce numerical error at the cost of increased communication volume. This decision should be based on measurements from the target system rather than on assumptions.
What does a 16-GPU, 400-step validation demonstrate?
The vendor reported that 16 training processes completed 400 consecutive optimizer updates. Loss and gradient norms remained finite throughout the run, with no numerical overflow or unexpected interruption.
This result can be interpreted in three ways:
- Distributed correctness: The synchronized gradients across the 16 processes were consistent, indicating that collective communication and parameter-sharding scheduling were basically correct, with no obvious silent data inconsistency.
- Training behavior: The loss decreased in the expected direction during the 400 steps, suggesting that the learning rate, warmup, gradient clipping, and related hyperparameters behaved similarly to the open-source reference implementation on this software and hardware stack.
- System stability: The uninterrupted run indicates that memory management, communication scheduling, and operator numerical precision remained stable for the tested duration.
However, 400 steps is still a small-scale validation. It does not represent the stability of complete pretraining lasting weeks or months. Fault-tolerance recovery, checkpoint write performance, and potential degradation in communication performance during long-running jobs require additional testing.
To reproduce or compare similar validations, record the following metrics using consistent measurement rules. Batch size and precision configuration should remain the same, and warmup steps should be excluded from performance comparisons.
| Metric | Measurement method | Purpose |
|---|---|---|
| Loss | Record every step and compare with the reference curve | Evaluate convergence trends |
| Gradient norm | Record every step; calculate maximum values and spike counts | Detect early signs of gradient explosion |
| Throughput | Tokens processed per second, normalized by node count | Measure scaling efficiency |
| Peak memory | Record per-GPU peak usage and fragmentation | Confirm that the sharding strategy is effective |
| Communication ratio | Measure All-to-All and collective communication time as a percentage of step time | Locate communication bottlenecks |
| Anomalies | Count overflows, skipped steps, and process restarts | Evaluate long-run stability |
How should training adaptation on domestic GPUs be implemented?
Based on common industry practice, a training adaptation project generally includes the following stages:
- Operator coverage and precision alignment: Implement the core operators required by the model, including attention, MoE routing, and optimizer kernels. Perform numerical alignment tests against the reference implementation across multiple tensor shapes.
- Distributed strategy validation: Validate the parallelism combinations on a single GPU, multiple GPUs within one node, and multiple nodes. Coverage should include data parallelism, tensor parallelism, pipeline parallelism, and expert parallelism.
- Small-scale end-to-end training: Use a smaller model or a shortened training configuration to verify that the loss curve is comparable to the reference implementation.
- Long-running training at the target scale: Validate numerical stability and throughput over an extended period using the target parameter scale.
- Toolchain maturity: Convert the process into automated checks, performance profiling, and fault-diagnosis tools to reduce the cost of adapting future models.
Each stage should record enough environment information for reproducibility. At a minimum, capture:
- Driver and domestic GPU software-stack versions
- PyTorch version and FSDP2 API version
- GPU model and the number of GPUs per node
- Inter-node network type
- Complete launch command
- Random seed
- Version of the reference implementation
What is still missing between “it can train” and “ready to train out of the box”?
“It can train” means that, with substantial engineering effort, a specific model can run and train stably under a specific configuration. This process often depends on manual tuning by an experienced team.
“Ready to train out of the box” means that users can start training with an experience close to that of mainstream frameworks, supported by mature operator libraries, parallelism templates, automatic tuning tools, monitoring, and alerting.
Closing this gap requires continued improvements in:
- Operator coverage and generalization
- Automated parallelism-strategy search
- Training observability, including metric collection, anomaly detection, and checkpoint resumption
- Compatibility with open-source training-framework ecosystems
For enterprises, a 400-step validation cannot demonstrate the stability of full pretraining. Before adopting a training solution, conduct a proof of concept and define exit criteria in advance. These criteria may include a minimum throughput, a required stable-runtime duration, and a maximum acceptable accuracy deviation.
A fallback plan should also be retained. It should cover continued use of the existing training environment and the procedure for resuming training from a previously validated checkpoint.
