Multi-Card Training Adaptation for Ultra-Large Multimodal Models on Domestic AI Accelerators

    This article describes how a multi-card training setup was adapted for an ultra-large, open-weight multimodal model running on domestically developed AI accelerator cards. It covers the main training challenges of mixture-of-experts, dynamic sparse attention, and vision-language modules. It also explains the adaptation approach across forward computation, backward propagation, parameter updates, and multi-card synchronization, and reports results from a 400-step test on two machines with 16 cards. Finally, it describes how to confirm that the vision branch takes part in training and outlines next steps for scaling.

    Training a large multimodal model takes more than adding compute cards. The model structure, memory allocation, gradient synchronization, and communication scheduling must form a stable closed loop. When a model combines a mixture-of-experts (MoE) structure, dynamic sparse attention, a vision encoder, and a cross-modal projection module, training pipelines built for dense language models often need to be adapted.

    A training solution for multimodal models on domestically developed AI accelerator cards recently completed a phase of validation. The test ran on two machines with 16 cards in total. It completed 400 consecutive optimizer updates without numerical overflow or unexpected exits of the training process. The vision encoding branch, the cross-modal projection layer, and the language backbone all produced valid gradients. This shows that image information does not stop at the input stage. It actually takes part in parameter optimization. Validation like this matters for scaling up model size, increasing data volume, and extending training to long sequences.

    1. Training Challenges for Ultra-Large Multimodal Models

    This adaptation targets an open-weight, natively multimodal model with trillions of parameters that supports a long context window. The model consists of a language backbone, a vision tower, a cross-modal projection layer, and a mixture-of-experts module. It also uses dynamic sparse retrieval and gated attention.

    Compared with ordinary dense models, this type of model faces four main engineering challenges.

    First, the parameter count is very large. A single card cannot hold the full parameters, gradients, and optimizer states. Even with an MoE structure, inactive experts still need to be managed as parameters. The training framework must control the lifecycle of parameters at a fine granularity.

    Second, expert routing is dynamic. Each input token does not pass through every expert. A routing network selects a subset of experts for each token. Token distribution can vary widely between batches, which can cause uneven expert load, local memory peaks, and communication congestion.

    Third, the computation graph of the multimodal path is more complex. The vision tower often has deep encoding layers, and image features must be projected and fused with the text sequence. If the vision branch is wrongly frozen during the forward pass, or the backward graph is cut off, the language loss may decrease while the vision parameters never update.

    Fourth, cross-node training places higher demands on collective communication. Parameter sharding, gradient reduction, expert data exchange, and optimizer state updates all add communication overhead. If communication cannot overlap with computation, training throughput drops noticeably as the number of devices grows.

    2. Overall Adaptation Approach

    The solution did not redesign the full training framework. It worked within the existing training pipeline and focused on four stages: forward computation, backward propagation, parameter updates, and multi-card synchronization. The core goals were:

    • Keep the native model structure, so hardware adaptation does not change the network semantics;
    • Let the language, vision, cross-modal, and expert modules share one unified automatic differentiation path;
    • Use sharding of parameters, gradients, and optimizer states to reduce per-card memory use;
    • Complete data synchronization across cards and nodes with efficient collective communication;
    • Pipeline the loss computation, parameter prefetching, and gradient communication.

    At the execution level, the training process first splits the input batch across devices using data parallelism. It then assigns each device a portion of the parameters according to the sharding policy. During the forward pass, the parameters for a layer are gathered temporarily only when that layer is computed. After the backward pass, gradients are reduced and stored using the same sharding rules. The optimizer updates only the parameter shards that each device owns. This avoids keeping a full copy of the model state on every card.

    This approach reduces the peak memory use of parameters, gradients, and optimizer states. It also increases the number of parameter fetches and gradient synchronizations. The actual implementation therefore needs to combine parameter prefetching, communication aggregation, and computation overlap.

    3. Handling Mixture-of-Experts and Dynamic Routing

    The test model used a reduced language backbone with a mixture-of-experts configuration. It had 16 routed experts, and each token selected 8 of them for computation. Top-K routing does not mean the computation cost drops by half. Routing, token reordering, cross-card dispatch, and result merging each add cost.

    A complete expert computation flow usually includes the following steps:

    1. The routing network computes expert weights for each token;
    2. The target experts are selected based on those weights;
    3. Tokens are reordered by expert ID;
    4. Tokens are sent to the devices that hold the corresponding experts;
    5. The experts run forward and backward computation;
    6. Results are reassembled according to their original token positions;
    7. The outputs are fused using the routing weights.

    In a multi-card environment, steps 4 and 6 are often the performance bottleneck. If tokens are unevenly distributed, some devices may receive many expert requests while others sit idle. The implementation therefore needs to manage expert capacity limits, token layout, communication packet aggregation, and monitoring of abnormal load.

    Routing weights and expert outputs both take part in backpropagation. If only the language backbone’s loss is checked, there is no way to confirm that the dynamic sparse path actually participates in training. A more reliable approach is to record gradient norms separately for the routing layer, the expert layers, and the output projection layer, then check whether they stay non-zero across several training stages.

    4. Validating the Vision Branch Training Path

    Total loss alone is not enough to judge multimodal training. Whether the vision branch actually updates is an important indicator of whether the training path is complete.

    This test kept the full vision tower and the cross-modal projection module. The results showed that the image embedding layer, the first and last layers of the vision tower, and the cross-modal projection layer all produced non-zero gradients and parameter changes. This indicates that image features, after visual encoding and cross-modal mapping, did influence subsequent language modeling.

    In practice, the vision branch can be validated at four levels:

    • Input validation: Confirm that image tensors take part in computation, and that shape, data type, and normalization are correct;
    • Computation graph validation: Confirm that visual features are not wrongly converted into non-differentiable objects;
    • Gradient validation: Check that gradients exist at different depths of the vision tower;
    • Parameter update validation: Compare parameters before and after optimization to rule out the case where gradients exist but parameters do not change.

    Two claims must be kept apart: “the vision branch participates in training” and “the model has strong visual capability.” The first only shows that the computation and backpropagation path works. It does not prove that the model has completed sufficient pretraining or reached a target accuracy.

    5. Memory Management and Sharding Strategy

    The test ran on two machines with 16