Training Trillion-Parameter Multimodal Models on Self-Developed AI Accelerators: A Practical Guide
This article walks through the practical methodology for adapting trillion-parameter multimodal models to self-developed AI accelerator platforms (China's domestically built AI compute hardware). It explains why such training is difficult in the first place — the memory wall, communication bottlenecks, and operator and software-ecosystem gaps — then examines why Fully Sharded Data Parallel (FSDP2) has become the core strategy, and breaks down the end-to-end training pipeline: sharded model loading and initialization, shard scheduling and compute execution, and gradient synchronization with optimizer updates. It closes with software-stack and engineering optimization recommendations covering collective communication library alignment, operator coverage and numerical accuracy, memory optimizations, mixed precision strategies, and observability.
In recent years, multimodal large models whose parameter counts are approaching the trillion scale have become a focal point of industry attention. These models carry cross-modal capabilities such as language understanding and vision at the same time, and their training cost and engineering complexity far exceed anything that came before. When such a training workload has to land on a diverse set of compute platforms — including self-developed AI accelerator cards — the ability to connect the full chain from model loading and memory management through shard scheduling to gradient synchronization becomes the deciding factor in whether training runs efficiently at all. This article systematically unpacks the methodology for training trillion-parameter multimodal models on self-developed AI accelerators.
Why Adapting Trillion-Parameter Multimodal Models Is So Hard
1. The memory wall is the first barrier
When training a large model, device memory has to hold more than the model parameters themselves: it also holds forward activations, backward gradients, and optimizer states. Take common mixed-precision training as an example — parameters, gradients, and optimizer states together typically require several times the memory footprint of the parameter count alone. For trillion-parameter models, even on high-end accelerator cards, a single device’s memory falls far short of holding the complete model, so sharding and parallelism strategies are unavoidable.
Multimodal models make this worse. They are usually composed of heterogeneous submodules — a language backbone together with a vision encoder, for instance. Different parts differ markedly in tensor shapes, computational characteristics, and activation sizes, which makes memory consumption hard to predict evenly.
2. Communication bottlenecks determine scaling efficiency
Growing parameter counts mean distributed training depends on large volumes of cross-card and cross-node data exchange. If that communication overhead cannot be sufficiently hidden behind computation, cluster compute utilization drops sharply. Self-developed compute platforms differ from the traditional ecosystem in areas such as high-speed interconnect and the maturity of collective communication libraries, which makes adapting and tuning the communication path especially important.
3. The operator and ecosystem adaptation gap
Multimodal models contain many non-standard operators and custom compute paths. When migrating to self-developed accelerator cards, the coverage, numerical alignment, and performance of some operators may not match expectations. Adaptation at the software-stack level — filling in operator library gaps, mixed-precision support, communication library integration — often costs more effort than migrating the model code itself.
Why Fully Sharded Data Parallel (FSDP2) Has Become the Core Solution
Among distributed training strategies, Fully Sharded Data Parallel takes an approach similar to ZeRO-3: it slices parameters, gradients, and optimizer states across all training processes, making it possible to fit extremely large models within the memory of individual devices.
The newer generation, FSDP2, offers several key improvements over earlier implementations that engineering teams should pay attention to:
- Parameter representation based on distributed tensors (DTensor): each parameter is managed uniformly as a sharded tensor with clear sharding semantics, which makes it easier to combine with capabilities such as compute graph compilation and operator fusion.
- Finer-grained per-parameter sharding: compared with earlier approaches that sharded flattened parameter groups, per-parameter sharding makes memory reclamation and communication scheduling more flexible.
- Stronger composability: it can be stacked with tensor parallelism and pipeline parallelism, meeting the hybrid parallelism needs of extremely large models.
Its core runtime logic can be summarized as follows: before computing a given layer, an all-gather collects the full parameters that layer needs onto each card; once the computation completes, the shards not held locally are released (resharded) immediately; during the backward pass, parameters are gathered again to compute gradients; finally, reduce-scatter performs gradient reduction and redistribution. Optimizer states are likewise maintained in sharded form, so each card updates only the portion it is responsible for.
Breaking Down the Key Stages of the Full Training Pipeline
1. Model loading and sharded initialization
The first step of training is loading and initializing the model. For an extremely large model, loading the complete weights immediately hits the memory ceiling, so a sharded loading strategy is required: each training process reads and initializes only the parameter shards it is responsible for, or builds the graph from metadata first and then instantiates it layer by layer to lower peak memory.
A schematic initialization flow looks like this:
# Pseudocode: build the graph from metadata + fully sharded wrappingwith meta_device(): # Build the compute graph on the meta device only, avoiding real memory allocationmodel = build_multimodal_model(config)model = fully_shard(model) # Wrap with per-parameter sharding; parameters, gradients, and optimizer states are sharded accordinglyload_sharded_checkpoint(model) # Load saved weights in sharded form
The key point here: build the graph first and instantiate later, and load only local shards, which pushes the peak memory of the loading stage as low as possible.
2. Shard scheduling and compute execution
The goal of shard scheduling is to pipeline “gather parameters — compute — release” efficiently. Ideally, the all-gather for the next layer’s parameters overlaps with the current layer’s computation, hiding communication latency behind computation. In practice, the following deserve attention:
- Matching shard granularity to batch size: shards that are too fine increase the number of communication operations, while shards that are too coarse weaken the memory savings.
- Degree of compute/communication overlap: use a prefetch mechanism to issue parameter gathering for subsequent layers ahead of time.
- Handling heterogeneous submodules: the sharding strategies of the language backbone and the vision encoder in a multimodal model can be tuned separately, so that one modality does not become a straggling bottleneck.
3. Gradient synchronization and optimizer updates
During the backward pass, each card computes gradients for its local shards and then uses reduce-scatter to reduce and redistribute them, so every card keeps and applies only the gradient shard that belongs to it. Because optimizer states are also stored in sharded form, parameter updates are inherently distributed and there is no need to additionally broadcast full parameters. While preserving mathematical equivalence, this design spreads both memory and communication cost across all processes.
Software Stack and Engineering Optimization Recommendations
Whether training adaptation succeeds depends largely on the maturity of the software stack and on engineering tuning. The following points deserve particular focus:
- Collective communication library alignment: make sure the distributed backend integrates well with the collective communication capabilities of the self-developed accelerators, and where necessary verify the numerical correctness of primitives such as all-gather and reduce-scatter.
- Operator coverage and numerical alignment: for the non-standard operators in multimodal models, confirm support on the self-developed backend one by one, and use accuracy comparisons to pinpoint potential deviations.
- A combined approach to memory optimization: combine techniques such as gradient checkpointing (recomputation), optimizer state offloading, and activation management to push peak memory down further.
- Mixed-precision strategy: use lower precision to accelerate computation while numerical stability allows, and retain higher precision for sensitive operators to prevent gradient overflow or convergence anomalies during multimodal training.
- Building observability: use general-purpose capabilities such as logging and monitoring alerts to continuously collect metrics including throughput, memory usage, and communication time, providing data support for iterative tuning.
Summary
Adapting a trillion-parameter multimodal large model to self-developed compute platforms is fundamentally a systems engineering effort: it requires understanding the principles of distributed training paradigms such as fully sharded data parallel, solid engineering implementation at every stage from model loading to shard scheduling and gradient synchronization, and full alignment of operators, communication, and precision at the software-stack level. For developers and engineering teams, mastering this complete “from loading to synchronization” chain makes large-scale training far more manageable, and makes it easier to achieve efficient, stable training in a diverse landscape of self-developed compute hardware.
