Training Large Models on Domestic AI Accelerators: Adaptation Paths and Engineering Considerations

    This article examines the technical approach behind adapting a 2.8-trillion-parameter open-source large model to a domestic AI accelerator platform, focusing on hardware requirements, software stack migration, FSDP2 parameter sharding, training pipeline debugging, and pre-deployment validation steps. It provides actionable engineering guidance for developers working outside the NVIDIA ecosystem, emphasizing operator alignment, precision validation, and practical measurement over theoretical estimates.

    1. What This Adaptation Report Tells Us, and What Still Needs Verification

    According to public reports, a domestic AI chip vendor announced that its training-and-inference integrated accelerator card, combined with its proprietary heterogeneous computing software stack, completed training adaptation for a 2.8-trillion-parameter open-source large model, and established a multimodal training pipeline based on FSDP2. As of now, the specific model name, release date, and official announcement have not been verified. This article does not judge the authenticity of the announcement but focuses only on the technical path involved.

    For developers, the more valuable takeaway lies in the general methodology. Supporting trillion-parameter training on a non-NVIDIA ecosystem requires solving problems across four levels simultaneously: hardware architecture, software stack, parallel strategy, and memory management.

    2. Hardware Requirements for a Training-and-Inference Integrated Accelerator Card

    “Training-and-inference integrated” means that a single accelerator card can handle both distributed training and high-throughput inference. These two workloads place different demands on hardware.

    For the training side, the key requirements are:

    • High-bandwidth memory (e.g., HBM), which determines the read/write speed of weights and intermediate results.
    • Sufficient memory capacity to hold sharded parameters, gradients, and optimizer states.
    • Compute units supporting multiple precisions. BF16 and FP16 are common choices. FP8 can further reduce memory and bandwidth pressure, but it requires accompanying scaling calibration and depends on framework and operator library support. It should not be enabled by default.
    • High-speed inter-card interconnect for gradient synchronization.

    For the inference side, the focus is on compute density, low-latency memory access, and efficient KV cache management in long-context scenarios.

    Sharing the same software stack and cluster resources for training and inference avoids duplicated infrastructure (“one stack for training, another for deployment”). Whether this actually reduces cost depends on resource utilization and scheduling strategies, which must be evaluated with real workload measurements.

    3. Operator Alignment and Precision Validation in Software Stack Migration

    The main difficulty in migrating to domestic chips is usually the software ecosystem, not just the hardware parameters. A heterogeneous computing software stack generally offers functionality similar to CUDA, but with different interfaces and implementations. It typically consists of these layers:

    • Driver and runtime layer: device management, memory allocation, stream and event scheduling.
    • Operator library layer: high-performance operators for BLAS, convolution, attention, etc. This is often the performance bottleneck in training.
    • Compilation layer: graph optimization, operator fusion, and auto-tuning.
    • Framework adaptation layer: integration with frameworks like PyTorch, determining the amount of changes needed in training code.

    The core of migration is operator alignment and precision validation. A common practice is to feed the same inputs to the reference implementation and the target platform implementation, then compare outputs layer by layer. Example:

    1. import torch
    2. def check_layer(ref_layer, tgt_layer, test_inputs, tgt_device, rtol=1e-3, atol=1e-3):
    3. """Compare reference and target layer outputs layer-by-layer; return max absolute error and pass/fail per input."""
    4. report = []
    5. for x in test_inputs: # inputs should cover normal, extreme, near-zero, and all-zero cases
    6. ref_out = ref_layer(x.clone())
    7. tgt_out = tgt_layer(x.clone().to(tgt_device)).cpu()
    8. max_diff = (ref_out - tgt_out).abs().max().item()
    9. ok = torch.allclose(ref_out, tgt_out, rtol=rtol, atol=atol)
    10. report.append((max_diff, ok))
    11. return report

    When using this code, note the following: rtol and atol should be set according to the data type—BF16 tolerances are typically looser than FP32. Both forward and backward passes should be validated separately. Error statistics should record both maximum and mean values, to distinguish between isolated outliers and systematic deviations.

    4. How FSDP2 Shards Parameters, and How Much Memory It Saves

    FSDP (Fully Sharded Data Parallel) shards parameters, gradients, and optimizer states across compute devices, and temporarily gathers them on demand during computation. It significantly reduces per-GPU memory usage, but the actual savings depend on sharding scope, precision settings, and whether activation recomputation is enabled.

    FSDP2 introduces three main improvements over the first-generation FSDP:

    1. DTensor-based sharding representation. Sharding state is explicitly declared at the tensor level, making sharding strategies more controllable.
    2. Finer-grained overlap of communication and computation, e.g., all-gather prefetching can overlap with backward computation, hiding some communication overhead.
    3. More complete support for mixed precision.

    FSDP2 availability depends on the PyTorch version and DTensor-related dependencies. Before migration, confirm version requirements against the official documentation.

    Here is a rough numerical estimate. For a 2.8-trillion-parameter model with BF16 (2 bytes per parameter), the weights alone are about 5.6 TB. If sharded across 1024 cards, each card holds about 5.5 GB of weights. In mixed-precision training with the Adam optimizer, you typically need about 12 bytes per parameter (FP32 master weights plus two momentum terms), totaling about 33.6 TB—far larger than the weights themselves. Activation values add more on top. Therefore, when planning a sharding scheme, the memory footprint of optimizer states must be carefully accounted for.

    In multimodal scenarios, the vision encoder and language model differ in parameter scale and computational characteristics. A common approach is to use different sharding granularity for the vision branch, or freeze certain modules during the early training phase. The specific plan must be designed based on the model architecture.

    5. Key Stages in the Training Pipeline and What to Check

    The training pipeline can be broken down into three stages: model loading, sharding and scheduling, and gradient synchronization. Each stage has common failure points that should be checked during adaptation.

    Model loading:

    • Checkpoint files are large. Weights alone are about 5.6 TB; if optimizer states are included, the total can reach tens of TB.
    • Use streaming loading and sharded initialization to avoid memory spikes during the loading phase.
    • After loading, verify parameter shapes, data types, and metadata, and compare against hash values or statistics from the source checkpoint.

    Sharding and scheduling:

    • Place shards according to the hardware topology. The bandwidth difference between intra-node high-speed interconnects and inter-node RDMA is significant, so shard groups should be placed within the same node whenever possible.
    • Record the communication volume per shard group to identify cross-node communication bottlenecks.

    Gradient synchronization:

    • The bandwidth utilization of reduce-scatter and all-reduce directly affects training throughput.
    • Gradient accumulation can reduce synchronization frequency, and communication compression can reduce the data volume per synchronization. Both may affect convergence, so each must be validated separately. The accumulation steps and compression method should be chosen based on experimental results.

    6. Pre-Deployment Validation Steps

    1. First, run a complete pipeline on a small model and confirm that the loss curve is broadly consistent with the reference platform.
    2. Perform layer-by-layer precision alignment, recording error statistics for each layer.
    3. Measure memory peak and throughput with a realistic sharding configuration—do not rely solely on theoretical estimates.
    4. After training for several checkpoints, compare convergence to confirm there is no systematic deviation from the reference result.

    7. Conclusion

    Whether a domestic AI computing platform can handle ultra-large-scale training must be judged by measured data on a specific model and a specific configuration. For developers, FSDP2, mixed precision, communication optimization, and precision alignment are general skills. Once these are mastered, migration cost can be assessed quickly regardless of the platform vendor. Any specific model or vendor information mentioned in this article should be confirmed with official announcements.