Adapting a Domestic GPU for Trillion-Parameter Multimodal Training: A Practical Methodology

    This article examines a real-world adaptation of a domestic GPU and its software stack for training an open-weight native multimodal model with roughly 2.8 trillion parameters. It explains why multimodal MoE training is harder than text-only training, breaks down the four core adaptation modules, and details the parallel strategy, numerical stability techniques, and memory optimizations used in a 400-step validation run on 16 cards across two nodes. Readers will find configuration logic, key loss and memory results, and a verification method that confirms the vision branch actually participates in training.

    1. Introduction: Why Trillion-Parameter Multimodal Models Strain the Training Foundation

    Since 2025, native multimodal large models have evolved rapidly from a “text-first, vision-as-an-addon” stitching architecture into a native form that models text and image tokens in a unified way. These models typically reach a total parameter count in the trillion range, support context lengths of up to a million tokens, and commonly adopt a Mixture-of-Experts (MoE) design together with new hybrid attention mechanisms. Four factors stack on top of each other—parameter scale, sparse routing, dynamic retrieval, and joint text-image training—so the training process simultaneously pushes hard on compute density, memory capacity, and multi-card communication efficiency.

    On November 16, a domestic GPU vendor announced that its flagship AI training-and-inference accelerator card and in-house software stack had completed the training adaptation of an open-weight native multimodal model (about 2.8 trillion total parameters, support for up to 1 million tokens of context, a hybrid attention and MoE architecture, and visual understanding plus tool-calling capabilities). In a two-node, 16-card environment, the setup completed 400 consecutive training steps without numerical overflow or abnormal interruption, and the vision branch achieved real gradient updates. Using this practice as a sample, this article abstracts a reusable methodology for adapting ultra-large-scale multimodal training.

    A boundary needs to be stated up front: this validation used a randomly initialized, trimmed configuration. The goal was to verify the functional correctness and numerical stability of the training pipeline, not to run full-scale pretraining of the complete model. This distinction is essential for understanding all the data that follows.

    2. Why Multimodal MoE Training Is Harder Than Text-Only Training

    2.1 Load Imbalance from Dynamic Sparsity

    In an MoE architecture, each token is routed by a routing network to the Top-K experts that process it. Routing results are data-dependent, so the number of tokens each expert receives fluctuates sharply between steps. Load imbalance shows up as two problems: first, some devices are compute-saturated while others idle, and end-to-end throughput is held back by the slowest device; second, all-to-all communication volume changes with the routing distribution, making it hard to hide latency with a fixed communication primitive.

    2.2 Memory Structure Differences in Joint Text-Image Training

    The vision tower processes image patch sequences, and its activation memory is strongly correlated with image resolution and patch count; the language backbone processes text tokens, and its activation memory is correlated with sequence length. The two alternate forward passes within the same step, so memory usage shows a bimodal pattern, with the peak appearing near the cross-modal projection and fusion layers. If batch size and recomputation strategy are set based on text-only experience, it is easy to trigger OOM in the vision branch.

    2.3 Operator Gaps in Hybrid Attention

    New hybrid attention mechanisms (such as a combination of linear attention/gated sparse attention with standard attention) often lack highly optimized backward operators in training frameworks. Falling back to a generic implementation leads to a large number of stitched-together small operators, bloated intermediate results in memory, and numerically unstable backward passes—a common root cause of “loss turns into NaN after a few dozen steps.”

    3. The Four Core Modules of the Adaptation

    This adaptation did not change the model semantics. Instead, it centered on four engineering modules and wired them into a unified forward, backward, and parameter-update flow:

    1. Attention computation: Complete the forward/backward operators for the hybrid attention structure, ensuring gradients from the gated and sparse branches can propagate back.
    2. Dynamic routing: Handle expert bucketing, capacity factor, and token reordering, ensuring token order is reversible before and after routing and gradients stay aligned.
    3. Vision encoding: Fully wire the vision tower into the computation graph rather than treating it only as data preprocessing.
    4. Cross-modal projection: Align the vision feature dimension with the language hidden dimension, ensuring the projection layer’s parameters enter optimizer state management.

    Together, these four points solve one essential problem: the “non-text parts” of a multimodal model are easily simplified into inference-style forward passes during adaptation, so the model appears to run but does not actually learn.

    4. Parallel Strategy: Coordinating FSDP2 with Expert Parallelism

    The training scheme kept the model library’s native AutoModel flow and did not introduce a private model definition, which significantly lowers the maintenance cost of following future model version upgrades. Parameters, gradients, and optimizer states are sharded across different GPUs via FSDP2, so each card only holds a parameter shard, and memory pressure drops from “the whole model” to “shard + activations.”

    Cross-card and cross-node communication is handled by the collective communication library, and its scheduling needs to overlap with computation. Practices that worked well include:

    • Parameter prefetching: While the backward pass computes the current layer, prefetch the parameter shards needed for the next batch ahead of time to hide communication latency.
    • Gradient communication scheduling: Interleave reduce-scatter with backward computation in buckets to avoid idle gaps at the communication tail.
    • Combining expert parallelism with sharded parallelism: Split the expert dimension across device groups, then shard parameters within each group to reduce the proportion of cross-node all-to-all traffic.

    Illustrative configuration logic (pseudocode, expressing strategy intent only):

    1. # Sharding strategy: language backbone and vision tower both under FSDP2
    2. fsdp_config = {
    3. "reshard_after_forward": True, # release shards after forward to lower peak
    4. "param_prefetch": True, # prefetch parameter shards during backward
    5. "reduce_dtype": "bfloat16", # low-precision communication, main precision compute
    6. }
    7. # Expert parallelism: routed experts split by device group, then sharded within group
    8. parallel_plan = {
    9. "expert_parallel_size": 8,
    10. "fsdp_group": "intra_node", # keep sharding within the node where possible
    11. "all_to_all_backend": "mccl",
    12. }

    5. Numerical Stability and Memory Optimization: Two Easily Overlooked Details

    5.1 The Necessity of High-Performance Attention Operators

    If hybrid attention lacks a fused operator, the backward pass has to store a multiplied amount of intermediate tensors. A fused implementation merges softmax, gating, and output projection, which both reduces intermediate memory results and avoids the accumulation error from multi-stage computation. This is a prerequisite for long-sequence training stability.

    5.2 Chunk Loss: Chunked Loss Computation

    The vocabulary size in a trillion-parameter model is usually very large. Computing logits for the full sequence at once makes memory overhead proportional to sequence length and vocabulary size. Chunked loss computation splits the sequence into segments, computes logits and cross-entropy chunk by chunk, and accumulates gradients, reducing peak memory from O(seq × vocab) to a constant level. This option was enabled in the 400-step test.

    6. Experimental Configuration and Result Interpretation

    The test environment was two servers with a total of 16 accelerator cards. The model used a 13-layer language backbone, 16 routed experts (Top-8 routing), and retained the full 27-layer vision tower and cross-modal projection module. Training data was an image-text question-answering dataset, with a global batch size of 16 and a sequence length of 1024.

    Key results:

    • 16 training processes completed 400 consecutive optimizer updates with no interruption and no numerical overflow;
    • Training loss dropped from an average of 8.9365 over steps 21–70 to 2.1802 over the last 50 steps;
    • Validation loss dropped from 6.5297 at step 100 to 4.6873 at step 400;
    • Peak sampled device memory was 44.80 GiB.

    There are three points to interpret. First, the monotonic loss decrease with no spikes indicates that the combination of mixed precision, gradient clipping, and sharded communication is numerically reliable under this configuration. Second, the validation loss dropped less than the training loss, which matches the expectation for a trimmed small-configuration model and should not be extrapolated into a conclusion about convergence quality. Third, the 44.80 GiB peak appeared near the vision branch and fusion layers, indicating the memory bottleneck comes from multimodality rather than the language backbone, so future scaling should prioritize adjusting recomputation and chunking strategies on the vision side.

    7. How to Verify the Vision Branch Actually Participates in Training

    This is the most engineering-valuable part of the practice. The verification method checks whether parameters produce non-zero gradients and real updates:

    1. # Sample-check vision-side parameters
    2. for name, p in model.named_parameters():
    3. if "visual" in name or "projection" in name:
    4. grad_norm = p.grad.norm().item() if p.grad is not None else 0.0
    5. update_norm = (p - p_before[name]).norm().item()
    6. assert grad_norm > 0 and update_norm > 0, f"{name} did not participate in training"

    The check covered the vision tower’s image embeddings, the first and last layers, and the cross-modal projection module; all showed non-zero gradients and parameter updates. This rules out the hidden failure where “vision input only goes through the data pipeline and never enters the computation graph.” Any multimodal training adaptation should include this check in its admission checklist.

    8. Engineering Takeaways and Deployment Recommendations

    1. Keep the native model flow: Not changing the model definition gives the lowest adaptation cost and the smoothest upgrades.
    2. Prioritize communication-computation overlap over simply scaling up: The gains from parameter prefetching and gradient bucketing scheduling usually exceed those from adding nodes.
    3. Locate memory optimization by branch: Distinguish the peak sources on the language side and the vision side, and apply recomputation and chunked loss separately.
    4. Move stability verification earlier: Short continuous training (hundreds of steps) plus a non-zero gradient check is a necessary gate before going live.
    5. State the validation boundary clearly: Functional validation of a trimmed configuration is not equivalent to full-scale pretraining results, and external statements must distinguish the two strictly.

    Against the backdrop of a continuously improving domestic compute ecosystem, this three-layer coordinated adaptation method spanning “chip—software stack—model structure” is becoming a common paradigm for large-model engineering teams to evaluate the usability of a compute foundation.