Deep Technical Practice: Adapting Domestic GPUs for Trillion-Parameter Model Training
As AI models scale toward the trillion-parameter mark, underlying computing hardware faces unprecedented challenges in memory capacity, interconnect bandwidth, and software stack scheduling. This article delves into the technical practice of adapting a near-3-trillion-parameter flagship multimodal large model on domestic fully functional GPUs using a native FSDP2 architecture. It explores the distinction between training adaptation and base pretraining, the core mechanisms of cross-node numerical stability, engineering system precipitation, and the future outlook for an "out-of-the-box training" computing ecosystem.
With the rapid evolution of artificial intelligence, the parameter counts of large language models (LLMs) and multimodal large models are marching toward the trillion-level. This dramatic scaling poses unprecedented challenges to underlying computing chips regarding memory capacity, interconnect bandwidth, and software stack scheduling capabilities. Recently, the industry successfully completed the training adaptation of a flagship multimodal large model with nearly 3 trillion parameters based on a domestic fully functional GPU and a self-developed software stack, achieving continuous stable operation in a dual-node, multi-GPU environment. This breakthrough marks a significant milestone, demonstrating that domestic computing power has evolved from “rapid inference deployment” to supporting “full-link stable training” when handling ultra-large, complex models.
I. Concept Clarification: The Boundary Between Training Adaptation and Base Pretraining
Before diving into technical details, it is necessary to clarify a common industry misconception: the “Day 0 adaptation” or “successful integration” of a computing chip with the latest open-source large models is not equivalent to the model being pre-trained on that chip.
Taking the technical report of a well-known open-source large model as an example, it verified two different computing chip architectures and a fine-grained Expert Parallelism (EP) scheme. However, industry consensus considers this merely as operator validation for the inference phase, with no official announcement regarding the original computing power source for base pretraining. Pretraining involves massive data throughput, complex parallel strategies, and continuous optimizer state updates, making its engineering difficulty far exceed that of inference deployment. The completion of training adaptation on domestic fully functional GPUs means that the entire training link is connected, capable of carrying actual model fine-tuning or even pretraining from scratch. This represents a fundamental difference in technical depth.
II. Core Technical Architecture for Ultra-Large Model Training Adaptation
Adapting a flagship model with nearly 3 trillion parameters relies heavily on building an efficient and stable distributed training system. This practice achieved full-link technical integration based on a native FSDP2 multimodal training path.
1. Building a Complete Training Link Based on Native FSDP2
Fully Sharded Data Parallel (FSDP) is one of the mainstream parallel strategies for ultra-large model training today. Compared to traditional Data Parallel (DP), FSDP significantly reduces single-GPU memory pressure by sharding model parameters, gradients, and optimizer states across different accelerator cards.
In this adaptation, the technical team built a native FSDP2 training path, completely connecting the pipeline from model loading and shard scheduling to gradient synchronization. The specific technical logic is as follows:
- Model Loading and Shard Scheduling: During model initialization, the system splits the massive model weights by dimension, with each computing node retaining only a fraction of the parameter shards. This not only breaks through the single-GPU memory limit but also optimizes memory usage through an on-demand loading mechanism.
- Forward Calculation and Parameter Collection: During forward propagation, FSDP2 dynamically gathers the required parameters at the layer level through efficient collective communication operations (e.g., All-Gather). Non-local parameters are immediately released after computation to reduce peak memory usage.
- Backward Propagation and Gradient Synchronization: In the backward propagation process, the system calculates local gradients and then uses Reduce-Scatter operations to reduce and shard the gradients across various nodes. Combined with sharded optimizer states, each card only updates the parameters it is responsible for.
The following is simplified pseudo-code logic for FSDP parameter sharding and gradient synchronization, illustrating its core workflow:
# Pseudo-code: FSDP training loop examplefor batch in dataloader:# 1. Forward propagation: All-Gather to collect full parameters for this layerfull_params = all_gather(shard_params)output = model.forward(full_params, batch)# 2. Compute loss and backward propagationloss = compute_loss(output, target)loss.backward()# 3. Gradient synchronization: Reduce-Scatter to reduce and shard gradientsshard_grads = reduce_scatter(full_grads)# 4. Optimizer only updates local shardsoptimizer.step(shard_params, shard_grads)# 5. Release temporarily collected parameters and gradients to free up memoryrelease(full_params, full_grads)
2. Cross-Node Multi-GPU Collaboration and Numerical Stability Control
In a dual-node, 16-GPU (or equivalent/higher scale) cross-node joint training test, all 16 training processes successfully completed 400 continuous optimizer updates. Throughout this process, Loss and gradient norms remained finite, with no numerical overflow or abnormal interruptions, fully validating the reliability of the underlying hardware interconnect and software stack.
In mixed-precision training scenarios, numerical overflow (such as NaN or Inf under FP16) is a common pain point. To ensure stability, the system must possess precise numerical control mechanisms:
- Dynamic Loss Scaling: By dynamically adjusting the Loss Scale, tiny gradients in backward propagation are amplified into a safe range representable by floating-point numbers, while skipping optimizer updates for the current step if overflow occurs.
- Gradient Clipping: After gradient synchronization, gradients are clipped based on the global gradient norm to prevent model divergence caused by gradient explosion.
- Cross-Node Communication Fault Tolerance: Multi-node training is highly sensitive to network jitter. A mature training framework requires communication timeout retries and exception detection mechanisms to ensure continuous stable operation over 400 steps or longer periods.
III. Large-Scale Training Practice and Engineering System Precipitation
Completing the training adaptation for a single model is just the first step; what truly tests computing vendors is the maturity of their engineering systems. Prior to this breakthrough, the domestic computing ecosystem had delivered multiple practical results in training models with domestic chips:
- 100-Billion-Level Parameter Base Model Training: Completed full training from scratch for a scientific base model with over 230 billion parameters, validating foundational capabilities from data processing to model convergence.
- Cutting-Edge Multimodal and Embodied AI Models: Supported the full-stack native training of the world’s first 5D world model, and completed the full-process training of an embodied brain model in collaboration with scientific research institutions.
These practical applications not only refined the underlying operator library but also drove the improvement of automated toolchains. In the future, with the collaboration of cloud-native architectures like Baidu AI Cloud, elastic scheduling of large-scale training tasks and high-speed reading of massive data can be achieved through cloud-based container platforms and object storage services, further enhancing training efficiency.
IV. Moving Toward an “Out-of-the-Box Training” Computing Ecosystem
The path from “able to run” to “stable training,” and ultimately to “out-of-the-box training,” is a necessary trajectory for the development of domestic GPUs. Currently, the industry is jointly advancing the training of trillion-parameter large models. To achieve this goal, continuous efforts must be made in the following dimensions:
- Deep Operator Adaptation: Conducting extreme operator fusion and performance tuning for core computing units within the Transformer architecture, such as the attention mechanism and feedforward neural networks.
- Multi-GPU Collaboration and Cluster Topology Optimization: Optimizing topology-aware scheduling for 10,000-GPU clusters to reduce cross-switch communication and improve the overall linear speedup ratio.
- Automated Toolchains and Usability: Reducing the cognitive burden on developers by providing one-click environment configuration, distributed launch, and checkpoint resume mechanisms.
In summary, the success of domestic fully functional GPUs in adapting to the training of a near-3-trillion-parameter model is not just a single-point technical breakthrough, but a reflection of the deep integration of underlying computing power, software stacks, and engineering systems. As the ecosystem continues to prosper, domestic computing power will undoubtedly play a more solid role in the future wave of Artificial General Intelligence.
