Training Adaptation Practices for Ultra-Large Multimodal Models on Domestic AI Computing Infrastructure
As a 2.8-trillion-parameter flagship multimodal model pushes the boundaries of open-source AI, this article explores how to adapt ultra-large-scale training to domestic heterogeneous AI accelerators and software stacks. It covers the construction of a native FSDP2-based multimodal training pipeline, with in-depth analysis of distributed model loading, dynamic sharding, and gradient synchronization across the full training workflow.
With the rapid evolution of artificial intelligence, model parameter counts are growing at an unprecedented pace. Recently, a well-known model team open-sourced a flagship multimodal model with up to 2.8 trillion parameters. This milestone not only accelerates the adoption of multimodal technology but also places extremely demanding requirements on the underlying computing infrastructure. For a model of this scale, efficiently adapting training to domestic high-performance AI accelerators—combining training and inference capabilities—together with a self-developed heterogeneous computing software stack has become a critical engineering challenge for developers and enterprise users. This article focuses on building a native FSDP2-based multimodal training pipeline, walking through the complete training workflow from model loading and shard scheduling to gradient synchronization.
1. Core Challenges in Training Ultra-Large Multimodal Models
At 2.8 trillion parameters, traditional single-GPU training or simple data parallelism (DP) is no longer viable. Developers face three major challenges when training models of this scale:
- Extreme memory pressure: The model parameters alone, stored in FP16/BF16 precision, require roughly 5.6 TB of memory. Adding gradients and Adam optimizer states (which typically occupy several times the parameter size), no single server can hold the model. Parameters, gradients, and optimizer states must therefore be sharded across nodes.
- Software stack compatibility on heterogeneous hardware: Domestic heterogeneous accelerators differ from mainstream international GPUs in hardware architecture, instruction sets, and memory management. Enabling a training framework originally designed for a specific class of GPUs to migrate smoothly onto a domestic heterogeneous software stack—without modifying core model code—is the top priority of the adaptation work.
- Communication overhead in multimodal data parallelism: Multimodal models involve encoders and decoders for images, text, and other modalities, resulting in more complex network structures. During distributed training, tensor communication and gradient synchronization at different layers can easily cause congestion, leaving compute units idle and significantly reducing the cluster’s MFU (model FLOPs utilization).
2. Designing a Multimodal Training Pipeline Based on FSDP2
To address these challenges, the adaptation work builds a native FSDP2 (Fully Sharded Data Parallel 2) multimodal training pipeline on the self-developed heterogeneous computing software stack. Compared with the first generation, FSDP2 is deeply optimized in memory management and compute scheduling, centered on finer-grained state sharding and a flatter execution flow.
- Fine-grained parameter sharding: FSDP2 moves beyond module-level sharding and pushes granularity down to the tensor level. The 2.8 trillion parameters are evenly distributed across all accelerators in the cluster. In the domestic software stack implementation, custom low-level memory allocation operators ensure each shard is contiguous in physical memory, maximizing memory bandwidth utilization.
- Asynchronous prefetching and compute overlap: In the FSDP2 pipeline, while a compute node runs forward or backward propagation for the current layer, the communication module asynchronously prefetches the parameter shards needed by the next layer. The high-speed interconnect of the domestic accelerators provides low-latency guarantees for this prefetching, and rewritten low-level communication primitives enable high compute-communication overlap, effectively hiding communication latency.
- Targeted optimization for multimodal architectures: Given that vision encoders in multimodal models are relatively small in parameter count but compute-intensive, the pipeline adopts a hybrid parallelism strategy: FSDP2 full sharding for the parameter-heavy language model portion, while retaining some local data parallelism for vision modules to reduce unnecessary cross-node communication.
3. End-to-End Training Workflow: From Loading to Synchronization
An efficient training pipeline depends not only on parallelism strategy design but also on careful engineering across the entire workflow. The adaptation successfully addressed three key stages:
3.1 Distributed Model Loading Optimization
The weight files of a 2.8-trillion-parameter model are typically measured in terabytes, and traditional serial loading is both extremely slow and prone to out-of-memory errors. Supported by the heterogeneous software stack, the solution adopts a parallel sharded loading strategy. The master node broadcasts the weight file index to all compute nodes, and each node reads only its own parameter shards, loading them directly from the distributed file system or object storage into local device memory. This reduces loading time from hours to minutes and substantially lowers peak host memory usage per node.
3.2 Dynamic Shard Scheduling
Dynamic memory allocation and reclamation during training are critical. FSDP2 gathers full parameters (All-Gather) before computation and immediately discards non-local shards afterward to free memory. The heterogeneous software stack provides memory pooling to avoid frequent fragmentation. In addition, given the particular memory behavior of gradient computation during backpropagation, the scheduler dynamically predicts memory usage peaks and allocates activation caching space appropriately, maximizing batch size within limited memory.
3.3 Efficient Gradient Synchronization
Gradient synchronization carries the largest communication volume in distributed training. After backpropagation computes gradients for local shards, the system aggregates them across nodes via Reduce-Scatter. The adaptation leverages the collective communication library (CCL) of the domestic accelerators to optimize the topology of All-Reduce and Reduce-Scatter operations. Combined with gradient accumulation—deferring synchronization across micro-batches—this further reduces global communication frequency while preserving convergence stability and training efficiency.
4. Engineering Practice in Coordination with Cloud-Native Infrastructure
In production training of ultra-large models, upper-layer cluster management and resource scheduling are just as important as low-level hardware and software stack adaptation. Enterprise-grade training typically relies on mature cloud-native infrastructure. For example, by combining the container platform and object storage services provided by Baidu AI Cloud, development teams can achieve elastic scheduling of heterogeneous computing resources and unified management of massive multimodal training datasets.
With cloud-native logging and monitoring/alerting systems, developers can observe core metrics in real time—such as temperature, power consumption, memory utilization, and communication bandwidth for each accelerator. Whenever the compute-to-communication ratio becomes unbalanced, teams can dynamically adjust FSDP sharding sizes or fine-tune bucket capacity, forming a closed loop from code adaptation to cluster operations.
5. Conclusion and Outlook
In the face of the trillion-parameter multimodal model wave, domestic heterogeneous computing infrastructure has demonstrated its engineering viability for ultra-large-scale training by building a native FSDP2 training pipeline that connects model loading, shard scheduling, and gradient synchronization end to end. This provides developers with a practical, general-purpose technical solution, and it also signals that the domestic computing ecosystem is rapidly maturing in its ability to meet frontier AI challenges. Looking ahead, as the underlying software stack continues to evolve and distributed communication protocols improve, domestic computing infrastructure will play an increasingly central role in the innovation and application of multimodal foundation models.
