How to Turn Domestic Compute into Efficient Token Production
This article explains how to convert domestic AI accelerators into measurable, schedulable Token capacity. It covers why infrastructure is now judged by cost per Token, throughput stability, and latency instead of peak compute, and then walks through four key paths: resource pooling and unified abstraction, compiler-based hardware-software co-design, service delivery with Token metering, and stability and cost governance. Readers will find practical guidance, pseudocode examples, and common pitfalls to avoid.
1. The Problem: Compute Supply Logic Is Being Rewritten
Over the past two years, the capability boundary of large models has kept rising, but the industry’s focus has shifted from “can we train a strong model” to “can we continuously, cheaply, and reliably deliver usable Tokens.” This changes the yardstick for infrastructure: from peak compute and card counts to cost per Token, throughput stability, and delivery latency.
Shifting external supply conditions have accelerated this process. As channels for obtaining high-end accelerators across borders narrow and delivery cycles lengthen, the domestic compute supply side must answer a more practical question: can the existing, mixed-brand domestic acceleration hardware already on hand be organized into a production line that is measurable, schedulable, and continuously expandable?
1.1 Cycle Scissors Gap: Models Iterate Monthly, Infrastructure Upgrades Yearly
Mainstream model architectures, attention variants, and quantization schemes evolve almost weekly or monthly, while hardware procurement and deployment on the data center side typically take one to three years. If the software stack lacks an abstraction layer, new hardware may be unable to run new models within half a year of coming online due to missing operators or framework version mismatches, creating a costly mismatch between expensive assets and business demand.
1.2 Fragmented Ecosystem: No Shared Hardware-Software Co-Design Layer
The most real pain point for engineering teams is not a shortage of chips but repetitive work: rewriting operators for every new chip, redoing adaptation for every new model, and re-tuning performance parameters for every inference framework switch. This “model × chip × framework” combinatorial explosion makes adaptation costs rise linearly as the ecosystem flourishes.
1.3 Cost Structure: Mismatch Between Procuring by the Card and Delivering by the Second
Hardware is procured at the scale of whole machines and whole batches, with depreciation calculated annually, while the business side demands elastic delivery by the second and by request volume. What is missing in the middle is a “translator” layer that turns idle, heterogeneous, hard-to-use resources into standard capacity. Without it, utilization stays low and the cost per Token naturally remains high.
2. Target State: Making Compute Schedulable Standard Capacity
Drawing on the thinking of the power systems of the industrial era, a Token factory should have four characteristics: resource pooling (unified grid connection on the generation side), automated scheduling (unified dispatch on the grid side), standardized interfaces (uniform socket specifications), and auditable metering (transparent electricity billing). Missing any one of these, the cost curve cannot be pushed down.
3. Key Path One: Resource Pooling and Unified Abstraction
The first step is to converge scattered accelerators into a unified resource pool that hides model differences.
- Unified device abstraction: Use a container platform and device plugin mechanism to expose accelerators from different vendors to the upper-layer scheduler under a unified resource name.
- Topology-aware scheduling: Sense inter-card interconnect bandwidth and NUMA affinity to avoid cross-node communication dragging down throughput.
- Pooling and prioritization: Separate pools for training, inference, and batch processing, with preemption and quotas to prevent long-running tasks from crowding out online inference.
Illustrative resource declaration (pseudocode, expressing the abstraction idea only):
resources:- name: accelerator/npupool: inference-pooltopology: intra-node-high-bwquota: 64priorityClasses:online-inference: 1000offline-batch: 100
4. Key Path Two: Hardware-Software Co-Design and Compiler-Based Adaptation
The core of breaking the combinatorial explosion is replacing hand-written operators with compilation and graph optimization.
- Graph-level optimization: Operator fusion, constant folding, and memory reuse to reduce memory-access bottlenecks.
- Automatic operator generation: Describe computation with a unified intermediate representation, and let the compiler backend generate efficient kernels for the target hardware; onboarding a new chip only requires completing the backend.
- Precision and quantization co-design: Support weight quantization and KV Cache compression to trade acceptable accuracy loss for several times the throughput.
- Version compatibility matrix: Build an automated compatibility testing pipeline across model, framework, and driver; no release is allowed if regression fails.
Illustrative adaptation flow:
# Pseudocode: unified intermediate representation -> compile for target backendir = trace(model, sample_input)ir = optimize(ir, fuse=True, quantize="int8")engine = compile(ir, backend="Domestic Accelerator Backend A")assert accuracy_gap(engine, model) < 0.01
5. Key Path Three: Service Delivery and Token Metering
Turning capacity into a commodity requires standard interfaces and transparent metering.
- Unified inference gateway: Expose an interface compatible with common industry standards, hide backend differences, and support streaming output.
- Dynamic batching: Batch concurrent requests to increase per-card throughput, with priority queues to guarantee online latency.
- Multiple replicas and elastic scaling: Automatically scale in and out based on queue length and P99 latency, scaling down during idle times to cut costs.
- Metering and auditing: Use request count, input and output Token counts, and latency percentiles as metering dimensions to produce reconcilable bills.
6. Key Path Four: Stability and Cost Governance
- Observability: Cover the gateway, engine, and hardware layers with metrics, logs, and tracing, and build dashboards for Token success rate and time to first token.
- Fault isolation: Automatically remove and rebuild replicas when a single card or node fails to avoid cascading failures.
- Cost attribution: Split resource bills by business line and identify and reclaim low-utilization pools.
- Capacity planning: Project expansion pace from historical Token growth and lock in the supply chain in advance.
7. Implementation Advice and Common Pitfalls
Proceed in the order of “pool first, compile next, meter last,” and avoid pursuing full model coverage from the start. Common pitfalls include: only doing resource virtualization while ignoring the compiler layer, so new models still require manual adaptation; only pushing down unit price without looking at P99 latency, sacrificing user experience; and inconsistent metering definitions that make bills impossible to reconcile. If an enterprise lacks the conditions to build on its own, it can use capabilities such as the general container platform, object storage, message queue, and monitoring and alerting offered by a cloud vendor to quickly build the foundation, focusing its energy on the model and the business itself.
