Training Trillion-Parameter Models on Domestic AI Accelerators: A Practical Breakdown of Large-Scale Training Adaptation

    Adapting trillion-parameter model training to non-mainstream AI accelerator platforms is a full-stack systems engineering challenge. This article breaks down the core technical work involved in training a 2.8-trillion-parameter open-source multimodal model on a domestic AI accelerator and its software stack, covering FSDP2-based fully sharded data parallelism, model loading, sharding scheduling, gradient synchronization, multimodal data pipelines, and the role of unified training-inference software stacks, along with practical recommendations for teams planning similar work.

    1. Background: Training Infrastructure Challenges in the Trillion-Parameter Era

    As large language models scale from tens of billions to trillions of parameters, training flagship models is no longer something a single multi-GPU server can handle. It has become a full-stack systems engineering problem involving cluster scheduling, communication optimization, memory management, and numerical stability. At the same time, demand for compute sovereignty is growing, and more teams are attempting to adapt large-model training and inference to domestically developed AI accelerators.

    Recently, an industry team announced that it had completed training adaptation for a 2.8-trillion-parameter open-source multimodal model on a flagship domestic AI accelerator designed for both training and inference, together with its companion software stack—building a complete training pipeline from model loading and sharding scheduling to gradient synchronization. Behind this announcement lies a broadly relevant technical question: how to run an ultra-large-scale model training workflow end to end on a heterogeneous compute platform outside the mainstream ecosystem. Rather than focusing on any specific product, this article breaks down the core stages and key difficulties of this kind of adaptation work from a general technical perspective.

    2. The Core Technique for Ultra-Large-Scale Training: Fully Sharded Data Parallelism

    2.1 Why Full Sharding Is Necessary

    When training a trillion-parameter model, the parameters alone can consume terabytes of memory (in mixed-precision training, the ratio of parameters to gradients to optimizer states is typically 1:1:2 or higher), far exceeding the memory capacity of a single accelerator. Traditional data parallelism (DP), which requires every device to hold a full model replica, is clearly infeasible.

    The widely adopted solution is Fully Sharded Data Parallel (FSDP): model parameters, gradients, and optimizer states are partitioned across devices, and the required shards are temporarily gathered via collective communication (All-Gather) when needed for forward and backward computation, then released immediately afterward. This “gather on demand, release after use” strategy reduces memory footprint from “the entire model” to “one shard plus the temporarily gathered active layer.”

    2.2 Why a Native FSDP2 Path Matters

    The newer generation of FSDP implementations (often called FSDP2) offers several notable engineering improvements over earlier wrapper-based approaches:

    • Per-parameter tensor sharding management: instead of wrapping entire modules and flattening them uniformly, each parameter is sharded along a dimension, making shard boundaries clearer and easier to combine with quantization and low-precision optimizers;
    • Finer-grained memory control: per-device reshard strategies allow different aggregation granularity for different layers, enabling flexible trade-offs between communication volume and memory usage;
    • Better compatibility with compilation and offload mechanisms: memory-saving techniques such as CPU offload and activation recomputation can be composed at per-layer granularity.

    Building a native FSDP2 training path on a domestic accelerator means more than simple porting—it requires reimplementing these distributed primitives within a self-developed software stack and ensuring their correctness and efficiency on top of the underlying communication and operator libraries.

    3. Breaking Down the Complete Training Adaptation Pipeline

    A complete large-model training adaptation typically involves solving the following stages in sequence.

    3.1 Model Loading and Weight Initialization

    Loading a trillion-parameter model is itself a challenge. Sound practices include:

    • Meta device initialization first: build the model skeleton on a virtual device to determine the shape and sharding plan of each parameter, then load or initialize actual data on demand, avoiding memory peaks from intermediate states;
    • Sharding-aware checkpoint I/O: saving and restoring pretrained weights must align with the sharding layout and support parallel per-shard reads and writes, avoiding out-of-memory failures caused by single-point aggregation.

    The following pseudocode illustrates a typical sharded initialization flow:

    1. # Pseudocode: meta device + sharded initialization
    2. with torch.device("meta"):
    3. model = build_model(config) # Build structure only, no memory allocated
    4. sharding_plan = build_sharding_plan(model) # Define per-layer sharding strategy
    5. model = apply_fsdp(model, sharding_plan)
    6. load_checkpoint_shards(model, ckpt_dir) # Load weight shards in parallel

    3.2 Sharding Scheduling and Computation Graph Orchestration

    Sharding scheduling answers the question of when, at what precision, and on which devices each layer should be aggregated. Key considerations include:

    • Aggregation granularity: finer granularity saves memory but increases the number of All-Gather operations. A common approach is to aggregate at the Transformer block level, combined with prefetching—pulling the next block’s shards while the current block is being computed—to hide communication latency;
    • Activation checkpointing: selectively recomputing attention and feed-forward layers trades roughly 30% extra computation for substantial activation memory savings, and is a standard technique for long-sequence multimodal training;
    • Operator mapping on heterogeneous platforms: core operators in the training graph (matmul, attention, LayerNorm, optimizer updates, etc.) must be mapped to the accelerator’s operator library, with performance validation on critical paths to prevent individual operators from becoming bottlenecks.

    3.3 Gradient Synchronization and Communication Optimization

    After backpropagation, gradients for each shard must be reduced (Reduce-Scatter) so that each device holds only the aggregated gradient for its own shard. Optimization priorities for this stage:

    • Communication-computation overlap: splitting gradient reduction into bucketed operations that pipeline and overlap with backward computation, reducing exposed communication time;
    • Reduced-precision communication: transmitting gradients at lower precision where convergence allows, reducing communication volume—particularly important on domestic clusters where interconnect bandwidth is relatively constrained;
    • Topology-aware collective communication: the communication library must be aware of the topology differences between intra-node (high-speed NVLink-class interconnects) and inter-node (network) links, executing All-Gather/Reduce-Scatter hierarchically to maximize bandwidth utilization.

    3.4 Integrating Multimodal Data Pipelines

    Multimodal training adds a layer of data engineering complexity compared to pure text training: each modality (text, images, video, etc.) requires its own preprocessing pipeline, encoder, and alignment strategy. In practice, attention should be paid to:

    • Packing and padding strategies for heterogeneous inputs: when packing samples from different modalities into unified sequences, well-designed bucketing and padding strategies are needed to reduce wasted computation;
    • Matching data loading throughput to compute: trillion-parameter models have extremely high compute density; if data loading cannot keep up, accelerators sit idle. Distributed dataset sharding, parallel preprocessing, and prefetch caching are needed to keep the pipeline fed.

    4. Unified Training-Inference Design and the Ecosystem Significance of the Software Stack

    It is worth noting that unified training-and-inference capability is becoming an important design direction for AI accelerators. Training demands maximum throughput and stability, while inference prioritizes latency, concurrency, and cost. The two scenarios place different demands on the software stack but share a common foundation—a unified operator library, communication library, compiler, and runtime allows downstream work such as model migration and quantized deployment to reuse the adaptation results accumulated during training.

    For domestic compute platforms, the real barrier is often not peak hardware performance but software stack maturity: the completeness of distributed strategies, operator coverage, numerical stability under mixed precision, and fault recovery capabilities (automatic checkpointing and training resumption). Completing this full pipeline adaptation marks another step forward in the usability of domestic software stacks for the demanding scenario of large-model training.

    5. Conclusion and Outlook

    From a general technical perspective, adapting trillion-parameter multimodal model training to a domestic AI accelerator comes down to three things: a native implementation of fully sharded parallelism represented by FSDP2, an end-to-end pipeline from loading through gradient synchronization, and sufficient support for training workloads from the underlying operator and communication libraries.

    Looking ahead, as more open-source flagship models are adapted to heterogeneous compute platforms, the industry will gradually develop a methodology for co-optimizing models, frameworks, and hardware: training frameworks will continue evolving finer-grained parallelism and memory management techniques, while hardware and software stacks will close the ecosystem gap through compiler optimizations and communication compression. For teams planning to train large models on domestic compute platforms, we recommend validating distributed strategy compatibility early, establishing robust numerical accuracy checks and checkpoint-resumption mechanisms, and benchmarking communication efficiency on small clusters before scaling up—thereby reducing overall trial-and-error costs.