Domestic AI Compute Enters Production-Grade Inference: A Technical Breakdown

    This article examines a production-grade inference implementation for domestic AI accelerators, validated under real traffic with roughly 98K-token inputs. It explains the key metrics (TTFT, single-stream output speed, and revenue per card per hour), the four main engineering levers (core operators, communication and memory management, Prefill/Decode decoupling, and SLO-driven scheduling), and the availability, security, and compliance requirements for running inference in core business systems. A practical rollout checklist for technical teams is included.

    1. Background: An Engineering Validation, Not a Parameter Race

    Industry attention has shifted noticeably. A large model team open-sourced a production-grade inference implementation for domestic acceleration platforms and published verifiable runtime data collected under real business traffic. The significance is not a peak compute number. It turns “can domestic compute reliably serve online inference?” from speculation into a reproducible engineering conclusion.

    Under an average input length of about 98K tokens, the reported results are roughly 277 ms P50 time-to-first-token (TTFT), about 138 tokens/s single-stream output speed, and about RMB 118 in output per card per hour. These numbers matter because they constrain three dimensions at once: latency, throughput, and unit economics. Only when all three are met does an inference service have a viable commercial loop.

    2. Understanding the Metrics: Why These Numbers Are Meaningful

    2.1 TTFT Determines Perceived Speed

    In interactive online scenarios, the “fast” that users perceive comes mainly from time to first token. With very long contexts, the Prefill stage must process tens of thousands of tokens at once, putting pressure on both compute and memory bandwidth. TTFT is therefore the first gate for deciding whether a system is production-ready.

    2.2 Single-Stream Output Speed Determines Usability

    The decode stage generates tokens serially, one at a time, and is governed by memory bandwidth and access efficiency. A single-stream speed of 138 tokens/s is close to human reading speed for sustained output, so long-form generation no longer requires long waits.

    2.3 Revenue per Card per Hour Determines Sustainability

    Converting performance into revenue per unit of card time is the key bridge between technical and business metrics. It forces teams to optimize utilization, queuing strategy, and batching efficiency together, rather than chasing isolated benchmark scores.

    3. Four Engineering Levers

    3.1 Core Operators: Approaching the Hardware Limit

    Take attention operators as an example. Public information indicates they reach about 425 TFlops in the Prefill stage, roughly 98.5% of the hardware’s theoretical peak. Common techniques for this kind of optimization include tiling and pipelining to fit the on-chip cache hierarchy, operator fusion to reduce round trips for intermediate tensors, and rewriting memory access paths for specific data types such as low-precision floating point.

    A schematic tiling schedule can be expressed as:

    1. # Pseudocode: process long sequences in blocks to control on-chip cache usage
    2. for block in chunk(range(seq_len), size=BLOCK):
    3. q = load_q(block)
    4. k, v = load_kv(block) # load in blocks, avoid a single large allocation
    5. acc = fused_attention(q, k, v) # fused operator, fewer intermediate write-backs
    6. write_output(block, acc)

    3.2 Communication and Memory Management: Reducing Data Movement Cost

    For multi-card tensor parallelism and pipeline parallelism, the bottleneck is often communication rather than computation. Common approaches include overlapping computation with communication, selecting communication paths based on topology, and tiered plus quantized management of the KV cache. On the memory side, fragmentation must be handled by moving allocation overhead off the critical path through pre-allocation and pooling.

    3.3 Inference Pipeline: Decoupling Prefill from Decode

    Splitting the Prefill of long inputs from the token-by-token Decode into separate resource pools prevents long requests from blocking short ones and noticeably improves tail latency. Combined with paged KV cache and prefix reuse, requests that share the same system prompt can reuse computed results.

    3.4 Scheduling: Target SLOs, Not Averages

    The scheduler should support continuous batching, priority queues, and timeout-based degradation, using P99 rather than the mean as the constraint target. A simplified admission control approach:

    1. def admit(req, cluster):
    2. if cluster.p99_ttft_ms > SLO_TTFT or cluster.queue_len > MAX_QUEUE:
    3. return degrade(req) # shorten context or switch to a smaller model
    4. return cluster.schedule(req)

    4. Additional Requirements for Production-Grade Service: Availability and Security Compliance

    Once inference workloads enter core business systems, data center requirements rise accordingly. The hosting environment needs redundant power and networking, plus clear fault-domain isolation. On the data side, it needs encryption in transit and at rest, key management, tenant-level isolation, and audit trails. On the network side, it needs perimeter protection, access control, and traffic anomaly detection. Observability is equally non-optional: logging, metrics monitoring, and alerting should cover latency percentiles, queue length, cache hit rate, and revenue per card.

    5. Industry Chain Perspective: Demand Release and Policy Alignment

    Engineering validation drives demand at three levels: first, servers, super nodes, and supporting power and cooling infrastructure; second, cloud service distribution and compute scheduling platforms; third, software adaptation and industry application deployment. At the same time, tighter external supply raises the barrier to obtaining advanced compute through overseas channels, while some local compute plans explicitly encourage prioritizing domestic chips. Procurement direction and engineering validation reinforce each other.

    6. A Practical Checklist for Technical Teams

    1. Define SLOs first: specify TTFT, P99 output speed, and availability targets before optimizing.
    2. Establish a baseline: record operator efficiency, memory usage, cache hit rate, and revenue per card.
    3. Optimize in layers: operators, then memory and communication, then pipeline decoupling, then scheduling policy, validating gains at each layer.
    4. Canary and roll back: release new versions to a percentage of traffic and keep a fast rollback path.
    5. Close the cost loop: put revenue per card per hour on the daily dashboard and tie it to scaling decisions.

    The conclusion is clear: the expansion of domestic compute capability comes fundamentally from hardware-software co-engineering, not from a single parameter. For developers, the right way to turn technical validation into stable business returns is to define metrics precisely, layer the optimization path, and build availability and compliance in from the start.