How Homegrown AI Chips Adapt to Trillion-Parameter Open-Source Model Training

    This article examines the technical path behind adapting a 2.8-trillion-parameter open-source multimodal model to a vendor’s self-developed AI training/inference accelerator card and software stack. It explains why trillion-parameter training is difficult, how FSDP2 sharding works, and how model loading, sharding scheduling, and gradient synchronization form a complete training pipeline. It also discusses the value of training-inference integrated architecture and the implications for heterogeneous AI compute ecosystems.

    1. Event Context: Trillion-Parameter Models Meet Domestic Compute

    The industry has recently seen a noteworthy development: a vendor completed training adaptation for a 2.8-trillion-parameter open-source multimodal flagship model based on its self-developed flagship AI training/inference integrated accelerator card and supporting software stack. The work established a complete training pipeline covering model loading, sharding scheduling, and gradient synchronization.

    The technical significance of this event needs to be understood against a broader background. The open-source community continues to release foundation models with hundreds of billions or even trillions of parameters, and these models often default to ecosystems tied to specific mainstream hardware and software stacks. For domestic AI chips to prove their capabilities in real production environments, “being able to run inference” is only the first step; “being able to train, and to train ultra-large-scale models” is the critical benchmark. Training places far higher demands on hardware stability, interconnect bandwidth, software stack completeness, and operator coverage than inference.

    Therefore, the value of this kind of adaptation work is not the news itself, but the technical path it represents: how to run the complete training process of a trillion-parameter multimodal model on a non-native hardware ecosystem. That is the subject this article breaks down.

    2. Why Trillion-Parameter Training Adaptation Is Extremely Difficult

    2.1 The Memory Wall

    Taking 2.8 trillion parameters as an example, even with FP16/BF16 mixed-precision storage, model weights alone require about 5.6 TB of memory capacity. Add optimizer states, gradients, and activations, and a single card’s memory is far from sufficient. The common industry approach is a combination of distributed parallelism strategies:

    • Data parallelism: different devices hold complete model replicas and process different data shards.
    • Tensor parallelism: a single weight matrix is split across multiple cards.
    • Pipeline parallelism: the model is split by layers, with different devices handling different stages.
    • Fully Sharded Data Parallel (FSDP): parameters, gradients, and optimizer states are sharded across data-parallel ranks and temporarily gathered when needed.

    For trillion-scale models, multiple parallelism methods are usually combined, forming what is often called “3D parallelism” or “4D parallelism.”

    2.2 Software Stack Completeness

    Mainstream training frameworks depend on three layers of hardware adaptation:

    1. Operator layer: every operator in the model—attention, LayerNorm, custom fused operators, and so on—needs a corresponding high-performance implementation.
    2. Communication layer: collective communication primitives such as AllReduce, AllGather, and ReduceScatter require sufficient bandwidth from the underlying interconnect, such as NVLink-like high-speed inter-card links.
    3. Framework layer: the training framework’s device abstraction, memory management, and mixed-precision logic must map correctly to the new hardware.

    A missing piece at any layer can cause training failure or a collapse in performance.

    3. FSDP2: A Mainstream Sharding Approach for Modern Large-Model Training

    One keyword in this adaptation work is the “native FSDP2 multimodal training path.” It is worth explaining the evolution of FSDP.

    3.1 From FSDP to FSDP2

    First-generation FSDP implemented parameter sharding by wrapping model submodules, but it had drawbacks: configuration could be cumbersome, and compatibility with some newer features—such as certain activation recomputation and memory management mechanisms—was not always ideal. FSDP2’s core improvement is DTensor-based per-parameter sharding:

    1. # FSDP2-style illustrative code (pseudocode)
    2. from torch.distributed.fsdp import fully_shard
    3. for layer in model.layers:
    4. fully_shard(layer) # Apply sharding at parameter granularity
    5. fully_shard(model) # Root module fallback
    6. model.forward(batch)

    The advantages of this approach include:

    • Finer sharding granularity: sharding is performed per individual parameter, enabling more precise memory planning.
    • Natural compatibility with hooks: makes it easier to insert advanced features such as quantized training and gradient accumulation.
    • State dictionaries are already sharded: saving and restoring checkpoints directly uses the sharded form, avoiding the memory disaster of first aggregating and then saving a trillion-parameter model.

    3.2 What “Native” Adaptation Means

    A “native” training path means the model is not merely made to run through conversion tools. Instead, framework capabilities such as sharding scheduling and gradient synchronization are built directly on the self-developed software stack. For users, this means that from the moment the model is loaded, parameters are distributed across accelerator cards in sharded form, and the process never needs to fall back to single-card mode.

    4. Breaking Down the Multimodal Training Pipeline into Three Stages

    The original work established a complete pipeline “from model loading and sharding scheduling to gradient synchronization.” These three stages cover the core difficulties of large-model training.

    4.1 Model Loading: Initializing Trillions of Parameters

    Loading models at the hundred-billion scale or above faces two problems: the checkpoint itself may reach tens of terabytes, and there is a temporary memory peak during loading. Mature practices include:

    • Metadata first: load only the model structure and sharding plan first, without instantiating the full weights.
    • On-demand reading: each rank reads only its own shard data from the storage layer.
    • dtype planning: load weights in BF16 and initialize optimizer states on demand at the first update, avoiding a doubling of memory during startup.

    4.2 Sharding Scheduling: Matching the Split Strategy to the Topology

    The sharding strategy is not static. Reasonable scheduling needs to consider:

    • High-speed inter-card interconnect topology: place communication-intensive tensor parallelism inside groups with high interconnect bandwidth.
    • Layer differences: special structures such as embedding layers and output heads may use different replication/sharding strategies.
    • Recomputation and offload: use selective activation recomputation to trade off computation against memory usage.

    4.3 Gradient Synchronization: Overlapping Communication and Computation

    After backpropagation produces gradients, they must be synchronized through AllReduce/ReduceScatter. The key optimization is communication-computation overlap: as soon as the gradient computation for one layer is complete, communication is launched while gradient computation continues for subsequent layers. On domestic hardware with limited bandwidth, this overlapping schedule has a particularly significant impact on overall throughput.

    1. # Communication-compute overlap illustration
    2. with model.join():
    3. loss = model(inputs).sum()
    4. loss.backward()
    5. # FSDP automatically triggers sharded gradient reduction at the end of each layer's backward pass

    5. The Architectural Value of Training-Inference Integration

    This adaptation used a “training-inference integrated” accelerator card, and this design direction deserves elaboration. Traditionally, training cards and inference cards are two product lines, optimized separately for backpropagation bandwidth and inference latency. Training-inference integration means:

    • One software stack covers both scenarios, so models do not require extensive engineering conversion between training and deployment states.
    • Compute resources can be scheduled elastically, and idle training capacity can be shifted to batch inference services.
    • Operational complexity is reduced for users, since one monitoring, scheduling, and storage system can support the full lifecycle.

    6. Implications for the Industry

    From a broader perspective, this adaptation demonstrates a methodology for building heterogeneous compute ecosystems:

    1. Software stack first: hardware performance matters, but what determines whether real workloads can be supported is operator coverage, framework compatibility, and toolchain maturity.
    2. Use open-source models as benchmarks: targeting community flagship models is an effective way to validate the completeness of a training stack, because the training recipes of open-source models are public and reproducible.
    3. Standardized interfaces lower migration costs: as long as the software stack is compatible with the programming model of mainstream training frameworks, users’ code migration costs can remain within an acceptable range.

    For teams planning to conduct large-model training on multiple types of compute, selection should focus on: actual operator coverage for the target model structure, collective communication bandwidth on the real topology, long-duration training stability on large clusters (fault recovery and checkpoint efficiency), and software consistency between training and inference. These dimensions reflect real production capability better than single-point peak compute.

    7. Conclusion

    The continuous emergence of trillion-parameter open-source models is becoming a touchstone for AI compute platforms of all kinds. Completing a full training adaptation is backed by systematic engineering accumulation across operator ecosystems, communication libraries, distributed frameworks, and scheduling systems. As the training stack continues to improve, domestic compute is expected to move from a “supplementary compute” role toward becoming a “mainstream choice” in the large-model industry chain—a process worth watching.