Training Trillion-Parameter LLMs on Domestic AI Accelerators: Sharding, Validation, and Open Questions
This article examines the general technical path for training ultra-large language models on heterogeneous domestic compute platforms. Using public reports about a roughly 2.8-trillion-parameter open-source model and a domestic accelerator vendor’s training adaptation as context, it explains the memory, communication, and stability pressures at trillion-parameter scale; outlines FSDP2 sharding and 3D parallelism; proposes acceptance checks for model loading, sharding scheduling, gradient synchronization, numerical correctness, and checkpoint resume; and discusses the boundaries of train-inference integrated architectures and the data still needed to evaluate domestic platforms credibly.
According to public reports, a research team open-sourced a large language model with roughly 2.8 trillion parameters. A domestic accelerator vendor subsequently said that its training accelerator cards and in-house software stack had completed training adaptation for the model. Specific training scale, throughput figures, and acceptance results should be based on original materials published by the vendor and the research team. This article does not independently verify that claim. Instead, it discusses the general technical chain that any ultra-large model must address when adapting training to heterogeneous hardware.
1. Why Trillion-Parameter Training Is Difficult
Once parameter scale reaches the trillion level, training faces simultaneous pressure on memory, communication, and stability.
Start with memory. In mixed-precision training, each parameter requires not only its weight but also gradients and Adam optimizer states. A common estimate is that bf16 weights and gradients each take 2 bytes, while fp32 master parameters, momentum, and variance each take 4 bytes, totaling about 16 bytes per parameter. Under this estimate, a 2.8-trillion-parameter model alone requires about 44.8 TB of memory for model states. Even if those states are evenly distributed across 1,024 cards, each card still carries about 44 GB, before activations, communication buffers, and fragmentation are counted. A single card cannot hold the full model, which is the fundamental reason sharding strategies exist.
Next is communication. When data parallelism, tensor parallelism, and pipeline parallelism are combined, cross-node gradient synchronization and activation transfer consume substantial bandwidth. The communication volume per step depends on parameter count, parallelism degree, batch size, and network topology. If interconnect bandwidth is insufficient, compute units spend long periods waiting for data, and training efficiency drops noticeably.
Finally, stability. Training cycles often last weeks. Numerical overflow, a single-card failure, or network jitter can interrupt a job. A full checkpoint can reach tens of TB, so saving and restoring it is itself an engineering problem. Whether checkpoint resume can reconnect seamlessly determines whether training can be completed smoothly.
2. The Sharding Approach of FSDP2
The core approach of FSDP (Fully Sharded Data Parallel) is to partition parameters, gradients, and optimizer states across devices. During forward and backward computation, it temporarily aggregates the parameters needed for the current layer through all-gather, then immediately releases shards that do not belong to the local device, reducing peak memory per card.
The main difference between FSDP2 and FSDP1 is sharding granularity. FSDP1 manages shards as flattened, overall parameter blocks. FSDP2 is based on DTensor and manages shards parameter by parameter. Per-parameter sharding makes it easier to combine with mixed precision, gradient checkpointing, CPU offload, and other features, and it is also easier to coordinate with other parallelism methods such as tensor parallelism.
Configuration also differs. FSDP1 specifies strategies such as FULL_SHARD through sharding_strategy. FSDP2 controls whether to release shards after forward through parameters such as reshard_after_forward; the effect of FULL_SHARD roughly corresponds to reshard_after_forward=True. The following code is a conceptual illustration. Specific API paths, device names, and parameter names vary with the PyTorch version and vendor backend, so actual use should follow the documentation for the corresponding version:
# Illustrative code: per-layer sharding with FSDP2. Actual APIs and device backends depend on the version documentation.import torchfrom torch.distributed.device_mesh import init_device_meshfrom torch.distributed.fsdp import fully_shard, MixedPrecisionPolicymesh = init_device_mesh("cuda", (world_size,)) # The device name for domestic cards is provided by the vendor backend.mp_policy = MixedPrecisionPolicy(param_dtype=torch.bfloat16, # Use bf16 parameters in forward and backward.reduce_dtype=torch.float32, # Use fp32 for gradient reduction to reduce accumulation error.)# First shard each Transformer layer, then shard the outer module.for layer in model.layers:fully_shard(layer, mesh=mesh, mp_policy=mp_policy, reshard_after_forward=True)fully_shard(model, mesh=mesh, mp_policy=mp_policy)
For trillion-parameter models, full sharding alone is usually not enough. In practice, data parallelism, tensor parallelism, and pipeline parallelism are often combined into 3D parallelism. Tensor parallelism involves frequent communication and is generally placed within a node, relying on high-bandwidth interconnect. Pipeline parallelism has lower communication volume and is suitable for cross-node deployment. The number of shards, parallelism dimensions, and pipeline stages must be repeatedly measured and tuned, with the goal of balancing cluster scale and per-card memory.
3. How to Validate the Training Pipeline
“Completing the full training pipeline from model loading and sharding scheduling to gradient synchronization” sounds abstract, but each stage can have acceptance metrics.
First, model loading. Large-scale checkpoints usually use sharded storage formats, such as safetensors files split by tensor or distributed checkpoint formats. Three things need to be checked: whether the number of concurrent loading threads is appropriate, whether loading time and peak memory are acceptable, and whether the checkpoint can be re-sharded according to the new parallelism degree. During acceptance, weights can be compared tensor by tensor before and after re-sharding to confirm that errors are within floating-point precision.
Second, sharding scheduling. Confirm that computation graph partitioning, device mapping, and peak memory control are reasonable. It is advisable to record peak memory for each card and calculate deviation from the mean. If one card is noticeably higher than the others, a common cause is that the embedding or output head of the first or last layer is placed on the same device; check the layer partitioning method first. A deviation above 10% can be used as a starting point for investigation; this figure is an empirical practice, not a universal standard.
Third, gradient synchronization. Use collective communication benchmarks to measure the actual bandwidth of all-reduce, reduce-scatter, and all-gather, and compare it with theoretical bandwidth. Then use profiling tools to inspect the overlap ratio between communication and computation. If the overlap ratio is very low and most time is spent waiting for communication, check gradient bucket size and communication stream scheduling.
Fourth, numerical correctness. Define an acceptable error range before training. A common practice is to compare the loss curve step by step with a reference platform under the same random seed and the same data, comparing deviations over the first few hundred or even few thousand steps. Mixed-precision accumulation, reduction, and optimizer updates can all introduce differences, which need to be investigated item by item.
Fifth, checkpoint resume. Periodically save checkpoints during training, then interrupt the job and restore from the most recent checkpoint. The loss after restoration should continue from before the interruption. Pay particular attention to whether optimizer states are consistent with shards, whether random number states are saved correctly, and whether the data reading position is accurate.
Common acceptance issues and corresponding investigation directions are as follows:
- Out-of-memory during loading: load shard by shard and reduce the number of concurrent reads.
- Uneven device load: check layer partitioning and embedding placement.
- Communication timeout: check topology configuration, NIC binding, and timeout parameters.
- Checkpoint resume failure: check shard metadata for optimizer states and random number states.
4. Boundaries of Train-Inference Integrated Architecture
Domestic accelerator cards are positioned for both training and inference, meaning the same hardware supports both training and inference deployment. The theoretical advantage of this architecture is that the operator libraries, communication libraries, and precision validation system accumulated during training can be directly used for inference.
However, this advantage has preconditions. Only when operator libraries, precision systems, and software stack versions remain consistent can training-side adaptation experience migrate to inference with fewer changes. The bf16 or fp8 computation paths commonly used in training are not necessarily the same as the quantization paths and KV cache management methods used on the inference side. If implementations differ between the two sides, the inference side still needs separate validation of numerical results and performance. When evaluating such platforms, readers should ask clearly whether training and inference share the same operator implementations and where the differences lie.
5. Industry Observations and Open Questions
Three observations can be drawn from this type of adaptation case.
First, training code for open-source large models is expanding from a single hardware ecosystem to multiple platforms, making hardware abstraction at the framework layer more important.
Second, the main workload of training adaptation is usually concentrated in operator coverage, communication libraries, and numerical debugging, rather than in the model structure itself. The same model structure does not mean training results can be reproduced directly.
Third, most public reports on adaptation only state that adaptation was “completed” and rarely provide comparable data such as training throughput, model FLOPs utilization, convergence curves, and software versions. When this information is missing, conclusions are difficult to evaluate independently.
Two questions still require empirical answers. First, under the same model and same data, how large is the difference in convergence curves between a domestic platform and a reference platform? Second, during weeks-long training, what are the hardware failure rate and mean recovery time?
For enterprises and developers currently selecting platforms, the questions above can be organized into a verification checklist, with suppliers asked to provide corresponding test data. Only when these metrics can be reproduced can the actual capability of domestic compute platforms for ultra-large-scale training be judged clearly.
