Training Trillion-Parameter Open-Source Models on Domestic AI Accelerators: Adaptation Practices

    This article examines the engineering work required to adapt trillion-parameter model training to domestic heterogeneous AI accelerators. Using the recent adaptation of a 2.8-trillion-parameter open-source model as context, it explains why such training runs into memory, communication, and stability walls; how FSDP2 sharding, multidimensional parallelism, gradient synchronization, mixed precision, and multimodal data pipelines fit together; and what reusable methodology teams can apply when bringing large-scale training to a new accelerator software stack.

    Training Trillion-Parameter Open-Source Models on Domestic AI Accelerators: Adaptation Practices

    Recently, an AI company open-sourced a flagship large language model with 2.8 trillion parameters, and a domestic AI chip vendor announced that it had completed training adaptation for the model based on its flagship training-and-inference accelerator card and in-house software stack. This event has again prompted discussion of how very large models can run and remain stable on domestic heterogeneous compute. This article sets aside specific brand information and examines the core stages and engineering priorities of trillion-parameter model training adaptation from a general technical perspective.

    Why Trillion-Parameter Training Adaptation Is Difficult

    What does 2.8 trillion parameters mean? Even with FP8 or mixed-precision storage, model weights, optimizer states, and gradients alone occupy tens of terabytes of memory capacity, far beyond what a single machine, or even a single cluster in a short period, can accommodate. The challenges of training models at this scale can be grouped into three categories:

    1. Memory wall: A single card usually has only tens of GB of memory, so the model must be partitioned across thousands of cards.
    2. Communication wall: After partitioning, forward passes, backward passes, and parameter updates all involve extensive cross-card and cross-node communication. Communication efficiency directly determines cluster utilization.
    3. Stability wall: Training cycles are measured in weeks, and any single-point failure, numerical overflow, or slow node can stall overall progress.

    Therefore, “completing training adaptation” is not simply about getting the model to run. It means establishing the entire training pipeline at the thousand-card scale and ensuring acceptable model FLOPs utilization (MFU) and stable long-duration operation.

    Why Fully Sharded Data Parallelism (FSDP2) Has Become a Mainstream Choice

    The adaptation involved building a native FSDP2 multimodal training path. It is worth explaining how FSDP-style techniques work.

    Traditional data parallelism requires every card to hold a complete model replica, which is entirely infeasible at trillion-parameter scale. FSDP (Fully Sharded Data Parallel) partitions model parameters, gradients, and optimizer states across workers, temporarily gathers and restores them when needed during forward or backward computation for a given layer, and releases them immediately after use. FSDP2 generally refers to a newer generation of implementations that use device meshes to finely shard each parameter along dimensions. Compared with first-generation implementations, it provides more uniform sharding granularity and better memory predictability.

    The memory benefit can be estimated roughly. Let the number of model parameters be P. With the Adam optimizer and mixed precision, traditional data parallelism requires about 16P bytes per card for weights, gradients, and optimizer states. After full sharding, each card needs only about 16P/N plus communication buffers and activations, where N is the degree of parallelism. For a trillion-parameter model, this determines whether training is feasible at all.

    A typical sharding schedule is shown in the following pseudocode:

    1. # Apply fully sharded wrapping to each Transformer layer
    2. for layer in model.layers:
    3. layer = fully_shard(layer, sharding_dims=["dp", "fsdp"])
    4. apply_apply_bucketing(model) # Bucket parameters by size to reduce aggregation overhead

    In real engineering work, sharding granularity also needs careful tuning, such as bucketing by layer or by block, to trade off between the number of communication operations and peak memory usage.

    From Model Loading to Gradient Synchronization: The Complete Training Pipeline

    The adaptation established a complete training pipeline from model loading and sharding scheduling to gradient synchronization. This pipeline can be broken down into four key stages.

    1. Model loading and initialization

    The checkpoint files for a trillion-parameter model are themselves on the terabyte scale. Adaptation work must first implement efficient weight loading: chunked streaming reads and direct mapping into the shard layout during initialization, rather than loading a complete replica first and then sharding it. This can reduce initialization time from hours to minutes while avoiding memory overflow.

    2. Sharding scheduling and multidimensional parallelism layout

    FSDP alone is not enough. The industry generally uses multidimensional hybrid parallelism:

    • Data parallelism (DP): Different data shards are processed in parallel.
    • Tensor parallelism (TP): A single layer’s weight matrices are split across multiple cards, which suits high-speed intra-node interconnects.
    • Pipeline parallelism (PP): Layers are split and deployed across machines, with micro-batch overlap between computation and communication.
    • Sequence/context parallelism: Attention computation for very long contexts is further partitioned.

    When adapting to domestic accelerator cards, the parallel layout must be replanned according to their interconnect topology, where intra-node bandwidth is high and inter-node bandwidth is relatively constrained. This step has a major impact on final MFU.

    3. Gradient synchronization and communication optimization

    In fully sharded mode, backward computation and gradient aggregation (reduce-scatter) hide latency through computation-communication overlap. Key optimization points include gradient bucketing to increase communication granularity, overlap scheduling, topology-aware communication libraries that prioritize intra-node NVLink-like interconnects before inter-node RDMA, and operator-level fusion optimization for the domestic card software stack.

    4. Mixed precision and numerical stability

    Very large model training generally uses BF16 or FP8 mixed precision, together with dynamic loss scaling, gradient clipping, and strategies that keep critical layers such as embeddings and the output layer at higher precision. When adapting to new hardware, validating the numerical consistency of each operator under low precision is an indispensable step.

    Adaptation Priorities for Multimodal Training Paths

    The adaptation emphasized a multimodal training path. Multimodal large models typically consist of a vision encoder, a text backbone, and modality alignment modules, and training adaptation faces additional complexity:

    • Heterogeneous data pipelines: Image and video preprocessing, including decoding, resizing, and tokenization, is computationally intensive. Large-scale preprocessing parallelism must be performed on the CPU side so that it does not slow down the GPU side.
    • Different parallel strategies for different modules: The vision encoder has fewer parameters but large activations, making activation recomputation plus data parallelism suitable. The text backbone requires a combination of full sharding and tensor parallelism.
    • Loss computation and sample organization: Multimodal samples vary widely in length distribution, requiring dynamic packing and efficient attention mask handling.

    These engineering details determine whether multimodal training can converge stably on heterogeneous compute.

    A Reusable Practical Methodology

    Based on the analysis above, completing very large model training adaptation on a non-traditional GPU ecosystem can be summarized as a general methodology:

    1. Validate before scaling parallelism: First verify operator correctness and numerical precision on a single card and a single machine, then gradually expand the scale of parallelism.
    2. Base the work on operator coverage: Inventory all operators used by the model, confirm software stack support, and fill gaps through equivalent replacements or custom implementations.
    3. Prioritize communication optimization: First perform topology-aware communication tuning and overlap scheduling, then pursue operator-level optimization.
    4. Build comprehensive observability: Use general infrastructure such as monitoring, alerting, and logging services to track loss curves, gradient norms, hardware utilization, and slow nodes, and combine this with automatic checkpointing and failure recovery to support long-cycle training.
    5. Use MFU and convergence as north-star metrics: All optimizations should return to these two quantifiable goals.

    Conclusion

    The completion of training adaptation for this trillion-parameter open-source model on domestic accelerator cards marks a shift of the domestic AI compute software stack from “inference-capable” toward the deeper waters of “training-capable.” For developers, specific vendors and model numbers will continue to change, but the methodology of fully sharded parallelism, multidimensional hybrid parallelism, computation-communication overlap, and numerical stability assurance remains broadly applicable over the long term. Mastering these principles enables teams to adapt and tune large-scale model training more quickly on any heterogeneous compute platform.