Adapting Training for Ultra-Large Multimodal Models: Methods and Engineering Practice
This article covers the main challenges of training ultra-large multimodal models on a new AI accelerator and its software stack. It explains how to handle model loading, parameter and optimizer state sharding, compute scheduling, gradient synchronization, and checkpointing. It also describes a native sharded training path, compatibility work across software environments, fault recovery, layered validation, and further optimization directions.
Parameter counts in large models keep growing, and training has shifted from a pure contest over compute to a combined effort across hardware, software, parallelism strategies, and engineering systems. Ultra-large models that take text, image, video, or other modality inputs must handle an enormous number of parameters. They also have to cope with differences among modalities in sequence length, input size, encoding method, and computational complexity. Adapting training to new accelerator hardware and software stacks has become an important topic in large model infrastructure.
Recently, a Chinese-developed AI accelerator card and its supporting software environment completed training adaptation for an ultra-large multimodal model. The adaptation did not simply move the model code to another device. It systematically reworked the full pipeline, including model loading, parameter sharding, compute scheduling, gradient synchronization, and state saving. The result is a native sharded path for large-scale distributed training. This article takes a general technical view of such work and analyzes its core difficulties, implementation approach, and engineering practice.
1. Main Problems in Ultra-Large Multimodal Training
Once a model reaches the trillion-parameter scale, a single device usually cannot hold the complete model. Even a large memory capacity falls short. Parameters, gradients, optimizer states, activations, and temporary buffers add up quickly and exceed the limits of one card. The training system must therefore split model state across many devices using data parallelism, tensor parallelism, pipeline parallelism, or parameter sharding.
Multimodal models add further complexity. Text encoders, vision encoders, cross-modal connection layers, and generation modules can have different computational profiles. Some modules show large differences in input length and intermediate activation size. A fixed batching strategy designed for text-only models tends to cause the following problems:
- Load imbalance across devices, with some devices waiting for long periods;
- Large jumps in activation memory when image or video inputs appear, which makes peak memory hard to predict;
- Mismatched preprocessing speeds across modalities, which leaves compute devices idle;
- Parameter shards that do not align with module boundaries, which increases the number of communication operations;
- Gradient synchronization and checkpoint saving that take too long and reduce overall training efficiency.
The goal of training adaptation is therefore not only to get the model running. The system must also run stably, scale to more devices, and stay recoverable and observable during long training runs.
2. Scope of the Full Training Pipeline
A complete adaptation plan should cover at least the following stages.
2.1 Model Loading and Initialization
Initialization should avoid building a full copy of the model on each device and only then sharding it. For ultra-large models, that approach creates a sharp memory peak, which can exhaust resources before training starts.
A better approach is sharded initialization:
- Build the model structure and parameter metadata first;
- Determine the parameter sharding plan based on the number of devices;
- Place each parameter directly on its assigned device;
- Delay loading for state that is not used in the current stage;
- Handle shared weights, frozen modules, and sparse modules separately.
Initialization must also keep the parameter layout consistent. Each device needs to know which shard owns a given parameter, when the parameter must be fetched, whether it can be released after computation, and how it maps back during checkpoint recovery. Only a unified parameter lifecycle mechanism lets forward and backward passes run reliably.
2.2 Sharding of Parameters and Optimizer States
In sharded training, parameters, gradients, and optimizer states are usually split across device groups rather than copied to every device. Common states include:
- Model parameters;
- Parameter gradients;
- First- and second-order optimizer statistics;
- High-precision parameter copies needed for mixed-precision training;
- Temporary buffers used during parameter updates.
If only parameters are sharded while gradients or optimizer states remain fully replicated, memory savings stay limited. The adaptation must plan the whole training state together.
During the update step, the system typically computes local gradients for the parameters in the current shard, runs the necessary collective communication to aggregate them, and then updates only the parameter shard that the device owns. Parameters that are not in use can stay in host memory or another storage tier and be scheduled back when needed. This reduces the resident memory footprint on the device.
2.3 Forward and Backward Computation
The forward pass of a multimodal model often consists of several submodules. To reduce peak memory, the system must decide when to load and release parameters based on module boundaries. For example, during visual feature extraction, only the vision module parameters needed at that stage stay resident. After the flow enters the cross-modal fusion stage, the corresponding connection layers and language generation modules are loaded.
The backward pass requires more care. Some intermediate activations are reused during backpropagation. Keeping all of them consumes a lot of memory, while releasing all of them requires recomputation, which adds compute cost. Engineers usually balance activation saving against recomputation, choosing a strategy for each module based on its compute cost, memory use, and communication latency.
Communication in the forward and backward passes should also overlap with computation where possible. While one stage runs, the system can prepare the parameter shards needed by the next stage. Completed gradient portions can be synchronized in batches before the full gradient calculation finishes. These steps reduce the time devices spend waiting for communication and raise overall utilization.
3. Design of the Native Sharded Training Path
A native sharded training path means the model runs on sharded state from loading through computation to updates. The system does not first build a complete model using single-device logic and then force a split through external tooling.
This design usually includes three key components.
3.1 Parameter State Manager
The parameter state manager tracks each parameter’s owner device, its current state, and its lifecycle. Parameter states fall into the following categories:
- Not loaded: the parameter exists only in persistent storage or host memory;
- Sharded: the current device holds one part of the parameter;
- Temporarily gathered: the parameter is briefly assembled to compute a given module;
- Computed: the forward or backward task using the parameter has finished;
-
