Trillion-Parameter Multimodal Training on Homegrown AI Accelerators: Technical Practices
This article examines the system-level requirements for training a 2.8-trillion-parameter multimodal model on homegrown AI accelerators. It covers three main training stages: distributed model loading, FSDP2-based sharding and memory efficiency, and communication-compute overlap for gradient synchronization. It then discusses multimodal-specific sharding and data-pipeline balancing, and summarizes engineering checkpoints for operator coverage, numerical consistency, communication topology tuning, fault tolerance, and observability. The goal is to show which methods are reusable for ultra-large training on heterogeneous compute.
1. Background: Why Trillion-Parameter Model Training Is Hard
Recently, the industry open-sourced a flagship multimodal model with 2.8 trillion parameters, which immediately triggered discussion about whether homegrown compute can support training at this scale. A homegrown AI accelerator vendor announced that its flagship training-and-inference integrated AI accelerator card and self-developed software stack had completed training adaptation for the model, building a native FSDP2 multimodal training path. Setting aside the specific vendor, this event reflects a general technical question: when model scale crosses the trillion-parameter threshold and involves multimodal inputs such as text and vision, at which layers must the training system be designed systematically?
The training difficulties of trillion-parameter models can be grouped into three categories:
- Memory wall: Even with BF16 mixed precision, a 2.8-trillion-parameter model requires about 5.6 TB of memory for weights alone. After adding optimizer states and gradients, traditional data parallelism cannot support it at all.
- Communication wall: The collective communication volume generated by gradient synchronization and parameter reconstruction grows linearly or even superlinearly with the number of cards, making interconnect bandwidth a bottleneck.
- Multimodal complexity: Structural differences between the vision encoder and the language model, along with uneven length distributions across modalities, make load balancing and pipeline scheduling more complex.
2. Overall Training Pipeline: Three Key Stages
A complete ultra-large-scale training adaptation usually has to connect three stages, and none can be omitted.
2.1 Model Loading: From Weight Files to Distributed Shards
The weight files of a trillion-parameter model usually reach tens of TB. The core issue in the loading stage is avoiding any process holding the full weights. The mainstream approach is metadata-driven lazy loading:
- First read the model structure description and the shard layout of each tensor, and assign each process the shard it is responsible for;
- Each process reads only its corresponding weight range through memory mapping;
- For large tensors spanning devices, use a distributed checkpoint format to record split information and support conversion between different parallelism strategies.
An illustrative pseudocode example is as follows:
# Core idea of distributed lazy loadingshard_meta = read_checkpoint_meta(path) # Read metadata onlylocal_tensor = mmap_read(path, shard_meta[rank]) # Each rank reads only its own shardmodel.load_state_dict(local_tensor, partial=True)
This design reduces per-card peak memory from “full model scale” to “model scale / number of shards”, which is the first threshold for whether a trillion-parameter model can start training.
2.2 Shard Scheduling: Memory Efficiency Brought by FSDP2
The core idea of FSDP (Fully Sharded Data Parallel) is: shard parameters, gradients, and optimizer states across cards, temporarily all-gather them when needed for forward/backward passes, and release them immediately after use. Compared with the first-generation implementation, FSDP2 performs precise dimension partitioning for each parameter based on a device mesh and brings several improvements:
- Sharding granularity is refined from “module level” to “tensor level”, making partitioning more uniform and lowering peak memory;
- It is decoupled from mixed precision, gradient checkpointing, CPU offload, and other mechanisms, and can be combined as needed;
- It provides a clearer memory tracing interface, making it easier to locate fragmentation issues.
Taking a trillion-parameter model as an example, a typical memory composition is roughly as follows (illustrative estimate):
| State | Full scale | Per-card footprint after FSDP2 sharding on 256 cards |
|---|---|---|
| Parameters (BF16) | ~5.6 TB | ~22 GB |
| Gradients (BF16) | ~5.6 TB | ~22 GB |
| Optimizer states (FP32) | ~33.6 TB | ~131 GB |
As can be seen, without sharding, no single card can hold the optimizer states; with sharding and high-memory accelerator cards, training becomes feasible. This is also why the combination of “high-memory training-and-inference integrated cards + a fully sharded framework” has become a key route for adaptation on homegrown accelerators.
2.3 Gradient Synchronization: Overlap of Communication and Computation
During backpropagation, after each sharded parameter completes local gradient computation, the gradients need to be reduced and distributed back to each shard through reduce-scatter. The key to an efficient implementation is communication-compute overlap:
- Following the reverse computation order, initiate communication as early as possible for the parameter that was last used;
- Group parameters into buckets and perform communication in batches by bucket, reducing the latency overhead of small messages;
- Use a bucket size limit to control the scale of a single communication and avoid instantaneous bandwidth contention.
# Strategy sketch for communication/compute overlapfor bucket in reverse(param_buckets):bucket.wait_all_gather() # Forward all-gather completeloss = forward_backward(bucket)bucket.async_reduce_scatter() # Asynchronously initiate gradient reduction
In scenarios with limited inter-node interconnect bandwidth, the overlap ratio often directly determines whether training throughput can approach linear scaling.
3. Special Handling for the Multimodal Training Path
Compared with text-only models, multimodal training must also solve two problems.
First, differentiated sharding strategies for heterogeneous modules. The vision encoder usually has far fewer parameters than the language model backbone, but its activations are larger; the language model is the opposite. A reasonable approach is to use lower sharding redundancy on the vision side and full sharding plus activation recomputation on the language backbone, matching their respective memory characteristics instead of applying the same configuration to both.
Second, modality balancing in the data pipeline. Image tokens and text tokens differ greatly in sequence length. If batches are split by sample count, the token load on each card may be severely uneven, causing some cards to sit idle. Common optimizations include:
- Dynamic batch assembly based on token count instead of fixed sample-count splitting;
- Length-based bucketing during data loading and balanced shuffling across ranks;
- Position-aware attention masks for packed sequences to ensure modality boundaries are not contaminated.
4. Engineering Highlights for Adaptation Work
Based on common experience from this type of adaptation practice, the following checklist can be summarized:
- Verify operator coverage first: Run all operators on a small-scale model first, and confirm that the custom acceleration library fully supports key operators such as attention, normalization, and optimizers.
- Align numerical consistency: Compare intermediate activation statistics between the reference implementation and the target hardware to troubleshoot precision anomalies. In mixed-precision scenarios, pay particular attention to loss scale and overflow handling.
- Tune communication topology: Choose the sharding mesh and bucket size based on intra-node and inter-node bandwidth differences, and adjust gradient accumulation steps when necessary to amortize communication overhead.
- Fault tolerance and resumable training: Trillion-scale training cycles are long, so distributed checkpoints need to support asynchronous saving to avoid snapshots blocking training.
- Build observability: Track metrics such as memory watermark, communication ratio, and MFU through monitoring and alerting services, so that anomalies can be quickly traced to specific shards and stages.
5. Conclusion
The significance of homegrown accelerator cards completing training adaptation for a trillion-parameter multimodal model lies not in the single event itself, but in validating a complete technical path: high-memory training-and-inference integrated hardware + a self-developed unified software stack + a native fully sharded parallel framework working together can theoretically support frontier-scale model training. For engineering teams, the truly reusable asset is the method itself: sharding-first memory design, metadata-driven loading, communication-compute overlap synchronization strategies, and multimodal-oriented load balancing. These general practices also apply to ultra-large-scale training on any heterogeneous compute. As the software stack ecosystem continues to mature, the role of homegrown compute in large-model training is expected to move from “usable” to “easy to use”.
