Production-Grade AI Inference: Engineering Optimization on Chinese AI Accelerators
Moving AI inference from benchmarks to live services requires optimizing latency, throughput, and billable utilization together. This article examines kernel efficiency, communication and memory management, prefill/decode separation, scheduling, and infrastructure requirements for production deployments on Chinese-developed AI accelerators, with practical metrics and a deployment checklist.
1. The Real Divide: From Benchmarks to Online Services
AI accelerators have traditionally been evaluated by peak compute performance and individual operator benchmarks. Once workloads enter production, the standard shifts to service quality at a given cost. Benchmarks are typically static, single-stream, and interference-free. Online inference is dynamic and concurrent, with mixed input lengths, long-tail workloads, and possible preemption.
One publicly reported production reference illustrates this shift: with average inputs of approximately 98K tokens, median time to first token was around 277 ms, single-stream generation reached approximately 138 tokens/s, and reported revenue per accelerator-hour was on the order of RMB 100.
The significance is not the absolute values, but the combination of three requirements: long-context processing, low latency, and billable service delivery. Optimizing any one in isolation is relatively straightforward. Meeting all three together is what makes an inference system production-grade.
These figures depend heavily on model architecture, input and output length distributions, parallelism strategies, and pricing. They should not be treated as general hardware specifications. What can be reused is the engineering approach behind them.
2. Four Optimization Areas for Production Inference
2.1 Core Operators: Approaching Hardware Limits
Operator efficiency determines how much theoretical compute capacity becomes useful inference performance. Typical optimization areas include:
- Attention operator fusion: Fuse operations across QKV projection, positional encoding, attention computation, and output projection to reduce intermediate tensor transfers to and from device memory.
- Paged KV caching: Manage the cache in fixed-size blocks rather than reserving contiguous memory for the maximum sequence length, reducing fragmentation.
- Quantization and low-precision computation: Use lower-precision matrix multiplication to improve effective throughput while keeping accuracy within acceptable limits.
- Memory-access optimization: Decode is memory-intensive, so operators must be tuned for bandwidth rather than compute capacity alone.
The key measure is hardware utilization, not the number of supported operators. Public reports describe attention implementations achieving hundreds of TFLOPS during prefill and roughly 90% or more of the relevant theoretical hardware limit. Such results indicate increasingly effective hardware–software co-optimization.
2.2 Communication and Memory Management: The Bottlenecks in Multi-Accelerator Systems
In multi-accelerator servers and large, tightly interconnected clusters, communication can account for a substantial share of end-to-end latency. Engineering techniques include:
- Overlapping communication with computation in tensor and pipeline parallelism.
- Combining All-to-All communication operations and using topology-aware scheduling for expert parallelism.
- Sharding and migrating KV caches within and across layers.
- Pooling device memory to coordinate allocation for model weights, KV caches, and temporary activations.
2.3 Inference Execution: Separating Prefill and Decode
Long-input workloads create a fundamental scheduling conflict. Prefill is compute-intensive, with attention computation growing approximately quadratically with input length. Decode is memory-intensive, with relatively stable per-step execution time. Mixing these workloads in the same batch can allow long inputs to block short requests, increasing P99 latency.
A common approach is disaggregated deployment: prefill and decode run in separate resource pools, with KV caches transferred over a high-speed network.
For very long inputs, chunked prefill breaks a large prefill operation into smaller chunks that can be interleaved with decode batches, preventing a single long request from monopolizing execution.
# Pseudocode: scheduling skeleton for continuous batching and chunked prefilldef schedule_step(running, waiting, cfg):batch, token_budget = [], cfg.max_batch_tokens# 1) Advance active decode requests first to stabilize output speedfor req in running:batch.append(req)token_budget -= 1# 2) Use the remaining budget for chunked prefill# so long inputs do not monopolize the entire stepfor req in waiting:chunk = min(cfg.prefill_chunk, req.remaining, token_budget)if chunk <= 0:breakbatch.append(req.partial(chunk))token_budget -= chunkif req.remaining == 0:running.append(req)return batch # Send to the executor; allocate and release KV cache in blocks
2.4 Request Scheduling: From Availability to Service Commitments
Production scheduling must address, at minimum:
- Request priorities and quotas.
- Timeouts and retries.
- Queue size limits.
- Overload degradation, such as reducing maximum output length or rejecting excessively long inputs.
- Scaling policies.
Monitoring should cover P50, P95, and P99 time to first token, per-user output rates, queueing time, and device memory usage—not just average throughput.
3. Interpreting Three Key Metrics
| Metric | Meaning | Common Misinterpretation |
|---|---|---|
| P50 time to first token | Median latency from request arrival to the first generated token | Using P50 alone and ignoring tail latency, leading to inaccurate capacity planning |
| Single-stream output rate | Tokens generated per second for one request | Confusing it with aggregate concurrent throughput; improving one can come at the expense of the other |
| Revenue per accelerator-hour | Billable revenue generated by one accelerator in one hour | Ignoring idle time and the hidden costs of failures and retries |
A throughput-based revenue calculation can be expressed as:
def revenue_per_card_hour(tokens_per_sec, price_per_mtoken, cards=1, util=1.0):"""tokens_per_sec: effective output throughput per card;util: effective billable utilization"""return tokens_per_sec * 3600 / 1_000_000 * price_per_mtoken * cards * util
With cards=1, this estimates revenue per accelerator-hour. Because the formula multiplies by cards, using a larger value produces an hourly revenue estimate across that number of accelerators rather than a per-accelerator figure. The price and resulting revenue use the same currency.
The underlying optimization objective is effective throughput × billable utilization, rather than latency reduction alone.
4. Supporting Infrastructure: How Online Inference Changes Data Center Requirements
Moving inference from offline workloads to online services changes the requirements for the infrastructure underneath it.
Availability: Online services cannot tolerate prolonged interruptions. They require redundant power, active-active deployment or geographically separate disaster recovery, and failover on the order of minutes.
Security and compliance: Real user traffic makes data classification, encryption in transit and at rest, access auditing, and tenant isolation essential. Network infrastructure also needs perimeter protection and traffic scrubbing capabilities.
Hosting and operations: Power delivery and cooling for high-density racks, cluster health checks, and capacity headroom management directly affect revenue per accelerator-hour.
Software enablement: The maturity of operator libraries, communication libraries, compilation and graph optimization, and observability components determines how effectively hardware can be used. This layer is also often among the first areas where deployment spending materializes.
Service routing and orchestration: Model-service routing, staged rollouts, coexistence of multiple versions, and cross-cluster compute scheduling become more important as inference moves into production.
5. External Constraints and Policy Context
When access to advanced compute hardware becomes more restricted, demand can shift toward hardware and software stacks that can be supplied domestically.
In China, some regional compute infrastructure plans explicitly encourage the use of Chinese-developed AI chips. This is a local procurement and policy context, not a statement about global product availability.
Procurement preferences and validation under real business workloads reinforce each other. Together, they help domestic accelerator platforms move from basic functionality toward practical production efficiency.
6. Deployment Checklist
- Have you built a capacity model centered on P99 latency and revenue per accelerator-hour?
- Do long-input workloads use chunked prefill and prefill/decode separation?
- Is the KV cache managed in pages, with support for cross-node migration?
- Does communication overlap with computation, and is scheduling topology-aware?
- Are overload degradation and multi-site disaster recovery in place?
- Does observability include operator-level utilization rather than only service-level queries per second?
7. Conclusion
Production-grade inference is fundamentally a systems engineering challenge. Operators determine how much hardware performance is realized. Scheduling determines service quality and cost. Infrastructure determines availability and compliance.
As Chinese-developed AI accelerators are validated under real production traffic, the focus shifts from whether a model can run to how economically, reliably, and compliantly it can be served. That is where subsequent investment and optimization must concentrate.
