Training a 2.8-Trillion-Parameter Multimodal Model on Domestic AI Accelerators: A Practical Guide

    A 2.8-trillion-parameter flagship multimodal model has been successfully adapted for training on domestic training-and-inference AI accelerators, using a native FSDP2-based training pipeline. This article breaks down the full adaptation workflow—from model loading and weight migration to FSDP sharding, gradient synchronization, and training stability—and distills the practice into a general methodology for building complete large-model training pipelines on heterogeneous hardware platforms.

    Adapting Large-Scale Multimodal Model Training to Domestic AI Accelerators: Lessons from Practice

    Background: Training Challenges in the Trillion-Parameter Era

    A team in the industry recently open-sourced a flagship multimodal model with roughly 2.8 trillion parameters, pushing the infrastructure bar for large-model training even higher. For enterprises and developers who want to continue pretraining or fine-tuning such a model, the core question has shifted from “is the model available?” to “can we actually train it in our own compute environment?”

    Trillion-parameter models introduce challenges across the board:

    • Massive memory pressure: Even with mixed-precision training, model weights alone require multiple terabytes of memory, and optimizer states and gradients add more—far beyond what a single accelerator can hold;
    • Significant communication overhead: Gradient synchronization and parameter aggregation across devices and nodes can easily become a throughput bottleneck;
    • Complex multimodal data: Preprocessing pipelines and load balancing for text, images, and other heterogeneous data sources require dedicated design;
    • High software stack adaptation costs: Models are typically developed for mainstream accelerator ecosystems, and migrating to other hardware platforms requires working through operator coverage, distributed primitives, and graph compilation optimizations one by one.

    Recently, a domestic chip vendor announced that, based on its flagship training-and-inference AI accelerator and self-developed software stack, it had completed training adaptation for this model, building a native multimodal training path based on Fully Sharded Data Parallel (FSDP2). Using this practice as a starting point, this article abstracts a general technical methodology for building a complete large-model training pipeline on domestic compute platforms.

    Overall Architecture for Training Adaptation

    “Training adaptation” is far more than just getting a model to run. It means building a complete, efficient, and stable training pipeline covering model loading, sharding and scheduling, and gradient synchronization. The overall architecture has four layers:

    1. Hardware layer: Training-and-inference AI accelerators with high-bandwidth memory and fast inter-chip interconnect provide the physical foundation for large models;
    2. Software stack layer: Drivers, operator libraries, collective communication libraries, and compilation optimization tools map the computation and communication requests from upper-layer frameworks efficiently onto the hardware;
    3. Distributed training framework layer: Parallel strategies such as FSDP manage sharded model states and orchestrate the training process;
    4. Model and data layer: The multimodal model’s architecture definition, weight conversion, and data preprocessing pipelines.

    The four layers are decoupled yet tightly coordinated; a missing piece in any layer means the training either fails to start or efficiency collapses.

    Key Step 1: Model Loading and Weight Migration

    Loading a very large model is the first hurdle in itself. Common engineering points include:

    • Sharded weight loading: Model weights are typically stored in hundreds of shard files. The training framework must support loading in parallel across devices, to avoid out-of-memory failures caused by reading the full weights into a single point’s memory;
    • Precision and format conversion: Convert weights to mixed-precision formats such as BF16/FP16 according to the training strategy, and validate numerical ranges to prevent overflow;
    • Operator semantic alignment: Operator implementations can differ subtly across hardware platforms (e.g., epsilon handling in normalization, attention mask conventions), so layer-by-layer forward-pass alignment checks are needed to confirm the loss curves match.

    A schematic loading flow looks like this:

    1. # Example code: load weights sharded by device
    2. def load_sharded_weights(shard_files, device_mesh):
    3. local_state = {}
    4. for shard in shard_files:
    5. for name, tensor in load_shard(shard):
    6. if belongs_to_rank(name, device_mesh.rank):
    7. local_state[name] = tensor.to(device_mesh.device)
    8. return local_state

    Key Step 2: FSDP Sharding Strategy

    Fully Sharded Data Parallel (FSDP) is the mainstream approach for training very large models today. Its core idea is to shard model parameters, gradients, and optimizer states across all compute devices, temporarily gathering only the required shards during forward and backward passes—reducing memory footprint by roughly an order of magnitude or more.

    Key improvements in the newer FSDP implementation (often called FSDP2) over earlier versions include:

    • Declarative parallelism based on Device Mesh: Data parallelism, tensor parallelism, and other dimensions are modeled uniformly, enabling more flexible strategy combinations;
    • Tensor-level sharding abstraction: Parameters are expressed as distributed tensors, allowing finer orchestration of communication-computation overlap;
    • Native support for hybrid sharding: A hybrid strategy (HSDP) that fully shards within a node while replicating across nodes balances memory savings against communication overhead.

    When building a native FSDP path on a domestic accelerator platform, the software stack must provide complete collective communication primitives (all-gather, reduce-scatter, etc.) and efficient memory management. For multimodal models, where visual encoders and language models coexist as heterogeneous structures, sharding strategies should be defined separately—the visual component usually has fewer parameters and can be sharded conservatively, while the language backbone requires full sharding.

    Key Step 3: Gradient Synchronization and Communication Optimization

    Gradient synchronization is the decisive factor for scalability. Common optimization techniques include:

    1. Communication-computation overlap: During backpropagation, layers that finish computing immediately trigger gradient reduction, hiding communication under the computation of subsequent layers;
    2. Gradient bucketing: Merge small gradient tensors into larger communication chunks to reduce the number of communication calls;
    3. Mixed-precision communication: Transmit gradients in low-precision formats, nearly halving communication volume without sacrificing convergence;
    4. Topology-aware scheduling: Account for bandwidth differences between intra-node high-speed interconnects and inter-node networks, organizing communication hierarchically to prioritize high-bandwidth links.

    In multimodal training, uneven per-step load caused by varying sample lengths across modalities also needs attention; dynamic batch sizes or sample ordering can mitigate this “bucket effect.”

    Ensuring Training Stability and Efficiency

    The final piece of a complete training pipeline is observability and fault tolerance:

    • Numerical health monitoring: Track gradient norms and loss spikes, combined with gradient clipping and loss scaling strategies;
    • Resumable training: Sharded checkpoints support asynchronous persistence and fast recovery, so long-running training runs are not lost to failures;
    • Performance profiling: Use profiling capabilities provided by the software stack to locate communication bottlenecks and operator hotspots, iterating optimizations continuously.

    Teams looking to lower in-house engineering barriers can also consider running training workloads in the cloud. General-purpose cloud capabilities—container platforms, object storage, and monitoring and alerting, such as those offered by Baidu AI Cloud—can provide infrastructure support for job scheduling, data management, and runtime observability in large-model training, letting teams focus on models and algorithms.

    Conclusion

    Completing training adaptation for a 2.8-trillion-parameter multimodal model on domestic training-and-inference accelerators validates that the full pipeline—from model loading and FSDP sharding to gradient synchronization—is feasible on heterogeneous hardware. The significance of this practice is that large-model training is no longer bound to a single hardware ecosystem: developers can build efficient, stable training systems on diverse compute foundations using open technical methodologies. As software stacks continue to mature, the engineering path for domestic accelerators to carry frontier model training will only get smoother.