Large Models Embrace Domestic Computing Power: The Path to a Self-Reliant AI Infrastructure
As supply restrictions on high-end AI chips reshape the global AI landscape, migrating large model training and inference to domestic AI chip platforms has become a strategic necessity. This article breaks down the engineering challenges behind that migration—from rewriting compute operators and ensuring numerical stability in mixed-precision training, to optimizing collective communication, compilers, and MFU—and explains how real-world workloads at the scale of hundreds of thousands of chips are driving the maturation of the domestic AI computing ecosystem. It also offers a practical migration roadmap for engineering teams evaluating the transition.
Large Models Embrace Domestic Computing Power: The Path to a Self-Reliant AI Infrastructure
Introduction: A Significant Technological Shift
The global AI industry is undergoing profound change. Supply restrictions on high-end AI chips have made “where does the compute come from” a question that every large model team must answer head-on. When leading large model projects choose to migrate both training and inference entirely to domestic AI chip platforms—and drive real procurement at the scale of hundreds of thousands of chips across the supply chain—this is no longer a simple technology selection. It is a systematic engineering effort tied to industry resilience.
The technical implications run far deeper than they appear: a large model is not ordinary software. Its dependence on the compute substrate goes to the bone—from operator implementations and communication libraries to compilers and memory management, every layer has historically been deeply optimized around the dominant foreign GPU ecosystem. “Swapping the chip” essentially means rebuilding the foundation of the entire technology stack. This article dissects the key stages of this journey toward self-reliance from an engineering perspective.
1. Why Compute Sovereignty Is a Mandatory Question
1.1 The Reality of Supply Chain Risk
Training a large model routinely requires clusters of thousands to tens of thousands of accelerator cards. A single-card supply cutoff, a halted driver update, or an ecosystem lockout—any one of these can paralyze a compute cluster worth hundreds of millions of yuan. Betting the lifeline of your infrastructure on uncontrollable external supply is an unacceptable systemic risk for any serious AI business.
1.2 The Tension Between Cost and Scale
Even setting aside supply-cutoff risk, the procurement cost, lead times, and limited pricing leverage of imported high-end chips severely constrain the expansion of training scale. The advantages of domestic compute in supply stability and cost structure make it a realistic option for scaling large models into production.
1.3 The Multiplier Effect of an Autonomous Stack
Once the compute substrate is autonomous and controllable, the upper-layer frameworks, middleware, and toolchains can evolve around it continuously, forming a positive feedback loop. This vertical synergy of “substrate—framework—application” is exactly how mature computing ecosystems grow.
2. The Core Battlefield of Migration: A Ground-Up Rewrite of Low-Level Code
2.1 Rewriting and Tuning Operators
A large model’s computation graph is ultimately decomposed into fundamental operators: matrix multiplication, attention, normalization, activation, and so on. Different chip architectures (SIMT, Da Vinci-style Cube units, vector processors, etc.) demand very different optimal operator implementations. The first step of migration is writing high-performance implementations of the key operators in mainstream Transformer architectures for the domestic chip.
Take the attention operator as an example: the tiling strategy must be redesigned around the target chip’s on-chip memory capacity, tensor core specifications, and data movement bandwidth:
# Illustration: attention tiling must adapt to on-chip memorydef flash_attention_forward(Q, K, V, tile_m, tile_n):# tile_m / tile_n depend on the target chip's# SRAM capacity and vector unit width, not fixed heuristicsO = zeros_like(Q)L = zeros(batch, heads, seq_len)for i in range(0, seq_len, tile_m):q_tile = load_to_onchip(Q[i:i+tile_m])for j in range(0, seq_len, tile_n):k_tile = load_to_onchip(K[j:j+tile_n])v_tile = load_to_onchip(V[j:j+tile_n])s = matmul_core(q_tile, k_tile) # invoke the matrix coreo, l = online_softmax_update(s, v_tile)accumulate(O, L, i, o, l)return O, L
The core idea here: tile sizes and the online softmax update strategy must be re-derived from the target hardware’s memory hierarchy, not copied from the classic implementation parameters tuned for foreign GPUs.
2.2 Mixed Precision and Numerical Stability
Domestic chips differ in how they support low-precision formats such as FP16, BF16, and even FP8. Engineering teams need to re-validate loss scaling strategies and gradient overflow detection in mixed-precision training to ensure convergence curves match the original platform. This typically requires an automated pipeline for layer-by-layer numerical parity checks: given identical inputs and weights, verify that the per-layer output error between the two platforms stays within tolerance.
2.3 Communication Libraries and Distributed Parallelism
At the ten-thousand-card scale, the training bottleneck often lies not in per-card compute but in inter-chip interconnects. The collective communication library on the domestic chip platform needs re-optimization of primitives such as AllReduce, AllGather, and Send/Recv, paired with new topology-aware scheduling strategies. Common practices include:
- Topology-aware parallelism partitioning: adjusting tensor parallelism (TP) and pipeline parallelism (PP) split dimensions based on the actual bandwidth ratio of intra-server versus inter-server interconnects;
- Communication-computation overlap: fully pipelining gradient communication with forward/backward computation to hide communication latency;
- Gradient bucketing and compression: using bucketed gradient aggregation in bandwidth-constrained scenarios, and introducing error-compensated quantized communication when necessary.
3. Hardware-Software Co-Design: Squeezing Real Efficiency Out of Domestic Compute
3.1 Compilers and Graph Optimization
Modern AI compilers play the dual role of “translator and optimizer” in migration. Techniques such as operator fusion (e.g., fusing LayerNorm with the residual add into a single operator), memory reuse planning, and automatic operator generation (template-based codegen) can significantly narrow the performance gap with mature platforms. In practice, teams use profiling tools to locate hotspots and optimize layer by layer in the order of “fuse first, tune parameters second, hand-write last.”
3.2 MFU: The Hard Metric of Migration Success
Model FLOPs Utilization (MFU) is the authoritative metric for evaluating migration quality. In a healthy migration project, MFU should climb gradually from a low initial level toward the range achieved on the original platform. The typical path: first ensure correctness (convergence alignment), then optimize per-card operator efficiency, and finally address cluster communication overhead. Industry practice shows that after months of hardware-software co-tuning, domestic platforms have reached practical training efficiency on mainstream dense models and MoE models.
3.3 Inference-Side Adaptation Matters Just as Much
Beyond training, inference migration involves quantization (W8A8, W4, and similar schemes), KV cache management, continuous batching, speculative sampling, and a series of other optimizations. Because inference directly serves business traffic and is more sensitive to latency and cost, it is often where domestic compute first generates commercial returns.
4. Ecosystem Building: The Industry Logic Behind Hundreds of Thousands of Chips
Large-scale procurement of domestic AI chips by leading tech companies sends a signal far beyond the orders themselves:
- Real workloads feed back into hardware iteration: large model training is the most demanding compute scenario, and real training jobs continuously expose issues at the chip, driver, and library levels, driving rapid hardware maturation;
- Toolchain refinement: cluster operations capabilities—monitoring and alerting, fault localization, checkpoint resume, elastic scheduling—are forged in real-world operations. These are invisible in papers but decisive for cluster availability;
- Accumulation of talent and standards: once mainstream frameworks complete native adaptation and model weights and inference engines work out of the box, the barrier to entry for smaller teams drops sharply, and the ecosystem enters a self-reinforcing trajectory.
For teams looking to build on domestic compute, cloud-based compute services are a low-barrier starting point. Taking domestic cloud platforms such as Baidu AI Cloud as an example, general-purpose capabilities like container platforms, object storage, logging services, and monitoring and alerting can support the full lifecycle of large model training—from data preparation and distributed training to model deployment—helping enterprises validate and migrate to domestic compute without heavy upfront capital investment.
5. Practical Advice for Developers
If your team is evaluating a compute migration, the following path is recommended:
- Inference before training: inference migration is low-cost and delivers quick results, making it an ideal first validation scenario;
- Establish a numerical parity baseline: use small-scale tasks with fixed seeds for cross-platform alignment, and build up a regression test suite;
- Validate performance in small steps: progress from single-machine single-card, to single-machine multi-card, to a small cluster, locating performance bottlenecks level by level;
- Set up a joint tuning mechanism with the hardware team: operator-level issues often require collaboration between software and hardware sides—the communication channel matters more than any single technical solution;
- Track native framework support progress: prioritize platforms with native support from mainstream deep learning frameworks to minimize in-house adaptation costs.
Conclusion
From line-by-line reconstruction of low-level code to real investment at the scale of hundreds of thousands of chips, building a domestic compute substrate has shifted from “optional” to “in progress.” There are no shortcuts on this road—it is built on operator-level tuning runs, cluster stress tests, and day-after-day joint engineering between software and hardware teams. When world-class large models run on an autonomous and controllable compute foundation, the word “supply cutoff” truly loses its deterrent power. Technological self-reliance is not a slogan—it is certainty written one line of code at a time.
