Trillion-Parameter Multimodal Model Training on Domestic AI Compute: An Adaptation Practice
This article examines the engineering work required to run end-to-end training for a native multimodal model with trillions of parameters on a domestic AI compute platform. It explains why dynamic sparse attention, MoE routing, vision-language joint training, and memory/communication pressure make adaptation difficult; describes a reuse-oriented design based on NeMo AutoModel and FSDP2 with MCCL communication; and reports a two-server, 16-accelerator, 400-step validation using a trimmed, randomly initialized model on MedPix-VQA. Training loss fell from 8.9365 to 2.1802, validation loss from 6.5297 to 4.6873, and per-card peak memory reached 44.80 GiB. The article also covers module-level gradient checks for the vision branch and summarizes the key adaptation areas.
1. Background: Why Training Adaptation for Sparse Multimodal Models Is So Difficult
In recent years, the open-weight model community has seen a growing number of native multimodal models with parameter counts reaching the trillions. These models typically share several characteristics: trillion-scale total parameters, long-context support ranging from hundreds of thousands to millions of tokens, MoE architectures to control inference cost, improved attention structures such as differentiable sparse retrieval (DSA) or gated sparse attention, and simultaneous development of visual understanding and tool-use capabilities.
Consider a trillion-parameter native multimodal model with about 2.8 trillion total parameters and a context window of up to 1 million tokens. Its architecture uses a hybrid attention mechanism combining KDA and Gated DSA, along with MoE expert routing. The direct consequence of this design is that the training pipeline places requirements on the underlying compute platform that go far beyond those of dense models:
- Dynamic sparse retrieval: Attention computation is no longer the standard
softmax(QK^T)Vflow. It requires dynamic token selection and aggregation along the sequence dimension, and the kernel’s memory access pattern is highly irregular. - Expert routing: Top-K routing means each token activates only a subset of experts, causing load imbalance and fluctuations in all-to-all communication volume.
- Vision-language joint training: The vision encoder and language backbone must operate within the same forward/backward graph, and gradients from the cross-modal projection module must be correctly propagated back.
- Memory and communication pressure: Even with sparse activation, the total memory footprint of parameters, gradients, and optimizer states for trillion-scale models remains beyond what a single card can handle.
Therefore, running complete training for such a model on a new compute platform is essentially a comprehensive test of that platform’s software stack maturity. This article uses a two-server, 16-card, 400-step training validation as the thread to break down the key technical steps involved.
2. Overall Training Design: Reuse the Native Pipeline and Minimize Adaptation Cost
For a new model with a complex architecture, the engineering team must first answer a key question: should they rewrite a training framework, or reuse the model author’s original training pipeline as much as possible?
The mature approach is the latter: retain native model definitions and training flows such as NeMo AutoModel, keep the model’s forward, backward, and optimizer update logic consistent with the official implementation, and adapt only the distributed strategy and communication layer for the platform. This has two clear benefits:
- A correctness anchor: Training configurations, hyperparameters, and data formats remain consistent with the native pipeline, so any loss anomaly can be quickly traced to either the platform side or the model side.
- Lower maintenance cost: When the model architecture is upgraded, platform-specific code does not need to be synchronized.
On this basis, distributed training uses FSDP2 (Fully Sharded Data Parallel 2) as the core memory management strategy.
FSDP2 sharding: spreading trillion-scale parameters across multiple cards
The core idea of FSDP2 is to split all three “large objects”—model parameters, gradients, and optimizer states—across different GPUs and temporarily aggregate them only when needed via all-gather:
Per-card resident memory ≈ (parameters + gradients + optimizer states) / N cardsForward: all-gather parameter shards → compute → releaseBackward: all-gather → compute gradients → reduce-scatter gradient shards
For the trimmed configuration in this case—a 13-layer language backbone plus 16 routed experts (Top-8 routing), together with the full 27-layer vision tower and cross-modal projection module—FSDP2 effectively controlled per-card peak memory at about 44.80 GiB, leaving headroom for batch size and sequence length.
Communication layer: MCCL handles cross-card and cross-node coordination
Cross-card and cross-node collective communication is handled by the platform’s in-house MCCL communication library. In the two-server, 16-card scenario, communication pressure mainly comes from three types of operations:
- FSDP parameter/gradient shard synchronization (all-gather / reduce-scatter);
- All-to-all token dispatch and return triggered by MoE expert routing;
- Activation transfer between the vision tower and the language backbone.
MCCL must ensure that these communication operations overlap with computation as much as possible under limited cross-node bandwidth, avoiding idle GPU waiting. This is also one of the core indicators for validating the software stack maturity of a non-mainstream compute platform.
3. Experiment Configuration and Validation Results
Training configuration
This validation used two servers with a total of 16 AI compute cards. Because the goal was to verify the functional correctness of the training pipeline rather than full-scale pretraining, the model used a trimmed configuration with random initialization:
- Language backbone trimmed to 13 layers;
- MoE retains 16 routed experts with Top-8 routing;
- Vision tower retains the full 27 layers, and the cross-modal projection module is fully retained;
- Training data uses the MedPix-VQA image-text dataset;
- Global batch size is 16, and sequence length is 1024.
Key metrics
The 16 training processes completed 400 consecutive optimizer updates with no interruption, no NaN, and no gradient explosion. The convergence details are as follows:
| Metric | Start | End |
|---|---|---|
| Training loss (moving average) | 8.9365 (steps 21–70) | 2.1802 (last 50 steps) |
| Validation loss | 6.5297 (step 100) | 4.6873 (step 400) |
| Per-card peak memory | — | 44.80 GiB |
Training loss dropped by about 75%, and validation loss decreased monotonically in tandem. This indicates that the model was learning the real data distribution rather than memorizing the training set, and that the numerical stability of the training pipeline was acceptable.
Gradient validation for the vision branch
A commonly overlooked pitfall in multimodal training adaptation is that the vision tower may “appear to be running” while producing no effective gradients—for example, when the data pipeline only supplies text, the projection layer is frozen, or visual embeddings are incorrectly detached. The technical team therefore performed module-by-module checks:
- The image embedding layer of the vision tower produced non-zero gradients;
- Parameters in both the first and last layers of the vision tower were updated;
- Both gradients and parameter updates in the cross-modal projection module were non-zero.
This proves that the vision encoding part truly participated in end-to-end training rather than merely acting as an idle data input. For image-text joint training, this kind of validation is a necessary step to confirm that the multimodal pipeline is fully connected.
4. Summary of Key Technical Adaptation Points
In summary, the adaptation work mainly focused on four modules and integrated them into a unified forward, backward, and parameter update flow:
- Hybrid attention computation: Non-standard attention structures such as KDA and Gated DSA need correct and efficient implementations in the platform operator library, including handling irregular memory access for dynamic sparse retrieval.
- MoE dynamic routing: Routing logic, expert dispatch, and load statistics need to run stably on 16 cards, with all-to-all communication and FSDP sharding cooperating without conflicts.
- Vision encoding: Operator coverage and precision alignment for the 27-layer vision tower.
- Cross-modal projection: Ensure that gradients from both image and text modalities converge and propagate correctly at the projection layer.
5. Conclusion and Outlook
It should be emphasized that this validation used a trimmed configuration with random initialization. Its purpose was to verify the functional correctness and stability of the training pipeline, not full-scale pretraining of the complete model. Nevertheless, the signal is clear: for native multimodal models with trillion-scale parameters, hybrid attention, and MoE structures, a new compute platform can also support frontier model training requirements as long as the distributed strategy is well designed, the communication stack is robust enough, and operator coverage is complete.
For engineering teams, the methodology of this kind of end-to-end validation—trimmed configuration, retention of the native pipeline, module-level gradient checks, and loss curves as the final judge—has broad reference value and can be extended to adaptation validation scenarios involving any new model and new hardware combination.
