Trillion-Parameter Multimodal Model Training on a Domestic AI Compute Platform: Engineering Practices

    Training trillion-parameter multimodal models on a new AI compute platform requires more than moving an existing job to different devices. This article examines the main engineering constraints—memory pressure from weights, optimizer states, and activations; communication bottlenecks at hundreds-to-thousands-card scale; and software-stack compatibility gaps—and describes a training path built on fully sharded data parallelism (FSDP). It covers shard-aware checkpoint loading, multimodal data pipelines, gradient synchronization and communication-compute overlap, numerical validation, fault tolerance, and throughput tuning. It concludes with a hardware-agnostic methodology: establish the end-to-end path first, prioritize numerical alignment, use differentiated sharding, and drive optimization with observability.

    1. Background: When Model Scale Crosses the Trillion-Parameter Threshold

    In recent years, the parameter scale of open-source large models has continued to climb. Flagship models with total parameter counts approaching three trillion have appeared in the industry, and they commonly use mixture-of-experts (MoE) architectures to control activation costs during inference and training. Such models often also provide multimodal capabilities such as text and image understanding. Their weight files can reach several TB, and neither a single machine with one accelerator nor a single machine with multiple accelerators can carry the full training workload.

    Meanwhile, the compute supply landscape is also changing. More teams are evaluating the feasibility of completing large-model training—not just inference deployment—on domestic training-and-inference AI accelerator cards and their accompanying software stacks. This creates a typical engineering problem: how to run the complete training pipeline for a trillion-parameter multimodal model on a new hardware and software ecosystem, keep it stable, and achieve acceptable throughput. This article breaks that problem down into a set of actionable engineering steps.

    2. Core Challenges in Training Adaptation

    2.1 Memory Wall: Triple Pressure from Weights, Optimizer States, and Activations

    For a model with trillions of parameters, even storing weights in BF16 precision requires several TB of memory for model parameters alone. Add the first- and second-order moments of Adam-style optimizers, which are usually stored in FP32, and the memory overhead of optimizer states can reach four to eight times that of the weights themselves. In addition, long-sequence multimodal inputs produce substantial activation values. Any approach that simply “puts the model in memory” does not work at this scale; systematic sharding strategies are required.

    2.2 Communication Wall: Cross-Card Synchronization Becomes a Throughput Bottleneck

    When training spans hundreds or even thousands of accelerators, gradient synchronization, aggregation and broadcast of sharded parameters, and cross-node traffic caused by expert routing all significantly erode effective compute. The degree of overlap between communication and computation often directly determines the end-to-end utilization of the cluster.

    2.3 Ecosystem Differences: Compatibility Gaps in the Software Stack

    Mainstream training frameworks usually prioritize mature ecosystems. On a new platform, operator coverage, distributed communication libraries, and memory management strategies may all differ. The essence of adaptation work is to close these gaps layer by layer at the framework, communication, and operator levels, rather than simply “running on a different device ID.”

    3. Training Path Design Based on the Native FSDP Sharding Paradigm

    3.1 Why Choose Fully Sharded Data Parallel

    At trillion-parameter scale, the new generation of fully sharded data parallel (FSDP) is a mainstream industry choice. Its core idea is to shard model parameters, gradients, and optimizer states across the data-parallel dimension. Each card holds only a 1/N shard, temporarily aggregates full parameters on demand during forward and backward computation, and releases them after use. Compared with the traditional combination of tensor parallelism and pipeline parallelism, the fully sharded approach has these advantages:

    • Extreme memory reduction: sharding parameters and optimizer states eliminates redundant replicas.
    • Regular communication pattern: all-gather and reduce-scatter are naturally suited to overlapping with computation.
    • MoE friendliness: sharding granularity can be set separately for dense layers and expert layers, with expert parallelism added on top of the expert layers.

    An illustrative sharding configuration is shown below:

    1. # Illustrative configuration: differentiated sharding by module type
    2. sharding_plan = {
    3. "embedding": "full_shard",
    4. "dense_layers": "full_shard",
    5. "moe_experts": "expert_parallel + full_shard",
    6. "shared_router": "replicate", # Replicate small modules to avoid communication overhead
    7. }

    3.2 Model Loading: Mapping from Checkpoint to Shards

    Loading a trillion-parameter model is itself an engineering challenge. A recommended approach is “lazy loading + direct shard reading”: first complete model structure construction and sharding planning on meta tensors, then have each process read only the shard data it is responsible for. This avoids the two-stage overhead of first landing the full weights on a single point and then broadcasting them. The loading layer should also include built-in format conversion capabilities to map tensor naming and sharding layouts from open-source weights to local sharding conventions.

    3.3 Multimodal Data Pathway

    The data pipeline for multimodal training has its own characteristics: preprocessing for images and other modalities is compute-heavy, and sample length distributions differ significantly across modalities. Common best practices include:

    1. Decouple preprocessing from training: make compute-heavy steps such as visual encoding asynchronous so they do not block the main training process.
    2. Dynamic sequence packing: concatenate and bucket samples according to a token budget to reduce padding waste.
    3. Shard-aware data loading: ensure that each data-parallel rank reads only the shards it needs, and use local caching to reduce pressure on shared storage.

    3.4 Gradient Synchronization and Communication Optimization

    The complete gradient synchronization chain includes reduce-scatter by shard during the backward pass, aggregation of sharded norms before gradient clipping, and gradient precision strategies under mixed precision. There are several key engineering levers:

    • Communication-compute overlap: use the layer-by-layer backward property to overlap gradient communication for one layer with backward computation for the next.
    • Gradient bucketing: merge small gradient tensors into larger communication buckets to reduce the number of communication operations.
    • Topology-aware scheduling: arrange communication groups according to the cluster network topology (intra-node high-speed interconnect and inter-node network), prioritizing higher-bandwidth links.
    1. # Illustrative: gradient bucketing and overlap configuration
    2. dist_config = {
    3. "bucket_size_mb": 256, # Communication bucket size
    4. "overlap_reduce": True, # Overlap backward pass with gradient communication
    5. "overlap_param_gather": True, # Overlap forward pass with parameter aggregation
    6. "grad_precision": "bf16", # Gradient communication precision
    7. }

    4. Stability and Efficiency: The Second Half of Adaptation

    4.1 Numerical Consistency and Precision Validation

    Getting the job to run on a new platform is only the first step. Training dynamics must be verified against a reference implementation. Recommended validation methods include loss-curve alignment on a small-scale proxy model, layer-wise numerical comparison of key operators, and comparison of gradient norm distributions over the first several hundred steps. For MoE models, routing load-balance metrics also require special attention to prevent expert collapse from being amplified under new operator implementations.

    4.2 Fault Tolerance and Checkpoint Resume

    At thousand-card scale, hardware failures are the norm rather than the exception. A layered fault-tolerance mechanism should be established: in-process health checks and timeout fallback, periodic sharded checkpoints where each rank writes only its own shard asynchronously, and fast recovery after failure—loading directly from sharded checkpoints in parallel rather than reassembling them serially.

    4.3 Common Levers for Throughput Tuning

    Without changing model semantics, throughput tuning usually proceeds along the following dimensions:

    • Activation recomputation (selective checkpointing): recompute memory-heavy parts such as attention to allow larger batches.
    • Operator fusion: provide fused implementations for frequent operators such as normalization, activation, and RoPE.
    • Sequence parallelism: split along the sequence dimension in long-sequence scenarios to reduce activation memory.
    • Pipeline bubble compression: when pipeline parallelism is also used, adopt interleaved scheduling to reduce bubbles.

    Each optimization should be paired with fine-grained profiling to locate the real bottleneck and avoid blind tuning based on experience alone.

    5. Reusable Methodology Summary

    Looking back at the entire adaptation process, a methodology independent of specific hardware can be distilled:

    1. Build the path first, then discuss performance: prioritize running the load-forward-backward-sync-save loop with a minimal viable configuration.
    2. Numerical alignment before throughput alignment: training correctness is a veto item.
    3. Differentiated sharding strategy: treat dense layers, expert layers, and small modules differently.
    4. Observability first: metrics such as communication time share, memory watermark, and MFU must be visualized, and optimization should be data-driven.

    6. Conclusion

    Training adaptation for trillion-parameter multimodal models is essentially a systems engineering effort around memory, communication, and ecosystem compatibility. With fully sharded data parallelism as the backbone, together with shard-aware model loading, multimodal data pipelines, communication-compute overlap, and layered fault tolerance, it is possible to build a complete, stable, and efficient training pipeline on a new compute platform. For teams evaluating compute diversification, this methodology also applies to the migration and adaptation of other large-scale models: establish the pipeline first, then extract performance layer by layer. This is a pragmatic path that has been repeatedly validated.