Trillion-Parameter Multimodal Training with FSDP2 on Chinese AI Accelerators

    Adapting a 2.8-trillion-parameter multimodal model to a Chinese-developed accelerator cluster requires more than sufficient compute capacity. This article examines an FSDP2-based training path, covering distributed initialization, sharding policies, communication overlap, gradient synchronization, and checkpoint recovery. It also outlines practical steps for validating correctness and scaling training on an alternative hardware and software stack.

    Introduction: Training Challenges at Trillion-Parameter Scale

    As multimodal models grow to trillions of parameters, the central training challenge shifts from having enough compute to keeping the entire training pipeline stable and efficient. A 2.8-trillion-parameter flagship multimodal model requires several terabytes of memory for FP16 parameters alone. Gradients, optimizer states, and activations add substantially to that footprint, making large-scale distributed training and coordinated hardware–software optimization essential.

    An industry team recently adapted an open-source flagship model at this scale to Chinese-developed accelerators designed for both training and inference, using an in-house GPU software stack. The work established a native Fully Sharded Data Parallel, or FSDP2, training path for multimodal workloads, connecting model loading, shard scheduling, and gradient synchronization.

    The broader engineering lesson is that an alternative accelerator platform can support trillion-parameter training workloads when its parallelism strategy and software stack are carefully integrated. The following sections examine the key components of that adaptation.

    1. Why FSDP Matters: Memory Limits and Parallelism Strategies

    Understanding the adaptation starts with the four main consumers of training memory:

    1. Parameters: The model weights used in forward and backward computation.
    2. Gradients: Typically comparable in size to the parameters.
    3. Optimizer states: Adam-style optimizers maintain first- and second-moment estimates. Mixed-precision training may also retain FP32 master weights, making the optimizer-related footprint several times the parameter size.
    4. Activations: Intermediate values whose memory requirements depend heavily on sequence length, batch size, and model depth.

    Conventional data parallelism stores a complete copy of the parameters, gradients, and optimizer states on every accelerator. This replication is impractical for trillion-parameter models. Tensor parallelism and pipeline parallelism can partition the model, but often require more invasive changes and tighter integration with its architecture.

    FSDP instead shards parameters, gradients, and optimizer states across the accelerators in a data-parallel group. With N accelerators, each holds roughly 1/N of these persistent states. Before a layer or computation unit runs, an AllGather operation temporarily reconstructs the required parameters. Those gathered parameters can then be released according to the resharding policy. During backward propagation, ReduceScatter synchronizes gradients and distributes the resulting shards.

    This reduces persistent model-state memory per accelerator to approximately 1/N of the replicated footprint. Activations and temporarily gathered parameters still contribute to peak memory, but full sharding makes much larger models feasible.

    FSDP2 advances this approach by managing sharded parameters individually rather than combining them into flattened parameter buffers. This provides more flexible parameter management and supports the scheduling needed to overlap communication with computation.

    For multimodal models, sharding and mixed-precision policies can be configured differently across the vision encoder, language backbone, and cross-modal fusion components. These components differ substantially in size and computational behavior, so a single policy is not always appropriate.

    2. Multimodal-Specific Adaptation Challenges

    Compared with text-only models, multimodal models introduce several complications under sharded training:

    • Heterogeneous architectures: Vision encoders, audio encoders, and language backbones differ in operator mix, parameter count, and compute intensity. Uniform sharding granularity can create load imbalance.
    • Dynamic input shapes: Image resolution, video frame count, and text length vary across samples. These variations can invalidate assumptions built around static graphs or fixed execution patterns.
    • Complex data pipelines: Decoding, augmentation, and tokenization are CPU-intensive. If preprocessing cannot sustain the required throughput, accelerators wait for data, wasting capacity across the distributed job.
    • Uneven backward execution: Different modality branches take different amounts of time to compute gradients. Poorly placed synchronization points can introduce substantial idle periods.

    The goal is therefore not simply to make the model execute. It is to build a multimodal-aware FSDP2 training path in which sharding, scheduling, and communication account for the model’s heterogeneous structure.

    3. Key Components of the Training Pipeline

    3.1 Model Loading and Initialization

    Trillion-parameter models commonly store their weights in sharded checkpoints. Loading the full model before partitioning it can cause an unacceptable memory peak.

    The training path therefore needs distributed lazy loading: each process reads and materializes only the parameter shards assigned to its accelerator. Essential capabilities include initialization on the meta device, on-demand parameter materialization, and mapping checkpoint shards directly to their distributed destinations.

    This makes initialization part of the distributed memory strategy rather than a separate step that temporarily requires a complete model replica.

    3.2 Sharding Policies

    FSDP2’s per-parameter representation supports differentiated policies across model components. The following pseudocode illustrates the intended configuration logic; it is not an executable API example:

    1. # Illustrative pseudocode: differentiated sharding for a multimodal model
    2. for name, module in model.named_modules():
    3. if is_vision_encoder(module):
    4. apply_shard(module, policy=full_shard, mp_policy=bf16_mixed)
    5. elif is_language_backbone(module):
    6. apply_shard(module, policy=full_shard, mp_policy=fp8_aware_mixed)
    7. elif is_fusion_head(module):
    8. apply_shard(module, policy=replicate) # Replicate small modules

    The principle is straightforward: fully shard large backbones to reduce memory consumption, while considering replication for small, frequently invoked components when communication costs outweigh memory savings. Mixed-precision policies should reflect each component’s numerical sensitivity.

    The precision choices shown here are illustrative rather than a statement of verified hardware or software support.

    3.3 Overlapping Communication and Computation

    FSDP performance depends heavily on hiding AllGather and ReduceScatter behind useful computation.

    Prefetching is a common technique. While layer i is computing, the runtime can begin gathering parameters for layer i + 1. During backward propagation, parameter prefetching and gradient reduction must likewise be scheduled to overlap with available computation.

    A hierarchical collective communication backend and topology-aware scheduling can further reduce exposed communication time. On the accelerator platform described here, effective overlap requires close coordination among collective communication primitives, memory-pool management, and execution-stream scheduling.

    The objective is to prevent communication from becoming a recurring pause between otherwise efficient compute operations.

    3.4 Gradient Synchronization and Numerical Stability

    Gradient magnitudes can differ substantially between modality branches. Global gradient clipping must therefore compute the correct global norm even when gradients are sharded.

    For sharded gradients, this requires calculating local sums of squares and combining them with an AllReduce operation before applying clipping consistently.

    Where dynamic loss scaling is used, loss-scale updates, overflow detection, and skipped optimizer steps must also remain consistent across the distributed group. If one accelerator updates its state while another skips the step, the resulting inconsistency can destabilize training or cause divergence.

    Correct synchronization must cover both gradient values and the decisions that govern optimizer updates.

    3.5 Fault Tolerance and Checkpoint Recovery

    For long-running jobs on large clusters, hardware failures are an operational expectation rather than an exceptional event.

    The training system needs atomic saving of sharded checkpoints and fast recovery from them. Asynchronous checkpoint writes can reduce interruptions caused by storage operations.

    Combined with heartbeat monitoring and automatic restarts, these mechanisms provide the foundation for sustained operation across clusters with thousands of accelerators.

    4. Practical Recommendations for Deployment

    Teams building a similar training path on their own infrastructure can follow a staged approach:

    1. Validate the complete pipeline on a smaller model. Start with a model in the tens-of-billions-of-parameters range. Verify loading, sharding, synchronization, checkpoint saving, and recovery before scaling further.

    2. Establish memory and throughput baselines. Record peak memory per step, model FLOPs utilization (MFU), and the share of time spent in communication. Use these measurements to guide optimization.

    3. Prioritize correctness before performance. Numerical consistency is a prerequisite for tuning. Where feasible, compare loss behavior with a single-machine reference implementation before introducing further optimizations.

    4. Use standard cloud infrastructure capabilities where available. Object storage can support tiered training-data storage, container platforms can orchestrate jobs, and logging, monitoring, and alerting systems can help identify failures and accelerate recovery.

    These steps reduce the risk of scaling a pipeline whose initialization, numerical behavior, or recovery mechanisms have not yet been validated.

    Conclusion

    Adapting a trillion-parameter multimodal model for training is fundamentally a systems engineering task. Parallelism, communication, memory management, numerical stability, and fault tolerance must work together on the target software stack.

    The reported FSDP2 adaptation on Chinese-developed training-and-inference accelerators demonstrates a practical path toward supporting models at this scale on an alternative compute platform. Its broader value lies in the engineering approach: validate the full training lifecycle, account for multimodal heterogeneity, and optimize the hardware and software stack as an integrated system.