Production-Grade LLM Inference on Chinese AI Hardware: From Open Code to Service Validation

    Publicly available inference code improves transparency, but it does not by itself establish production readiness. This article explains how to evaluate inference systems built for Chinese-developed AI hardware across output quality, latency, sustained throughput, reliability, and total cost. It also examines prefill and decoding workloads, fair benchmarking, caching, disaggregated deployment, and a reproducible acceptance-testing process.

    1. Evaluate Open Code Across the Full Serving Pipeline

    When an inference implementation for Chinese-developed AI hardware becomes publicly available, developers usually care less about whether it can generate text than about three practical questions: Can it reliably support real workloads? Is its performance competitive? Is its cost per unit of service acceptable?

    Making code available allows developers to inspect key components, including model execution, operator implementations, parallelization strategies, memory management, and request scheduling. Teams can analyze bottlenecks, reproduce optimizations, and determine whether the system fits their models and workloads. This is more useful than performance claims that disclose results without implementation details.

    However, three levels of readiness must remain distinct:

    • Functional implementation: The model executes correctly, and basic features work.
    • Deployable system: The environment, dependencies, configuration, and operating procedures are sufficiently complete for deployment under specified conditions.
    • Operational service: The system continues to meet quality, latency, availability, and cost requirements under sustained load, traffic spikes, device failures, and resource contention.

    Public code can help validate the first two levels and provide a foundation for the third. It cannot, on its own, prove operational readiness. Claims of meeting the “highest standards” become technically meaningful only when translated into explicit test methods and acceptance criteria.

    2. Production-Grade Inference Is More Than a Throughput Number

    A production inference system should be evaluated across at least five dimensions.

    Output Quality and Numerical Correctness

    Inference optimizations may involve low-precision computation, operator fusion, parallel execution, or cache reuse. A model that still produces output after optimization has not necessarily retained the same quality.

    Representative test sets should cover tasks such as technical question answering, code generation, long-document comprehension, and structured information extraction. Evaluation should check answer accuracy, information retrieval from long contexts, format adherence, and consistency.

    Low-precision implementations require particular attention to sensitive tasks rather than average scores alone.

    Latency

    Interactive services typically care about time to first token and the interval between subsequent tokens. Batch workloads may place greater emphasis on task completion time and overall throughput.

    Average latency can conceal long-tail delays caused by queuing, communication, or scheduling. Measurements should therefore include median latency, high-percentile latency, and timeout rates.

    Sustained Throughput

    Peak throughput from a short benchmark may depend on a warmed-up system, a particular request distribution, or relaxed latency requirements. Production evaluation should instead measure how much useful output the system can deliver over time while meeting agreed latency and error-rate limits.

    If higher throughput comes from allowing requests to remain in queues until the user experience becomes unacceptable, that increase does not deliver equivalent business value.

    Reliability and Recovery

    Production systems must handle device faults, process exits, communication timeouts, out-of-memory conditions, and version upgrades.

    Testing should cover the time required to detect failures, the scope of affected requests, recovery time, and the additional load caused by retries.

    Total Cost

    Hardware purchase or rental is only part of the cost. Hosts, interconnects, electricity, cooling, rack space, operations, and redundant capacity can all materially affect the final cost per unit of service.

    Higher performance does not automatically mean better economics.

    3. Prefill and Decoding: Two Different Workloads Within One Model

    Large language model inference generally consists of two main stages: prefill and decoding.

    Prefill processes the input text and creates intermediate states needed for subsequent computation. Long inputs can make this stage compute-intensive. As context length grows, attention computation, intermediate data movement, and memory management become increasingly important.

    Decoding generates output incrementally from the existing context. Because each generation step depends on earlier results, performance is influenced by model-weight reads, key-value cache access, compute efficiency, and communication across devices.

    The key-value cache, or KV cache, stores reusable intermediate states from attention computation. It reduces repeated computation but consumes device memory. Its capacity requirements vary with context length, concurrent request count, and model architecture.

    For mixture-of-experts models, expert routing and data exchange introduce additional constraints. Requests may distribute unevenly across experts, creating hotspots on some devices. Even hardware with high theoretical compute capacity may remain underutilized because of communication overhead or load imbalance.

    The key implication is:

    A system that leads in prefill does not necessarily retain the same advantage in decoding. Faster output for a single request also does not necessarily translate into higher total cluster throughput.

    4. Avoid Misleading Inferences From Performance Comparisons

    Comparing inference efficiency across hardware or systems starts with defining a consistent measurement boundary.

    The unit being compared might be a single accelerator, a server node, or a tightly coupled multi-node cluster. Results become misleading if one system is measured per accelerator and another per server, or if one includes host power consumption while the other counts only accelerator power.

    Even “per-accelerator” comparisons may involve different host resources, interconnect topologies, memory capacities, and parallel deployment strategies. Per-accelerator metrics help describe resource productivity, but they cannot replace a whole-system comparison.

    At a minimum, benchmarks should disclose the following conditions:

    Dimension Information to disclose
    Model Parameter count, architecture, weight version, and compute precision
    Requests Input length, output length, concurrency, and arrival pattern
    Caching Whether caching is enabled, hit rate, and matched prefix length
    Deployment Device count, parallelization strategy, host configuration, and interconnect
    Service constraints Time to first token, inter-token latency, timeout rate, and error rate
    Measurement boundary Accelerator, node, or cluster, and whether supporting resources are included
    Operating conditions Warm-up status, test duration, and whether failure recovery is included

    It is also important not to infer hardware specifications directly from benchmark results. If one system achieves several times the prefill throughput of another, that does not establish that its theoretical compute capacity is several times higher. Likewise, faster decoding does not imply a proportional increase in memory bandwidth.

    End-to-end performance depends on operator efficiency, data precision, batching, communication overhead, model partitioning, and scheduling. A performance difference can reasonably be attributed to a specific hardware factor only when other conditions are adequately controlled and the bottleneck has been identified.

    5. Why Long Inputs With Short Outputs Can Raise Serving Costs

    A user receiving a one-sentence answer does not mean the request was inexpensive to process.

    When a request contains a large input but produces little output, the system still has to process the input that cannot be reused from cache. Most resource consumption may occur during prefill, so output length alone does not reflect the total workload.

    Text file size is also not a direct measure of token count. Language, encoding, text structure, and tokenization rules affect the conversion. A more rigorous approach is to tokenize the actual input and check whether it exceeds the model’s context window or the service’s input limit.

    Very large inputs can create several problems:

    • Requests may be rejected or truncated if they exceed input limits.
    • Even within the context limit, long inputs consume substantial compute time and cache capacity.
    • Large and small requests may compete for resources, causing shorter requests to queue.
    • Frequently changing inputs with few repeated prefixes offer limited cache reuse.
    • Short outputs can cause resource consumption to be underestimated when accounting focuses only on generated tokens.

    However, long-input, short-output workloads alone do not justify claims about a specific reduction in hardware-related revenue or an increase in electricity consumption or rack requirements. Quantifying those effects requires actual request distributions, pricing, device utilization, and energy measurements.

    A more general cost metric is:

    Cost per successful request = Total serving cost during the evaluation period ÷ Number of successful requests meeting quality and latency requirements

    This measure accounts for failures, timeouts, and wasted resources. It is closer to operational reality than counting generated tokens alone.

    6. Caching Helps, but It Is Not a Universal Performance Fix

    Prefix caching reuses intermediate states associated with identical input prefixes, reducing repeated prefill work. It can provide substantial benefits for workloads with fixed system prompts, stable background knowledge, or ongoing conversational structures.

    Its effectiveness nevertheless depends on several conditions:

    1. Whether inputs share reusable prefixes.
    2. How much of the total input those prefixes represent.
    3. Whether cache capacity can hold the active content.
    4. Whether requests can be routed to instances holding the relevant cache.
    5. Whether model versions and execution configurations are consistent.
    6. Whether multi-tenant isolation permits reuse across requests.

    A high request-level cache hit rate does not necessarily mean large compute savings. If the matched prefix is only a short shared prompt followed by extensive new text, the overall benefit may be limited.

    Monitoring should therefore track request hit rate, reused token volume, prefill time saved, and changes in concurrency capacity caused by cache occupancy.

    Cache is not a free resource. Retaining too much low-value content can reduce the space available for active requests.

    7. Disaggregated Prefill and Decoding: Benefits and Trade-Offs

    Because prefill and decoding have different resource requirements, they can be deployed separately, with resources allocated according to the workload.

    Potential benefits include reducing interference from long inputs on decoding requests, applying stage-specific scheduling strategies, and scaling each stage more flexibly.

    However, this architecture also introduces intermediate-state transfer, cross-stage routing, and resource-balancing challenges. After prefill, the cache must be transferred to the decoding side. The overhead depends on state size, network capability, and implementation. If transfer takes too long, it can cancel out the compute time saved by separating the stages.

    There is no universally correct resource ratio. Workloads with long inputs generally need more prefill capacity, while workloads with long outputs or high sustained concurrency may require more decoding resources.

    The appropriate configuration should be determined through load testing with actual traffic and adjusted dynamically, rather than copied from the device ratio used in a particular benchmark.

    8. From Public Code to Deployment: A Reproducible Acceptance Process

    Step 1: Confirm Implementation and Deployment Boundaries

    Check the code license, runtime dependencies, supported model architectures, precision requirements, and supported hardware.

    Record all key configurations so that results from a specific environment are not mistaken for universal capabilities.

    Step 2: Build Representative Workload Samples

    The test set should cover:

    • Short inputs with short outputs.
    • Long inputs with short outputs.
    • Short inputs with long outputs.
    • Long inputs with long outputs.

    Preserve the input and output length distributions found in the actual business workload. Separate repeated inputs from new inputs to avoid unrealistically favorable caching conditions.

    Step 3: Test Cold and Warm Caches Separately

    Cold-cache tests help reveal baseline prefill performance. Warm-cache tests help measure the value of reuse in the target workload.

    Report the two separately rather than combining them into a single throughput figure without explanation.

    Step 4: Increase Load Under Service Constraints

    Gradually increase the request arrival rate while continuously recording throughput, queue time, memory usage, and high-percentile latency.

    Identify the stable operating range that satisfies business requirements, rather than simply maximizing device utilization.

    Step 5: Run Long-Duration and Failure Tests

    Check whether memory usage grows continuously, cache eviction works effectively, load remains balanced, and service recovers after failures.

    Passing a short test does not establish that a system is free from resource leaks or performance degradation during prolonged operation.

    Step 6: Calculate the Full Operating Cost

    Account for hardware, supporting resources, energy, operations, and redundancy over the same evaluation period.

    Calculate unit cost using successful requests, useful input and output volume, or completed business tasks. The accounting method should reflect business value and remain transparent.

    9. Conclusion: Establish Hardware Value Through Engineering Evidence

    Publicly available inference code for Chinese-developed AI hardware can lower adaptation barriers, improve implementation transparency, and enable developers to contribute performance optimizations. That is meaningful engineering progress. It does not, however, establish that a system reaches the highest level of performance in every scenario without a complete validation process.

    A rigorous assessment follows three principles:

    • Do not mix device-level and cluster-level measurement boundaries.
    • Do not infer hardware specifications directly from throughput results.
    • Do not treat unmeasured revenue or energy changes as established facts.

    For developers and enterprises, the most useful question is not which isolated metric looks best. It is whether the system can consistently deliver results that meet quality and latency requirements under real workloads, at an acceptable total cost.

    Only by evaluating correctness, performance, reliability, and economics together can teams determine whether an inference system built on Chinese-developed AI hardware is ready for production service.