FSDP2 Training Stability Validation on Domestic GPUs: A Verification Checklist
This article explains what training adaptation really requires beyond inference, how to configure FSDP2 (sharding, mixed precision, and launch setup), how to estimate memory for trillion-parameter models, and how to assess the credibility of vendor training validation reports.
Large model training places far greater demands on chips than inference. In past industry discussions about chip adaptation, most attention went to whether inference operators run correctly and whether model deployment is smooth. Training, however, must simultaneously handle forward computation, backpropagation, gradient synchronization, and parameter updates — all while maintaining numerical stability over long-running iterations.
According to public reports, a domestic GPU vendor disclosed a training validation: in a two-node, 16-GPU environment, 400 consecutive optimizer updates were completed using the native FSDP2 path, with loss values and gradient norms remaining finite throughout — no numerical overflow or interruption occurred. The model involved was large, but the parallel strategy, precision settings, sequence length, batch size, and network configuration were not disclosed. The publication date of the source material and the vendor’s claims also require further verification, so this article does not cite those numbers as established conclusions.
This article uses that validation to explain three things: what training adaptation means, how to configure FSDP2, and how to judge the credible scope of such validations.
1. Training Adaptation vs. Inference Adaptation
Inference adaptation focuses on the correctness of forward computation, single-step latency, throughput, and memory usage. Training adaptation additionally requires backpropagation, gradient aggregation, sharded parameter updates, and checkpoint recovery to all run correctly on the target chip. The engineering difficulty differs substantially:
| Dimension | Inference Adaptation | Training Adaptation |
|---|---|---|
| Computation | Forward pass | Forward pass, backpropagation, optimizer updates |
| Memory usage | Model weights, KV cache | Weights, gradients, optimizer states, activations |
| Communication | Mostly single-node or tensor parallelism | Frequent cross-GPU and cross-node collective communication |
| Numerical requirements | Output roughly matches reference implementation | Loss and gradients must remain finite over long iterations |
| Common validation | Operator precision comparison, throughput tests | Loss curves, gradient norms, checkpoint recovery |
Getting expert-parallel forward computation to run only proves the forward path works. It does not prove that a base model has been pretrained on that chip. When reporting adaptation results, inference validation and training validation should be stated separately.
2. FSDP2 Sharding Logic
FSDP2 is built on PyTorch’s DTensor. It shards parameters, gradients, and optimizer states by module — typically at the Transformer layer level — by calling fully_shard on each layer. After sharding, each GPU holds only the portion it is responsible for. During the forward pass, the framework gathers the full parameters of the current layer onto each GPU on demand and releases them once computation finishes; the same gathering happens again during backpropagation.
reshard_after_forward controls whether the full parameters are released immediately after the forward pass. Setting it to True lowers peak memory but requires an extra parameter gather before backpropagation, increasing communication. Setting it to False makes the backward pass faster, but each layer’s full parameters stay in memory until the backward pass completes. Choose True when memory is tight. When memory is sufficient and communication is the bottleneck, you can set it to False only for the last few layers, since their backward pass immediately follows their forward pass.
3. Mixed Precision and Launch Configuration
FSDP2 controls precision through MixedPrecisionPolicy. Unlike FSDP1, it has no buffer_dtype parameter — buffer precision follows the module’s original settings. A reference implementation:
import torchfrom torch.distributed.fsdp import fully_shard, MixedPrecisionPolicymp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16, # Parameter precision for forward and backward computationreduce_dtype=torch.float32, # Precision for gradient reduction)for layer in model.layers:fully_shard(layer, mp_policy=mp_policy, reshard_after_forward=True)fully_shard(model, mp_policy=mp_policy)# The optimizer must be created after shardingoptimizer = torch.optim.AdamW(model.parameters(), lr=1e-4)
Prefer bf16 when the chip supports it. It has the same exponent bits as fp32, providing sufficient dynamic range, and usually requires no gradient scaling. If only fp16 is available, you need a gradient scaler (such as ShardedGradScaler) and should track the number of steps skipped due to overflow.
Example launch command for two machines with 8 GPUs each:
torchrun --nnodes=2 --nproc_per_node=8 \--node_rank=$NODE_RANK \--master_addr=$MASTER_ADDR --master_port=29500 \train.py
The PyTorch version must match the adapted version released by the vendor. A generic build may not include the backend for that chip. The versions of PyTorch, the communication library, and the driver should all be pinned in the project’s dependency manifest. The code above uses generic interfaces as an example; refer to the official documentation of your version for the exact APIs available.
4. Memory Estimation for Trillion-Parameter Models
Take mixed-precision Adam as an example. After sharding, each parameter’s state includes: 4 bytes for the fp32 master weights, 4 bytes for the fp32 gradient, 4 bytes for Adam’s first moment, and 4 bytes for the second moment — 16 bytes in total. The bf16 parameter copies used in the forward pass are gathered on demand and do not reside in memory long-term, so they are not counted here.
For 1 trillion (1×10¹²) parameters:
- Total model state: 1×10¹² × 16 bytes = 16 TB
- Model state per GPU at different GPU counts:
| GPU Count |
