Ultra-Large-Scale Multimodal Model Training: Native FSDP2 Adaptation and Optimization Practices

    This article covers distributed training adaptation for ultra-large-scale multimodal large language models with 2.8 trillion parameters. It outlines three main challenges: GPU memory limits, the heterogeneity of multimodal architectures, and communication overhead. It then describes how to build a native FSDP2 training path and optimize the full training pipeline, including meta-device initialization, selective activation recomputation, asynchronous prefetching, bucketed gradient synchronization, and co-optimization with the underlying infrastructure.

    As AI technology advances rapidly, large language models are growing toward trillion-parameter scale and multimodal integration. Recently, a multimodal flagship model with up to 2.8 trillion parameters has been open-sourced in the industry. With such a large parameter count and a complex multimodal architecture, efficient training adaptation on heterogeneous compute and an in-house software stack has become a key engineering problem in AI infrastructure. This article focuses on distributed training practice for ultra-large-scale multimodal models. It examines how to build a native FSDP2 training path and how to optimize the full training pipeline.

    1. Engineering Challenges in Training Trillion-Parameter Multimodal Models

    When a model reaches 2.8 trillion parameters, traditional single-device training and simple data parallelism no longer work. Developers and enterprises face several serious engineering challenges:

    1. Memory wall: Under mixed-precision training, the model weights alone can occupy several terabytes of GPU memory. Optimizer states (such as the momentum and variance in AdamW), gradients, and activations add further demand, and memory requirements grow rapidly. A single accelerator, typically with tens to over a hundred GB of memory, cannot hold the entire model.
    2. Architectural heterogeneity: Multimodal models usually include several components, such as a text encoder, a vision encoder, a modality alignment layer, and a decoder. These components differ widely in parameter distribution, compute density, and communication patterns, so the distributed training framework needs more flexible scheduling.
    3. Communication bottleneck: In clusters with many nodes and accelerators, the bandwidth between cards and between nodes is limited. If every forward and backward pass requires global synchronization, the communication latency slows overall computation and lowers model FLOPs utilization (MFU).

    2. Solution: Building a Native FSDP2 Training Path

    To address these challenges, the industry has increasingly adopted Fully Sharded Data Parallelism (FSDP). Compared with the first generation of FSDP, native FSDP2 offers finer-grained control, better memory efficiency, and tighter integration with the PyTorch distributed ecosystem. For a 2.8-trillion-parameter model, building a native FSDP2 multimodal training path is the core approach.

    FSDP2 shards model parameters, gradients, and optimizer states at fine granularity within the data-parallel group. Each accelerator holds only a small part of the full model. During the forward pass, FSDP2 uses collective communication primitives such as All-Gather to dynamically collect the parameters it needs. During the backward pass, it uses Reduce-Scatter to synchronize gradients and releases non-local shards immediately, which significantly lowers peak memory usage.

    For multimodal training, FSDP2 lets developers assign different sharding strategies and hybrid parallelism schemes to sub-networks of different modalities, such as combining tensor parallelism (TP) or sequence parallelism (SP). This helps balance computation and communication.

    3. End-to-End Training Adaptation

    Connecting the full training pipeline, from model loading to gradient synchronization, is essential for stable convergence of trillion-parameter models. The core techniques for end-to-end adaptation are described below.

    3.1 Model Loading and Memory Warm-Up

    Loading the weight files for a 2.8-trillion-parameter model is a major challenge in itself. Traditional serial loading can easily cause out-of-memory (OOM) errors. In practice, teams often use a meta-device initialization strategy. The model computation graph is first built on the meta device, which allocates no physical memory. Then, a distributed loading mechanism splits the weight files according to the FSDP2 sharding rules and maps each shard directly to the corresponding device memory on each accelerator. This approach avoids the memory peak caused by centralized loading and greatly shortens model initialization time.

    3.2 Fine-Grained Sharding Scheduling

    During training, the FSDP2 sharding scheduling engine manages the lifecycle of parameters. To save more memory, the system also uses activation recomputation. For the compute-intensive vision encoder layers in a multimodal model, selective recomputation recalculates some forward activations during the backward pass, trading time for memory. Meanwhile, FSDP2’s asynchronous prefetching fetches the parameter shards needed by the next layer through a background communication stream while the current layer is computing. This overlaps computation and communication closely.

    3.3 Gradient Synchronization and Communication Optimization

    Gradient synchronization is one of the most time-consuming steps in distributed training. In the native FSDP2 path, gradients are stored in shards. The local gradients computed during backpropagation are reduced directly to their corresponding devices through Reduce-Scatter. To reduce network congestion, communication is typically bucketed, and gradient accumulation is used. Cross-node global synchronization runs only after several micro-batch computations. In addition, combining RDMA (Remote Direct Memory Access) with network communication optimizations in the in-house software stack can improve collective communication throughput.

    4. Co-Design of Infrastructure and Software

    Training ultra-large-scale models requires more than changes to the upper-level framework. It also depends on close coordination between the underlying compute hardware and the software stack. Flagship AI accelerators need high-bandwidth memory (HBM) and high-speed chip-to-chip interconnects. A unified system architecture software stack needs native support for standard AI frameworks and operator-level optimization.

    At the cloud level, mainstream cloud providers in the industry, including Baidu AI Cloud, continue to upgrade their AI infrastructure. They offer general-purpose capabilities such as high-performance compute clusters, parallel file storage, container platforms, and distributed training frameworks to support pretraining and fine-tuning of trillion-parameter models. Combining low-level compute scheduling and network topology optimization with upper-level distributed strategies such as FSDP2 can hide much of the complexity of heterogeneous hardware. This lets developers focus more on model algorithm innovation.

    Conclusion

    Completing the training adaptation of a 2.8-trillion-parameter multimodal model shows that heterogeneous compute has matured for ultra-large-scale distributed training. By building a native FSDP2 multimodal training path and connecting the full pipeline, from model loading and sharding scheduling to gradient synchronization, the industry has overcome both memory and communication barriers. As software and hardware co-design advances, AI infrastructure is expected to become more efficient and easier to use, providing a foundation for the continued development of artificial general intelligence (AGI).