Training Adaptation for Trillion-Parameter Large Models on Chinese-Made GPUs: Technical Approaches and Engineering Practice
This article explains how to adapt a Chinese-made full-featured GPU for training a flagship mixture-of-experts (MoE) model with nearly 3 trillion parameters. It distinguishes training adaptation from inference support and outlines a native FSDP-style distributed training pipeline. It also covers the added challenges of MoE and multimodal models, mixed-precision numerical stability checks, stability acceptance criteria, and the engineering practices needed to scale this work.
Introduction: From Running Inference to Training
As large models move toward trillion-parameter scale, the meaning of model adaptation is changing. In the past, when the industry discussed adapting open-source large models to a compute chip, it usually meant inference-side operator alignment. The goal was to deploy the model and get it running soon after release. Training adaptation is different. It means building a complete training pipeline on the target platform, covering model loading, parameter sharding, forward and backward computation, gradient synchronization, and optimizer updates. The two tasks differ greatly in technical difficulty.
This article uses a representative project as its background: training adaptation of a flagship MoE model with nearly 3 trillion parameters on a full-featured Chinese-made GPU. It breaks down the key technical points and engineering methods.
1. Clarifying Key Concepts: Training Adaptation Is Not Inference Adaptation
Before discussing technical solutions, several easily confused concepts need to be clarified.
1. Day 0 inference adaptation
This refers to completing operator compatibility and deployment for inference on the compute platform on the day a new open-source model is released. It mainly tests the inference framework’s operator coverage, quantization support, and scheduling optimization.
2. Training adaptation
This refers to a model being able to run the complete training process on the target compute platform. That includes implementing distributed parallelism strategies, gradient communication, and optimizer state management. Training places far higher demands on numerical stability, memory management, and communication efficiency than inference does.
3. Pretraining compute attribution
A model being successfully adapted to a chip does not mean it was originally pretrained on that chip. Model developers commonly verify operators and parallelism schemes across multiple compute platforms in parallel. This is engineering validation, not a statement about where pretraining compute came from. When reading technical reports, distinguish among inference operator validation, training pipeline validation, and the compute actually used for pretraining.
2. Core Technical Path: Building a Native Distributed Training Pipeline
2.1 Implementing Fully Sharded Data Parallelism (FSDP)
A single accelerator’s memory is far too small to hold the full parameters, gradients, and optimizer states of a trillion-parameter model. The mainstream industry approach is fully sharded data parallelism (FSDP-style strategies). It splits parameters, gradients, and optimizer states across all training cards and gathers them on demand during computation.
Building a native FSDP training path on Chinese-made GPUs requires connecting the following steps:
- Model loading and shard initialization: Distribute model weights evenly across training processes according to the sharding strategy. This avoids memory peaks that overflow during loading.
- Parameter gathering during forward computation: Use all-gather communication to temporarily collect the current layer’s parameters before computation, then release them immediately afterward.
- Backward propagation and gradient reduction: Reduce-scatter gradients so that each card keeps only the gradient shard it is responsible for.
- Optimizer update: Each process runs the optimizer step only on its local shard, which greatly reduces memory usage.
# Illustrative FSDP-style sharded training loop (pseudocode)for step in range(total_steps):batch = next(data_loader)with fsdp_forward_context(model): # Gather parameters on demandloss = model(batch)loss.backward() # Gradients are sharded and reduced automaticallyclip_grad_norm_(model, max_norm=1.0)optimizer.step() # Update only the local shardoptimizer.zero_grad()check_finite(loss, grad_norm) # Monitor numerical stability
2.2 Additional Challenges for Multimodal and MoE Architectures
For multimodal models and mixture-of-experts (MoE) architectures, training adaptation becomes considerably more complex:
- Expert parallelism (EP): MoE models distribute different experts across different devices and route tokens with all-to-all communication. This places
