Building a Domestic Compute Foundation in China: System Re-Engineering and Scaling to Production
As access to high-end AI chips tightens, Chinese AI teams must migrate training and inference workloads onto domestic hardware. This article explains why that migration is a full system engineering effort rather than a chip swap, covering compiler and operator-level optimization, collective communication and topology-aware scheduling, multi-chip cloud abstraction, ecosystem validation at enterprise scale, model-chip co-design, and the three main challenges—software ecosystem fragmentation, inference cost-effectiveness, and talent gaps—along with practical mitigations and verification metrics.
1. Once Compute Is Constrained, What Does the Problem Become?
Over the past few years, large models have driven rapid growth in demand for compute. At the same time, access channels for high-end AI chips have tightened, and many R&D teams and enterprises now face insufficient compute supply. The previously common path—procure high-end GPUs, plug into the CUDA ecosystem, and launch services quickly—is now blocked for many. The industry must therefore answer a question: once the hardware and software stack is switched to domestic alternatives, can it support training and inference for the next generation of large models?
The answer is yes, but migration is far more complex than swapping one chip for another. A domestic compute foundation involves instruction set adaptation, compiler optimization, distributed framework re-engineering, and upper-layer application adjustments. It is a system engineering effort. Ecosystem competition is predicated on system-level capability: only after the底层 runs correctly and stably can an upper-layer ecosystem be built.
2. Low-Level Re-Engineering: From “It Runs” to “It Runs Fast”
2.1 Compilers and Operator Libraries
The real-world performance of an accelerator chip depends heavily on how deeply the compiler and operator libraries are adapted to it. In the early days, the problem with many domestic chips was not peak compute, but a large gap between actual runtime efficiency and theoretical values. Common causes included unsuitable memory access patterns, insufficient operator fusion, and data layouts mismatched to the hardware.
Key operators such as matrix multiplication, normalization, and attention usually require dedicated optimization for the target chip’s instruction set and memory hierarchy; relying solely on generic auto-compilation is not enough. Take the attention implementation in a Transformer as an example: memory access order and matrix tiling sizes must be redesigned around on-chip cache capacity and bandwidth. The ideas behind FlashAttention can be referenced, but on specific hardware they require re-tuning and re-validation.
At the compilation layer, intermediate representations such as TVM and MLIR provide a unified entry point for multiple hardware backends. Developers can define dialects targeting specific chips, map computation graphs from frameworks like PyTorch and MindSpore down to low-level instructions, and implement operator fusion and memory reuse. The payoff of this kind of work must be confirmed through profiling of real workloads.
2.2 Collective Communication and Topology-Aware Scheduling
Once training scale grows from a few hundred cards to over a thousand, communication overhead often becomes the bottleneck. NCCL is already the de facto standard collective communication library in the NVIDIA GPU ecosystem. Domestic chips need corresponding communication libraries that implement primitives such as AllReduce and AllGather for their own interconnect topologies.
Topology-aware scheduling is an effective direction. Placing frequently communicating compute nodes physically close to each other reduces cross-switch traffic and shortens communication time. When evaluating a communication library, it is recommended to focus on three metrics: effective bandwidth under different message sizes, the efficiency curve when scaling across multiple nodes, and recovery time after node failures.
2.3 Cloud-Native Packaging of “One Cloud, Multiple Chips”
Major cloud vendors are broadly advancing “one cloud, multiple chips”—managing domestic accelerator chips and general-purpose compute chips under a single platform. Through unified resource abstraction, task scheduling, and monitoring interfaces, the platform hides hardware differences. Developers submit jobs via container services, inference services, or elastic training tasks without directly touching drivers.
This model decouples applications from hardware, making migration and selection more flexible. But it has clear boundaries. In a heterogeneous resource pool, a failure of one chip type must be isolated from other pools to avoid affecting overall scheduling. A unified abstraction layer introduces some scheduling overhead. Billing conventions may also differ across chips, so cost accounting needs to be aligned separately. When selecting a platform, confirm the depth of support for each chip, and also check whether the interfaces are truly unified.
3. Ecosystem Validation: From Single-Point Trials to Production-Scale Workloads
3.1 The Procurement Logic of Large Enterprises
Some leading technology companies have begun migrating part of their large-model training workloads to domestic compute clusters, gradually running real business workloads—not just test tasks—on them. Judging from public discussions, what these enterprises care about, beyond per-chip peak performance, is how much effective compute they get per unit of investment.
Take large-model pre-training as an example: migrating to a domestic cluster typically requires re-adjusting the parallelism strategy, including how data parallelism, tensor parallelism, and pipeline parallelism are partitioned. After optimization, whether training duration and total cost of ownership are acceptable depends on model scale, cluster scale, software maturity, and operational investment. Enterprises should run comparative tests using their own models and data, rather than directly applying cost figures published by others.
Supply chain stability is also a practical value. When an enterprise controls a self-governed, large-scale compute base, its R&D scheduling is less affected by external factors, and long-term planning becomes easier to execute.
3.2 Co-Design of Models and Chips
A two-way collaboration has emerged between domestic large-model teams and chip teams. Model teams provide chip teams with real model structure characteristics. For example, the number of attention heads and the hidden dimension affect the shapes of matrix multiplications, which in turn influence the design of compute unit arrays. Chip teams, in turn, provide specific hardware capabilities—such as higher-capacity high-bandwidth memory or dedicated vector instructions—to help model teams redesign operators and parallelism schemes.
This collaboration is similar in spirit to the overseas “GPU plus CUDA plus large model” full-stack model, but the path differs: it emphasizes multi-party co-design, and it is less common for a single vendor to control every layer.
4. Key Challenges and Mitigations
A domestic compute foundation still faces three categories of challenges that require serious handling. The table below lists, for each category, the main impact, executable countermeasures, and metrics for judging effectiveness.
| Challenge | Main Impact | Executable Countermeasures | Verification Metrics |
|---|---|---|---|
| Fragmented software ecosystem | Each vendor maintains its own compiler toolchain and acceleration libraries; cloud vendors and developers duplicate adaptation work | Provide unified hardware adaptation interfaces in upper-layer frameworks such as PyTorch and MindSpore, confining low-level differences inside the framework | Amount of code change needed to migrate the same model across backends; proportion of operators covered by the interface |
| Insufficient inference cost-effectiveness | Memory bandwidth and KV Cache management efficiency limit throughput and latency | Prioritize high-concurrency, latency-sensitive scenarios; adapt mechanisms such as continuous batching and PagedAttention in the inference engine | Throughput per unit cost, time-to-first-token latency, P99 latency |
| Shortage of cross-disciplinary talent | Few people understand frameworks, computer architecture, and compiler theory simultaneously; optimization cycles are long | Co-build labs with universities; build internal technical knowledge bases and optimization case libraries | Time for a new hire to independently complete one operator optimization; knowledge base reuse rate |
Regression validation is required both before and after migration, covering at least three items. First, accuracy alignment: compare loss curves and evaluation metrics on identical data. Second, performance regression: compare throughput, memory usage, and communication time. Third, stability testing: verify long-duration runs, checkpoint resume, and failure recovery. If any item fails to meet the bar, production traffic should not be switched over directly.
