Domestic AI Accelerator Adaptation: A Full-Stack Approach to Software-Hardware Co-Design and System Efficiency
The conversation around domestic (China-built) AI accelerators is shifting from "is there usable hardware" to "can it reliably and economically support large-scale model training and inference." This article lays out a reusable software-hardware co-design methodology organized around three industry drivers: expanding demand, supply-chain localization, and system efficiency. It covers a five-layer full-stack adaptation framework, model adaptation strategies (precision, graph optimization, memory management), operator and compiler optimization, runtime tuning, cluster engineering with topology-aware scheduling, an end-to-end efficiency evaluation model, and a phased engineering roadmap for taking adaptation from one-off projects to a scalable platform capability.
Domestic AI Accelerator Adaptation: A Full-Stack Approach to Software-Hardware Co-Design and System Efficiency
The discussion around domestic AI accelerators is shifting from “is usable hardware available” to “can it reliably and economically support large-scale model training and inference.” Recent progress in adapting new models to emerging accelerator platforms shows this space is still accelerating—but the real dividing line is not getting a single model to run once. It is sustained evolution capability: model architectures are changing rapidly, inference workloads keep growing, and cluster scales keep expanding, which demands a closed loop across the software stack, operator libraries, scheduling systems, and operations. This article presents a reusable software-hardware co-design methodology along three main lines: demand expansion, supply-chain localization, and system efficiency.
1. Three Industry Drivers: Demand Expansion, Localization, and Efficiency
Demand expansion is the primary driving force. Large-model applications are extending from training into inference. Interactive Q&A, code generation, multimodal understanding, retrieval-augmented generation (RAG), and agent orchestration bring longer contexts, higher concurrency, and more complex request patterns. Training cares about throughput and stability; inference cares about time-to-first-token, tokens output per second, tail latency, and cost. These impose different optimization targets on the compute system.
Localization is a supply-chain resilience requirement. Multiple accelerator types coexisting, software-hardware decoupling, and heterogeneous compute pooling will become the norm. Substitution is not simply swapping out the underlying hardware—it requires full-stack adaptation across models, frameworks, compilers, operators, communication, scheduling, and monitoring. Without unified abstractions and a regression testing system, adaptation costs grow quickly as the number of models and hardware SKUs increases.
System efficiency is where industrial value gets realized. Single-card peak performance is only a theoretical ceiling; actual efficiency depends on data movement, operator fusion, memory reuse, parallelism strategies, communication overlap, and failure recovery. End-to-end cost per million tokens, stable uptime, peak throughput, and tail latency reflect engineering maturity far better than any single performance spec. The three drivers are tightly coupled: demand expansion drives substitution, substitution demands efficiency, and efficiency gains in turn unlock more application space.
2. Building a Full-Stack Adaptation Framework
Organize adaptation work with a five-layer model:
| Layer | Core Question | Key Deliverables |
|---|---|---|
| Model & Algorithm | Is the architecture suited to the target accelerator? Does precision meet business requirements? | Precision strategy, quantization plan, caching policy |
| Framework & Compiler | Can the computation graph be expressed and optimized effectively? | Graph optimization, layout conversion, dynamic shape support |
| Operator & Kernel | Are critical operators efficient? Do fallback paths exist? | Fused operators, tiling strategies, numerical validation |
| Hardware & System | Do memory, interconnect, power, and cooling match? | Capacity planning, topology-aware scheduling, resource isolation |
| Cluster & Operations | Are multi-node, multi-card setups stable, observable, and recoverable? | Monitoring and alerting, elastic scaling, failure drills |
The goal of adaptation is not to reimplement every operator, but to achieve acceptable performance and stability at minimal cost. Prioritize covering high-frequency request paths, resolving bottleneck operators first, and establishing reproducible performance baselines and correctness regressions. Low-frequency operators can use generic fallback paths; high-frequency operators must be optimized with fusion, vectorization, tiling, and pipelining.
3. Model Adaptation: Precision, Graph Optimization, and Memory Management
Model adaptation must deliver both correctness and speed.
First, precision strategy. Training and inference can use mixed precision, low-bit quantization, and selective fallback. Quantization should not be judged by average error alone—you must inspect outliers, distribution shifts, and long-tail samples. For sensitive components such as attention, normalization, and accumulation, keep higher precision or adopt a layered strategy, and validate jointly with task metrics, perplexity, accuracy, and manual spot checks.
Second, computation graph optimization. Typical steps include constant folding, equivalence rewriting, operator fusion, layout propagation, shape inference, and dynamic shape bucketing. Dynamic shapes are the hard part of inference adaptation: varying request lengths cause compilation cache bloat and scheduling jitter. In practice, define a set of representative shapes, bucket them according to your business distribution, and set a cache eviction policy so compiled artifacts don’t grow indefinitely.
Third, memory management. The main pressure in large-model inference comes from weights, caches, and temporary tensors. Peak memory can be reduced through weight quantization, paged caching, layer-wise loading, activation recomputation, temporary buffer reuse, and lifetime analysis. In distributed settings, you also need to consider combinations of tensor parallelism, pipeline parallelism, and expert parallelism, avoiding communication and memory contention amplifying each other.
A simplified adaptation pipeline looks like this:
def adapt_and_validate(model, backend, workload):graph = export_graph(model)graph = simplify_and_fuse(graph)graph = legalize_layout(graph, backend.layout_policy)graph = quantize(graph, policy="mixed-precision")for shape in workload.representative_shapes:compiled = compile_graph(graph, shape, backend)check_numerics(compiled, tolerance=workload.tolerance)check_operator_coverage(compiled)profile(compiled, workload)return select_best_variant(graph, backend, workload.metrics)
This pipeline emphasizes three things: graph optimization must happen under the target backend’s constraints; numerical validation must cover representative shapes; and performance selection must be based on real workloads, not isolated operator microbenchmarks.
4. Operator, Compiler, and Runtime Optimization
At the operator layer, focus on hot paths first. Common optimizations include operator fusion, tiled scheduling, double buffering, loop unrolling and pipelining, on-chip cache reuse, and vectorization. Tile sizes must be searched based on memory bandwidth, cache capacity, and parallelism—parameters cannot be copied from other platforms. Auto-tuning should define its search space, evaluation metrics, and caching mechanism to avoid triggering heavy compilation on the first online request.
At the compiler layer, pay attention to fallback strategy. When the target backend lacks an operator, options include splitting, composition, a generic implementation, or falling back to the host. Fallback paths should have clearly known performance ceilings and stability risks, and their trigger frequency should be tracked in monitoring. High-frequency fallbacks go into a dedicated optimization queue; low-frequency fallbacks can remain but must be observable.
At the runtime layer, optimize around request scheduling. Continuous batching, dynamic batching, separating the prefill and decode phases, cache reuse, priority queues, and timeout control all significantly affect tail latency. Inference services should distinguish interactive requests from offline batch requests so that long requests don’t block short ones. Memory caches need caps and eviction policies to prevent sudden traffic spikes from taking the service down.
5. Cluster Engineering: Topology, Communication, and Stability
In multi-node, multi-card environments, topology-aware scheduling is essential. Tasks should be placed as locally as possible to reduce cross-node communication; data, tensor, and pipeline parallelism should be chosen based on bandwidth, latency, and failure domains. Communication optimizations include hierarchical aggregation, gradient compression, and overlapping communication with computation—but numerical stability and convergence must be preserved.
Stability engineering must be built in up front. You need health checks, node isolation, task retries, checkpoint recovery, canary releases, and rollback mechanisms. Both large-scale training and inference must handle slow-node problems: a single degraded node can drag down an entire job. Monitoring should cover accelerator utilization, memory usage, communication wait time, request queueing, cache hit rate, error code distribution, and tail latency, with tiered alerting and a root-cause analysis process.
6. Efficiency Evaluation: From Peak Specs to End-to-End Cost
The evaluation system should cover five categories of metrics:
- Throughput: requests or input/output tokens processed per unit time.
- Latency: time to first token, per-output-token latency, P95 and P99 tail latency.
- Resource efficiency: accelerator utilization, memory bandwidth utilization, communication wait share, cache hit rate.
- Stability: long-run duration, failure recovery time, retry rate, error rate.
- Economics: cost per million tokens, cost per request, resource idle rate, and elasticity of scale-out.
Testing methodology should fix the dataset, request distribution, concurrency model, warm-up time, and sampling window, and cover mixed long/short requests, traffic bursts, and node failures. Reporting only the best sample is meaningless—report means, tail latency, and long-term variance together. Optimization decisions should be driven by end-to-end metrics, avoiding cases where local microbenchmarks improve while online performance degrades.
7. An Engineering Roadmap
Phase 1: Correctness validation. Complete model export, operator coverage checks, numerical alignment, and a minimal viable pipeline; establish a baseline release. Phase 2: Performance tuning. Iterate on hot operators, memory peaks, communication bottlenecks, and batching strategies, producing reproducible benchmark reports. Phase 3: Productionization. Add monitoring and alerting, capacity planning, canary releases, failure drills, and security isolation. Phase 4: Continuous optimization. Build multi-backend abstractions, automated regression, and performance dashboards so adaptation capability becomes accumulative and reusable.
On the industry opportunity side, demand expansion creates compute needs where training and inference both matter; localization opens space for software-hardware co-design and toolchain building; and efficiency gains make compiler optimization, operator engineering, cluster scheduling, and operations services long-term value pools. Risks to watch include ecosystem fragmentation, duplicated adaptation effort, distorted benchmarks, and talent shortages. The more robust path is to build unified intermediate representations, portable operator interfaces, standard test sets, and long-run regression systems—using engineering discipline to drive down the marginal cost of adaptation.
Overall, the competitiveness of domestic AI accelerators will not be determined by any single spec, but by model adaptation capability, operator and compiler efficiency, cluster stability, and end-to-end cost together. Whoever can turn adaptation from a project-by-project activity into a platform capability, and turn optimization from experience-driven to data-driven, is more likely to build a sustainable engineering moat amid the long-term trends of demand expansion, localization, and system efficiency gains.
