Trillion-Parameter LLM Training Adaptation on Domestic GPUs: From "It Can Train" to "Ready to Train Out of the Box"

    This article examines the full-pipeline training adaptation of a domestic all-function GPU to a flagship multimodal model approaching 3 trillion parameters. On a dual-node setup with 16 compute cards, all training processes completed 400 consecutive optimizer updates, with loss and gradient norms remaining finite throughout and no numerical overflow or abnormal interruption. It breaks the adaptation engineering chain into six parts: clarifying what "adaptation" means, building a native sharded training path, cross-node communication tuning, interpreting long-run stability tests, adaptation differences across three model types, and the engineering loop that takes a platform from "it can train" to "ready to train out of the box." A selection and acceptance checklist is included at the end.

    A domestic all-function GPU has, for the first time, been adapted to a flagship multimodal model with a parameter count approaching 3 trillion. On a dual-node environment with 16 compute cards in total, all training processes completed 400 consecutive optimizer updates. Loss and gradient norms stayed finite throughout, with no numerical overflow and no abnormal interruption. From training a scientific base model from scratch to pushing forward the training of trillion-parameter-scale models, domestic compute is rapidly clearing the “it can train” threshold.

    There is a large body of engineering detail between “it runs” and “it trains stably.” How are parameters sharded? How are gradients synchronized across nodes? When does numerical stability break down under bf16 precision? And what techniques keep training stable across 400 steps, or even tens of thousands?

    This article systematically breaks the technical chain behind this training adaptation into six parts:

    1. Concept clarification;
    2. Building the sharded training path;
    3. Cross-node communication tuning;
    4. Reading long-run stability tests;
    5. Adaptation differences across three model types;
    6. The engineering loop from “it can train” to “ready to train out of the box.”

    A ready-to-use selection and acceptance checklist is included at the end.

    1. Clarifying the concepts: training adaptation is not native pretraining

    The term “adaptation” is used broadly in the context of domestic chips, but it covers very different levels of work. It is worth distinguishing the following layers.

    Layer Typical work Verifiable signal
    Inference adaptation Deploy inference on the target hardware as soon as a new model is released Inference throughput, first-token latency
    Fine-tuning / post-training adaptation Complete supervised fine-tuning, preference optimization, and so on on the target hardware Small-scale convergence curves, evaluation metrics
    Full-pipeline training adaptation Complete the full loop of weight loading, shard scheduling, gradient synchronization, and optimizer updates on the target hardware, and run stably over consecutive steps Finite loss and gradient norms across consecutive optimizer updates, no interruption
    Native pretraining Start from random initialization on the target hardware and consume a massive corpus to train the base model A complete pretraining loss curve, an explanation of the compute used for training

    What people often called “Day 0 adaptation” in the past mostly referred to completing inference deployment on the day a new model was released. What was completed this time is full-pipeline training adaptation, which is significantly different in both effort and difficulty.

    The two cannot be conflated, for the following reasons:

    • Inference adaptation mainly tests operator availability on the target hardware and whether the precision matches a reference implementation.
    • Training adaptation must also make backpropagation, optimizer state updates, and cross-card gradient synchronization all work end to end. With parameters in the billions and gradients that are nonzero and dense, the numerics are extremely sensitive, and any operator error can be amplified over hundreds or thousands of accumulated steps.
    • Some model technical reports in the industry verify operator performance across several hardware routes side by side, but this is usually validation of the inference stage. Which compute was originally used for base pretraining is often not disclosed.

    For a team making a selection decision, the right question is not “does it support this model,” but three questions:

    1. Which layer of adaptation was validated?
    2. Which training stages were covered?
    3. Over how many consecutive steps did it run stably?

    Everything discussed in the rest of this article refers to “full-pipeline training adaptation.”

    2. The native sharded training path: from model loading to gradient synchronization

    For large models that cannot fit on a single card, memory capacity determines the parallelism strategy.

    Take 1 trillion parameters as an example. Using the industry’s common rough memory-estimation rule of thumb (K = 12):

    • The parameters and gradients alone, plus the momentum and variance states of an Adam-style optimizer, require roughly 16 TB of memory. Here the fp32 master weights, momentum, and variance each take 4 bytes, while the bf16 parameters and gradients each take 2 bytes.
    • 16 TB is equivalent to the entire memory of 200 80 GB accelerator cards. And this does not yet include activations, temporary buffers, and memory fragmentation.

    Simply adding more cards therefore does not solve the problem; sharding is essential.

    The native sharding approach is centered on “parameter-level sharding” and advances along three lines.

    1. Model loading: make it fit first, then make it compute correctly

    • Meta-device initialization: If you materialize the weights before loading, the model can blow up memory before training even starts. A safer approach is to build the model skeleton on the meta device first, keeping only structure and shape information.
    • Rank-based loading: After sharding is set up, each process loads only the weights corresponding to its own shard. Loading changes from “one full copy of the weights per card” to “each card reads only its own share.”
    • Multimodal structure: The vision encoder, the projection layers, and the language backbone differ substantially in structure. The projection layers are small and are best sharded along with the backbone; a small vision tower can also be left unsharded to reduce communication.
    • Operator mapping: Some chips do not natively support certain weight layouts or data types, so format conversion must be done at load time, and numerical consistency before and after the conversion must be verified.

    2. Shard scheduling: trading off memory, communication, and speed

    Sharding splits a model that cannot fit on one card across multiple cards:

    • Before the forward pass, each card temporarily gathers the parameters it needs;
    • The parameters are released immediately after computation finishes;
    • The backward pass works the same way;
    • After gradients are aggregated via reduce-scatter, each process keeps only the gradients corresponding to its own parameter shard.

    This leads to two direct consequences:

    • Per-card memory usage drops from being proportional to the total parameter count to roughly “total memory requirement ÷ number of cards in the shard group.” The shard group is the set of processes that jointly hold a model’s shards.
    • Each training step adds two rounds of parameter-gathering communication, one for the forward pass and one for the backward pass, plus one round of gradient reduce-scatter.

    With the parameter count denoted Ψ (in B) and the per-parameter byte count b, the approximate per-card, per-step communication volume is as follows:

    Parallelism Per-card per-step communication (approx.) Model state memory (approx.)
    Standard data parallelism (full gradient all-reduce) 2 × Ψ × b 16 × Ψ
    Sharded data parallelism 3 × Ψ × b 16 × Ψ ÷ N

    Here N is the number of cards in the shard group. The cost of sharding data is roughly 50% more communication, in exchange for a multiplicative drop in memory usage. This also shows that whether sharding can “train fast” depends on whether collective-communication bandwidth can keep up.

    The following illustrative code shows a typical way to organize a native sharding scheme (the APIs are illustrative; actual calls should follow the interface of the framework version in use):

    1. from torch.distributed.device_mesh import init_device_mesh
    2. from torch.distributed.fsdp import fully_shard
    3. # mesh: describes how processes are organized across the cluster; dp_size is the number of cards in the shard group
    4. mesh = init_device_mesh(device_type, (dp_size,), mesh_dim_names=("dp",))
    5. # Shard one submodule at a time (e.g., Transformer layers): gather parameters before compute, release them after
    6. for layer in model.layers:
    7. fully_shard(layer, mesh=mesh)
    8. # Shard the top level once more to cover non-hierarchical parameters on the backbone (e.g., embedding, output head, normalization layers)
    9. fully_shard(model, mesh=mesh)
    10. # For a meta-device-initialized model, load each shard's weights into place after sharding
    11. load_sharded_weights(model, checkpoint_path)

    For models with nearly a trillion or several trillion parameters, where even a single layer does not fit on one card, sharding alone is still not enough and must be combined further:

    • Tensor parallelism (TP): splits a single layer’s matrix operations across cards. It requires high-frequency communication and should be placed within a high-bandwidth domain, such as the range formed by 8 cards on a single node connected through high-bandwidth interconnects;
    • Pipeline parallelism (PP): splits the model by layer segments and executes them in a pipeline. It needs little communication but requires scheduling of micro-batches;
    • Expert parallelism (EP): distributes MoE experts across different cards, with routing deciding where tokens go, so the communication pattern varies dynamically with routing.

    These forms of parallelism are often stacked on top of sharding, forming multi-dimensional parallelism.

    3. Dual-node 16-card cross-node joint training: communication is the main bottleneck

    Multi-card single-node communication can use high-bandwidth interconnects, while cross-node communication can only go over the network. The dual-node 16-card scale is small, but it is the smallest credible unit for testing cross-node capability: all training processes must take part in cross-node gradient synchronization, and the number of nodes is enough to expose topology and configuration problems.

    1. Topology awareness

    Within a shard group, there are many cross-node communication links. Make sure the shard groups are distributed evenly across nodes, so that all shard groups are not crowded onto the same cross-node link, which would cause congestion.

    2. Choose and validate the communication backend

    • The collective communication library (the underlying library used to perform all-gather, reduce-scatter, all-reduce, and other operations across multiple processes) needs to match the driver, the NIC firmware, and the network protocol stack (such as RDMA). Version mismatch is one of the most common causes of communication timeouts.
    • Before going live, three validations should be done: a cross-node bandwidth benchmark, a full-connectivity check for shard groups, and a long-lived connection stability test (holding communication open for hours and watching for drops or timeouts).

    3. Overlap computation and communication

    Communication libraries typically provide chunked operation primitives that can split one large communication into several smaller chunks and insert computation between chunks:

    • Chunked pipelining of parameter gathering: while the current layer computes with the parameter chunks that have already arrived, the next layer’s parameter chunks are being transferred over the network at the same time, “hiding” communication time inside computation time;
    • Initiating parameter gathering in advance according to the order in which layers arrive during the backward pass, further reducing wait time.

    4. Don’t let data supply fall behind

    Multimodal training data preprocessing includes image decoding, resize and crop, and text tokenization, which are CPU-intensive. When data supply falls short, the GPU idles at the start of every step.

    Countermeasures include:

    • Increasing the number of data-loader processes;
    • Combining “decode while training” with “offline preprocessing and caching”;
    • Storing the dataset on parallel file storage, so that multiple nodes do not read from a single storage source at the same time and contend for bandwidth.

    5. Control fixed overhead

    Fine-grained communication performed at every step brings substantial launch overhead. During configuration, ensure the per-card shard granularity is large enough, and where necessary merge the communication of small tensors to reduce the number of communications per unit of computation.

    4. 400 consecutive updates: which signals to watch in a long-run stability test

    This validation completed 400 consecutive optimizer updates on dual nodes with 16 cards, with loss and gradient norms finite throughout and no numerical overflow or abnormal interruption. The three criteria correspond to the three most common failure modes in training:

    Criterion Corresponding failure mode Common measures
    Loss finite throughout Overflow or underflow produces NaN/Inf, which then spreads through the computation graph bf16 training with fp32 master weights; monitor unscaled gradients; keep sensitive modules such as the embedding table in fp32
    Gradient norm finite throughout Gradient spikes, learning rate too high, anomalous data Global gradient clipping; learning-rate warmup; grouping long-sequence samples separately
    No abnormal interruption Communication timeout, process exit, out-of-memory Set a communication timeout; a job daemon; staggered checkpoint saving

    1. Why the gradient norm deserves separate monitoring

    Under sharded parallelism, gradients are stored in a distributed manner across processes, so any numerical anomaly on a single card is easily “averaged out,” and watching loss alone often fails to detect it. In the training loop, you first need to aggregate the sum of gradient squares across processes and take the square root to obtain the global gradient norm, then clip based on that. Illustrative code:

    1. def global_grad_norm(params):
    2. # Each process computes its local sum of squared gradients
    3. local_sq = sum(p.grad.detach().float().pow(2).sum() for p in params if p.grad is not None)
    4. # Sum across processes to get the global gradient norm
    5. return all_reduce_sum(local_sq).sqrt()
    6. for step, batch in enumerate(dataloader):
    7. loss = model(batch)
    8. # Abort immediately if any process sees a non-finite loss, to prevent the error state from spreading
    9. if not isfinite(loss):
    10. raise RuntimeError(f"non-finite loss at step {step}")
    11. loss.backward()
    12. grad_norm = global_grad_norm(model.parameters())
    13. clip_coef = max_norm / (grad_norm + 1e-6)
    14. # Scale gradients proportionally if they exceed the threshold; skip the update for this step if the norm is non-finite
    15. for p in model.parameters():
    16. if p.grad is not None:
    17. p.grad.mul_(clip_coef if isfinite(grad_norm) else 0.0)
    18. optimizer.step()
    19. optimizer.zero_grad(set_to_none=True)

    2. What 400 steps can and cannot prove

    400 steps is a reasonable starting point for a “long-run stability test,” but it is still not enough to serve as a complete acceptance conclusion for a hyper-scale training run:

    • By a rough estimate under common configurations, 400 steps on dual nodes with 16 cards takes on the order of tens of minutes to about an hour. This is enough to cover the warmup stage and several gradient-accumulation cycles, but it is hard to expose sparse problems that only appear under specific data distributions;
    • At the 10,000-card scale, events such as node failures, slow nodes, and network jitter occur far more frequently;
    • The official “ready to train out of the box” goal also means validation must advance from “it runs” to “stable, reproducible, and operable.”

    A more complete long-run stability test should include the following:

    • Gradient-accumulation boundaries: run continuously under a configuration where the number of micro-batches is a multiple of 2, verifying that the accumulation count is correct and the number of updates per step is consistent;
    • Checkpoint resume: kill some processes forcibly during training; after recovering from a checkpoint, the loss curve should connect seamlessly with the uninterrupted run, with no jumps;
    • Full data traversal: complete at least one full pass over the dataset, covering boundary data such as long samples, special characters, and anomalous images;
    • Alignment with a reference on the same architecture: under the same hyperparameters and data, compare the loss curve against an already-validated training job of the same architecture on other hardware. Due to parallel splitting, operator implementations, and floating-point accumulation order, small deviations are normal, but the trend should be consistent;
    • Horizontal-scaling validation: scale the global batch size in step with 2× and 4× the number of cards, and observe whether the throughput scaling efficiency and the loss curve stay consistent.

    5. From scientific models to trillion parameters: adaptation differences across three model types

    The collaboration between domestic compute and domestic models already covers multiple forms: scientific base models trained from scratch, world models trained natively with a full stack, embodied brain models trained across the full pipeline, and trillion-parameter-scale models now in progress.

    Model form Main challenge Adaptation focus
    Scientific base model Training from scratch, requires a complete pretraining data pipeline Data cleaning and deduplication, tokenizer consistency, loss-curve monitoring throughout training
    World model Spatiotemporal or multimodal generation; high input/output dimensions and long sequences High-dimensional tensor operators, activation memory management, loading throughput for video/time-series data
    Embodied brain model Fusion of vision, language, and action modalities; heterogeneous structure Cross-modal alignment operators, bucketing and batching of different data modalities, checkpoint compatibility for heterogeneous modules
    Trillion-parameter-scale model Parameter count far exceeds single-node capacity Expert parallelism, multi-dimensional parallelism combinations, fault tolerance and self-healing

    These scenarios together make one point: training adaptation is not a one-off task of “getting the model to run,” but a systems-engineering effort covering data, operators, parallelism, fault tolerance, and observability.

    6. From “it can train” to “ready to train out of the box”: how to build the engineering loop

    “Ready to train out of the box” means that once users have the environment and the model configuration, they can start training directly without debugging operators layer by layer. Supporting this goal requires three layers of capability.

    Layer 1: Operator adaptation and precision alignment

    • Operator coverage list: mark the support status of each type of operator involved in the model one by one, including linear layers, attention, normalization, activations, and the loss function, as well as MoE routing and grouped matrix multiplication;
    • Precision-alignment testing: use an industry-standard reference implementation as the baseline, compare outputs layer by layer, set reasonable relative and absolute error thresholds for bf16 precision, and record how the error accumulates with depth;
    • Fallback for missing operators: provide equivalent composite implementations or custom operators for temporarily missing operators, with a clear statement of the performance impact.

    Layer 2: Multi-card coordination and a parallelism strategy library

    • Preload recommended configurations for common parallelism combinations, such as “sharding first,” “tensor parallelism confined within a single node,” “pipeline parallelism across nodes,” and so on;
    • Give parameter recommendations based on card count and network topology, instead of making each user tune from scratch;
    • Build in switches and default values for common strategies such as global gradient clipping, bf16 mixed precision, and activation recomputation.

    Layer 3: Automation toolchain and observability

    • One-click environment check: automatically verify the driver, the communication-library version, node connectivity, and data-path permissions before startup;
    • Distributed launch and job daemon: bring up all training processes uniformly, monitor process liveness and heartbeats, preserve the scene on failure, and restart automatically;
    • Training pipeline: trigger a small-scale smoke test (such as tens of steps) as soon as code is committed, run a long stability test daily, and compare metrics against a baseline;
    • Training metric monitoring: continuously collect throughput, memory usage, loss, gradient norms, communication time, and node health status, configure threshold alerts, and notify on-call staff as soon as anomalies appear.

    When landing on a cloud environment, these three layers of capability are typically realized through a combination of a few foundational services:

    • Use a container service to deliver training images uniformly, ensuring a consistent runtime environment across nodes;
    • Store training data and checkpoints in parallel file storage or object storage;
    • Log and monitoring/alerting services handle real-time observation and anomaly notification for the training process;
    • Use job scheduling to quickly re-orchestrate tasks after a faulty node appears.

    For example, Baidu AI Cloud offers general capabilities such as containers, storage, and log monitoring, which can serve as a foundation for building a training platform.

    7. Selection and acceptance checklist: giving the evaluation something to stand on

    When evaluating whether domestic compute can carry large-model training, you can check the following checklist item by item:

    Dimension Key question Acceptance evidence
    Adaptation layer Is it inference adaptation or training adaptation? Records of consecutive multi-step optimizer updates
    Precision alignment Is the single-layer output consistent with the reference implementation? A layer-by-layer error report
    Numerical stability Are mixed precision and global gradient clipping enabled? Loss and gradient-norm curves in a long stability test
    Communication efficiency How does cross-node scaling efficiency look? Throughput comparison at 2× and 4× card counts
    Fault tolerance Is checkpoint resume smooth? Loss-continuity curve after a forced-kill recovery
    Observability Can anomalies be detected promptly? Monitoring dashboards and alert records

    It is recommended to advance validation in three steps:

    1. Small-scale smoke test: run several hundred steps on dual nodes with 16 cards, confirming that loss and gradient norms are finite and that there is no interruption;
    2. Mid-term long stability test: scale up to the level of days and thousands of steps, adding checkpoint resume and full data traversal;
    3. Scale-out validation: gradually increase the number of cards while validating throughput scaling efficiency and fault self-healing capability in parallel.

    Conclusion

    From 400 consecutive updates running stably on dual nodes with 16 cards, to training a scientific model from scratch and advancing trillion-parameter-scale models, the training capability of domestic all-function GPUs is moving from “it can train” toward “ready to train out of the box.” For a technical team, selection should step beyond the surface-level question of “does it support a given model” and focus on the underlying engineering capabilities that determine long-term training efficiency and cost: the sharding path, cross-node communication, numerical stability, and the automation toolchain. Only by distilling adaptation work into standardized operator libraries, strategy libraries, and pipelines can domestic compute truly become a reliable foundation for large-model training.