Domestic GPU Training Adaptation: Key Metrics for Stable Training
A guide to what training adaptation on domestic AI accelerators involves, how to interpret vendor announcements, and the key metrics—loss stability, gradient norms, communication health, and memory usage—that indicate stable multi-node training.
How Training Adaptation Differs from Inference Adaptation
Inference adaptation mainly verifies that a model can be loaded and that operator outputs are correct, with a focus on throughput and latency. Training adaptation is far more demanding: the numerics of the forward pass, backward pass, and optimizer updates must all be correct, while also handling mixed precision, gradient accumulation, distributed sharding, and fault-tolerant recovery. Because training involves long-running iterations, any numerical deviation accumulates over steps. This makes training adaptation a much better indicator of an accelerator’s engineering maturity.
How to Read Public Announcements
Recently, a domestic GPU vendor announced that, using its flagship AI training-and-inference accelerator and its in-house software stack, it completed training adaptation for an open-source large model and ran 400 consecutive optimizer updates on a two-node, sixteen-GPU setup. According to the public description, no details were given about total parameter count, activated parameter count, whether MoE sparse activation was used, whether CPU or NVMe offloading was enabled, per-GPU memory, batch size, sequence length, or parallelism strategy. These details determine how significant the result actually is, so readers should check the vendor’s official announcement or technical report to verify the exact conditions.
It is also worth noting that “vendor-announced adaptation” and “independent third-party reproduction” are two different things. For now, this result should be understood as vendor-disclosed, preliminary data.
Why Large Models Must Be Sharded
Take mixed-precision Adam training as an example: each parameter typically occupies about 16 bytes—2 bytes each for the BF16 weights and gradients, plus 4 bytes each for the FP32 master weights, first moment, and second moment, totaling 16 bytes. A trillion-parameter model would need roughly 16 TB for these states alone, excluding activations and communication buffers. Sixteen 80 GB GPUs provide only about 1.28 TB in total—clearly not enough. Training models at this scale therefore requires one or more of the following: parameter sharding, memory offloading, or more GPUs.
Fully Sharded Data Parallelism (similar in spirit to FSDP) shards parameters, gradients, and optimizer states across GPUs, gathering them on demand during forward and backward computation. The following PyTorch FSDP example illustrates the configuration concepts. It is a demonstration snippet, not the vendor’s actual code, and must be adjusted for your framework version and model before running:
import functoolsimport torchfrom torch.distributed.fsdp import (FullyShardedDataParallel as FSDP,ShardingStrategy,MixedPrecision,)from torch.distributed.fsdp.wrap import transformer_auto_wrap_policy# Replace DecoderLayer with the model's actual Transformer layer classwrap_policy = functools.partial(transformer_auto_wrap_policy,transformer_layer_cls={DecoderLayer},)mp_policy = MixedPrecision(param_dtype=torch.bfloat16,reduce_dtype=torch.float32, # FP32 gradient reduction is safer; BF16 needs empirical validationbuffer_dtype=torch.bfloat16,)model = FSDP(model,auto_wrap_policy=wrap_policy,sharding_strategy=ShardingStrategy.FULL_SHARD,mixed_precision=mp_policy,device_id=local_rank,)
How to Choose the Sharding Granularity
Sharding granularity determines communication frequency and per-GPU memory usage. Finer granularity saves more memory but increases the number of small messages, raising the share of communication latency. Common choices include:
| Sharding granularity | Communication characteristics | Per-GPU memory | Best suited for |
|---|---|---|---|
| Per Transformer layer | Parameters gathered once per layer; communication count grows with layer count | Lower | Mainstream models with regular layer structures |
| Per larger module | Fewer communications, larger payload per exchange | Higher | Interconnects with ample bandwidth and spare memory |
| Per tensor or sub-block (very fine) | Many small messages; latency overhead dominates | Lowest | Extremely tight memory with already-optimized communication |
Before settling on a granularity, estimate as follows: compute the number of bytes per layer’s parameters, determine how many gathers the forward and backward passes require, multiply by the number of GPUs and training steps to get total communication volume, and compare it against interconnect bandwidth to see whether communication becomes the bottleneck.
What AllReduce, AllGather, and ReduceScatter Do in Gradient Synchronization
Data parallelism (DDP) uses AllReduce so that every GPU receives the complete averaged gradient. With FSDP, after parameters are sharded, AllGather reconstructs the full parameters of a layer before it is computed. After the backward pass, ReduceScatter sums the gradients and shards the results back across GPUs. The combined data volume of ReduceScatter and AllGather is roughly equivalent to a single AllReduce, but per-GPU memory usage drops significantly.
To determine whether communication is slowing down training, measure the fraction of each training step spent on these collective operations. If the share is too high, check whether communication and computation overlap properly and whether the inter-GPU topology is sensible.
Key Metrics for Multi-Node Stability
- Numerics: Loss stays finite throughout the run—no inf or NaN—with a smooth trend and no sudden jumps.
- Gradient norms: Fluctuate within a sliding window. Alert on spikes far exceeding the recent mean. The exact threshold depends on the model and learning rate; avoid fixed universal numbers.
- Communication: Track collective communication timeouts and retries. Retries should be zero, or every occurrence should have a clearly identified cause.
- Memory: Log peak memory usage per GPU.
