Domestic GPU Adaptation for LLM Training: A Two-Node, Sixteen-GPU Validation Breakdown
This article clarifies the differences between inference adaptation, training adaptation, and base-model pretraining on new hardware, then explains why trillion-parameter model training is hard—covering the memory wall, communication overhead, and numerical stability. It walks through an FSDP2-based multimodal training pipeline with example PyTorch code, and discusses the engineering practices needed to move from a single successful run to reusable, long-running training infrastructure on domestic GPU stacks.
1. Distinguish Three Things First: Inference Adaptation, Training Adaptation, and Base-Model Pretraining
In the LLM space, “a new model runs on a chip on day one” is often conflated with “the model can be trained on that chip.” The effort behind these two statements differs greatly.
Inference adaptation mainly involves operator integration and inference engine optimization. It validates whether operator computations are correct and whether the inference graph is efficient. Training adaptation, by contrast, requires the entire training pipeline to work end to end: model loading, parameter sharding, scheduling and orchestration, gradient synchronization, and mixed-precision numerical stability—with results that remain verifiable after long-running execution.
There is another layer that is frequently overlooked: completing training adaptation does not mean the base model was pretrained on that chip. Some vendors validate multiple hardware paths side by side in their technical reports; such work is mostly compatibility verification. When reading this kind of information, you should distinguish between “adaptation validation” and “pretraining output” as two separate levels.
2. Why Trillion-Parameter Models Are Hard
2.1 The Memory Wall
With mixed precision plus an Adam-style optimizer, each parameter occupies roughly 16 bytes: 2 bytes for BF16 weights, 2 bytes for BF16 gradients, 4 bytes for the FP32 master weights, and 8 bytes for the two FP32 optimizer momentum states. A three-trillion-parameter model therefore requires about 48 TB of memory for model states alone. Single-GPU memory is far smaller than this, so sharding strategies like ZeRO or FSDP are essential—they partition parameters, gradients, and optimizer states across many GPUs and aggregate them on demand during the forward and backward passes.
2.2 Communication Overhead
Sharding introduces frequent communication. Intra-node communication typically relies on high-bandwidth interconnects, while inter-node communication relies on RDMA networks. For MoE models, the efficiency of All-to-All communication in expert parallelism directly determines overall throughput. Imbalanced expert loads also slow training down.
2.3 Numerical Stability
In mixed-precision training, gradient explosions, abnormal loss values, and NaN propagation are common failures. The key indicator of a correct training stack is whether the loss and gradient norm remain finite over long optimization runs. Hundreds of consecutive update steps can expose some issues in operator precision, gradient synchronization, initialization, and learning-rate scheduling, but they cannot prove long-horizon convergence.
3. The Training Pipeline Described in Public Information
According to publicly described cases, this adaptation centers on the FSDP2 multimodal training path. That description is not accompanied by a paper, technical report, or verifiable test configuration, so the following explains each stage following the general workflow.
(1) Model loading and weight partitioning: Load the very large model from a checkpoint, distribute parameters to each training process according to the sharding strategy, verify metadata consistency, and support resuming from checkpoints.
(2) Sharded scheduling and communication orchestration: On top of parameter sharding, FSDP2 supports bucketed prefetching, which overlaps communication with computation and reduces the idle time GPUs spend waiting for communication.
(3) Gradient synchronization and precision guarantees: After backpropagation, sharded gradients are reduced to ensure numerical consistency across GPUs. Under the BF16 path, you need to confirm whether loss scaling is still required.
(4) Multimodal support: Jointly training a vision encoder with a language model places higher demands on the data pipeline, feature alignment, and memory management.
Below is an example of FSDP wrapping code. It demonstrates how the APIs are composed; build_model and DecoderLayer need to be replaced with actual implementations, device-related calls need to be swapped for the vendor-provided device interfaces, and you should confirm environment variables and the launch method before running it directly.
import functoolsimport osimport torchimport torch.distributed as distfrom torch.distributed.fsdp import (FullyShardedDataParallel as FSDP,MixedPrecision,ShardingStrategy,)from torch.distributed.fsdp.wrap import transformer_auto_wrap_policy# On a domestic software stack, replace with the corresponding collective communication backenddist.init_process_group(backend="nccl")local_rank = int(os.environ["LOCAL_RANK"])torch.cuda.set_device(local_rank)model = build_model(config) # Placeholder: user-defined model construction functionwrap_policy = functools.partial(transformer_auto_wrap_policy,transformer_layer_cls={DecoderLayer}, # Placeholder: the decoder layer class in the model)model = FSDP(model,sharding_strategy=ShardingStrategy.FULL_SHARD,mixed_precision=MixedPrecision(param_dtype=torch.bfloat16,reduce_dtype=torch.float32, # Reduce gradients in FP32 for better numerical stabilitybuffer_dtype=torch.bfloat16,),auto_wrap_policy=wrap_policy,device_id=local_rank,)
What a domestic software stack must do is fully support these communication primitives on its self-developed compute backend—including AllReduce, AllGather, ReduceScatter, and All-to-All—along with automatic differentiation of operators, and integrate with mainstream training frameworks.
4. Engineering System: From a Single Successful Run to Reusability
A single successful run only demonstrates feasibility. To keep training stable over long periods, the following capabilities are also needed.
1. Operator regression testing: Automatically compare the precision and performance of new operators to ensure that operators introduced by new models…
