Practices for Adapting Domestic GPUs to Train Trillion-Parameter Multimodal LLMs
Training trillion-parameter multimodal large models requires overcoming significant hardware and engineering barriers. This article explores how a domestic GPU platform successfully adapted to train a 2.8 trillion-parameter multimodal model. It details the foundational synergy between integrated hardware and software stacks, the construction of a native FSDP2 training path, and the specific engineering challenges of multimodal training, offering actionable insights for teams scaling LLMs on emerging hardware.
Practices for Adapting Domestic GPUs to Train Trillion-Parameter Multimodal LLMs
1. Background: Training Challenges in the Trillion-Parameter Multimodal Era
Recently, an AI research institution open-sourced its flagship 2.8 trillion-parameter multimodal large model, pushing the hardware requirements and engineering complexity of large model training to new heights. At this scale, a single GPU cannot hold the complete parameters, necessitating large-scale distributed training. Furthermore, multimodal models must simultaneously process text, images, and other inputs, making data preprocessing, modality alignment, and computation scheduling far more complex than pure text models.
For a long time, training ultra-large-scale models has heavily relied on accelerators and software ecosystems from a few overseas vendors. Whether domestic computing power can handle the complete training pipeline of a trillion-scale model has become a critical benchmark for its maturity. Recently, a domestic GPU vendor completed the training adaptation of this model based on its flagship integrated training and inference acceleration card and a self-developed software stack. This effort built a native Fully Sharded Data Parallel (FSDP2) multimodal training path, successfully bridging the entire pipeline from model loading and shard scheduling to gradient synchronization. This article breaks down the key technical takeaways from this practice.
2. Synergy Between Integrated Hardware and Software Stacks
The first step in large-scale training adaptation is the deep synergy between hardware capabilities and the software stack.
1. The Role of the Integrated Training and Inference Accelerator
The core value of an integrated training and inference design lies in its ability to handle high-throughput distributed training while supporting low-latency inference deployment on the same hardware platform. For trillion-parameter models, the training phase requires large memory capacity, high memory bandwidth, and efficient multi-GPU interconnectivity to support parameter sharding and communication overhead. A unified architecture avoids model format conversion and precision alignment issues between training and inference, reducing overall engineering costs.
2. Compatibility and Extension of the Self-Developed Software Stack
The software stack is critical for whether domestic computing power can be adopted by mainstream training frameworks. A mature AI software stack typically needs to provide:
- Operator Library: Covering core operators like matrix multiplication, attention, and normalization, with targeted optimizations for visual encoding operators in multimodal scenarios.
- Communication Library: Implementing efficient multi-GPU collective communication primitives (e.g., AllReduce, AllGather, ReduceScatter) to support gradient synchronization in distributed training.
- Programming Interfaces: Aligning as closely as possible with mainstream GPU programming models to lower migration costs and allow existing distributed training code to run on new hardware with minimal modifications.
Relying on this hardware-software synergy, the upper-level distributed strategies of training frameworks can be successfully implemented.
3. Constructing a Native FSDP2 Multimodal Training Path
Fully Sharded Data Parallel (FSDP) is currently the mainstream solution for ultra-large-scale model training. Its second-generation implementation (FSDP2) introduces significant improvements in usability, composability, and communication efficiency, such as finer-grained parameter management and more flexible combinations of hybrid parallelism. Building a native FSDP2 training path on domestic computing power means executing sharding, communication, and computation natively and efficiently on the self-developed software stack, rather than relying on simple operator translation or compatibility layer emulation.
Constructing this path involves three core stages:
1. Model Loading and Shard Initialization
A 2.8 trillion-parameter model cannot be loaded into a single GPU with its full weights. In practice, a “meta device initialization + shard loading” approach is typically used: the model structure is first built on a meta device without memory consumption, and then parameter shards are loaded on-demand from distributed storage (such as object storage or parallel file systems) to their respective compute cards. This step requires strict alignment between the software stack and the training framework’s checkpoint format and shard metadata to prevent parameter misalignment or precision loss.
2. Shard Scheduling and Compute-Communication Overlap
The core idea of FSDP2 is to temporarily aggregate parameter shards via AllGather on-demand during forward and backward passes, releasing them immediately after computation. To hide this communication overhead, fine-grained scheduling is required: placing communication and computation operations into different streams for parallel execution, and reasonably setting prefetch timing. For multimodal models, the computation density differs significantly between the visual encoder and the language backbone, requiring separate tuning of shard granularity and scheduling strategies to avoid a “barrel effect” that slows down overall throughput.
3. Gradient Synchronization and Optimizer State Management
After backpropagation, gradients on each card are reduced via ReduceScatter and re-sharded. Each compute node only maintains the parameters and optimizer states it is responsible for. This allows the optimizer’s memory footprint to decrease linearly with the number of GPUs, which is a fundamental prerequisite for training trillion-parameter models. In practice, it is also necessary to ensure global consistency of gradient scaling and gradient clipping under mixed-precision training, as well as fault tolerance for abnormal nodes and the ability to resume training from checkpoints.
4. Specific Engineering Challenges of Multimodal Training
Compared to pure text models, multimodal training pipelines present additional challenges:
- Heterogeneous Data Pipelines: The preprocessing overhead for images and text varies greatly, requiring asynchronous data loading and pipeline parallelism to prevent data supply from becoming a bottleneck.
- Uneven Sequence Lengths: After concatenating visual and text tokens, sequence lengths fluctuate significantly, necessitating dynamic batching and load balancing strategies.
- Memory Peak Control: The activation values in multimodal fusion layers consume massive memory, usually requiring activation checkpointing to strike a balance between compute and memory.
5. Practical Significance and Industry Insights
The value of this adaptation lies not only in verifying the trainability of a single model but also in bridging the complete technical pipeline across “framework, software stack, and hardware.” For teams looking to train large models on domestic computing power, the following path can be used as a reference: first validate the operator completeness and communication correctness of the software stack with small and medium-sized models, then gradually scale up to tens of billions, hundreds of billions, and eventually trillions of parameters. Meanwhile, prioritize industry-standard distributed parallelization solutions to ensure the portability of training code.
From a cloud service perspective, a complete training pipeline also relies on underlying infrastructure: an elastic and scalable container platform for orchestrating large-scale training tasks, high-performance object storage and parallel file systems to carry massive training data and checkpoints, and logging and monitoring systems to ensure observability and stability for long-running training jobs. For example, general cloud product capabilities provided by vendors like Baidu AI Cloud can offer foundational support for compute scheduling and O&M in such large-scale training scenarios.
6. Conclusion
Adapting trillion-parameter multimodal models for training is a comprehensive test of the hardware and software capabilities of domestic computing platforms. Bridging the pipeline from model loading and shard scheduling to gradient synchronization marks a critical step for domestic AI computing platforms in the ultra-large-scale training domain. As software ecosystems continue to mature and engineering best practices accumulate, domestic computing power is poised to play an increasingly important role in the era of large models.
