Adapting Training for a 2.8-Trillion-Parameter Multimodal Model with Native FSDP2 and End-to-End Optimization

    This article explains how a 2.8-trillion-parameter multimodal model was adapted for training on a self-developed AI compute platform. It covers the main challenges at this scale, including memory pressure, communication bottlenecks, and software stack compatibility. It also describes the native FSDP2 training path, from model loading and per-parameter sharding to gradient synchronization, and the cloud infrastructure that supports it. The discussion focuses on general engineering practice rather than specific products.

    With open-source large model technology advancing rapidly, multimodal models are moving toward the trillion-parameter scale. Recently, an open-source team released a flagship multimodal model with up to 2.8 trillion parameters. A model of this size places new demands on compute clusters, network bandwidth, and distributed training software stacks. This raises a central question: how can a self-developed AI compute platform be adapted to train a model of this size, covering the full path from model loading to gradient synchronization? This article sets aside product-specific details and examines the core technical approach to training a 2.8-trillion-parameter model from a general engineering perspective.

    1. Technical Challenges of Training Trillion-Parameter Multimodal Models

    At the 2.8-trillion-parameter scale, single-machine training and simple data parallelism can no longer meet the requirements. The main challenges are:

    1. Memory wall and fragmentation: The model parameters alone require terabytes of memory. Optimizer states, gradients, and activations raise total memory use sharply. Traditional memory management can also fragment memory when allocating very large tensors, which can trigger out-of-memory (OOM) errors.
    2. Communication bottleneck: In multi-node, multi-accelerator clusters, synchronizing gradients and parameters consumes a large share of network bandwidth. If communication does not overlap effectively with computation, accelerators sit idle for long periods, which slows training significantly.
    3. Software stack adaptation for heterogeneous compute: AI accelerators from different architectures differ in operator support, low-level drivers, and distributed communication libraries. Efficient large-model training requires a native training path built on a specific software stack, rather than relying on the generic abstractions of a framework.

    2. Building a Native FSDP2 Multimodal Training Path

    To address these challenges, the adaptation uses a native FSDP2 (Fully Sharded Data Parallel 2) architecture. Compared with FSDP1, FSDP2 is substantially restructured in sharding granularity and memory management. It is currently a mainstream approach for training trillion-parameter models in the industry.

    2.1 Fine-Grained Parameter Sharding

    FSDP2 drops module-level coarse-grained sharding and uses per-parameter sharding instead. Each individual parameter tensor is split and distributed across all compute devices. During the forward and backward passes, the framework uses All-Gather operations to collect the full parameters for computation. It releases them immediately after the computation finishes, which keeps peak memory usage as low as possible.

    A conceptual sketch:

    1. # FSDP2 parameter sharding: conceptual example
    2. class FSDP2Model:
    3. def __init__(self, module, mesh):
    4. self.module = module
    5. # Shard each parameter at fine granularity
    6. for param in module.parameters():
    7. shard_param(param, mesh)
    8. def forward(self, x):
    9. # Trigger All-Gather to collect the full parameters
    10. with param_collection(self.module):
    11. return self.module(x)

    2.2 Unified Scheduling of Multimodal Data Streams

    Multimodal models process more than text. They also handle images, audio, and other modalities. When building the training path, the data loading stage must align the modalities and mix them into batches. A general-purpose data processing framework converts inputs from different modalities into a unified token sequence. Combined with FSDP2 sharding, this keeps the data distribution balanced across compute nodes and prevents gradient oscillation caused by an imbalanced modality ratio.

    3. Connecting the Full Training Chain: From Model Loading to Gradient Synchronization

    Whether the adaptation succeeds depends on whether the full training chain runs stably and efficiently. This includes three key stages: model loading, shard scheduling, and gradient synchronization.

    3.1 Efficient Model Loading and Checkpoint Resume

    The weight files for a 2.8-trillion-parameter model are very large, so serial loading takes far too long. The adaptation combines parallel loading with on-demand loading. During training initialization, the system uses the high-concurrency bandwidth of cloud-native infrastructure, such as object storage, to load each shard directly into the GPU memory of its assigned node. The system also records global optimizer state and the training step count. This forms a reliable checkpoint-and-resume mechanism, so that after a hardware failure interrupts training, it can recover quickly from the most recent checkpoint.

    3.2 Dynamic Shard Scheduling

    During training, the shard scheduler manages the lifecycle of parameters and gradients. The adaptation improves the scheduler with memory pre-allocation and asynchronous reclamation. After the forward computation for a layer finishes, the full parameters for that layer are reclaimed immediately, and only the shard state is kept. During the backward pass, gradient computation and the release of parameter shards happen together. This substantially reduces memory usage.

    3.3 Gradient Synchronization and Computation-Communication Overlap

    Gradient synchronization is central to distributed training. The adaptation implements Reduce-Scatter operations for gradient synchronization on top of a native collective communication library. To hide communication latency, the computation is split into multiple micro-batches. While the backward pass for the current micro-batch computes gradients, the Reduce-Scatter for the previous micro-batch’s gradients is launched asynchronously. This overlap hides nearly all network communication time and raises cluster Model FLOPs Utilization (MFU) to an ideal level.

    4. Integrating Software, Hardware, and Cloud-Native Infrastructure

    Training adaptation at this scale is not only a software task. It also requires coordination among software, hardware, and cloud infrastructure. In addition to the drivers and operator library optimizations for the in-house compute hardware, general-purpose cloud services are essential.

    1. Containerized cluster scheduling: Large training clusters are managed on a container platform. Orchestration tools such as Kubernetes handle automatic scaling of compute nodes, fast environment dependency setup, and fine-grained isolation of GPU resources.
    2. Large-scale data storage and acceleration: Multimodal training depends on massive image-text datasets. High-throughput storage services, such as Baidu AI Cloud Object Storage (BOS), combined with local caching, prevent data loading from becoming a training bottleneck.
    3. Comprehensive monitoring and alerting: Long-running training jobs at the trillion-parameter scale are prone to hardware and software faults. Log services and monitoring and alerting systems collect metrics in real time, including GPU utilization, memory usage, network throughput, and temperature. When the system detects a slow node or hardware throttling, it raises an alert and can automatically isolate and replace the faulty node.

    5. Summary

    Building a native FSDP2 training path for a 2.8-trillion-parameter model and connecting the full training chain marks a key step forward for self-developed compute platforms in training very large models. Fine-grained parameter sharding, efficient dynamic scheduling, and deep overlap of computation and communication help developers work within memory and bandwidth limits. As compute platforms and cloud-native technology continue to evolve, training trillion-parameter multimodal models is expected to become more accessible and efficient, providing a technical foundation for AI in more complex scenarios.