Training Adaptation of Trillion-Parameter Multimodal LLMs on Domestic AI Accelerators: An FSDP2 Practice

    Adapting trillion-parameter multimodal models for training is a full-stack test of an AI compute platform. This article explains why fully sharded data parallelism (FSDP/FSDP2) is mandatory at this scale, walks through building a native FSDP2 training pipeline on a domestic train-and-inference accelerator and its software stack—covering sharded initialization, differentiated sharding for multimodal architectures, communication scheduling, and numerical correctness validation—and closes with practical pitfalls and engineering recommendations. This guide targets infrastructure and ML engineers planning to continue-train or fine-tune ultra-large open-source models.

    Introduction: The Training Adaptation Challenge in the Era of Ultra-Large Models

    As open-source LLMs cross the trillion-parameter threshold, model training places unprecedented demands on the underlying compute platform. Recently, the community open-sourced a flagship multimodal model with roughly 2.8 trillion parameters. Its sheer parameter count and complex multimodal architecture mean that any team hoping to continue-train or fine-tune it must first answer a basic question: can the model even run on their hardware?

    Training adaptation is far more than “being able to load the model.” It requires the platform’s hardware capabilities, driver layer, operator libraries, communication libraries, and training framework to form a complete closed loop—so that every step from loading, forward computation, and backpropagation to parameter update executes correctly and efficiently. Using the training adaptation of such trillion-parameter multimodal models as the entry point, this article dissects the full technical chain of building a native FSDP2 training path on a domestic train-and-inference AI accelerator and its accompanying software stack.

    1. Why Trillion-Parameter Models Require Fully Sharded Training

    1.1 The Memory Wall Is the Core Constraint

    Take 2.8 trillion parameters as an example: even with mixed-precision training, the model weights alone require several terabytes of memory. Once optimizer states (such as momentum and second-moment estimates), gradient copies, and activations are included, total memory demand balloons to the tens-of-terabytes range. No single accelerator card can hold this, so distributed training shifts from an option to a necessity.

    1.2 From Data Parallelism to Fully Sharded Data Parallelism

    Traditional data parallelism requires every card to hold a complete model replica, with memory overhead growing linearly with model size—long since unworkable for ultra-large models. The core idea of Fully Sharded Data Parallel (FSDP) is to shard model parameters, gradients, and optimizer states across all compute devices, so each device holds only its assigned shard. When computation needs the full parameters, they are temporarily gathered via collective communication and released immediately afterward. As a result, per-device memory usage is roughly proportional to total parameters divided by device count, making trillion-scale training feasible.

    1.3 Key Improvements in FSDP2

    The new-generation FSDP2 evolves the engineering implementation further, with typical characteristics including:

    • Sharded tensors as a first-class abstraction: parameters exist in sharded form from creation, avoiding the memory spike of “initialize fully, then shard”;
    • More flexible device meshes: sharding and data-parallel dimensions can be composed into multi-dimensional topologies, making it easier to coordinate with pipeline and tensor parallelism;
    • Finer-grained communication-computation overlap: parameter-gathering communication in forward and backward phases can overlap the compute pipeline more precisely, reducing exposed communication time.

    2. Building a Native FSDP2 Multimodal Training Path

    A “native” path means the model’s training code runs directly on the target platform’s software stack—without extra adaptation layers or intermediate conversion frameworks—calling its natively provided distributed primitives and operator implementations. Building such a path typically requires working through the following stages.

    2.1 Model Loading and Sharded Initialization

    The weights of a trillion-parameter model are usually stored as hundreds of shard files. A native path must support streaming loading: each compute device reads only the parameter shards it is responsible for, rather than loading the full weights into memory and redistributing them. A common engineering approach combines lazy initialization with the meta-tensor mechanism—first building the model structure and deriving layer shapes on a “meta device,” then materializing layer by layer onto real devices and sharding immediately. A sketch of the flow:

    1. # Illustrative pseudocode demonstrating the basic idea of sharded initialization
    2. with meta_device_context():
    3. model = build_multimodal_model(config) # derive structure on the meta device only
    4. for name, module in model.named_modules():
    5. shard_plan = decide_shard_plan(name, module, device_mesh)
    6. materialize_and_shard(module, shard_plan) # materialize and shard onto local devices

    The key in this stage is avoiding memory peaks: at no point may a full parameter be materialized on a single card.

    2.2 Differentiated Sharding Strategies for Multimodal Architectures

    A multimodal model typically contains heterogeneous modules—a vision encoder, cross-modal projection layers, and a large-scale language backbone—whose parameter sizes and compute characteristics differ significantly. A sound approach is to define sharding and parallelism strategies at module granularity:

    • Language backbone: holds the largest share of parameters and is the primary target of full sharding, usually sharded by layer or by block;
    • Vision encoder: compute-intensive but relatively modest in parameters—local replication or small-scope sharding can be considered to reduce communication overhead;
    • Embedding layers and output head: with a huge vocabulary these often become memory hotspots and need to be sharded along the vocabulary dimension, paired with communication optimizations.

    2.3 Sharding Scheduling and Communication Optimization

    Fully sharded training generates enormous communication volume, so scheduling strategy directly determines training throughput. Core techniques include:

    1. Prefetch-style parameter gathering: launch the all-gather for a layer’s parameters before backpropagation reaches it, hiding communication inside computation;
    2. Gradient bucketing and reduction scheduling: organize gradients into buckets and trigger reduction once a threshold is reached, instead of waiting for all gradients;
    3. Low-level adaptation of communication primitives: the collective communication library must fully exploit hardware interconnects—both intra-node high-speed links and inter-node networking—which places high demands on the quality of the software stack’s communication implementation.

    2.4 Gradient Synchronization and Numerical Correctness Verification

    The final link in the training chain is the correctness of gradient synchronization. Engineering practice demands rigorous validation: at small scale, compare the loss curves and gradient norms of sharded training against a single-device reference implementation, checking bit-exact or tolerance-based agreement; also verify that optimizer states can be restored losslessly after sharded checkpointing and resumption. Only once numerical correctness is confirmed can training adaptation be considered complete.

    3. The Engineering Value of a Train-and-Inference Platform

    Adaptation work matters also for what it reveals about hardware-software co-design. A train-and-inference accelerator means the same hardware platform carries both training workloads and inference deployment. Paired with a unified software stack, it closes the “train–evaluate–deploy” loop within a single technical system, significantly cutting migration costs. For enterprise users, this means:

    • Converged technology stack: training and inference share operator libraries, communication libraries, and toolchains, reducing the burden of maintaining multiple heterogeneous environments;
    • A viable domestic path: the fact that a trillion-parameter flagship model can complete native training adaptation on domestic compute shows that overall maturity—operator coverage, communication performance, and framework compatibility—has reached a level capable of supporting frontier model development;
    • Positive ecosystem feedback: each successful adaptation of a heavyweight open-source model settles into the software stack as general capability, continuously lowering the adaptation cost for subsequent models.

    4. Practical Recommendations and Common Pitfalls

    For teams planning similar adaptation work, the following lessons are worth noting:

    1. Start small, scale up: validate numerical correctness first on a few devices with a scaled-down model, then expand gradually—never go full-scale directly;
    2. Budget memory first: during hardware selection, precisely estimate the memory footprint of parameters, gradients, optimizer states, and activations, and work backward to the required device count;
    3. Beware of silent errors: mismatched communication semantics or operator precision differences may not raise errors yet still prevent convergence—establish automated cross-checking mechanisms;
    4. Prioritize checkpoint resumption: ultra-large model training runs are long, so sharded checkpoint save and restore capability is an indispensable engineering safeguard.

    Conclusion

    Training adaptation for trillion-parameter multimodal models is, at its core, a systematic test of a compute platform’s full-stack capabilities. The end-to-end pipeline—from sharded initialization to gradient synchronization—demonstrates that domestic AI compute now meets the baseline conditions for supporting frontier large-model training. As the software stack continues to evolve and adaptation experience accumulates, the barrier to training ultra-large models will keep falling, giving more teams the opportunity to participate in developing and applying the next generation of models.