Full-Stack Adaptation for Training Trillion-Parameter Models on Domestic GPUs

    This article examines what full-stack training adaptation entails for trillion-parameter models on domestic GPUs, distinguishing Day 0 inference adaptation and operator validation from end-to-end training adaptation. It outlines an FSDP2-based training path, discusses multimodal sharding and cross-node communication challenges, and reviews validation criteria such as loss, gradient norm, and uninterrupted optimizer steps using a two-node, 16-GPU example. It also summarizes numerical-stability safeguards and the engineering capabilities needed to move from “can train” to “ready to train out of the box.”

    Full-Stack Adaptation for Training Trillion-Parameter Models on Domestic GPUs

    Introduction: The Gap Between “Can Run Inference” and “Can Train Stably”

    As open-source large models scale from tens of billions of parameters to trillions, more teams are asking a core question: can domestic full-featured GPUs truly support complete training for very large models, rather than only inference deployment?

    Recently, a notable development emerged in the industry: a domestic GPU vendor, using its flagship training-and-inference integrated compute card and in-house software stack, completed training adaptation for an open-source flagship model with nearly 3 trillion parameters. On a scale of two nodes and 16 cards, it achieved 400 consecutive stable training steps, with loss and gradient norm remaining finite throughout and no numerical overflow or abnormal interruption. This case offers a window into the training capability of domestic compute.

    This article removes specific product information and analyzes the topic from a general technical perspective: what does training adaptation for very large models actually involve? How is it fundamentally different from “Day 0 inference adaptation”? How is an FSDP2 training path constructed? And how does an engineering system support frontier large models in moving from “can train” to “ready to train out of the box”?

    1. Clarifying Concepts: Inference Adaptation, Operator Validation, and Training Adaptation

    When discussing adaptation between large models and compute platforms, several concepts are often confused and must be distinguished first.

    1.1 Day 0 Inference Adaptation

    This refers to a new compute platform completing operator adaptation and deployment on the inference side on the same day an open-source model is released, allowing users to run model inference on the new hardware. It mainly tests operator library coverage, inference framework compatibility, and quantization and graph optimization capabilities. It is a relatively lower-barrier but highly visible form of adaptation.

    1.2 Joint Validation of Training Operators

    Some open-source model teams validate multiple compute paths side by side in technical reports, for example validating a fine-grained expert parallelism (EP) scheme on both a certain type of NPU and mainstream GPUs. Such validation is usually operator correctness validation for inference or partial training stages, and it is not equivalent to the model having completed pretraining on those chips. The industry consensus is that unless the model team explicitly announces it, “side-by-side validation” should not be interpreted as “the original pretraining compute source.”

    1.3 Full-Stack Training Adaptation

    This is the focus of this article. It requires the compute platform not only to run the model’s forward and backward computation, but also to connect the complete training path from model loading, weight sharding, communication scheduling, and optimizer state management to gradient synchronization, while maintaining numerical stability over long periods at multi-card and multi-node scale. Its engineering difficulty far exceeds inference adaptation, mainly in the following areas:

    • Memory wall: The total size of weights, gradients, and optimizer states for trillion-parameter models far exceeds single-card memory, so sharded training is mandatory;
    • Communication wall: Cross-node gradient synchronization places extremely high demands on network bandwidth and communication library efficiency;
    • Numerical stability: During long training runs, any numerical overflow or gradient explosion can cause training collapse;
    • Fault tolerance and recovery: Long-cycle training must handle hardware failures and checkpoint resumption.

    2. Building a Native FSDP2 Training Path

    To address these challenges, the industry commonly adopts Fully Sharded Data Parallel (FSDP) to reduce per-card memory usage. The evolved version of FSDP, often called FSDP2, makes systematic improvements in sharding granularity, communication-computation overlap, and memory management. Building a native FSDP2 multimodal training path is the core engineering work of training adaptation.

    2.1 Four Stages of a Complete Training Path

    A practical training adaptation path must cover at least the following stages:

    1. Model loading: Support efficient loading and on-demand initialization of very large weights, avoiding full weights residing on every card;
    2. Sharding scheduling: Partition parameters, gradients, and optimizer states across devices in the data parallel group according to strategy, and properly handle the combination of tensor parallelism, pipeline parallelism, and data parallelism;
    3. Communication-computation overlap: Asynchronously execute gradient reduction communication (all-reduce/reduce-scatter) during backward computation to maximize hardware utilization;
    4. Gradient synchronization and update: Ensure cross-node gradient consistency, complete optimizer updates, and clip and monitor abnormal gradients.

    A typical sharded training configuration is illustrated below:

    1. # Illustrative pseudocode: training configuration based on sharded data parallelism
    2. training_config = {
    3. "sharding_strategy": "full_shard", # Full sharding of parameters, gradients, and optimizer states
    4. "mixed_precision": "bf16", # Mixed precision to reduce memory and communication
    5. "gradient_clipping": 1.0, # Gradient clipping threshold to prevent explosions
    6. "activation_checkpointing": True, # Activation recomputation to save memory
    7. "overlap_communication": True, # Overlap communication with computation
    8. }

    2.2 Additional Challenges in Multimodal Scenarios

    If the target model is multimodal, the training path also needs to handle differences in sharding strategies between heterogeneous modules such as the vision encoder and the language model, pipeline bubbles caused by unbalanced throughput across modalities, and the stability of cross-modal gradient flow. Native support, rather than after-the-fact patching, is key to ensuring training efficiency and stability.

    3. Cross-Node Joint Training Validation: A Two-Node, 16-GPU Example

    Successful training adaptation cannot be judged only by whether a single step runs. It depends on the sustained stability of cross-node joint training. A common industry validation approach is to run hundreds of consecutive training steps on a small-to-medium cluster and observe key metrics.

    3.1 Validation Metrics and Criteria

    A rigorous validation typically focuses on:

    • Number of optimizer updates: All training processes should complete a preset number of consecutive updates (for example, 400) without any process falling behind;
    • Loss curve: Values remain finite throughout, with no NaN/Inf, and the downward trend meets expectations;
    • Gradient norm: Bounded throughout, with no abnormal spikes;
    • No abnormal interruption: No process crashes, communication timeouts, or numerical overflow.

    Illustrative monitoring code:

    1. for step, batch in enumerate(dataloader):
    2. loss = model(batch)
    3. loss.backward()
    4. grad_norm = clip_grad_norm_(model.parameters(), max_norm=1.0)
    5. if not isfinite(loss) or not isfinite(grad_norm):
    6. logger.error(f"step={step} numerical anomaly, triggering rollback and checkpoint recovery")
    7. restore_from_checkpoint()
    8. continue
    9. optimizer.step()
    10. scheduler.step()
    11. if step % 10 == 0:
    12. logger.info(f"step={step} loss={loss.item():.4f} gnorm={grad_norm:.4f}")

    3.2 Engineering Safeguards for Numerical Stability

    The absence of numerical overflow during long training runs is supported by a set of engineering measures:

    • Mixed precision strategy: Use low precision (such as BF16) for forward and backward computation, while maintaining high-precision accumulation for master weights and optimizer states;
    • Gradient clipping and dynamic loss scaling: Suppress occasional large gradients and prevent cascading overflow;
    • Communication consistency checks: Ensure cross-node reduction results are consistent and avoid divergence caused by accumulated communication errors;
    • Periodic checkpoints: Combine with fault detection to enable fast checkpoint resumption.

    4. From Single-Point Validation to Scaled Practice

    Training adaptation for a single model is only the starting point. A mature engineering system needs repeated validation at larger scale and across more model types. Practical directions the industry can learn from include:

    • Training from scratch: Complete full training of foundation models with tens of billions to hundreds of billions of parameters from scratch, validating the entire process from data pipeline to training convergence;
    • Frontier model forms: Support full-stack native training for new architectures such as world models and embodied intelligence models. These models often contain non-standard operators and complex data flows, which better test platform generality;
    • Moving toward trillion-parameter scale: Advance joint training of trillion-parameter models on thousand-GPU clusters, comprehensively testing network topology, scheduling systems, and fault tolerance mechanisms.

    For enterprise users who lack the conditions to build large-scale compute clusters themselves, they can also use general cloud product categories (such as GPU compute instances, container platforms, object storage, logging services, and monitoring and alerting) to build their own training environments and apply the above engineering methodology to concrete business scenarios.

    5. From “Can Train” to “Ready to Train Out of the Box”: The Ultimate Goal of an Engineering System

    The ultimate value of training adaptation is not a single milestone validation, but the formation of reusable engineering capabilities that enable frontier open-source models to be “ready to train out of the box” on new compute platforms. This requires continuous refinement at three levels:

    1. Operator layer: Quickly follow new operators added to mainstream frameworks and establish automated regression tests for operator coverage;
    2. Collaboration layer: Optimize multi-card and multi-node communication scheduling to improve effective compute utilization at large parallelism scales;
    3. Toolchain layer: Provide automated model migration, performance analysis, and fault diagnosis tools to reduce the learning cost for users.

    Conclusion

    The completion of training adaptation for a model with nearly 3 trillion parameters on domestic GPUs, together with multi-card consecutive stable training, shows that domestic compute is crossing the key threshold from inference to training. For developers, understanding the essential differences between training adaptation and inference adaptation, and mastering the methodology of sharded training and numerical stability safeguards, has more long-term value than focusing on the progress of any single hardware platform. As engineering systems continue to improve, the barrier to training frontier large models on diverse compute platforms will be further lowered, which is positive for diversifying compute supply across the industry.