Domestic GPU Completes Trillion-Parameter Multimodal Training Adaptation
This article examines the recent adaptation of a domestic AI chip and its software stack for training an open-weight multimodal model of roughly 2.8 trillion parameters with million-token context support. It breaks down the model-side challenges, including hybrid attention, sparse expert routing, joint image-text training, and ultra-long context, then explains how FSDP2 sharding combined with expert parallelism, optimized operators, and chunked loss computation address memory capacity and peak usage. Test results from a two-node, 16-card setup are shared, along with reusable engineering practices for building a minimal trainable loop and validating stability.
1. Introduction: Why Trillion-Parameter Multimodal Training Is a Compute Testbed
As native multimodal models scale into the trillion-parameter range, training complexity is no longer just about adding more accelerators. An open-weight multimodal model typically combines a language backbone, a vision encoder, cross-modal projection layers, and a sparse expert routing structure, with parameter counts reaching several trillion and context length extending to millions of tokens. Training such models triggers three types of pressure at once: memory capacity pressure, cross-card communication pressure, and numerical stability pressure.
A domestic AI chip and its supporting software stack recently completed training adaptation for an open-weight multimodal model of roughly 2.8 trillion parameters with million-token context support. In a two-node, 16-card environment, the system completed 400 consecutive optimizer updates without numerical overflow or abnormal interruption, and the vision branch produced real gradient updates. This article uses that practice as a thread to extract a reusable engineering methodology.
2. Breaking Down the Model-Side Challenges
- Hybrid attention mechanism. The model uses a mixed design of linear attention and sparse attention: the former reduces long-sequence complexity, while the latter preserves high-resolution information at key positions. The hybrid structure means the operator library must cover both kernel types, and the two differ in sensitivity to numerical range.
- Sparse expert architecture. Expert routing is dynamically sparse, with each token activating only a subset of experts, which leads to load imbalance and All-to-All communication jitter.
- Joint image-text training. The vision tower and the language backbone must share the same forward pass, backward pass, and parameter update flow, and the gradient scale of the cross-modal projection layer differs markedly from the language side.
- Ultra-long context. Million-token context imposes additional demands on peak memory and chunked computation.
3. Parallelism Strategy: Coordinating FSDP2 with Expert Parallelism
The adaptation keeps the native training framework’s automatic model flow. The core idea is to use FSDP2 to shard parameters, gradients, and optimizer states across different GPUs, so each card holds only a sharded copy. This reduces memory usage from “the whole model” to “shards plus temporary aggregation.”
# Example: combining FSDP2 sharding with expert parallelismfrom torch.distributed.fsdp import fully_shardfor layer in language_backbone:fully_shard(layer, mesh=dp_mesh) # shard parameters/gradients/optimizer statesfor expert in moe_layer.experts:fully_shard(expert, mesh=ep_mesh) # expert-dimension parallelism
Cross-card and cross-node communication is handled by the collective communication library. In engineering practice, parameter prefetching and gradient communication scheduling hide All-Gather and Reduce-Scatter behind computation, reducing the exposed communication ratio. When expert parallelism works together with data sharding, global consistency of routing results must be guaranteed to avoid duplicate computation and misaligned weight updates.
4. Key Operators and Memory Optimization
- High-performance hybrid attention operators. Kernels are optimized separately for linear attention and sparse attention to reduce intermediate tensor materialization.
- Chunked loss computation. Loss computation over the large vocabulary is split into chunks, avoiding materializing a giant
[batch, seq, vocab]logits tensor at once. This option was enabled in the 400-step test. - Memory reuse for the vision encoding and projection modules. With the vision tower keeping all its layers, image embedding activations must share a memory pool with the language side, balancing peak usage through sharding and recomputation.
5. Experimental Setup and Result Interpretation
The test used two servers with a total of 16 training-and-inference compute cards. On the model side, it used a 13-layer language backbone, 16 routed experts with Top-8 routing, and kept the full 27-layer vision tower plus cross-modal projection. The data was an image-text question-answering set, with a global batch size of 16 and a sequence length of 1024.
- Training loss: mean of 8.9365 over steps 21–70, dropping to 2.1802 over the last 50 steps.
- Validation loss: 6.5297 at step 100, 4.6873 at step 400.
- Peak memory: 44.80 GiB sampled on a single device.
- Stability: 16 training processes completed 400 consecutive updates with no numerical overflow or interruption.
It is worth emphasizing that this validation used a randomly initialized, trimmed configuration. The goal was to verify functional correctness and stability of the pipeline, not full-scale pretraining of the complete model. Non-zero gradients appeared in the vision tower image embeddings, the first and last layers, and the cross-modal projection, indicating that the vision branch genuinely participated in training.
6. Reusable Engineering Conclusions
- First get a “minimal trainable loop” working, then gradually restore the model’s full structure.
- Use sharded parallelism to solve capacity problems, and operators plus chunked computation to solve peak-memory problems.
- Use three acceptance metrics: non-zero gradients, monotonically decreasing loss, and controllable peak memory.
- For cloud deployment, use a container platform to schedule multi-node jobs, object storage to hold datasets, monitoring and alerting to track loss and memory curves, and a logging service to retain training traces.
