Training a 2.8 Trillion-Parameter Multimodal Model on a Domestic GPU Platform: An End-to-End FSDP2 Implementation
This article describes the end-to-end adaptation of a 2.8 trillion-parameter multimodal model for training on a domestic full-function GPU platform. It covers native FSDP2 integration, multimodal sharding, asynchronous model loading, topology-aware communication, mixed-precision training, pooled memory management, checkpoint recovery, and scalability validation. The implementation demonstrates how hardware-software co-design can address the memory, communication, scheduling, and reliability challenges of trillion-parameter multimodal training.
1. Background and Challenges: The Technical Depth of Trillion-Parameter Multimodal Training
As large models scale into the trillion-parameter range and incorporate text, images, audio, and other modalities, training infrastructure faces challenges that go far beyond simply adding more compute. Memory management, communication topology, operator optimization, and fault tolerance must be addressed as part of a unified systems engineering effort.
Adapting a 2.8 trillion-parameter model means that the combined memory footprint of model weights and optimizer states can reach hundreds of gigabytes or even terabytes. This far exceeds the physical memory capacity of a single accelerator and requires multiple forms of distributed parallelism to work together.
Common industry approaches combine Tensor Parallelism, Pipeline Parallelism, and Data Parallelism. Fully Sharded Data Parallelism (FSDP) has also become a de facto standard for extremely large model training because of its improved memory efficiency. As its successor, FSDP2 introduces finer-grained parameter sharding and on-demand loading. Each compute device holds only a portion of the model parameters, while complete weights are assembled dynamically during forward and backward computation. This helps overcome the memory limitations of individual devices.
Multimodal models introduce additional complexity. Vision encoders, language decoders, and cross-modal alignment modules often have different compute characteristics and memory-access patterns. Applying a text-model FSDP strategy without modification can leave compute resources idle or create communication bottlenecks. The central challenge is therefore to configure differentiated sharding policies for different modality-specific subnetworks while preserving a smooth end-to-end data flow within a unified training framework.
2. Overall Architecture: Building a Native FSDP2 Multimodal Training Path
To address these challenges, a domestic full-function GPU platform built on its flagship AI training and inference accelerator created a native FSDP2 training path for multimodal models using the MUSA unified system architecture software stack.
This implementation was not a simple port of an existing open-source solution. Instead, it involved systematic reconstruction from the low-level operator libraries to the upper-level scheduler, ensuring close alignment with the underlying hardware architecture.
The overall architecture consists of four layers:
- Infrastructure layer: A cluster of AI accelerators provides heterogeneous computing capabilities and supports inter-node communication over a high-speed interconnect topology.
- System software layer: The MUSA software stack includes the compiler, runtime, and communication libraries. It provides low-level optimizations for the collective communication primitives required by FSDP2, including All-Gather and Reduce-Scatter.
- Framework adaptation layer: FSDP2 interfaces are aligned and extended within mainstream deep learning frameworks, with support for custom sharding logic for multimodal models.
- Model application layer: Based on the architecture of extremely large models such as the Kimi K3.1 Pro class, the implementation connects model loading, sharding, scheduling, and synchronization into a complete training workflow.
The key design principle is native support. FSDP2 semantics are treated as first-class capabilities at the bottom of the software stack rather than being implemented through external patches or compatibility layers.
This shortens the execution path for sharding operations, reduces synchronization overhead, and allows the platform to take better advantage of hardware-level atomic operations and direct memory access.
3. Key Components and Engineering Practices
3.1 Model Loading: Multidimensional Mapping and Asynchronous Prefetching
For a 2.8 trillion-parameter model, the model files may exceed 5 TB when stored using FP8 mixed precision. Model loading cannot rely solely on operating-system virtual memory mapping. A multidimensional mapping strategy between files and devices is required.
In practice, model weights can be partitioned by layer and tensor dimension into multiple shard files. Each compute node loads only the shards assigned to it.
The loading process uses a pipeline. While the first group of shards is read from storage, such as a parallel file system or object storage, the second group is undergoing CPU-side format conversion, including byte-order adjustment and quantization-format decoding. At the same time, the third group is being copied into GPU memory over a high-speed bus.
This asynchronous pipeline removes much of the I/O wait found in traditional loading approaches. In testing, it achieved effective loading throughput of tens of gigabytes per second per node.
For shared or frozen parameters, such as a pretrained vision encoder, the loading module also needs independent metadata and state tracking. This avoids unnecessary initialization of gradient states and further reduces startup time.
3.2 Shard Scheduling: Hierarchical Policies and Dynamic Balancing
The central scheduling problem in FSDP2 is defining the sharding unit and determining when it should be materialized in the computation graph. In a multimodal model, the visual and language subnetworks may have substantially different computational depths. A uniform sharding granularity would inevitably waste resources.
The scheduling strategy uses a hierarchical design:
- Macro-sharding: Shards are grouped by modality-specific subnetworks, such as the vision tower, projection layers, and language backbone.
- Micro-sharding: Within each macro-shard, parameters are divided more finely according to Transformer layer indices.
The scheduler maintains a global tensor-to-device mapping table and dynamically adjusts the number of shard replicas according to real-time memory consumption and communication-bandwidth utilization.
For example, during the forward pass of the vision encoder, if the scheduler detects that memory allocated to the language backbone is underutilized, it can prefetch parameters for that region and trigger All-Gather operations in advance. This overlaps computation and communication.
The scheduling logic can be conceptually represented as follows:
# Conceptual example only; not a product-specific interfaceclass FSDP2Scheduler:def __init__(self, model_config, device_mesh):self.mesh = device_meshself.macro_units = self._create_macro_units(model_config)def _create_macro_units(self, config):visual_units = [ShardUnit("visual_layer_" + str(i)) for i in range(config.visual_depth)]language_units = [ShardUnit("lm_layer_" + str(i)) for i in range(config.lm_depth)]return {"visual": visual_units, "language": language_units}def schedule_step(self, input_modality):if input_modality == "vision":self._prefetch(self.macro_units["language"][:2])return self.macro_units["visual"]
3.3 Gradient Synchronization: Communication Compression and Topology Awareness
In multi-node training, gradient synchronization, typically implemented through a combination of Reduce-Scatter and All-Gather, often becomes the main bottleneck to scaling efficiency.
For a 2.8 trillion-parameter model, using FP32 gradients would result in more than 11 TB of data during a single global reduction. Even over a 400 Gbps network, the operation could take tens of seconds.
The implementation introduces two key optimizations.
First, gradient quantization and sparsification. During backpropagation, gradient tensors are processed in blocks. Most blocks are transmitted in FP16 or BF16, while “hot” blocks whose gradient norms exceed a threshold retain FP32 precision. Gradient sparsification is also applied: only the top 1% of elements by absolute value, together with their indices, are transmitted. This reduces the communication volume by approximately one order of magnitude.
Second, topology-aware communication scheduling. The software stack queries the underlying hardware topology, including high-speed interconnect domains and switch hierarchies, and assigns an appropriate communication path to each gradient tensor.
Gradient reductions within the same rack use high-speed direct links, while cross-rack communication is aggregated to avoid repeated transfers. This prevents the traffic congestion associated with conventional broadcast-and-collect patterns.
3.4 Multimodal Feature Alignment and Mixed-Precision Training
Visual and textual features in multimodal models often occupy different numerical distribution ranges. Applying a single loss-scaling policy can cause gradient underflow in the visual branch or gradient overflow in the text branch.
The adaptation therefore integrates a modality-aware loss-scaling module into the FSDP2 framework. It maintains separate dynamic loss-scaling factors for the subnetworks associated with different modalities.
For mixed-precision training, the MUSA software stack provides hardware support for FP8 computation. In particular, its tensor-core matrix multiplication path supports FP8 inputs with FP32 accumulation natively.
This allows high-dimensional operations in the vision tower to run at throughput close to twice that of FP16, while experiments showed that the resulting accuracy impact remained within an acceptable range. On key evaluation datasets, the decrease in metrics did not exceed 0.2%.
4. Hardware-Software Co-Optimization and Performance Analysis
4.1 Overcoming the Memory Wall with Pooled Memory Management
Another major challenge in trillion-parameter training is the loss of effective capacity caused by fragmented device memory. Frequent shard loading and release operations in FSDP2 can generate substantial memory fragmentation.
To address this issue, the platform implements a memory-pooling layer. Device memory is divided into fixed-size reserved blocks and dynamically allocated blocks. Reserved blocks are preferred for repeated parameter transfers, while dynamic blocks are used for routine activation calculations. Asynchronous garbage collection is introduced to avoid memory spikes.
This design increases effective memory utilization from approximately 60% in the traditional approach to more than 85%, equivalent to expanding the usable training capacity of a single device by an additional 40%.
4.2 Checkpoint Recovery and Fault Tolerance
Because training can continue for several weeks, reliable recovery mechanisms are essential.
The implementation provides asynchronous checkpoint saving based on a sharded file system. Parameter shards and optimizer states from each node can be persisted without requiring a global training pause.
If a node fails, the system automatically schedules a replacement node to reconstruct the shards from the latest checkpoint. A “remaining-node gradient replay” mechanism maintains eventual consistency of the training state and avoids the catastrophic scenario of restarting the entire training process from the beginning.
5. Acceptance Criteria and Engineering Benefits
Acceptance testing for the training adaptation covers three categories:
- Scalability: When scaling from 64 to 512 accelerators, training throughput must maintain more than 85% linearity.
- Stability: Training must continue for seven consecutive days without interruption, and the loss curve must show no abnormal fluctuations.
- Convergence: Under the same hyperparameter settings, the convergence curve of the adapted implementation must remain within a very small deviation from that of a mainstream industry baseline platform.
The final results show that the platform successfully connected every major stage of the workflow, from model-weight loading and hierarchical shard scheduling to global gradient synchronization. It established a complete end-to-end training loop for a multimodal large model.
This result is significant for the development of controllable AI computing infrastructure. It demonstrates that a platform based on domestic full-function GPUs and a self-developed software stack can support training workloads at the trillion-parameter scale, providing a solid compute foundation for the continued development of large-model applications.
6. Conclusion and Future Directions
Multimodal models with larger scales, potentially reaching tens of trillions of parameters, and higher-dimensional inputs such as video and 3D point clouds are expected to continue emerging.
Future directions for the current implementation include:
- Combining FSDP2 with sequence parallelism;
- Introducing reinforcement-learning-based searches for automatic sharding strategies;
- Improving memory management for long-sequence inputs.
Further research in these areas will help build large-scale multimodal training infrastructure that is more general, efficient, and elastic.
