Multimodal Large Model Training on Domestic AI Compute: A Practical Adaptation and Validation Report
This report examines the practical adaptation of native multimodal large model training on domestic AI compute platforms. It covers the engineering challenges of trillion-scale models that combine long context, joint image-text training, and sparse expert routing; the adaptation of four key modules (attention computation, dynamic expert routing, vision encoding, and cross-modal projection); and a parallel strategy that combines data parallelism, sharded data parallelism, and expert parallelism. It then documents a 400-step validation on a two-node, 16-card setup using a randomly initialized trimmed configuration, reporting training stability, loss curves, memory footprint, and a reusable engineering checklist. The 400-step run is presented as a milestone for pipeline correctness and stability rather than a final assessment of model quality.
1. Technical Background: Why Multimodal Model Training Is Harder
Native multimodal models have become a major direction in large model evolution, and the training system now faces more than just “large parameter count.” It is a systems engineering challenge spanning compute, memory, communication, operators, numerical stability, and data pipelines. When trillion-scale parameters, long context, joint image-text training, and sparse expert routing appear together, any weak link in the training pipeline can cause interruptions, vanishing gradients, out-of-memory errors, or convergence anomalies.
From an architecture perspective, native multimodal models typically combine a language backbone, a vision encoder, a cross-modal alignment module, and a dynamic routing structure. Compared with text-only models, they add at least three sources of complexity:
Higher memory pressure — Vision encoding produces large amounts of intermediate activations, and the long context of the language backbone amplifies attention matrix and cache overhead. If model parameters, gradients, and optimizer states are all concentrated on a single card, memory can easily reach its limit.
More complex communication and scheduling — Multi-card training requires not only data parallelism but also expert parallelism, parameter synchronization, gradient reduction, and cross-modal feature aggregation. If communication and computation cannot overlap effectively, GPU utilization drops noticeably.
Higher numerical stability requirements — In multimodal training, the vision branch, text branch, routing branch, and loss computation are often coupled together. Poor design of attention, routing scores, loss normalization, or gradient update strategies can lead to numerical overflow, loss fluctuation, or gradient anomalies.
Therefore, adapting multimodal training to domestic AI compute platforms cannot stop at “getting it to run.” It must further verify the correctness, stability, and scalability of the entire training pipeline.
2. Adaptation Goals: From “Runnable” to “Trainable and Scalable”
The core goals can be summarized in three layers:
- Functional correctness — The forward pass, backward pass, and parameter updates must form a complete loop, avoiding the problem where the vision branch participates only in inference but not in training.
- Training stability — Over many consecutive steps, there should be no numerical overflow, abnormal interruption, communication timeout, or unrecoverable gradient anomaly.
- Engineering scalability — Building on a verified two-node, 16-card setup, the work should leave room for optimization toward larger parameter scales, higher parallelism, and more nodes.
Around these goals, the adaptation work covers four modules: attention computation, dynamic expert routing, vision encoding, and cross-modal projection. The training flow combines “data parallelism + sharded data parallelism + expert parallelism,” distributing parameters, gradients, and optimizer states across devices to reduce single-card memory pressure.
3. Key Module Adaptation: Breaking the Multimodal Model into Verifiable Engineering Units
1. Attention Computation: Long Context and Numerical Stability
Long context is an important capability of multimodal models but also a major source of memory and compute overhead. If attention computation lacks proper blocking, mask control, or numerical stability handling, memory usage climbs rapidly as sequence length grows.
Key issues to address during adaptation:
- Positional encoding and sequence length alignment — When text and vision tokens are interleaved, positional encoding must stay consistent to avoid position misalignment from interleaved inputs.
- Attention mask correctness — The visibility relationships among vision tokens, text tokens, and instruction tokens must be strictly defined, or the model may learn incorrect context dependencies.
- Numerical stability optimization — In scaled dot-product attention, softmax, and gating structures, use stable normalization to avoid exponential overflow from large values.
- Blocked computation — Blocking long-sequence attention lowers peak memory and improves control over operator and memory-access scheduling.
In practice, the attention module must complete not only the forward pass but also correct gradient backpropagation into parameters. Multimodal models often contain multiple attention branches; if one branch has an always-zero gradient, it is worth checking tensor connections, masks, detach calls, or incorrect scope settings.
2. Dynamic Routing: Load Balancing and Gradient Continuity under Expert Parallelism
Mixture-of-experts (MoE) structures are a key means of scaling parameters, but their engineering difficulty centers on routing and communication. A typical configuration forms a routing network from several experts and activates a subset through Top-k selection. In the configuration used for this validation, the model uses 16 routed experts with Top-8 routing, meaning each token selects a subset of experts for computation.
This structure controls per-token compute while keeping total parameters large, but it introduces new problems:
- Expert load imbalance — If some experts consistently carry too many tokens while others are undertrained, model expressiveness and training efficiency suffer.
- Unstable routing gradients — Routing scores usually depend on logits, softmax, or gating functions; poor scale control causes gradient fluctuation.
- Expert parallelism communication overhead — When experts are distributed across devices, token dispatch and result aggregation add communication that must be co-optimized with compute scheduling.
- Auxiliary loss design — A common approach is to introduce a load-balancing loss or routing smoothing mechanism to avoid expert collapse.
During adaptation, expert routing should be treated not just as an internal model module but as a training-system problem — ensuring both correct routing logic on the model side and synchronized dispatch, reduction, and parameter updates on the system side.
3. Vision Encoding: Ensuring the Vision Branch Actually Participates in Training
One of the most common pitfalls in multimodal training is a vision branch that only extracts features without participating in gradient updates. If the vision tower, image embeddings, or cross-modal projection produce no non-zero gradients, training appears to run, but the model only optimizes the language part and vision understanding does not improve.
To address this, the adaptation specifically checks:
- Whether image patch embeddings enter the language backbone successfully;
- Whether each layer of the vision tower produces gradients;
- Whether the cross-modal projection module completes parameter updates;
- Whether vision loss or cross-modal alignment loss backpropagates correctly;
- Whether the gradient scales of the image and text branches match.
In this validation, the team checked gradient behavior for the vision tower’s image embeddings, its first and last layers, and the cross-modal projection module, confirming that all produced non-zero gradients and parameter updates. This shows the vision encoding is not merely an “input placeholder” but genuinely participates in training.
4. Cross-Modal Projection: The Bridge for Aligning Image and Text Representations
The cross-modal projection module usually maps vision features into the language model’s representation space. It looks structurally simple but is critical in large-scale training. If the projection layer dimensions, normalization, initialization strategy, or gradient updates are inconsistent, image-text alignment suffers and overall convergence can be affected.
Points to focus on during adaptation:
- Dimension alignment between projection input and output;
- Consistency of normalization scale between vision and text features;
- Stability of projection layer gradients;
- Balance between multimodal loss and language loss weights;
- Whether gradients become too large or features collapse in early training.
4. Parallel Strategy: Reducing Single-Card Pressure with Sharding and Expert Parallelism
Trillion-scale models obviously cannot fit the full model, gradients, and optimizer states on a single card, so the training system must rely on parallel strategies. This validation uses a two-node, 16-card environment. The overall approach is: “data parallelism carries samples, sharded data parallelism reduces memory, and expert parallelism supports the routing structure.”
1. Data Parallelism and Sharded Data Parallelism
Data parallelism is the most basic multi-card method: each device processes a different batch and synchronizes gradients after backpropagation. But in large model scenarios, data parallelism alone may still run out of memory. Sharded data parallelism further distributes model parameters, gradients, and optimizer states across GPUs, reducing single-card memory usage.
Benefits of this approach:
- Each card stores only part of the parameters and optimizer states;
- Memory usage shifts from “full model replication” to “sharded storage”;
- Better suited to larger multimodal models;
- Can be combined with expert parallelism, tensor parallelism, and other strategies.
However, sharded parallelism also increases communication complexity. Each step requires parameter gathering, gradient reduction, and optimizer state updates, so communication scheduling and compute overlap are needed to hide wait time.
2. Expert Parallelism and Communication Scheduling
When an MoE structure participates in training, experts are typically distributed across multiple devices. Tokens are routed to the corresponding experts, computed, then aggregated back into the main representation. This process produces multiple cross-card, cross-node communications. If scheduling is poor, GPUs sit idle while waiting for data, hurting overall throughput.
Common optimization directions:
- Prefetch the next round’s parameters;
- Overlap parameter communication with backward computation;
- Merge small messages to reduce communication startup overhead;
- Load-balance hot experts;
- Schedule routing communication and gradient reduction in phases.
On domestic AI compute platforms, the collective communication library must work together with compute operators, memory management, and the scheduler. Adaptation should not focus only on single-operator performance but should observe end-to-end whether communication becomes a bottleneck.
5. Training Validation Configuration: Verifying the Full Pipeline with a Trimmed Model
To verify the training pipeline without full-scale pretraining, this test uses a randomly initialized trimmed configuration. Its value lies in exposing system-level problems quickly at low cost, rather than waiting for full pretraining to complete before surfacing risks.
The validation configuration includes:
- Two servers with 16 domestic AI compute cards in total;
- A language backbone of 13 layers;
- 16 routed experts using Top-8 routing;
- The full 27-layer vision tower retained;
- The cross-modal projection module retained;
- An image-text question-answering dataset;
- A global batch size of 16;
- A sequence length of 1024;
- 400 consecutive optimizer updates.
Though smaller than the full model, this configuration covers the key multimodal training paths: vision encoding, text modeling, expert routing, cross-modal projection, gradient updates, and communication synchronization. It therefore serves as an important validation of pipeline functional correctness.
6. Training Results: 400 Consecutive Steps Confirming Pipeline Stability
The most direct indicator is training stability. In the two-node, 16-card environment, all 16 training processes completed 400 consecutive optimizer updates without numerical overflow or abnormal interruption. This shows the pipeline is usable in terms of basic functionality, numerical safety, and communication synchronization.
The loss curve shows a clear decline:
- Average training loss from step 21 to step 70: 8.9365;
- Average loss over the final 50 steps: 2.1802;
- Validation loss dropped from 6.5297 at step 100 to 4.6873 at step 400;
- Peak device-sampled memory: 44.80 GiB.
These numbers indicate several facts:
The training objective optimizes normally — The falling loss shows gradient updates are not fully failing and that parameters are gradually fitting the data distribution.
Validation improves in step, showing a normal generalization signal — Training and validation loss drop together, indicating optimization has not deviated significantly and that there is no extreme overfitting or divergence.
Peak memory is within a controllable range — A 44.80 GiB peak shows that under the two-node, 16-card setup, sharded parallelism, activation management, and communication scheduling effectively control single-card pressure.
The vision branch truly participates in training — Non-zero gradients and parameter updates in the vision tower’s image embeddings, first and last layers, and cross-modal projection show this is not “pseudo-multimodal”; the vision branch genuinely participates in optimization.
It should be emphasized that this validation uses a randomly initialized trimmed configuration and is not equivalent to full-scale pretraining of the complete model. Its main goal is to verify pipeline functional correctness and stability, not to assess final model quality. The result is better viewed as an engineering adaptation milestone than as a final conclusion on model capability.
7. Key Optimizations: Moving Training from Usable to Efficient
Once the basic pipeline runs, further engineering optimization is needed. This practice covers four areas:
1. Coordinating Sharded Data Parallelism and Expert Parallelism
Sharded data parallelism reduces memory usage for parameters, gradients, and optimizer states, while expert parallelism supports the sparse routing structure. Combining them requires coordinating parameter sharding, expert token dispatch, gradient reduction, and update order. The focus is on avoiding communication serialization and reducing synchronization waits between different parallel groups.
2. Parameter Prefetch and Gradient Communication Scheduling
In large model training, communication often becomes a performance bottleneck. Parameter prefetch lets devices obtain the parameters needed for later steps in advance, and gradient communication scheduling reduces idle time after backpropagation. In engineering, this is usually achieved through compute-communication overlap, batched communication, and hierarchical reduction to raise overall throughput.
3. High-Performance Attention Operators
The attention module is a hot spot for both memory and compute. High-performance attention operators typically focus on:
- Reducing intermediate tensor materialization;
- Blocking long sequences;
- Fusing scaling, masking, and softmax operations;
- Supporting stable forward and backward gradients;
- Remaining compatible with different sequence lengths and batch combinations.
This kind of operator optimization does not necessarily change model semantics, but it can significantly lower peak memory and improve training efficiency.
4. Blocked Loss Computation
When the output vocabulary is large and sequences are long, computing all logits and loss at once greatly increases memory pressure. Blocked loss computation splits the output and loss computation into multiple blocks and accumulates gradients step by step, reducing memory usage while preserving mathematical equivalence. This 400-step test actually enabled blocked loss computation to verify its stability in multimodal training.
8. Engineering Checklist: Quickly Locating Training Pipeline Problems
In multimodal training adaptation, many problems do not raise explicit errors but appear instead as “loss not decreasing,” “vision branch has no gradient,” “memory creeping up,” or “some cards stalling.” A standardized checklist helps:
Check whether gradients exist and are non-zero — Gather gradient statistics separately for the language backbone, vision tower, cross-modal projection, and routing module, to avoid any part not participating in training.
Check for numerical overflow and NaN/Inf — Add numerical checks around attention, routing logits, loss computation, and before and after optimizer updates to catch instability early.
Check communication synchronization — If a card waits on communication for a long time, routing dispatch, parameter sharding, or collective communication may be blocked.
Check peak memory and fragmentation — Beyond total memory, watch peak memory, fragmentation rate, and activation recomputation strategy to avoid out-of-memory appearing only in the middle or later stages of training.
Check validation metrics — Training loss alone is insufficient for judging stability; observe validation loss, gradient norm, learning rate changes, and expert load together.
Improve observability for cloud training — If the task is deployed in a cloud environment, object storage can hold data and checkpoints, a container platform can schedule the training job, and logging and monitoring/alerting capabilities can track GPU utilization, memory, communication time, and task status.
9. Conclusion: The Key to Domestic Compute Training Adaptation Is Full-Pipeline Coordination
This two-node, 16-card, 400-step validation shows that adapting native multimodal large model training to domestic AI compute is not a single-point operator replacement but full-pipeline engineering coordination across model architecture, parallel strategy, communication scheduling, memory management, and numerical stability. Attention computation, dynamic expert routing, vision encoding, and cross-modal projection must all connect uniformly to the forward, backward, and parameter update flows to truly ensure effective multimodal training on domestic AI compute platforms.
The 400-step validation under a randomly initialized trimmed configuration also offers a low-cost, reusable engineering method: first verify pipeline correctness, then gradually scale up to larger parameter counts, longer context, and higher parallelism. For large model training teams, this progressive validation path — from “functionally usable” to “stably converging” to “efficiently scalable” — is an important practice for reducing training risk and improving adaptation efficiency.
