China's AI Compute Software Stack: What Core Operators Near Hardware Peak Performance Really Means
When core operators on domestic accelerators approach theoretical peak, the real signal is not a single number. This article explains the gap between paper FLOPS and usable performance, why operator libraries, compilers, and tuning knowledge form a moat, and how production-grade optimization plus regression gates can make domestic AI compute more predictable.
China’s AI Compute Software Stack: What Core Operators Near Hardware Peak Performance Really Means
Discussions of China’s AI accelerators often return to the same phrase: a weak software ecosystem. That is usually taken to mean incomplete operator libraries, limited framework support, scarce tuning experience, and immature toolchains. Those gaps are not closed by slogans. They are closed with code, profiling, and real model workloads. When teams report that multiple core operators have been tuned close to theoretical peak on domestic accelerators, the important point is not one metric. It is a path: software engineering can substantially shrink the distance between the hardware’s rated ceiling and the performance users actually get.
From paper FLOPS to usable compute: why operators are the main battleground
Chip spec sheets usually quote peak compute under ideal data layout, instruction streams, and parallelism. Real training and inference add overhead from matrix multiply, attention, normalization, activation, and communication: data movement, precision conversion, synchronization, register pressure, memory-hierarchy mismatch, and insufficient operator fusion. The same hardware may deliver only 60–70% of rated performance—or less—depending on the software stack.
Core operator optimization is how theoretical peak becomes usable compute. For matrix multiply, engineering typically covers tile sizes, data reuse, double buffering, asynchronous copy, pipeline scheduling, shared-memory bank conflicts, register blocking, and instruction-level parallelism. Pseudocode:
def optimize_matmul(shape, dtype, target_peak):tile = search_tile_candidates(shape, dtype)best = Nonefor t in tile:kernel = build_kernel(tile=t, dtype=dtype,pipeline="double_buffer",async_copy=True)latency = benchmark(kernel, shape, warmup=20, repeat=100)util = target_peak / latencyif best is None or util > best.util:best = Candidate(kernel, util)verify_numerics(best.kernel, shape, dtype)return best
The method is general: take real shapes and dtypes, search tiling and pipeline strategies, benchmark, then check numerical correctness. Low-precision formats such as FP8 also need scale factors, overflow protection, and stability. Sparse attention needs memory access organized around sparsity, less wasted compute, and fewer intermediate writes. A single operator near peak does not automatically speed up an end-to-end model, which still depends on data loading, preprocessing, communication overlap, scheduling, and graph optimization. Operators remain the most controllable, measurable layer with compounding returns: every library gain helps models and frameworks above it.
The real moat is software: operator libraries, compilers, and tuning knowledge
Chip competition is often framed as a hardware-spec race. Industry practice shows the long-term moat is software. Leading vendors’ most expensive assets are often not one generation of transistors, but years of operator libraries, compiler rules, runtime scheduling, profilers, model-porting experience, and developer knowledge. Hardware sets the ceiling; software decides whether users can reach it reliably.
A complete stack has at least four layers: (1) operator coverage for both hot large ops and long-tail small ops; (2) graph compilers and runtimes that fuse, reorder, and parallelize ops to cut memory traffic and launch cost; (3) profiling and tuning tools that locate bottlenecks in compute, memory, communication, or scheduling; (4) knowledge capture and regression so one optimization becomes reusable templates and CI gates. Missing any layer produces the familiar gap: strong paper specs, awkward real use.
Operators approaching hardware limits therefore prove more than a number: the stack can translate hardware capability into user performance. That work requires joint understanding of model structure, numerics, compile-time scheduling, and microarchitecture. It is slow and costly, and it lowers migration cost for the industry.
Why optimization by frontline model teams is a stronger signal
If only chip vendors tune kernels, outsiders may treat results as marketing: Are benchmarks real workloads? Were shapes cherry-picked? Does end-to-end improve? When large-model teams optimize against their own training and inference needs, the bar is different. Throughput, latency, cost, stability, and numerical correctness all matter. Publishing or open-sourcing that experience is an operations handbook for others.
That handbook has three strengths. First, real load mix: which operators are hot, which shapes dominate, which precision policies are acceptable. Second, full engineering constraints: long, stable runs, fallbacks, accuracy checks, version compatibility, and monitoring. Third, lower trust cost: later teams need not prove the path exists; they can adapt and retune with fewer traps.
What this means for China’s AI compute industry
First, performance expectations become measurable. Domestic accelerators were often labeled “usable but not pleasant.” If core operators can be stably tuned near theoretical limits, the industry can adopt layered benchmarks: microbenchmarks for operator efficiency, subgraphs for fusion, end-to-end for throughput and latency, and soak tests for reliability. Shared evaluation language supports procurement, migration, and capacity planning.
Second, hardware–software feedback tightens. Microarchitectural bottlenecks exposed by operator work can feed the next chip; new hardware features need software to unlock them. Faster loops raise iteration efficiency.
Third, migration cost falls. Model teams fear unpredictable performance, hard-to-find issues, and missing long-tail ops more than a lower peak. Public optimization paths and regression methods reduce porting risk and make teams more willing to put real workloads on domestic accelerators.
Fourth, talent and toolchains accumulate. Operator work is continuous regression, not a one-off project. Using general capabilities such as container platforms, object storage, and monitoring from Baidu AI Cloud, teams can build pipelines covering compile, benchmark, numerical checks, and performance regression, turning tuning into repeatable engineering assets.
Stay clear-eyed: a few operators near peak do not automatically speed every model. Different shapes, precision policies, and communication topologies can change results. Avoid overfitting benchmarks. Put numerical correctness, shape coverage, end-to-end gain, and long-run stability in the same gates.
A practical engineering path
Five steps: (1) layered benchmarks covering hot operators, typical subgraphs, and end-to-end models; (2) end-to-end profiling first, using Amdahl’s law so effort is not wasted on unimportant ops; (3) shape bucketing and templated tuning for hot operators, with fallbacks; (4) numerical checks, performance thresholds, and soak tests in CI; (5) document tuning parameters, applicable bounds, and known limits as a team knowledge base.
def regression_gate(candidate, baseline):assert verify_allclose(candidate.out, baseline.out, rtol=1e-3)for case in PRODUCTION_SHAPES:speedup = baseline.latency(case) / candidate.latency(case)assert speedup >= 0.95, f"regression on {case}"assert candidate.long_run_stable(hours=24)return "pass"
Core operators near hardware peak are a concentrated display of software engineering. They show that the ceiling of domestic AI compute is higher than many assume, and that there is no shortcut around the ecosystem gap: real workloads, frontline teams, open collaboration, and continuous regression. Turning one-off wins into reusable methods, operator speedups into end-to-end gains, and “it runs” into “it is usable, predictable, and maintainable” is the most valuable signal for the stack.
