Adapting Trillion-Parameter Multimodal Model Training: Technical Practices from Compute Infrastructure to a Full Training Pipeline
As open-source models scale into the multi-trillion-parameter era, training infrastructure faces unprecedented challenges in memory capacity, communication overhead, and software stack maturity. This article examines how a domestic AI training and inference accelerator was adapted to train a 2.8-trillion-parameter open-source multimodal MoE model using a native FSDP2-based pipeline. From a product-agnostic perspective, it breaks down the key methodologies: FSDP2's sharded training paradigm, the three critical stages of multimodal training (model loading, sharding orchestration, and gradient synchronization), software stack coordination, and practical recommendations for teams reproducing similar work.
Adapting Trillion-Parameter Multimodal Model Training: Technical Practices from Compute Infrastructure to a Full Training Pipeline
1. Background: New Challenges for Training Infrastructure in the Trillion-Parameter Era
The parameter scale of open-source large models continues to climb. Recently, a research organization open-sourced a flagship multimodal model with 2.8 trillion total parameters, marking the open-source community’s formal entry into the “multi-trillion-parameter” era. These models typically adopt a Mixture-of-Experts (MoE) architecture, which dramatically expands model capacity while keeping inference costs manageable—but this imposes unprecedented demands on training-side infrastructure:
- The memory wall: Even in half precision, a trillion-scale model’s weights alone require terabytes of GPU memory—far beyond a single card’s capacity—making multi-dimensional parallel sharding mandatory.
- Communication bottlenecks: The finer the parameter sharding, the higher the frequency of cross-card and cross-node communication. The overhead of gradient synchronization and parameter aggregation becomes the key constraint on throughput.
- Software stack maturity: Distributed training depends not only on hardware compute but on full-stack software coordination—from drivers and communication libraries to training framework adaptation layers. A missing link anywhere breaks the entire training pipeline.
Against this backdrop, a domestic all-in-one AI training and inference accelerator completed training adaptation for this open-source flagship model, building a multimodal training path based on native FSDP2 and connecting the complete training chain from model loading and shard scheduling to gradient synchronization. This practice offers a reference paradigm for running ultra-large model training on domestically developed compute. This article strips away product specifics and analyzes the key methodologies from a general technical perspective.
2. FSDP2: A Parameter-Sharding Training Paradigm for Ultra-Large Models
2.1 From Data Parallelism to Fully Sharded Data Parallelism
Traditional data parallelism (DP) requires each GPU to hold a complete model replica, resulting in severe memory redundancy. The core idea of FSDP (Fully Sharded Data Parallel) is to shard the model’s parameters, gradients, and optimizer states across all devices, so each card holds only a 1/N shard. Full parameters are all-gathered on demand during forward and backward computation and released immediately afterward, reducing memory footprint by nearly an order of magnitude.
2.2 Key Improvements in FSDP2
The new generation of FSDP2 introduces several important engineering improvements:
- Sharded tensors as first-class citizens: Parameters exist in sharded form from initialization (e.g., based on a distributed tensor abstraction), avoiding the memory peak caused by “load fully first, then shard.” This is critical for trillion-parameter models—otherwise, the loading phase alone could overwhelm host memory.
- Finer-grained communication scheduling: Communication-computation overlap is more flexible, supporting per-layer or per-module triggering of aggregation and release to maximally hide communication latency.
- Cleaner composability: It composes naturally with other parallelism dimensions such as tensor parallelism and expert parallelism, accommodating the special expert-distribution requirements of MoE architectures.
# Example: FSDP2-style model sharding (pseudocode)from torch.distributed.fsdp import fully_shardfor layer in model.transformer_blocks:fully_shard(layer, mesh=device_mesh) # shard layer by layerfully_shard(model) # shard the root module# Parameters are automatically all-gathered in forward;# gradients are automatically reduce-scattered in backwardloss = model(inputs)loss.backward()
3. Three Critical Stages of the Multimodal Training Pipeline
3.1 Model Loading: A Shard-First Initialization Strategy
Loading trillion-parameter models can no longer follow the old “single-point load, then broadcast” approach. Common engineering strategies include:
- Lazy initialization with meta device construction: Build the model structure first on a meta device with no actual storage, determining each tensor’s shape and sharding layout;
- Parallel weight reading: Each rank directly reads its own shard in parallel from shared storage; combined with high-speed object storage or a distributed file system, this can compress loading time from hours to minutes;
- Unified checkpoint format: Sharded checkpoints ensure saving and restoring never require re-aggregating the full model, supporting resumed training after elastic scaling.
3.2 Shard Scheduling: Pipelined Orchestration of Computation and Communication
The distinctive feature of multimodal models is their heterogeneous structure: the vision encoder, text backbone, and modality projection layers differ enormously in compute density and parameter count. Sound shard scheduling requires:
- Applying differentiated sharding granularity to different submodules, avoiding a “one-size-fits-all” approach that would make communication overhead disproportionately high for small modules;
- Exploiting idle communication bandwidth during forward computation to prefetch the next layer’s parameters, and interleaving gradient reduction during backward;
- Introducing an expert-parallel dimension for MoE expert routing, and optimizing token dispatch efficiency via all-to-all communication.
3.3 Gradient Synchronization: Communication Libraries and Topology Awareness
Gradient synchronization is the last mile of the training pipeline—and the main battleground for performance tuning:
- Communication primitive selection: All-gather for parameter aggregation, reduce-scatter for gradient averaging, all-to-all for MoE routing—each requires an efficient implementation in the underlying communication library;
- Topology-aware scheduling: Within a node, traffic should prefer high-speed interconnects; across nodes, it travels over RDMA networks. The communication library must be hardware-topology-aware to automatically select optimal paths;
- Gradient compression and mixed precision: Where precision permits, lower-precision communication can significantly reduce bandwidth pressure.
4. Software Stack Coordination: The Key to Unlocking Hardware Capability
An accelerator’s theoretical performance becomes effective throughput only through the software stack. A complete adaptation effort includes: deep optimization of core operators—attention, normalization, MoE routing—in multimodal models at the operator layer; integration with mainstream deep learning frameworks and training frameworks at the framework layer; and orchestration, fault tolerance, and monitoring/alerting for large-scale jobs at the cluster layer via a container platform. Developers building their own training platforms should likewise follow a three-layer “operator–framework–scheduling” validation approach, stress-testing layer by layer to locate bottlenecks.
5. Practical Recommendations and Outlook
For teams seeking to reproduce this kind of adaptation work, we recommend the following path: first validate the correctness of the FSDP2 sharding and communication pipeline on small- and medium-scale models, then progressively scale to the target parameter magnitude; in multimodal scenarios, isolate and validate each modality branch before merging and debugging; and throughout, establish monitoring baselines across three categories of metrics—memory usage, communication time, and MFU (model FLOPs utilization).
As the software ecosystem around domestic compute continues to mature, the barrier to training trillion-parameter multimodal models is falling rapidly, providing a solid foundation for more enterprises and research institutions to participate in frontier model development.
