Training Trillion-Parameter LLMs on Domestic GPUs: Engineering Practices and Full-Stack Adaptation
How do you train a trillion-parameter large language model on domestic GPUs? This article explains the difference between inference and training adaptation, how to build a native FSDP training path, stability standards for multi-node distributed training, and the engineering infrastructure needed to move from "capable of training" to "train-ready out of the box."
Training Trillion-Parameter LLMs on Domestic GPUs: Engineering Practices and Full-Stack Adaptation
Inference Adaptation vs. Training Adaptation: A Crucial Distinction
With the rapid growth of domestic AI compute in recent years, headlines claiming “Day 0 adaptation of an open-source LLM on a given chip” have become common. In technical contexts, however, such claims often involve serious conceptual confusion that practitioners need to evaluate carefully.
Inference adaptation means enabling an already-trained model to perform forward computation on a specific chip and produce inference results. The work mainly involves operator implementation, graph optimization, quantization support, and memory management. Verifying that a model can run inference on a chip is relatively quick—typically measured in days.
Training adaptation is far more complex. It requires not only correct forward computation, but also correct and numerically stable gradient computation, gradient synchronization, and optimizer state updates throughout the entire pipeline. Training runs for thousands to tens of thousands of steps, and even tiny numerical deviations get amplified over iterations, eventually causing loss divergence or gradient explosion.
There have been notable industry cases: some technical reports listed fine-grained expert parallelism validated on two different chip architectures, yet industry consensus held that this only demonstrated inference-level operator validation—not evidence that base-model pretraining actually ran on those chips. To assess a compute vendor’s real capability, the key question is whether it has completed full pretraining from scratch, not merely a successful “integration.”
Building a Native FSDP Training Path: From Model Loading to Gradient Synchronization
For flagship models at the multi-trillion-parameter scale, a single GPU’s memory cannot possibly hold the full model parameters, gradients, and optimizer states. Take mixed-precision training as an example: a 3-trillion-parameter model requires roughly 6TB of memory for parameters alone (FP16), and adding gradients plus the two momentum states of the Adam optimizer pushes total memory demand beyond 30TB. Fully Sharded Data Parallelism (FSDP) is therefore essential.
Building a native FSDP training path requires connecting four core components:
Model loading and sharding: Model parameters are split across devices by layer or by tensor dimension, with each GPU holding only one shard of the full parameters. During forward computation, complete parameters are temporarily reconstructed via all-gather and released immediately afterward, keeping peak memory within acceptable bounds.
Hybrid parallelism: For models with MoE (Mixture of Experts) structures, expert parallelism (EP) and tensor parallelism (TP) must be layered on top to route different experts to different device groups. The combination of parallelism strategies directly determines the communication overhead ratio and needs layer-by-layer tuning based on model architecture.
Gradient synchronization: Gradients produced by backpropagation are aggregated across the data-parallel group via reduce-scatter. The quality of the communication library implementation on domestic GPUs—including bandwidth utilization of collective communication primitives and overlap scheduling of computation and communication—is a key differentiator in performance.
Optimizer state management: Optimizer states are also stored as shards, and updates compute only local shards to avoid redundancy.
Here is a skeleton of a representative FSDP configuration:
from torch.distributed.fsdp import FullyShardedDataParallel as FSDPfrom torch.distributed.fsdp import ShardingStrategymodel = FSDP(model,sharding_strategy=ShardingStrategy.FULL_SHARD,auto_wrap_policy=transformer_layer_wrap_policy,mixed_precision=mp_policy, # mixed-precision policy for params/gradientsdevice_id=local_rank,sync_module_states=True, # cross-node initialization consistency)
Note that multimodal models add further complexity: vision encoders, projection layers, and language models differ significantly in parameter scale and computation characteristics, often requiring differentiated sharding and precision strategies across submodules—which raises the bar for software stack flexibility.
Stability Standards for Multi-Node, Multi-GPU Training
Verifying single-step correctness is only the starting point. The real test is numerical stability over long, continuous training runs. Widely accepted validation practices include:
- Consecutive optimizer updates: For example, completing hundreds of consecutive iterations on two nodes with 16 GPUs is a baseline threshold for validating cross-node communication and scheduling; full pretraining requires fault-free runs at the tens-of-thousands-of-steps level.
- Numerical health monitoring: Continuously monitor the loss curve and gradient norms to ensure they remain finite and consistent with theoretical expectations, with no NaN/Inf overflow, gradient explosion, or abnormal interruptions.
- Checkpoint fault tolerance: Whether training can recover losslessly from a checkpoint after interruption directly determines the total cost of long-duration training.
In practice, a layered validation approach is recommended: first verify operator correctness on a single GPU, then validate communication on multi-GPU within one node, and finally validate elasticity and fault tolerance across multiple nodes—scaling up step by step.
From “Capable of Training” to “Train-Ready”: Building the Engineering Ecosystem
A truly mature domestic training platform must be refined along three dimensions:
Operator layer: Cover the full set of operators required by state-of-the-art models—including attention variants, MoE routing, and normalization operators—while delivering kernel performance close to theoretical peaks.
Framework layer: Provide APIs compatible with mainstream deep learning frameworks to reduce migration costs, and build in automatic parallelism strategy search to ease manual tuning.
Toolchain layer: Automated performance profiling, communication bottleneck localization, fault self-healing, and cluster scheduling let developers focus on the model itself rather than low-level details. Combined with container platforms, object storage, and monitoring/alerting capabilities, this further enables standardized delivery and full lifecycle management of training jobs.
Conclusion
Achieving training-level adaptation for trillion-parameter models marks a new stage for domestic GPUs—moving from “usable for inference” to “trusted for training.” As the operator ecosystem, parallelism frameworks, and automated toolchains continue to mature, “domestic chips training domestic models” will evolve from isolated proofs into large-scale routine practice, laying a solid foundation for sovereign, self-controlled AI infrastructure.
