Trillion-Parameter Multimodal Model Training on Domestic AI Accelerators: FSDP, Parallelism Strategy, and Engineering Practice

    This article examines the challenges of training trillion-parameter multimodal models on China-developed AI accelerators and the engineering approach needed to adapt them. It covers the memory, communication, and heterogeneity walls such models run into, how Fully Sharded Data Parallel (FSDP) shards parameters, gradients, and optimizer states to reduce per-device memory use to roughly 1/N, and how to combine data, tensor, and pipeline parallelism across vision/audio encoders, the language backbone, and cross-modal alignment layers. It then walks through the three linked stages of a usable training pipeline — distributed checkpoint loading, shard scheduling, and gradient synchronization — before turning to software stack work such as operator adaptation, collective communication library integration, mixed precision, and memory lifecycle management. It closes with practical guidelines for scaling from small-scale validation to full-cluster runs.

    1. Background: New Training Challenges from Trillion-Parameter Multimodal Models

    Large models are moving from single-modality to multimodal, and from hundreds of billions of parameters toward the trillion-parameter range. Once a model reaches trillion-parameter scale and must simultaneously understand text, image, audio, and other modalities, traditional single-node training or naive data parallelism quickly runs into both physical and engineering limits.

    The core tension concentrates in three areas:

    • The memory wall: even stored in half precision, the weights, gradients, and optimizer states of a trillion-parameter model — plus forward activations — require far more memory than any single GPU, let alone a single node, can hold.
    • The communication wall: in multi-GPU, multi-node training, the volume of communication produced by parameter aggregation and gradient reduction climbs sharply as the cluster grows. Without effective overlap between computation and communication, communication easily becomes the throughput bottleneck.
    • The heterogeneity wall: a multimodal model is typically built from heterogeneous structures — a vision encoder, a language backbone, and cross-modal projection layers. Their operator characteristics, computational intensity, and memory footprints differ widely, so a single parallel strategy rarely fits all of them.

    Adapting this class of models to China-developed AI accelerators is therefore about more than making the model “run.” The goal is stable, sustainable, and reproducible large-scale training under constrained memory budgets and a specific software ecosystem. This is also a meaningful test of how mature the domestic AI compute ecosystem has become.

    2. Fully Sharded Data Parallel: The Key to Memory Optimization at Extreme Scale

    The mainstream answer to the memory wall is Fully Sharded Data Parallel (FSDP). Its core idea is that, on top of data parallelism, it does not merely split the input data — it also shards the model parameters, gradients, and optimizer states across all participating devices.

    The workflow breaks down as follows:

    1. Forward pass: when a layer needs to run, its complete parameters are temporarily reconstructed through an all-gather collective communication, then released immediately after the computation, leaving only the local shard.
    2. Backward pass: parameters are all-gathered again for gradient computation, after which a reduce-scatter redistributes the gradients back to their owning devices as shards.
    3. Update: each device updates only the parameter shards it holds.

    Compared with conventional data parallelism, where every device keeps a full model replica, FSDP brings per-device memory use down to roughly 1/N of the original (N being the number of parallel devices), which is what makes trillion-parameter training feasible on a finite cluster. Newer fully sharded data parallel designs go a step further, introducing a tensor-sharding-centric abstraction that enables more flexible sharding and placement at parameter granularity, composes more readily with other forms of parallelism, and reduces reliance on hand-written communication code.

    Illustrative code (showing the basic shape of shard wrapping):

    1. # Wrap an ultra-large model with fully sharded data parallelism (illustrative)
    2. for layer in model.layers:
    3. # Shard each Transformer layer individually to reduce all-gather granularity
    4. # and make compute/communication overlap easier
    5. layer = fully_shard(layer)
    6. # Wrap the top level once more to manage parameter, gradient,
    7. # and optimizer state sharding uniformly
    8. model = fully_shard(model)

    It is worth stressing that FSDP does not operate in isolation. In real training runs it is combined with techniques such as activation recomputation, mixed precision, and gradient checkpointing, and only this combination strikes a workable balance among memory, throughput, and convergence stability.

    3. Combining Parallel Strategies for Heterogeneous Multimodal Architectures

    Adapting a multimodal model comes down to managing “differences within a single model.” A typical multimodal large model contains a relatively small vision/audio encoder, a language backbone that holds the vast majority of the parameters, and projection or alignment modules that connect the different modalities. Their compute characteristics are fundamentally different, so the more sensible approach is to combine several parallel strategies on a per-module basis:

    • Vision/audio encoders: parameter counts are comparatively modest and the operator structure is fairly regular, so data parallelism or tensor parallelism works well, avoiding the communication overhead of excessive splitting.
    • Language backbone: holds the bulk of the parameters and is the main battleground for fully sharded data parallelism, optionally layered with tensor parallelism and pipeline parallelism — the 3D parallelism combination of data, tensor, and pipeline dimensions — to spread memory and compute pressure further.
    • Cross-modal alignment layers: usually small in scale but sitting at the boundary between different parallel domains, so particular attention is needed to how their parameter shards are redistributed and how communication hands off between domains.

    The crux of combining parallelisms is the mapping of parallel domains — determining which parallel strategy each sub-module belongs to, and where the communication boundaries between parallel groups fall. When designed well, each module can scale independently while together forming a coherent end-to-end training data flow.

    4. Wiring Up the Full Training Pipeline

    A genuinely usable training adaptation has to carry the whole pipeline through from end to end, which involves at least three tightly coupled stages.

    4.1 Model loading

    A trillion-parameter model cannot be loaded into every device as a single complete file. At startup, training typically relies on a distributed checkpoint mechanism: each device, according to its own parallel rank, reads and loads only the parameter shards that belong to it. This avoids per-device memory overflow and greatly reduces I/O pressure during startup. Loading also has to handle consistency checks between shards and the parallel topology, ensuring weights and optimizer states line up correctly across devices.

    4.2 Shard scheduling

    Shard scheduling determines which parameters live on which device, when they are all-gathered, and when they are released — making it critical for both memory and communication efficiency. A sound scheduling strategy will:

    • place parameters in a balanced way based on each device’s memory capacity and compute capability, so that no individual device becomes a bottleneck;
    • overlap parameter all-gathers with the computation currently in flight, “hiding” communication behind compute time;
    • time shard aggregation and release appropriately during backward propagation and optimizer updates, keeping peak memory in check.

    4.3 Gradient synchronization

    Once backward propagation completes, each device holds gradients for its local shards. A reduce-scatter is needed to reduce and re-shard those gradients so that global gradients are correct. The optimizer then updates parameters based on each device’s local shards, and gradients are cleared before the next iteration.

    Illustrative training loop (pseudocode, expressing the flow only):

    1. for step, batch in enumerate(dataloader):
    2. with torch.autocast(dtype=torch.bfloat16):
    3. loss = model(batch) # Forward: all-gather parameter shards on demand
    4. loss.backward() # Backward: reduce-scatter reduces and re-shards gradients
    5. optimizer.step() # Each device updates its local parameter shards
    6. optimizer.zero_grad() # Clear gradients for the next step

    At extreme scale, gradient synchronization has an inherent dependency on backward computation, so fine-grained shard aggregation and communication scheduling are required to keep communication tucked underneath computation and sustain high overall throughput.

    5. Software Stack and Operator Adaptation

    The success or failure of training on domestic accelerators depends largely on the maturity of the accompanying software stack. Even with ample hardware compute, shortcomings in the software ecosystem make efficient and stable operation difficult. Adaptation work typically focuses on the following areas:

    • Operator adaptation and optimization: core operators such as attention, normalization, activation, and linear layers need correct, efficient, and numerically stable implementations on the domestic hardware; missing or underperforming operators must be filled in or replaced promptly.
    • Communication library integration: collective communication primitives (all-gather, reduce-scatter, all-reduce, and others) must be matched to the hardware interconnect characteristics to make full use of high-speed link bandwidth.
    • Mixed precision support: the common strategy is BF16/FP16 compute with FP32 retained for master weights and critical accumulations, balancing throughput against numerical stability, with techniques such as loss scaling applied where overflow is likely.
    • Memory and lifecycle management: mechanisms such as activation recomputation and memory pooling/reuse help lower peak usage and mitigate fragmentation.

    6. Engineering Practice Recommendations

    Drawing the above together, a few general guidelines emerge:

    1. Start small, then scale: validate functionality at smaller scale with fewer devices first, confirming that loading, sharding, and synchronization work correctly, then expand to the full cluster.
    2. Observability first: build out training logs, memory monitoring, and throughput statistics so communication bottlenecks and memory peaks can be located quickly.
    3. Stability safeguards: set a sensible checkpoint frequency so training can resume quickly after interruption, and add alerting plus automatic pause for anomalous loss values.
    4. Keep parallelism configurable: expose parallel dimensions, shard granularity, and recomputation scope as configuration options, making it easy to tune for different model architectures and cluster sizes.

    7. Summary

    Training trillion-parameter multimodal models on domestic accelerators is a systems engineering effort spanning hardware, the software stack, and parallelism strategy. Fully sharded data parallel serves as the primary lever for memory optimization; combining parallel strategies across heterogeneous multimodal structures balances resource use; and the complete pipeline of model loading, shard scheduling, and gradient synchronization moves the effort from “it runs” to “stable, efficient, and reproducible.” As the domestic software ecosystem continues to improve in operator coverage, communication efficiency, and toolchain completeness, the barrier to training models at this scale is steadily coming down — opening a viable path for more teams to pursue frontier model research on a self-controlled compute foundation.