Scaling Multimodal Model Training: Full Sharding and Distributed Deployment Practices
Training models with trillions of parameters requires distributed execution across nodes and accelerators. Multimodal models add further challenges because text, vision, audio, and video components must be encoded, aligned, and jointly optimized. This article examines the core challenges of adapting a roughly 2.8-trillion-parameter multimodal model to domestic AI accelerators, covering full-sharded training, hardware and runtime integration, communication scheduling, numerical validation, performance optimization, and enterprise deployment practices. The methods provide a general reference for building large-scale model training platforms.
As large language models continue to grow, training workloads are evolving from single-node, multi-device execution to distributed computing across nodes and accelerator types. Multimodal models are particularly demanding because they must process different data modalities, align their representations, and optimize them jointly. This places greater requirements on accelerator compute, memory capacity, interconnect bandwidth, and the supporting software stack.
Recently, an AI infrastructure provider announced that it had completed training adaptation for a flagship multimodal model with approximately 2.8 trillion parameters on domestically developed AI accelerators. The work used high-performance training-and-inference accelerators and a supporting software stack to connect the entire workflow, from model loading and parameter sharding to execution scheduling and gradient synchronization.
Although the implementation targeted a specific model, the underlying engineering methods are broadly applicable. They offer useful guidance for building training platforms for extremely large-scale models.
1. Core Challenges in Training Extremely Large Models
For models with trillions of parameters, the most immediate problem is that a single accelerator cannot store the complete model. Even with low-precision data types, the parameters alone may require hundreds of gigabytes or more. Gradients, optimizer states, intermediate activations, and temporary buffers increase the actual memory requirement significantly.
Traditional data parallelism stores a complete model replica on every device. This approach is relatively simple, but it wastes substantial memory. As model size increases, keeping a full replica on each device becomes impractical. Training systems therefore need to distribute model parameters, gradients, and optimizer states across devices, fetching only the parameters required for the current operation. This is the basic idea behind fully sharded data parallelism.
Multimodal models introduce additional complexity. Text encoders, vision encoders, cross-modal fusion modules, and generation modules may have very different compute and communication characteristics. Some components are compute-intensive, while others are communication-intensive. Applying the same scheduling strategy to every module can lead to idle devices, network congestion, or excessive memory peaks.
As a result, adaptation cannot stop at replacing operators. It must cover the model architecture, runtime scheduling, and distributed communication layers.
2. Building a Native Fully Sharded Training Path
A complete training adaptation can generally be divided into four stages: model loading, parameter sharding, forward and backward execution, and gradient aggregation and updating.
2.1 Model Loading and Initialization
The system should avoid constructing the complete model on a single device and then moving its parameters to other devices. For extremely large models, this approach can cause an out-of-memory failure during initialization.
A better approach is delayed initialization or meta-device initialization. The system first creates the model structure and parameter metadata without allocating complete storage. It then loads parameters directly onto their target devices according to the sharding strategy. Weight files should also be indexed by parameter name, layer hierarchy, or tensor slice to avoid duplicate reads and unnecessary copies.
The implementation should address the following issues:
- Parameter names must remain stable before and after sharding to support checkpoint recovery and weight verification.
- Each device must have a clearly recorded data range to prevent duplicate or missing loading.
- Initialization should support checksum or integrity checks so that corrupted weights can be detected early.
- Shared weights, tied embeddings, and parameters reused across modules require a consistent reference model.
- Unsupported special layers should have fallback mechanisms so that they do not interrupt the entire training process.
2.2 Sharding Parameters, Gradients, and Optimizer States
The key to fully sharded training is not simply splitting the model. Training states must be partitioned systematically. These states typically include model parameters, parameter gradients, and optimizer states.
During the forward pass, each device keeps only the parameters needed by the current computation partition. Before a layer executes, the runtime temporarily gathers the required parameters through collective communication. After computation, those parameters can be released or resharded to control the memory peak. During backpropagation, gradients are processed in the reverse direction and aggregated across devices through reduction operations.
Optimizer states are often overlooked sources of memory consumption. With common first- and second-order momentum optimizers, each parameter may correspond to multiple additional state tensors. If these states remain fully replicated on every device, the memory savings from parameter sharding are greatly reduced.
Optimizer states should therefore follow the same sharding layout as the parameters. The system must also ensure that each parameter update can accurately locate its corresponding optimizer state.
2.3 Forward and Backward Scheduling
In distributed training, parameter communication and computation should form an efficient pipeline. Ideally, while the current layer is executing, the runtime prepares the parameters for the next layer in the background. Once the current layer finishes, parameter shards that are no longer needed can be released.
This scheduling strategy commonly involves:
- Parameter prefetching: Fetching the parameters required by an upcoming module in advance.
- Communication-computation overlap: Using asynchronous communication to reduce device waiting.
- Activation checkpointing: Recomputing selected results during backpropagation instead of storing all intermediate activations.
- Gradient accumulation: Accumulating gradients across multiple micro-batches to reduce the memory pressure of each individual step.
- Dynamic memory reclamation: Releasing temporary tensors promptly to reduce memory fragmentation.
Multimodal models also require separate evaluation of the compute and communication characteristics of each modality branch. Vision inputs, for example, may produce much longer sequences and therefore higher activation costs. Cross-modal attention may need frequent access to intermediate results from different branches. In such cases, finer-grained sharding and checkpointing strategies can be designed around module boundaries.
3. Key Areas in Adapting Domestic AI Accelerators
Migrating a training framework to new hardware generally requires work at four levels: operators, runtime, communication, and numerical precision.
The first area is operator compatibility. Common operations such as matrix multiplication, normalization, attention, activation functions, and tensor transformations must be mapped to implementations supported by the target hardware. If an operator lacks an efficient implementation, possible approaches include equivalent operator compositions, operator fusion, or custom kernels. All such changes must undergo numerical consistency validation.
The second area is runtime integration. The training framework must correctly identify the device topology, memory status, streams, and event mechanisms, while also supporting asynchronous task scheduling. If the runtime continues to use default behaviors designed for another hardware platform, it may introduce excessive synchronization, frequent memory copies, or low device utilization.
The third area is collective communication. Fully sharded training frequently relies on parameter gathering, gradient reduction, and broadcast operations. The communication library must support data transfer across accelerators and nodes and select suitable paths according to the network topology. Communication efficiency depends not only on link bandwidth, but also on message size, concurrency, topology, and synchronization strategy.
The fourth area is mixed precision. Low-precision computation can reduce memory usage and improve throughput, but hardware platforms may support different floating-point formats. The adaptation process must determine which operators can use lower precision and which require higher precision. Loss scaling, gradient checks, and overflow detection are also needed to prevent unstable training.
4. Training Stability and Correctness Validation
Making the model run is only the starting point. A production-ready adaptation must also produce correct results, remain stable, and run continuously over long periods.
For numerical correctness, testing can begin with a smaller model or shortened training sequence. The results should be compared between single-device and multi-device execution, including loss curves, gradient statistics, and model outputs. Parallel execution order, reduction order, and low-precision arithmetic can introduce small differences. Validation should therefore focus on acceptable error ranges and long-term trends rather than requiring every floating-point value to match exactly.
Distributed correctness checks should include:
- Whether parameter shards are complete and non-duplicated.
- Whether gradients from all devices are reduced as expected.
- Whether the number of gradient accumulation steps matches the global batch size.
- Whether optimizer states are correctly associated with their parameters.
- Whether checkpoints can restore the model, optimizer, and random-number-generator states.
- Whether node failures can be detected and handled safely by the remaining tasks.
Long-duration stability testing is also essential. Training an extremely large model may run for several days or longer, so passing a short test does not demonstrate production readiness. During testing, the system should continuously collect metrics such as device utilization, peak memory usage, communication time, iteration time, data loading latency, and the number of retry events.
5. Major Directions for Performance Optimization
Performance optimization should focus on end-to-end training efficiency rather than the compute capability of an individual accelerator.
Reduce Communication Overhead
Parameter prefetching, communication-computation overlap, gradient bucket aggregation, and appropriately configured synchronization frequency can reduce device waiting. For cross-node training, process placement should also account for network topology to prevent traffic from concentrating on a small number of links.
Control Peak Memory Usage
In addition to parameter sharding, activation checkpointing, micro-batches, gradient accumulation, and temporary tensor reuse can help control memory peaks. Excessive memory saving, however, may increase recomputation or communication. The system must balance memory usage, compute time, and communication overhead.
Optimize the Data Pipeline
Multimodal datasets often contain files with different formats and sizes, making preprocessing a potential bottleneck. Layered caching, asynchronous prefetching, batched decoding, and length-based bucketing can reduce the time accelerators spend waiting for data.
Improve Observability
The training platform should record the duration of each stage, including data loading, parameter aggregation, forward computation, backward computation, gradient synchronization, and parameter updates. Only by identifying the actual bottleneck can engineers determine whether the problem is insufficient compute, communication congestion, inadequate data supply, or inefficient memory management.
6. Implementation Recommendations for Enterprise Deployment
Organizations can deploy large-scale model training adaptations in the following sequence:
- Validate individual modules: Verify that basic operators and core model components execute correctly.
- Test a small cluster: Validate parameter sharding, gradient synchronization, and mixed-precision behavior on a limited number of devices.
- Complete the distributed training path: Expand to multiple nodes and focus on communication behavior and fault handling.
- Run long-duration full training: Evaluate stability and resource efficiency under realistic workloads.
A unified version-management and experiment-recording process should also be established. It should preserve model configurations, dataset versions, sharding strategies, precision settings, random seeds, and training logs.
For critical training workloads, the platform should provide regular checkpoints, anomaly alerts, and automatic recovery. These capabilities help prevent a single-point failure from wasting a large amount of compute time and infrastructure capacity.
Overall, adapting extremely large multimodal models for training is a systems engineering effort. It requires not only sufficient compute and memory bandwidth from the hardware, but also coordination across operators, runtimes, distributed communication, and resource scheduling in the software stack.
A native fully sharded training path can reduce the memory constraints of individual devices, improve collaboration across accelerators, and establish a foundation for future model scaling, continued pretraining, and more complex multimodal training workloads.
