A Technical Guide to Adapting Emerging AI Accelerators for Ultra-Large Model Training
As trillion-parameter large language models become prevalent, traditional GPU memory is insufficient for training, necessitating robust distributed parallel capabilities. Recently, emerging AI accelerator vendors have successfully adapted these ultra-large models, marking a shift from inference to large-scale training in their ecosystems. This article provides a general technical framework for adapting ultra-large model training on alternative hardware, covering software and hardware synergy, native FSDP2 implementation, and practical engineering methodologies.
1. Background: New Requirements for Ultra-Large Model Training
The industry recently witnessed the release of an open-source large language model with a parameter scale reaching 2.8 trillion. Whether for inference or training, such trillion-parameter models place extremely high demands on the underlying computing infrastructure. A single card’s memory is far from sufficient to hold model parameters, optimizer states, and activations, making it necessary to rely on the distributed parallel capabilities of large-scale clusters.
Concurrently, emerging GPU vendors have claimed to complete the training adaptation of such open-source models using their flagship unified training and inference accelerators and self-developed software stacks. This development has connected the entire training chain—from model loading and shard scheduling to gradient synchronization—reflecting that these emerging AI accelerator ecosystems are evolving from “capable of inference” to “capable of training,” and further to “capable of training ultra-large models.” This article does not focus on specific vendor products but extracts a general technical framework for ultra-large model training adaptation to help developers understand the underlying engineering logic.
2. The Technical Foundation: Hardware and Software Stack Synergy
2.1 The Significance of Unified Training and Inference Architecture
Modern AI accelerator cards generally emphasize a “unified training and inference” design, meaning the same hardware can support both high-throughput inference and large-scale distributed training. This imposes several core requirements on the hardware:
- High-bandwidth memory and large-capacity HBM: Training requires parameters, gradients, and optimizer states to reside in memory simultaneously. Memory capacity and bandwidth directly determine the shard scale a single card can handle.
- High-speed interconnects: High-speed networking (such as RDMA) between nodes and high-bandwidth inter-card connectivity within nodes are crucial to ensure the efficiency of collective communications like AllReduce.
- Stability: Continuous training spanning weeks imposes stringent requirements on hardware failure rates and error correction capabilities.
2.2 Self-Developed Software Stack: The Key to Adaptation
Hardware alone is far from enough. Standard training frameworks (like PyTorch) are built by default for mainstream accelerators. To run training on emerging hardware, a compatible software stack must be provided, typically including:
- CUDA-like programming model and runtime: Provides a unified device programming interface, lowering the migration cost for upper-layer frameworks.
- Operator libraries: High-performance implementations covering core Transformer operators (MatMul, Attention, LayerNorm, Optimizer, etc.). Fused operators are often necessary to reduce memory access overhead.
- Communication libraries: Compatible with NCCL collective communication semantics, supporting primitives like Ring/Tree AllReduce, AllGather, and ReduceScatter.
- Framework adaptation layer: Allows mainstream training frameworks to seamlessly switch backends through device abstraction (similar to an accelerator plugin mechanism).
From a migration cost perspective, a well-designed software stack should strive for “zero or minimal modifications to model code,” which is an important metric for adaptation maturity. Schematically, switching the backend usually only requires changes similar to the following:
# Pseudocode example: Device and backend switchingdevice = "musa" # or "cuda" and other generic device identifiersmodel = model.to(device)# Existing FSDP/DDP distributed wrapping logic remains unchanged
3. Native FSDP2: The Parallel Core for Ultra-Large Models
3.1 Why Full Sharded Data Parallel is Necessary
Even with mixed precision (FP16/BF16 for parameters, FP32 for optimizer states), a 2.8-trillion-parameter model requires tens of terabytes of memory for parameters and optimizer states alone, making sharding imperative. The core idea of Fully Sharded Data Parallel (FSDP) is to shard model parameters, gradients, and optimizer states across all data parallel processes. During forward and backward passes, it temporarily aggregates them via AllGather and releases them immediately after use, compressing the memory footprint to a 1/N magnitude.
3.2 Two Keywords in the “Native” and “Multimodal” Path
The original context mentions building a “native FSDP2 multimodal training path,” which entails two layers of meaning:
- Native FSDP2: This does not simply mean porting an old wrapping implementation. It adopts the framework’s next-generation sharding implementation (based on DTensor tensor sharding abstraction), supporting finer-grained sharding strategies, lower communication redundancy, and better combination capabilities with hybrid parallelism (data parallelism × tensor parallelism × pipeline parallelism). Native adaptation means that shard scheduling and gradient synchronization directly interface with the underlying communication library, avoiding the performance loss of multi-layer wrapping.
- Multimodal path: Current flagship models are mostly “text + vision” multimodal architectures. The training chain must simultaneously handle heterogeneous data (image-text pairs, pure text corpus, etc.), involving the joint training of vision encoders and language models, as well as the packing and scheduling of different modality samples. This requires the data pipeline to support multi-source data mixing, dynamic sequence packing, and loss masking.
3.3 Three Stages of the Complete Training Chain
A mature training adaptation usually requires verifying the following end-to-end chain:
- Model loading: Supports efficient loading of ultra-large weights from formats like checkpoint or safetensors, including weight format conversion and pre-sharding.
- Shard scheduling: Automatically or semi-automatically selects sharding dimensions and reorganization strategies based on cluster topology to balance communication volume and memory peaks.
- Gradient synchronization: Executes ReduceScatter after gradient sharding during backpropagation, combined with gradient accumulation and overlapping communication to mask synchronization overhead.
Furthermore, engineering must include: checkpoint resume (frequent checkpoint saving and rapid recovery), fault detection and automatic restart, and numerical precision validation (aligning loss curves with reference implementations). These often determine whether long-term training can truly succeed.
4. General Methodology for Adaptation
From this case, we can abstract the general steps for adapting emerging AI accelerators for ultra-large model training:
- Operator alignment: Prioritize numerical consistency and performance of core Transformer operators.
- Small-scale validation: First verify convergence on a scaled-down version of the model, comparing the loss curve against a standard backend.
- Parallel strategy stress testing: Measure MFU (Model FLOPs Utilization) on the target cluster. Tune shard granularity, micro-batch, and communication overlap.
- Stability run: Conduct continuous training for hundreds to thousands of steps, monitoring issues like memory fragmentation, communication timeouts, and slow nodes.
- Ecosystem completion: Synchronously follow up on supporting capabilities such as inference deployment, fine-tuning toolchains, and tokenizer compatibility.
5. Conclusion and Outlook
The successful adaptation of emerging AI accelerators for trillion-parameter model training marks a critical step from “usable” to “effective.” However, we must be objective: there is still ground to cover regarding software ecosystem maturity, cluster scale limits, and overall MFU levels compared to top-tier solutions. For developers, focusing on software stack compatibility, documentation, and toolchain completeness is more practically significant than merely comparing hardware parameters. It is foreseeable that as open-source large models and emerging computing power converge, large model training on heterogeneous hardware will become a routine engineering endeavor. Native distributed solutions like FSDP, a comprehensive operator ecosystem, and a stable training chain will remain the core pillars of this proposition.
