Training Trillion-Parameter Multimodal Models on Domestic AI Computing Clusters: A Practical FSDP2 Adaptation Guide

    As trillion-parameter multimodal models push the limits of training infrastructure, adapting them to run efficiently on domestic AI accelerators has become a major engineering challenge. This article walks through how a domestic chip vendor completed the training adaptation of a trillion-parameter open-source multimodal model using a native FSDP2 (Fully Sharded Data Parallel) training path. It covers the core ideas behind fully sharded data parallelism, why a native implementation outperforms compatibility-layer approaches, the three key stages of the training pipeline—streaming sharded model loading, shard scheduling with compute-communication overlap, and sharded gradient synchronization—plus a practical methodology for software-hardware co-adaptation, correctness verification, and performance tuning.

    Training Trillion-Parameter Multimodal Models on Domestic AI Computing Clusters: A Practical FSDP2 Adaptation Guide

    Background: The Engineering Challenges of Training Extremely Large Models

    In recent years, the parameter scale of multimodal large models has grown relentlessly, with flagship open-source models now reaching the trillion-parameter level. Models of this size place unprecedented demands on training infrastructure: the memory of a single accelerator card is far from sufficient to hold the full model weights, optimizer states, and gradients, making large-scale distributed parallel training essential. Moreover, multimodal models typically combine heterogeneous substructures—a vision encoder, a language backbone, and cross-modal alignment modules—whose compute load and memory footprints are highly imbalanced, further complicating scheduling and sharding decisions.

    Against this backdrop, adapting such models to domestic AI computing hardware has become a key focus across the industry. Recently, a domestic chip vendor completed the training adaptation of a trillion-parameter open-source multimodal flagship model using its flagship training-and-inference accelerator card and in-house software stack. The work established a native FSDP2 (Fully Sharded Data Parallel) multimodal training path, covering the entire chain from model loading and shard scheduling to gradient synchronization. This article uses that effort as a lens to systematically examine the key techniques and engineering methods involved in such adaptations.

    Why a Native FSDP2 Training Path Matters

    The Core Idea of Fully Sharded Data Parallelism

    Fully Sharded Data Parallelism (FSDP) is one of the mainstream approaches for training extremely large models today. The core idea is to shard the model’s parameters, gradients, and optimizer states across devices, so each accelerator card holds only one shard of the full state. During forward and backward computation, required parameters are aggregated on demand via collective communication and then released, reducing per-card memory pressure to a tiny fraction—often one-tenth or less—of what full replication would require.

    Native Path vs. Compatibility-Layer Migration

    When hardware platforms face new training framework capabilities, many adopt a “compatibility-layer migration” approach: emulating framework interfaces at the top of the software stack and translating calls down to low-level operators. This gets you started quickly, but it often falls short with second-generation FSDP implementations, which impose deeper coordination requirements around parameter sharding granularity, compute-communication overlap scheduling, and fine-grained memory management.

    Building a “native” training path means:

    • Native sharding semantics: parameters are managed as sharded tensors as first-class citizens within the software stack, rather than being wrapped after the fact;
    • Compute-communication overlap: while gradients for the current layer are computed in the backward pass, the next layer’s parameter shards are prefetched, maximizing hardware utilization;
    • Controllable memory lifecycles: the aggregation, use, and release of parameters are explicitly controlled by the training path, avoiding fragmentation and hidden copies.

    Special Considerations for Multimodal Models

    The submodules of a multimodal model differ dramatically in size. Applying a uniform sharding strategy naively tends to create problems: small modules incur excessive communication overhead, while large modules suffer from imbalanced load. A native training path should support configuring different sharding and parallelism strategies at submodule granularity—for example, using layer replication or hybrid sharding for the vision encoder, and full sharding for the language backbone—striking a balance between communication volume and memory usage.

    Three Key Stages of the Complete Training Pipeline

    Model Loading: From Checkpoint to Sharded Parameters

    Weight files for trillion-parameter models often span several terabytes, so the traditional “load fully, then shard” approach is simply not feasible on a single machine. The first step in the adaptation is streaming sharded loading:

    1. # Illustrative pseudocode: materialize parameters directly as shards
    2. def load_sharded_model(ckpt_index, rank, world_size):
    3. shard_plan = build_shard_plan(model_spec, world_size)
    4. for layer_name, tensor_meta in shard_plan.local_shards(rank):
    5. # Read only the data blocks belonging to this shard, avoiding a full-card load
    6. local_shard = read_tensor_slice(ckpt_index, layer_name,
    7. offset=tensor_meta.offset,
    8. shape=tensor_meta.shape)
    9. materialize_param(layer_name, local_shard, device="local")

    Key points: use index files to locate each shard’s offset on disk, so every card reads its assigned data blocks in parallel; determine data types and device placement at load time to avoid a second data transfer.

    Shard Scheduling: Orchestrating Compute and Communication

    Shard scheduling determines the upper bound of training throughput. The core strategies include:

    1. On-demand aggregation (all-gather): aggregate the full parameters of a layer before computing it, and immediately release everything beyond the local shard once the computation finishes;
    2. Prefetch pipelining: use a dedicated communication stream to issue the next layer’s aggregation request while the current layer is still computing, hiding communication under computation;
    3. Differentiated strategies for heterogeneous modules: for the multimodal model’s widely varying submodules, set sharding toggles and activation checkpointing policies individually, trading a small amount of recomputation for memory headroom.

    Gradient Synchronization: Ensuring Both Correctness and Efficiency

    After backward propagation, gradients on each card are also sharded and must be synchronized via reduce-scatter, so that each gradient shard is fully aggregated on the card that owns it before the local optimizer updates the corresponding parameter shard. Engineering attention should focus on:

    • Coordinating gradient accumulation with communication: when accumulating gradients over many steps, the reduction can be delayed or performed bucket-by-bucket to amortize communication launch overhead;
    • Numerical stability under mixed precision: gradient reduction should typically be performed at higher precision to avoid errors from low-precision accumulation;
    • Alignment with optimizer states: optimizer states are also stored as shards, and the update logic must strictly match the shard layout—any layout mismatch tends to surface as silent convergence anomalies.

    A Methodology for Software-Hardware Co-Adaptation

    Validating Operator and Communication Primitive Coverage

    The first step in training adaptation is building a coverage checklist: systematically review every operator, fused operator, and collective communication primitive the model uses, confirming their support status, numerical precision behavior, and performance baselines on the target software stack. Missing or underperforming operators must be implemented or decomposed into equivalent operator combinations.

    End-to-End Correctness Verification

    Correct individual operators do not guarantee correct training. A layered verification strategy is recommended:

    1. Single-step alignment: fix the random seed, run one training step on both the reference hardware and the target hardware, and compare per-layer output error ranges;
    2. Short-run convergence alignment: run several hundred steps on a small dataset and compare the loss curve’s downward trend and key inflection points;
    3. Long-duration stability observation: verify that extended training exhibits no memory leaks, communication deadlocks, or performance degradation.

    Common Performance Tuning Levers

    • Tune sharding granularity and parallelism dimension combinations to find the optimum between memory usage and throughput;
    • Enable graph compilation and operator fusion to reduce kernel launch overhead;
    • Asynchronize and prefetch the data loading pipeline to eliminate I/O stalls;
    • Leverage general platform capabilities such as monitoring, alerting, and logging services to continuously track cluster-level utilization and fault indicators.

    Significance and Outlook

    The successful establishment of a native training path for a trillion-parameter open-source model on domestic AI computing hardware delivers value beyond the adaptation of a single model: it validates a reusable methodology spanning streaming sharded loading, differentiated parallel scheduling, and sharded gradient synchronization, through to end-to-end correctness and performance verification. As the domestic computing ecosystem continues to mature, developers can leverage common infrastructure capabilities—object storage, container platforms, and logging services—to carry this methodology to more models and scenarios, progressively reducing the dependence of ultra-large model training on any specific hardware ecosystem and providing a more solid foundation for a diversified AI industry.