Training Trillion-Parameter Multimodal Models on Chinese-Developed AI Chips: A Practical Analysis of Native FSDP2 Adaptation

    This article describes how a training stack was adapted to run a trillion-parameter multimodal model on Chinese-developed AI chips. It covers the main infrastructure challenges at this scale: memory pressure, joint image and text data pipelines, communication overhead, and software stack compatibility. It also explains the hardware and software design behind the adaptation, the native FSDP2 training approach, and the steps used to verify correctness and scalability.

    1. Background: Training Challenges of Trillion-Parameter Multimodal Models

    Recently, the industry has open-sourced a multimodal flagship model with 2.8 trillion parameters. Training models of this kind places very high demands on infrastructure:

    1. Memory pressure: Even with mixed precision and sharding strategies, a trillion-parameter model cannot fit its full optimizer states, gradients, and parameter copies on a single card;
    2. Multimodal complexity: The vision encoder and the language model are trained jointly, so the data pipeline must handle heterogeneous inputs such as images and text at the same time;
    3. Communication overhead: Cross-node gradient synchronization and parameter resharding generate large volumes of collective communication. Network bandwidth and topology directly determine training efficiency;
    4. Software stack compatibility: Training frameworks depend heavily on operator and communication libraries built for a specific GPU ecosystem. Heterogeneous chips require a complete rebuild of this layer.

    Therefore, completing training adaptation does not simply mean getting forward and backward passes to run. It requires a complete pipeline, from model loading and shard scheduling to gradient synchronization, while preserving numerical correctness and scalability.

    2. Hardware Foundation: A Unified Training and Inference Design

    This adaptation is built on a flagship AI compute card designed for both training and inference, together with its supporting software stack. The core ideas of the unified training and inference architecture are:

    • Unified ISA and operator layer: Training and inference share the same instruction set and operator implementations. This reduces maintenance costs and avoids the numerical drift that can occur when training and inference run on separate stacks;
    • High-bandwidth interconnect: Multiple cards connect through high-speed links to form a training cluster that supports the collective communication required for large-scale data parallelism;
    • Layered software stack: Above the low-level driver, the stack provides compute libraries, communication libraries, a compiler, and a framework adaptation layer that connects to mainstream training frameworks.

    For developers, the completeness of the software stack often matters more than peak single-card compute in determining real-world usability. A typical layered view looks like this:

    1. Training framework layer (distributed strategies, scheduling, optimizer)
    2. ↓
    3. Framework adaptation layer (operator registration, automatic differentiation, mixed precision)
    4. ↓
    5. Compute and communication libraries (matrix operations, collective communication, memory management)
    6. ↓
    7. Driver and hardware (compute cores, interconnect network, memory)

    3. Core Technical Path: Native FSDP2 Multimodal Training

    3.1 Why FSDP2

    Fully Sharded Data Parallelism (FSDP) reduces per-device memory usage by sharding parameters, gradients, and optimizer states across devices. These values are gathered on demand during forward and backward passes. Key improvements in FSDP2 over the earlier implementation include:

    1. Fine-grained sharding based on DTensor: Sharding is described per tensor dimension, which is clearer and makes it easier to combine with model parallelism strategies;
    2. More flexible mixed precision control: Parameters and gradients can use separately specified precision policies, which makes it easier to balance stability and throughput;
    3. Better observability: The framework can track sharding state directly, which helps diagnose memory and communication bottlenecks.

    3.2 Key Stages in Building the Multimodal Training Path

    Model loading: Multimodal models usually contain a vision tower and a language tower, and their weights are very large. The loading stage must support sharded initialization. Each process creates its local shard directly instead of building the full model first and then splitting it. Otherwise, memory on the main process becomes a bottleneck. Illustrative logic:

    1. # Pseudocode: sharded initialization
    2. with sharding_context(mesh=mesh):
    3. model = MultiModalModel.from_config(cfg) # Parameters are created directly in sharded form
    4. optimizer = AdamW(model.parameters(), fused=True)

    Shard scheduling: Each module needs an appropriate sharding granularity. For example, the vision tower has a relatively small parameter count, so it can use a lower sharding degree to reduce communication. The language body uses full sharding. Activation recomputation also needs per-module configuration to balance memory use against computation.

    Gradient synchronization: During backpropagation, each shard performs reduce-scatter as soon as it finishes, and gradient accumulation overlaps with communication. For trillion-parameter models, the following techniques are typically added:

    • Gradient bucketing, which merges small communications to improve bandwidth utilization;
    • Asynchronous communication launched by hooks when gradients are ready, which hides synchronization latency;
    • Sharded optimizer state updates, which avoid memory peaks during the update phase.

    3.3 Data Pipeline and Multimodal Alignment

    Another difficulty in multimodal training lies on the data side. Image and text samples must be designed together for packing, padding, and sequence-length grouping. This prevents severe imbalance between visual tokens and text tokens within a batch, which would waste compute. Common practices include bucketing by sequence length during scheduling, controlling the mixing ratio of multimodal samples, and using prefetching and asynchronous decoding so that GPUs do not sit idle waiting for data.

    4. Adaptation Validation: Equal Focus on Correctness and Scalability

    Validation of training adaptation typically proceeds in three steps:

    1. Single-card numerical alignment: On a small model, compare the loss curve against a reference implementation to confirm operator precision and gradient correctness;
    2. Single-node multi-card convergence: With a medium-scale configuration, verify how FSDP2 sharding, recomputation, and mixed precision behave in combination;
    3. Multi-node scalability testing: Gradually increase the parallel scale and observe throughput linearity and communication share. Identify bottlenecks, then tune bucket size, sharding granularity, and pipeline overlap strategy.

    Only when loss converges stably at large scale, throughput stays sustainable, and long training runs show no memory leaks or deadlocks can the training pipeline be considered fully operational.

    5. Industry Significance and Outlook

    Completing training adaptation for a trillion-parameter multimodal model on Chinese-developed AI chips marks a step up in capability: from inference, to training, and then to training very large models. Its value is twofold. First, it validates the engineering maturity of an in-house software stack in complex distributed training scenarios. Second, it gives large model training more compute options and helps reduce reliance on a single hardware ecosystem.

    For engineering teams, the general lesson is that adapting heterogeneous compute depends less on single-point performance than on software stack completeness, native support for distributed strategies, and the verifiability of the end-to-end pipeline. As training frameworks continue to improve their device abstraction layers, building a unified multimodal training path across different hardware backends will become more standardized and reproducible.