Engineering Practices for Training Ultra-Large-Scale Models on Domestic GPU Clusters
This article explains the engineering methodology behind adapting ultra-large-scale (trillion-parameter) model training to domestic GPU clusters. It distinguishes between three levels of hardware adaptation—inference validation, training pipeline enablement, and full from-scratch pretraining—then details how to build a native FSDP2-based multimodal training path, covering model loading and sharding, operator adaptation, gradient synchronization, and numerical stability. It also discusses cross-node multi-GPU coordination, the four pillars of an engineering system for out-of-the-box training, and practical advice for developers evaluating domestic accelerators.
Engineering Practices for Training Ultra-Large-Scale Models on Domestic GPU Clusters
1. Background: From “Day 0 Adaptation” to “Full Training Pipeline Adaptation”
Whenever a major open-source foundation model is released, hardware vendors race to announce that they have “completed adaptation.” Developers, however, should recognize that “successful adaptation” and “pretraining on that chip” are two very different things.
Adaptation claims in the industry generally fall into three levels:
- Inference operator validation: The model can run forward inference on the hardware and produce numerically reasonable outputs. This is the lowest bar, usually requiring only core operator and inference framework adaptation.
- Training pipeline enablement: The model can complete backpropagation, gradient synchronization, and optimizer updates on the hardware, with the loss converging normally. This requires a complete software stack.
- Large-scale pretraining from scratch: The hardware serves as the primary compute foundation for a full pretraining run of a base model. This is the ultimate test of the chip, interconnect, software stack, and engineering organization.
When a technical report lists multiple hardware platforms side by side, it often reflects only inference-level comparison and does not mean the base model was pretrained on all of them. Readers should distinguish between “inference-ready” and “training-ready” claims and avoid being misled by marketing language.
This article focuses on the second level—training adaptation—and distills a general technical methodology, using as background a recent case in which a domestic GPU vendor completed training adaptation for a flagship model with nearly 3 trillion parameters.
2. The Core of Training Adaptation: Building a Native FSDP2 Multimodal Training Path
For trillion-parameter models, a single GPU’s memory cannot hold the weights, gradients, and optimizer states. With the Adam optimizer, each parameter typically requires about 16 bytes (2 bytes for the parameter, 2 bytes for the gradient, and 4 bytes each for first- and second-order moments in mixed-precision scenarios). Three trillion parameters imply tens of terabytes of state, making distributed parallelism mandatory.
FSDP (Fully Sharded Data Parallel) and its second-generation design are the mainstream full-sharding data parallel techniques. The core ideas are:
- Shard model parameters, gradients, and optimizer states across all GPUs;
- All-gather the full parameters of the current layer on demand before forward computation, then release them immediately afterward;
- Perform gradient reduction (reduce-scatter) during backpropagation so that each GPU keeps only its own shard.
Building a native FSDP2 multimodal training path on a domestic GPU software stack requires the following key components:
2.1 Model Loading and Sharding
- Lazy loading and streaming initialization: A trillion-parameter model cannot be fully instantiated on the CPU before being sharded. It must be initialized shard by shard directly on the device, using a meta device mechanism to avoid memory blowups.
- Customized sharding strategies: For Mixture-of-Experts (MoE) architectures, expert layers and dense layers should be sharded along different dimensions. Expert parameters are typically partitioned along the expert parallel (EP) dimension rather than a simple 1D flattened sharding.
2.2 Operator Adaptation
- Core operators—attention, gating/routing, normalization—need high-performance implementations on the domestic GPU instruction set;
- For MoE models, the dispatch/combine communication operators in expert routing are a performance bottleneck and require compute-communication overlap optimization;
- In multimodal scenarios, the vision encoder and the language model need differentiated mixed-precision strategies.
2.3 Gradient Synchronization and Numerical Stability
- The communication backend for gradient reduction must support the domestic GPU’s high-speed interconnect protocol and pipeline communication with backward computation;
- Loss and gradient norms must be monitored throughout to ensure they remain finite without numerical overflow. In the domestic GPU vendor’s published experiment, a joint cross-node training run on two servers with 16 GPUs completed 400 consecutive optimizer updates, with loss and gradient norms remaining stable throughout and no numerical overflow or abnormal interruption—this is the criterion for declaring training adaptation “qualified.”
3. Key Techniques for Cross-Node Multi-GPU Coordination
Two servers with 16 GPUs may sound small, but this scale is enough to expose all the typical problems of cross-node training:
- Topology-aware communication: Intra-node traffic uses high-speed chip-to-chip interconnect; inter-node traffic uses RDMA networking. Parallelism strategies must be topology-aware—keep communication-heavy dimensions (such as tensor parallelism and expert parallelism) within a node, and place data parallelism across nodes.
- Fault tolerance and checkpoint resumption: Even in short tests, checkpoint save/restore capability should be verified. Hardware failures are routine in large-scale training, so asynchronous checkpointing and incremental saving are essential.
- Profiling and bottleneck analysis: Use profiling tools to analyze the time split among computation, communication, and I/O, and to identify issues such as unoverlapped communication or inefficient operators. In a healthy training job, compute utilization should reach an acceptable range, and communication should be hidden behind computation as much as possible.
An illustrative launch configuration (expressed neutrally):
# Example: launching distributed training on 2 nodes with 16 GPUstorchrun --nnodes=2 --nproc_per_node=8 \--rdzv_backend=c10d --rdzv_endpoint=$MASTER_ADDR \train.py \--parallel-strategy fsdp2 \--expert-parallel-size 16 \--grad-clip 1.0 \--loss-scale dynamic
4. From “Trainable” to “Train Out of the Box”: Four Pillars of the Engineering System
Getting a single training run to work is only the starting point. Real engineering capability lies in systematic development:
- Continuous evolution of the operator library: Build an operator coverage matrix that anticipates the needs of mainstream model architectures, so that a newly released model requires only small incremental adaptation.
- Maturity of multi-GPU coordination: This includes communication library optimization, automatic search of parallelism strategies, and automatic memory planning, reducing the manual tuning burden on users.
- Automated toolchain: Cover model migration scripts, numerical alignment tools (layer-by-layer comparison against a reference implementation), and performance regression tests, so adaptation work becomes a pipeline.
- A closed loop of real-world validation: Capabilities are hardened through actual large-scale training projects—for example, full from-scratch training of a hundred-billion-parameter scientific foundation model, full-stack training of a multimodal world model, or end-to-end training of embodied AI models. Every real project exposes problems that simulation tests cannot find and feeds improvements back into the software stack.
5. Practical Advice for Developers
- Verify the level of an adaptation claim: When evaluating whether a domestic accelerator meets your needs, ask for training loss curves, gradient norm records, consecutive step counts, and throughput data—not just an “adapted” announcement.
- Validate numerics in small steps: Start with a small configuration (e.g., two servers with 16 GPUs), run a few hundred steps, confirm the loss stays finite and its convergence trend matches the reference implementation, then scale up gradually.
- Prefer mature, community-standard training frameworks: Adaptation based on mainstream distributed training solutions (such as FSDP2) is more maintainable and portable than a proprietary in-house parallelism framework.
- Consider total lifecycle cost: Beyond the chips themselves, evaluate supporting capabilities such as cluster interconnect, storage I/O, monitoring and alerting, and failure recovery. General-purpose cloud infrastructure—object storage, container platforms, and log services—can be used to build the training environment.
6. Conclusion
Training adaptation of trillion-parameter models on domestic GPUs marks a shift from “inference-ready” toward “training-ready” in domestic compute. The key to this path is not any single announcement but a complete engineering system spanning operators, communication, parallelism strategies, toolchains, and real-world validation. As automation improves and frontier models move from “trainable” to “train out of the box” on domestic full-featured GPUs, the industry gains a genuinely self-reliant compute foundation for large model development.
