How to Adapt Domestic AI Accelerators for Trillion-Parameter Multimodal Training

    Adapting domestically produced AI accelerators to trillion-parameter multimodal training is far more than getting a model to "run" on new hardware—it requires proving that the chip, drivers, communication libraries, framework, operators, and training strategy stay stable over long training runs. This article explains why trillion-parameter multimodal workloads are harder to train, how to choose a parallelism strategy (and when FSDP is and isn't the right fit), how to build a complete reproducible and observable training pipeline, and what to watch when adapting the software stack. It also provides layered verification, stop criteria, and engineering practices to help teams avoid common pitfalls before scaling out.

    Conclusion First: Which Scenarios Suit This Adaptation Approach?

    Before diving into the training pipeline itself, it is worth defining where this approach applies. Adapting trillion-parameter multimodal training to domestic AI accelerators is not just about “running the model on domestic hardware.” It means verifying that the chip, drivers, communication libraries, framework, operators, and training strategy remain stable throughout long training runs.

    Suitable scenarios typically include:

    • The domestic accelerator and training framework have already reached a baseline level of adaptation, and driver, firmware, and communication library versions are reproducible;
    • The cluster offers fast intra-node interconnect and a reasonably stable inter-node network;
    • The team can perform operator-level numerical alignment, communication profiling, and checkpoint recovery validation;
    • The training goal is long-horizon, large-scale, joint multimodal optimization—not a one-off short demo.

    Unsuitable scenarios include:

    • Insufficient network bandwidth, where collective communication easily times out or retransmits frequently;
    • Key operators lack usable implementations, or their numerical results cannot be aligned with a reference implementation;
    • No checkpointing, logging, monitoring, or failure-rollback mechanisms;
    • You only want to quickly validate a single-card forward pass, with no concern for later scaling.

    Recommended validation gates should cover at least three levels:

    1. Single-card operators run correctly, with numerical error within an acceptable range;
    2. Single-node parallelism converges, with normal gradient synchronization and loss curves;
    3. After multi-node scaling, throughput, memory usage, communication overhead, and checkpoint recovery all meet the training targets.

    Only when these gates are met is it appropriate to scale further to trillion-parameter training.

    1. Why Is Trillion-Parameter Multimodal Training Harder?

    When the model size reaches the trillion-parameter level while simultaneously handling text, images, audio, video, and other modalities, training complexity rises sharply. The main difficulties concentrate in three areas.

    1. An obvious memory bottleneck

    A single accelerator card can hardly hold the full set of parameters, gradients, and optimizer states. Taking mixed-precision training as an example, parameters, gradients, optimizer momentum, and some intermediate activations all consume substantial memory. Without a sharding mechanism, the model cannot be trained stably on limited devices.

    2. Communication overhead becomes a key constraint

    Distributed training requires frequent switching between computation and communication. If the partitioning granularity is unreasonable, or the communication topology does not match the available network bandwidth, communication time may exceed computation time and drag down overall throughput.

    3. Multimodal data heterogeneity adds scheduling complexity

    Different modalities have different tensor shapes, encoding paths, and loss functions. Branches such as text encoders, vision encoders, and audio encoders may all exist simultaneously. The training pipeline needs unified scheduling and must ensure gradients are correctly propagated across modality branches.

    For this reason, multimodal training adaptation on domestic accelerators is not merely framework adaptation—it is systems engineering.

    2. How Should You Choose a Parallelism Strategy? Is FSDP Suitable for Trillion-Parameter Models?

    Comparison of common parallelism methods

    Parallelism Memory saving Communication overhead Implementation complexity Suitable scale
    Data parallelism Low Low Low Small to medium scale; model fits on a single card
    Tensor parallelism Medium High High Intra-layer or operator-level splitting; needs fast intra-node interconnect
    Pipeline parallelism Medium Medium High Layer-wise splitting; must handle pipeline bubbles
    Fully Sharded Data Parallelism (FSDP) Relatively high Medium to high Medium Sharding of parameters, gradients, and optimizer states
    Combined parallelism High Depends on the combination High Trillion-parameter, multimodal, expert models, etc.

    The core idea of FSDP

    Fully Sharded Data Parallelism (FSDP) goes a step beyond data parallelism by further splitting parameters, gradients, and optimizer states. During forward and backward computation, it temporarily gathers the complete parameters of one layer or block on demand and releases them immediately after use, reducing per-card memory pressure.

    Pseudo-code:

    1. for block in model.blocks:
    2. all_gather(block.params) # Gather the full parameters of this block on demand before computation
    3. output = block.forward(input)
    4. release(block.params) # Release immediately after use to reduce the peak memory footprint
    5. # During backward pass, gather parameters in reverse; after computation, reduce_scatter the gradient shards

    The boundaries of FSDP

    FSDP is not a one-size-fits-all solution. For trillion-parameter models, it usually needs to be combined with tensor parallelism, pipeline parallelism, expert parallelism, sequence parallelism, or context parallelism.

    FSDP can approach near-ideal scaling only under the following conditions:

    • A single layer or block’s parameters can be evenly carried across multiple cards after sharding;
    • High-bandwidth intra-node interconnect is available to support frequent parameter gathering;
    • The sharding granularity has been tuned to avoid too many small shards causing communication amplification;
    • The communication share is kept within an acceptable range of total training time;
    • Activation recomputation, gradient accumulation, and checkpoint strategies match the sharding strategy.

    If the network bandwidth is insufficient, or the model has many expert branches, long-sequence context, or cross-modal fusion modules, FSDP alone often cannot achieve ideal throughput. In that case you need to design a combined parallelism scheme rather than simply increasing the number of FSDP shards.

    3. How Do You Build a Complete Training Pipeline?

    A reproducible, observable large-scale training pipeline usually needs to cover model loading, sharding and scheduling, forward and backward passes, gradient synchronization, checkpoints, and fault tolerance.

    1. Model loading and conversion: ensure weights, versions, and environment are consistent first

    At the loading stage, you need to pin down the framework version, the domestic software stack version, the weight format, and the precision format. It is recommended to record:

    • Training framework version;
    • Domestic accelerator driver and firmware version;
    • Communication library version;
    • Operator library version;
    • Model weight format;
    • Weight naming/mapping rules;
    • Parameter precision (e.g., BF16, FP16, FP32).

    Weight formats may include safetensors, bin, pt, or other custom formats. Before loading, perform structure validation and dtype validation.

    An example validation command could look like:

    1. python tools/check_model.py \
    2. --weights ./model_weights \
    3. --expect-dtype bf16 \
    4. --format safetensors \
    5. --rank-mapping ./rank_mapping.yaml

    Suggested pass criteria include:

    • All weight keys map correctly to the target parallelism structure;
    • Parameter shapes match the target model;
    • Parameter dtypes match the training precision;
    • Zero missing keys and zero extra keys;
    • Randomly sampled tensors match the reference implementation with no anomalies;
    • The first-step loss after loading falls within a reasonable range.

    If the model includes multimodal encoders, also check that the weight mapping for text, vision, audio, and other branches is correct, so that a modality branch is not silently skipped.

    2. Sharding and scheduling: judge whether the partitioning is reasonable using executable metrics

    Sharding and scheduling cannot rely on experience alone; you should provide decidable criteria.

    First, judge the sharding granularity.

    If the parameters, gradients, or optimizer states of a single layer exceed the per-card memory budget, you need to split by layer, by block, or by tensor dimension. If a single layer fits but the total parameter count is too large, you at least need to shard parameters, gradients, and optimizer states.

    Second, estimate the per-step communication volume.

    all-gather and reduce-scatter during each training step incur communication overhead. The communication volume is usually related to the total parameter count, the byte size of the parameters at the given precision, and the sharding structure. Estimate it along these lines:

    1. Per-step parameter communication ≈ total parameters × bytes per precision × communication factor

    Here, all-gather restores the complete parameters before computation, and reduce_scatter reduces gradients after the backward pass. The communication factor depends on the parallelism method, sharding granularity, and whether recomputation is enabled.

    If the communication share is too high, reduce frequent small shards, merge consecutive layers, or switch to a coarser scheduling block.

    Third, evaluate the minimum required interconnect bandwidth.

    Estimate the required bandwidth from the target throughput, the model’s communication volume per step, and the number of iterations. Fast intra-node interconnect should preferentially serve high-frequency communication such as tensor parallelism and intra-layer parameter gathering; the inter-node network is better suited to lower-frequency shard synchronization and checkpoint transfers.

    A simple rule of thumb: if the communication share stays persistently above an acceptable training threshold—for example, 20% to 30%—you should prioritize optimizing sharding granularity, communication topology, or the parallelism combination rather than blindly adding more cards.

    Fourth, determine the layer-release strategy.

    In the forward pass, parameters can be gathered per block and released immediately after computation; in the backward pass, they are gathered on demand. If memory pressure is high, combine this with activation recomputation to trade compute for memory. But recomputation increases computation time, so you must weigh it against your memory headroom and throughput targets.

    3. Forward and backward computation

    In multimodal training, modality branches can execute in parallel, but keep in mind:

    • Each branch’s outputs must be aligned to the fusion layer;
    • Loss functions must be aligned in scale;
    • Gradient backpropagation must avoid truncating certain modality branches;
    • Activation recomputation boundaries should be set sensibly to avoid excessive repeated computation.

    4. Gradient synchronization

    After the backward pass, gradients are usually reduced per shard via reduce-scatter, and then the optimizer updates parameters on its own shards. Before entering the next iteration, the full parameters are restored via all-gather as needed.

    During gradient synchronization, focus monitoring on:

    • Whether the gradient norm is abnormal;
    • Whether NaN or Inf appears;
    • Whether all shards update in sync;
    • Whether communication times out;
    • Whether optimizer states are saved completely.

    5. Checkpoints and fault tolerance

    Long training runs must take checkpoints seriously. The checkpoint frequency should be determined by the training step count, the cost of failures, and recovery speed. At minimum, record:

    • Model parameter shards;
    • Optimizer state;
    • Learning rate scheduler state;
    • Random seeds;
    • Data loading position;
    • Current training step;
    • Completed logs and metrics.

    Recovery acceptance should confirm: the loss curve is continuous after recovery, the learning rate state is consistent, optimizer states have no missing pieces, the data loading position is correct, and the training step count does not roll back to cause duplication or gaps.

    4. Key Points for Adapting the Domestic Accelerator Software Stack

    1. Operator coverage and numerical alignment

    Missing operators are among the most common problems when adapting to domestic accelerators. Key operators—attention, normalization, positional encoding, loss computation, mixture-of-experts routing, activation functions—all need to be confirmed to have a corresponding implementation on the target hardware.

    Numerical alignment testing cannot look only at “it runs”—it must look at “whether the results are trustworthy.”

    It is recommended to establish an operator inventory and error criteria:

    • Reference tensors: generated using the upstream implementation, a CPU reference implementation, or a high-confidence precision implementation;
    • Relative error: measures the proportion of numerical deviation;
    • Absolute error: helps detect anomalies in small-value regions;
    • Failed-sample archive: stores input shapes, random seeds, operator version, hardware topology, and logs.

    Error thresholds should be set according to the operator and precision. For example, in BF16 or FP16 training, ordinary element-wise operators can initially use a looser threshold, while operators more sensitive to numerical stability—normalization, attention, loss functions—need their own stricter thresholds.

    Pass criteria should include:

    • All key operators are included in the inventory;
    • Reference inputs and test inputs are fixed and reproducible;
    • Both relative and absolute error are below the set thresholds;
    • Failed samples can be archived and reproduced;
    • The same operator produces consistent results on a single card and across multiple cards.

    2. Communication library adaptation

    Collective communication primitives include all-gather, reduce-scatter, all-reduce, and others. Adaptation needs to consider:

    • Whether communication matches the hardware interconnect characteristics;
    • Whether there are frequent small-message sends;
    • Whether timeouts, retransmissions, or deadlocks occur;
    • Whether the communication library parameters are tuned for the domestic hardware;
    • Whether inter-node communication can overlap with computation.

    If communication frequently times out, first check the network topology, NIC status, communication library parameters, and rank mapping—rather than directly increasing the number of training cards.

    3. Precision and stability

    Mixed-precision training is prone to numerical overflow, gradient anomalies, and loss spikes. It is recommended to monitor:

    • Whether the loss shows continuous anomalies;
    • Whether the gradient norm suddenly spikes;
    • Whether parameter updates produce NaN or Inf;
    • Whether the modality loss weights become imbalanced;
    • Whether the learning rate matches the current training phase.

    You can enable mechanisms such as gradient clipping, loss scaling, outlier filtering, and automatic rollback. For multimodal training, since different modalities have different loss scales, you may need to dynamically adjust the loss weights.

    4. Performance profiling

    Performance profiling should form a closed loop:

    1. Record throughput, memory usage, and communication share;
    2. Locate the compute bottleneck or communication hotspot;
    3. Adjust sharding granularity, the parallelism combination, or the recomputation strategy;
    4. Regression-verify precision and stability.

    5. Common problems table

    Problem Possible cause Suggested handling
    Missing operator Software stack does not cover the target operator Use an equivalent implementation or write the operator
    Numerical deviation too large Precision strategy or implementation mismatch Fix reference tensors and adjust thresholds
    Collective communication timeout Network topology or communication parameter anomaly Check rank mapping and network status
    Precision overflow Learning rate too high or loss scaling anomaly Enable gradient clipping and automatic rollback
    Checkpoint recovery failure Missing shard metadata Add metadata validation and recovery testing
    Imbalanced multimodal loss Different modality loss scales Adjust loss weights or normalization

    5. Engineering Practices: How to Avoid Pitfalls in Long Training Runs?

    1. Set stop criteria for small-scale alignment first

    Before training on the full cluster, validate precision and convergence with a small-scale model first. But you cannot just watch “the loss is going down”—you must set clear stop criteria.

    At minimum, include:

    • Loss anomaly: the loss rises by more than a set proportion over several consecutive steps, or is clearly above baseline;
    • Gradient norm anomaly: the gradient norm exceeds a set multiple of its historical mean, or keeps growing;
    • Throughput drop: throughput falls below a certain proportion of baseline across several consecutive windows—for example, below 80%;
    • OOM: when a memory overflow occurs, save the latest checkpoint and diagnostic logs—do not just restart;
    • NaN or Inf: when a non-finite value appears, stop the current training immediately and roll back to the latest healthy checkpoint;
    • Checkpoint recovery acceptance: after recovery, the loss, learning rate, optimizer state, and training step should stay consistent, with allowable error within a preset range.

    These stop criteria help teams avoid wasting resources for a long time in the wrong environment.

    2. Layered verification

    Verify in the following order:

    1. Single-card operators are correct;
    2. Single-card model forward and backward work correctly;
    3. Single-node data parallelism works correctly;
    4. Single-node FSDP or combined parallelism works correctly;
    5. Multi-node communication is stable;
    6. The complete multimodal training pipeline converges;
    7. Scale up to the target size.

    Keep logs and acceptance records at every layer.

    3. Build observability in

    During training, continuously monitor:

    • Per-step throughput;
    • Memory usage;
    • Communication time;
    • Computation time;
    • Loss values;
    • Gradient norm;
    • Learning rate;
    • Checkpoint save and load status;
    • Loss for each modality branch.

    Only when metrics are observable can problems be located quickly.

    4. Fix reproducibility

    It is recommended to pin down:

    • Random seeds;
    • Data order;
    • Data sampling strategy;
    • Checkpoint format;
    • Framework and software stack versions;
    • Parallelism strategy configuration;
    • Key operator implementation versions.

    If results are not reproducible, subsequent tuning and troubleshooting become very difficult.

    Conclusion: What Should You Do First for Trillion-Parameter Multimodal Training on Domestic Accelerators?

    Many teams ask: How do you do trillion-parameter multimodal training on domestic accelerators? What common mistakes are there? What should you focus on when selecting components?

    A sound path is: validate operators and versions first, then validate single-node parallelism; confirm sharding/scheduling and the communication budget first, then design large-scale combined parallelism; establish small-scale stop criteria first, then scale to the trillion-parameter level.

    Common mistakes include:

    • Focusing only on whether the model loads, not on whether the numbers align;
    • Focusing only on getting a single card to run, not on the inter-node communication share;
    • Only scaling the number of cards without optimizing sharding granularity;
    • Saving only the model, not the optimizer and scheduler states;
    • Logging only the loss, not the gradient norm and communication metrics.

    For developers and engineering teams, mastering this “validate first, shard second, scale later” adaptation method offers more long-term value than simply adapting one particular model. Only when a stable closed loop forms among the domestic accelerator software stack, the training framework, and the parallelism strategy can the training needs of ultra-large-scale multimodal models be supported more reliably.