Training Trillion-Parameter Multimodal Models on Domestic AI Accelerators: An Engineering Practice
This article explores the engineering practices behind adapting a 2.8-trillion-parameter open-source multimodal model for training on a domestically developed AI accelerator and its software stack. It explains why Fully Sharded Data Parallel (FSDP) is essential at this scale, breaks down the three key stages of training adaptation—model loading, sharding scheduling, and gradient synchronization—and discusses the critical role of the software stack. It concludes with practical recommendations for teams planning large-scale model training on domestic compute clusters.
Engineering Practices for Training Trillion-Parameter Multimodal Models on Domestic AI Accelerators
Introduction: New Challenges for the Compute Foundation
As the open-source community continues to release flagship multimodal models with parameters reaching into the trillions, large model training places unprecedented demands on the underlying compute infrastructure. These models are not only massive in parameter count—they also combine text, image, and other modalities, causing memory consumption, communication overhead, and scheduling complexity to grow exponentially during training. Traditional single-GPU training, or even simple data parallelism, is no longer adequate. The industry has largely converged on distributed training paradigms represented by Fully Sharded Data Parallel (FSDP).
At the same time, a growing number of enterprises are paying attention to the capabilities of domestic AI compute platforms. Running the complete training pipeline of an ultra-large-scale model on a new generation of training-and-inference accelerator cards has become an important litmus test for platform maturity. Recently, a domestic compute vendor, using its self-developed flagship training-and-inference accelerator card and accompanying software stack, completed training adaptation for an open-source 2.8-trillion-parameter flagship multimodal model—building a native FSDP2 multimodal training path and打通 the full pipeline from model loading and sharded scheduling to gradient synchronization. Against this backdrop, this article systematically reviews the technical substance and engineering methodology of this kind of adaptation work.
1. Why Trillion-Parameter Models Require Fully Sharded Training
1.1 The Memory Wall Is the Primary Bottleneck
For a 2.8-trillion-parameter model, even with mixed-precision training, the parameters alone require several terabytes of memory. Adding optimizer states (such as Adam’s first and second moments) and gradient copies, total memory requirements in a full training state are typically several times the parameter count. No single accelerator card can hold state data at this scale, so the model state must be partitioned across hundreds or thousands of cards.
1.2 The Core Idea of FSDP
The core idea of Fully Sharded Data Parallel can be summarized as “gather on demand, release immediately after use”:
- Parameter sharding: Each compute node holds only one shard of the model parameters, rather than a full replica;
- Gathering during forward computation: Before executing a given layer, the full parameters needed by that layer are temporarily gathered via collective communication;
- Release after computation: Once the layer’s computation completes, the gathered parameters are immediately released, keeping only the local shard;
- Gradient reduction and sharding: Gradients produced by backpropagation are scattered back to each node through reduction operations, and the optimizer updates only the local shard.
This design reduces memory consumption from “every card stores the full model” to “every card stores 1/N of it,” making it possible to train ultra-large-scale models.
1.3 Improvements in the New Generation of FSDP
Compared with earlier implementations, the new generation of fully sharded schemes offers clear engineering improvements: a more flexible dimension-based sharding abstraction replaces fixed-granularity flattened parameter partitioning; communication-computation overlap is scheduled at a finer granularity to reduce bubbles; and in multimodal scenarios it better handles the heterogeneous sharding needs of different substructures (such as the vision encoder and the language backbone).
2. Three Key Stages of Training Adaptation
2.1 Model Loading: From Checkpoint to Distributed Memory
The weight files of a trillion-parameter model are themselves several terabytes in size, so the loading stage must achieve:
- Distributed parallel loading: Each node reads only the shard it is responsible for, avoiding the memory and I/O bottleneck of a single node reading the full weights;
- Tensor resharding: Open-source weights are usually saved in some particular parallel layout. During adaptation, they must be repartitioned into the target sharding format, which requires the software stack to provide efficient weight conversion tools;
- Lazy initialization: Build the model structure first using meta tensors, then materialize parameters on demand, avoiding memory peaks during loading.
2.2 Sharding Scheduling: The Heterogeneity Challenge of Multimodal Models
A multimodal model consists of multiple submodules with very different structures, so a one-size-fits-all sharding strategy does not work:
- Vision encoder: Relatively regular in layer structure but with large activations, making it well suited to activation checkpointing;
- Language backbone: Accounts for the largest share of parameters and is the focus of sharding scheduling, requiring fine-grained control over the timing of gathering and release;
- Mixture-of-Experts structures: If the model adopts an MoE architecture, the combination of expert parallelism and data parallelism must also be handled, further increasing scheduling complexity.
In practice, declarative sharding strategy configurations are typically used to assign different parallel dimensions and communication groups to different submodules, as illustrated below:
# Illustrative configuration: assign sharding strategies to different submodulesshard_plans = {"vision_encoder": {"mesh_dim": "dp", "checkpoint": True},"language_backbone": {"mesh_dim": "dp", "reshard_after_forward": True},"moe_experts": {"mesh_dim": "ep", "expert_parallel_size": 8},}
2.3 Gradient Synchronization: Communication Efficiency Determines Scalability
On thousand-card clusters, the communication efficiency of gradient synchronization directly determines training scaling efficiency. Key optimization techniques include:
- Communication-computation overlap: Backpropagation produces gradients layer by layer; reduction operations should be launched as soon as each gradient is ready, rather than waiting for the entire backward pass to finish;
- Gradient bucketing: Merge the gradients of multiple small tensors into larger communication buckets to reduce the number of communication calls and improve bandwidth utilization;
- Low-precision communication: Where convergence is not compromised, use low-precision formats for gradient communication to reduce traffic;
- Topology-aware scheduling: Partition communication groups according to the cluster’s network topology (high-speed intra-node interconnects versus inter-node networks), so that high-frequency communication stays on the fastest links as much as possible.
3. The Critical Role of the Software Stack in Adaptation
Hardware provides the compute; the software stack determines whether that compute can actually be used. A mature training-and-inference software stack needs:
- Operator coverage: Attention variants, normalization, expert routing, and other operators involved in multimodal models must all have efficient implementations. Missing operators lead to extensive fallbacks and severe performance degradation;
- Compatible computation graph and compilation capabilities: The ability to perform fusion optimization on the training computation graph, reducing kernel launch overhead;
- Communication library performance: Collective communication primitives need to be deeply tuned for the domestic interconnect architecture;
- Ecosystem compatibility: A smooth integration layer for mainstream training frameworks that lowers model migration cost—ideally achieving “runs with minimal changes.”
The essence of adaptation work is to verify, layer by layer, the correctness and performance of every operator and every communication pattern in the model’s computation graph on the target platform, and to carry out coordinated optimization for each bottleneck.
4. Best Practices for Engineering Implementation
For teams planning to train large models on large-scale domestic compute clusters, we recommend the following path:
- Validate correctness at small scale first: Run the complete training pipeline on a small number of cards with a miniature configuration, align the loss curves, and then scale up gradually;
- Enable optimizations in stages: First make sure it runs, then enable communication overlap, activation checkpointing, low-precision communication, and other optimizations one by one, validating the gains of each;
- Build a comprehensive observability system: Use general-purpose logging services and monitoring/alerting capabilities to continuously collect metrics on memory usage, communication time, and throughput, enabling rapid diagnosis of performance regressions;
- Fault tolerance and checkpoint resumption: At thousand-card scale, hardware failures are the norm. High-frequency distributed checkpoint saving and fast recovery mechanisms are essential.
Conclusion
Adapting trillion-parameter multimodal models for training on domestic compute is a systems engineering effort requiring deep coordination among hardware, system software, and training algorithms. The end-to-end enablement of the full pipeline—from model loading and sharded scheduling to gradient synchronization—demonstrates that domestic compute platforms now have the capability to support frontier large model training. As the fully sharded training paradigm continues to evolve and software stacks keep maturing, enterprises will have more diverse and controllable compute options for building their own large model training systems.
