Adapting a Domestic Compute Platform for Ultra-Large Open-Source LLM Training: A Practical Analysis

    This article examines how a domestic GPU vendor adapted its flagship training-and-inference accelerator card and in-house heterogeneous computing software stack to train a 2.8-trillion-parameter open-source large language model. It explains why FSDP2 was selected as the native multimodal training path, then analyzes the three key stages of the training chain: model loading, sharding scheduling, and gradient synchronization. It also summarizes a general methodology for adapting heterogeneous software stacks to large-model training and discusses what this practice means for the broader AI infrastructure ecosystem.

    1. Background: New Requirements for the Compute Ecosystem from Open-Source Ultra-Large Models

    An organization in the industry recently open-sourced a flagship large language model with a total parameter scale of 2.8 trillion. The release of such an ultra-large model marks another step forward in model capability for the open-source community, while also placing extremely high requirements on the underlying compute needed for training and fine-tuning.

    For models at the trillion-parameter level, a single accelerator’s memory is far from enough to hold model parameters, optimizer states, and activations. Large-scale cluster distributed training is therefore mandatory. The feasibility of distributed training depends not only on hardware compute, but also on the maturity of the supporting software stack, including operator coverage, communication libraries, parallel strategy frameworks, and compiler optimization capabilities.

    It is worth noting that domestic AI accelerators have continued to invest in this direction in recent years. A domestic GPU vendor, based on its flagship training-and-inference integrated AI accelerator card and in-house heterogeneous computing software stack, completed training adaptation of the above ultra-large model on its own platform. It also built a native FSDP2 multimodal training path, connecting the complete training chain from model loading and sharding scheduling to gradient synchronization. This practice provides a useful reference sample for how domestic compute ecosystems can support frontier large-model training. This article uses that background to analyze the key technical aspects involved.

    2. Why FSDP2: The Parallel Strategy Choice for Trillion-Parameter Training

    2.1 From Data Parallelism to Fully Sharded Data Parallelism

    The first problem to solve in ultra-large model training is memory. Taking common mixed-precision training as an example, the memory occupied by model states, including parameters, gradients, and optimizer momentum, is roughly more than 16 times the parameter count, estimated with FP16 parameters, an FP32 master copy, and Adam first- and second-order momentum. Even after sharding, 2.8 trillion parameters require coordination across hundreds or thousands of accelerators in a single training run.

    The core idea of Fully Sharded Data Parallel (FSDP) is to shard model parameters, gradients, and optimizer states across different devices. When forward and backward computation need them, the required shards are temporarily aggregated through collective communication such as all-gather. Once computation is complete, they are released immediately, compressing resident memory to 1/N of the original.

    FSDP2 is an evolved version of this approach. Its key improvements are:

    • Per-parameter sharding: Sharding is managed at the granularity of individual parameter tensors rather than nested FlatParameter wrapping. This makes the sharding logic more transparent and easier to combine with features such as quantization and offload.
    • Native DTensor semantics: Sharding state is expressed as distributed tensors, with a clear mapping relationship to the device mesh, reducing debugging and scaling difficulty.
    • More flexible sharding strategy composition: Different levels can be selected for nested modules, such as sharding only Transformer blocks, fully sharding, or replicating, allowing flexible trade-offs between communication volume and memory footprint.

    2.2 How FSDP2 Works with Tensor Parallelism and Pipeline Parallelism

    For trillion-parameter models, data parallelism alone is usually not enough. Multi-dimensional hybrid parallelism is commonly used:

    1. Tensor parallelism (TP): Splits matrix multiplications in attention and feed-forward layers across devices within a group, reducing peak memory for activations and weights in a single layer.
    2. Pipeline parallelism (PP): Splits the model by layer across different device groups and improves utilization through micro-batch overlap.
    3. FSDP2 data parallelism: Provides parameter and optimizer-state sharding and high scalability at the outer layer.
    4. Context/sequence parallelism: Shards activations when handling ultra-long sequences.

    FSDP2 plays the role of the outer-layer safety net. Its native sharding semantics allow it to combine well with inner-layer parallel strategies, which is the technical logic behind choosing to build a native FSDP2 training path in this adaptation.

    3. Three Key Stages of the Complete Training Chain

    The original adaptation work connected the complete training chain from model loading and sharding scheduling to gradient synchronization. What technical challenges do these three stages correspond to?

    3.1 Model Loading: Weight Initialization and Metadata Initialization

    A trillion-parameter model cannot be loaded by first loading the full model and then sharding it. At no point should the complete model appear in the memory of a single accelerator or a single node. The common industry approach is metadata initialization:

    1. # Illustration: metadata initialization in a distributed environment
    2. with empty_init():
    3. model = build_model(config) # Allocate metadata only; do not materialize weights
    4. model = fsdp2_shard(model, mesh) # Shard and materialize directly according to the device mesh
    5. load_checkpoint(sharded_state_dict) # Each shard loads its corresponding weights in parallel

    This requires the underlying software stack to support lazy materialization of distributed tensors and parallel read/write of sharded-format checkpoints. If any part is unsupported, memory overflow will occur during initialization.

    3.2 Sharding Scheduling: Overlapping Computation and Communication

    Sharding scheduling addresses when to aggregate parameters, when to release them, and how to hide communication latency. Core optimization methods include:

    • Prefetching: While layer N is performing backward computation, all-gather the parameter shards needed by layer N+1 in advance.
    • Communication-computation overlap: Overlap gradient reduce-scatter with the backward computation of the previous layer.
    • Bucketing: Merge communication for adjacent small parameters to reduce bandwidth waste caused by small messages.

    Whether these capabilities take effect depends heavily on hardware communication bandwidth and the asynchronous execution capability of the software stack. This is the stage that best demonstrates software maturity in domestic accelerator adaptation.

    3.3 Gradient Synchronization and Stability

    The gradient synchronization stage must ensure numerical correctness and training stability:

    • Sharded gradient reduction: During backpropagation, gradients are reduce-scattered back to each device by shard, and local updates are completed together with optimizer-state sharding.
    • Mixed precision and loss scaling: FP16/BF16 computation is combined with dynamic loss scaling to prevent gradient underflow.
    • Fault tolerance and consistency: Sharded checkpoints are saved periodically, and recovery is performed from sharded states after a failure to avoid full retraining.

    In addition, a multimodal training path means the training data stream mixes inputs from different modalities such as text and vision. This requires data loading, tokenizers/preprocessors, and model forward computation to remain consistent in a distributed environment, which further increases the engineering complexity of connecting the full chain.

    4. A General Methodology for Heterogeneous Software Stack Adaptation

    From this practice, a general methodology can be distilled for adapting domestic or non-mainstream accelerator platforms to large-model training:

    1. Operator coverage first: Ensure that core Transformer operators, such as attention, LayerNorm, RoPE, and optimizer operators, have high-performance implementations on the target hardware. Where necessary, fill gaps through compiler-generated or custom kernels.
    2. Communication library parity: Implement collective communication interfaces compatible with mainstream frameworks, ensuring the bandwidth and latency of key primitives such as all-gather and reduce-scatter.
    3. Framework-layer adaptation: Integrate a device abstraction layer into the distributed training framework so that parallel strategies such as FSDP2 can run on heterogeneous devices without requiring awareness of the underlying hardware.
    4. End-to-end validation: Compare convergence curves against a baseline implementation and confirm that adapted training is numerically consistent with the reference implementation.
    5. Ecosystem collaboration: Work with the model publisher to validate configurations and hyperparameters, ensuring reproducibility of the open-source model on heterogeneous platforms.

    5. Conclusion and Outlook

    The convergence of ultra-large open-source models and domestic compute platforms is reshaping the AI infrastructure landscape. For developers, this means more diverse compute choices when training large models. For the industry, software stack maturity, rather than paper specifications alone, is becoming a core criterion for evaluating AI acceleration platforms. The native implementation of advanced parallel strategies such as FSDP2 on heterogeneous platforms is an important milestone in this process. In the future, as compiler optimization, communication libraries, and fault-tolerance mechanisms continue to improve, the ability of domestic compute ecosystems to support trillion-level model training will be further enhanced.