Verifying a Truncated MoE Multimodal Training Pipeline on Domestic GPUs

    This article describes a validation guide for running a cut-down MoE multimodal training configuration on a two-node, 16-GPU domestic accelerator environment. It covers the system challenges of large-scale MoE multimodal training, the truncated model and parameter-counting scope, the EP plus FSDP parallel strategy, operator parity checks, and memory-budget monitoring.

    1. System Challenges in Very Large-Scale MoE Multimodal Training

    Large language model parameter counts continue to grow, and Mixture-of-Experts (MoE) architectures are widely used to control the amount of computation per step. The total parameter count is large, but only a subset of experts is activated for each token, so activated computation is no longer linearly related to total parameter count. Memory footprint and communication overhead still depend on the total parameter count, expert parallel layout, and routing distribution.

    MoE introduces two system issues. First, with many experts, routing results vary by input, token counts differ across cards, and communication load fluctuates accordingly. Second, routing determines which card each token is sent to, and the communication pattern is difficult to predict in advance.

    Multimodal models must also handle both a vision encoder and a language backbone. The two branches have quite different computation patterns, and a cross-modal projection module connects them. If the operator implementation in any one part is incomplete, training may show numerical anomalies within the first few dozen steps, or memory usage may exceed expectations. Single-card performance metrics are therefore not enough to show whether a platform can support this type of training. Domestic GPU adaptation requires validation of the full training pipeline.

    2. Validation Boundary: The Truncated Configuration Used Here

    This article discusses a truncated training configuration. The target model is designed with a total parameter count of 2.8 trillion, but the model actually run is only a subset of that. The truncated configuration is as follows:

    Item Configuration
    Language backbone 13 layers retained
    Routed experts 16 per layer, 8 activated per token (Top-8)
    Vision encoder Full 27-layer vision tower retained
    Cross-modal projection Fully retained
    Training data Medical image-text question-answering dataset; usage requirements are described in Section 7
    Parameter initialization Random initialization

    The parameter count after truncation is calculated using the following scope. All memory numbers in the report are based on this scope:

    • Total parameter count = token embeddings + non-expert parts of 13 layers + 13 layers × 16 experts + 27-layer vision tower + projection module;
    • Activated parameter count = token embeddings + non-expert parts of 13 layers + 13 layers × 8 experts + 27-layer vision tower + projection module.

    Each token passes through only the Top-8 experts, so the activated parameters of routed experts are about half of the total. This scope is used only for estimation. In actual computation, the per-module parameter statistics in the model construction log should be used.

    3. Two-Node, 16-GPU Environment and Parallel Strategy

    The validation environment is as follows. Items marked “To be filled in” need to be completed according to the actual hardware and software versions and must not reuse data from other platforms.

    Item Content
    Accelerator model To be filled in
    Nodes and cards 2 nodes, 8 cards per node, 16 cards in total
    Intra-node interconnect To be filled in
    Cross-node network To be filled in (bandwidth, protocol, switch configuration)
    Deep learning framework and version To be filled in
    Collective communication library and version To be filled in
    Compute precision bf16 for forward and backward, fp32 for optimizer states (recommended)
    Sequence length and batch To be filled in

    The parallel strategy combines expert parallelism (EP) with fully sharded data parallelism (FSDP):

    • EP size is 16. The 16 routed experts map one-to-one to the 16 cards, so each card holds one expert in each MoE layer, making per-card load inspection straightforward.
    • Dense parameters (attention, vision tower, projection module, etc.) are sharded across 16 cards via FSDP.
    • Top-8 routing means each token is sent to multiple cards. Cross-node all-to-all communication is the main pressure point in this configuration, so Section 6 lists it as a separate check item.

    During backpropagation, parameters in all three parts—the vision tower, the projection module, and the language backbone—should receive non-zero and finite gradients. In the original validation, the vision branch participates in parameter updates, and gradient backpropagation covers both branches. This should be checked after every run.

    4. Operator Parity Checklist

    The basic parity method is as follows: fix the random seed and input shapes, compute forward outputs and backward gradients separately with the domestic GPU implementation and a reference implementation (an fp32 reference or a verified GPU implementation), and then compare the differences. Before running, non-deterministic operators should be disabled, or their switch states should be recorded; otherwise, differences cannot be attributed to implementation errors versus randomness.

    Check object Reference implementation Comparison metric Suggested threshold (to be calibrated by precision) Result
    Attention operator fp32 reference Max absolute error, relative error Relative error below 1e-2 To be filled in
    Routing Top-8 selection Reference implementation Selected expert indices Exactly identical; if scores tie, record the tie-breaking rule To be filled in
    Expert FFN forward fp32 reference Relative error Relative error below 1e-2 To be filled in
    Cross-modal projection fp32 reference Relative error Relative error below 1e-2 To be filled in
    Normalization layer fp32 reference Relative error Relative error below 1e-3 To be filled in
    Backward gradients Reference implementation Gradient cosine similarity Not lower than 0.999 To be filled in
    Communication data Sender-side hash Receiver-side hash and send/receive consistency Exactly identical To be filled in

    The thresholds in the table are starting points, not fixed standards. If precision is set to bf16, first measure the natural error range on the reference platform and then set thresholds accordingly.

    5. Memory-Budget Formula and Numerical Monitoring

    Peak per-card memory is estimated with the following formula:

    M_card = M_w + M_g + M_opt + M_act + M_frag

    The terms are as follows:

    • M_w (parameters) = (P_dense / 16 + L × p_e) × b_w, where P_dense is the dense parameter count, L is the number of MoE layers (13 in this configuration), p_e is the parameter count of a single expert, and b_w is the number of bytes per parameter (2 for bf16).
    • M_g (gradients) = same structure as M_w, with byte count calculated according to gradient precision.
    • M_opt