Technical and Economic Analysis of Production-Grade LLM Inference on Domestic AI Accelerators

    As large language model (LLM) inference moves from basic functionality to production-grade operations, evaluation criteria must evolve. This article provides a technical and economic analysis of running production-level inference on domestic computing power. It outlines the three maturity stages of inference, decodes critical performance metrics, emphasizes the necessity of unified testing conditions, and details the economic accounting and systemic optimizations required for sustainable, profitable AI infrastructure.

    1. The Shift in Evaluation Criteria: From “Capable of Inference” to “Capable of Operation”

    When evaluating LLM inference capabilities on domestic computing power, three aspects must be distinguished: whether the model runs correctly, whether the system processes requests efficiently, and whether the service can be delivered long-term, stably, and economically.

    These aspects correspond to different capability levels. The model outputting answers proves basic software-hardware adaptation feasibility; reasonable throughput and resource utilization indicate progress in system optimization; only by continuously handling real business traffic and meeting service quality and cost requirements can it be considered to have entered the production-grade application stage.

    Therefore, the value of open-sourcing production-grade inference code lies not just in providing developers with an implementation, but in converting experiences in chip adaptation, operator optimization, distributed communication, request scheduling, and fault handling into auditable and reproducible engineering assets.

    However, it must be emphasized that open-sourcing code does not mean any enterprise can directly replicate the same performance. Model size, hardware topology, input length, request distribution, and operational capabilities all affect the final outcome. What truly matters is whether the open implementation can reduce repetitive adaptation costs, provide complete validation methods, and help enterprises build a closed loop for continuous optimization.

    2. Three Maturity Stages of Domestic Computing Inference

    2.1 Functional Adaptation Stage: Ensuring Correct Computation First

    The core task of this stage is to make the model run completely, including model weight loading, computation graph execution, operator support, numerical precision validation, and generation process control.

    “Being able to output text” is only the most basic validation. Stricter adaptation also requires checking execution results under different input lengths, confirming whether precision changes affect task quality, and validating whether abnormal inputs, long sequences, and concurrent requests cause errors.

    For example, executing calculations at lower precision may reduce memory usage and increase processing speed, but it cannot be assumed that model quality remains unchanged. Evaluations must be conducted for target businesses to observe whether answer correctness, format adherence, and long-text understanding degrade significantly.

    The main output of this stage should be a stable functional baseline and a reproducible test suite, rather than isolated demonstration results.

    2.2 Performance Engineering Stage: Converting Hardware Capabilities into Effective Throughput

    Model inference consists of multiple stages. Even if the computing unit has strong performance, as long as data movement, memory access, or inter-device communication becomes a bottleneck, the overall service efficiency may remain low.

    Optimization work typically involves:

    • Reducing unnecessary data read/writes between operators;
    • Improving the overlap between computation and communication;
    • Reducing memory fragmentation and repetitive allocation overhead;
    • Optimizing batch processing and request scheduling;
    • Improving cache management efficiency in long-sequence scenarios.

    The goal here should not simply be “maxing out device utilization.” High utilization might stem from effective computation, but it can also come from inefficient data movement or unreasonable task accumulation. The truly meaningful metric is how many valid business requests the system can complete while meeting latency constraints.

    2.3 Production Operation Stage: Transforming Performance into Sustainable Services

    Production environments must handle not only normal requests but also traffic spikes, request cancellations, device failures, service upgrades, and capacity shortages.

    Therefore, a production-grade inference system requires rate limiting, timeout control, fault isolation, monitoring and alerting, canary releases, and rollback mechanisms. For distributed inference, it is also necessary to define how requests are handled after a device failure to prevent local anomalies from escalating into overall unavailability.

    The hallmark of this stage is the ability to generate data evidence for continuous operation: whether service quality is stable, resource costs are controllable, operational investments are reasonable, and whether the system can scale smoothly as the business grows.

    3. Understanding Inference Performance Metrics Correctly

    The performance of an inference system cannot be compressed into a single number. Time to First Token (TTFT), single-stream output speed, and overall throughput describe different capabilities and must be analyzed jointly.

    3.1 Time to First Token (TTFT) Measures “How Soon It Starts Answering”

    TTFT typically refers to the time from when a request enters the measurement boundary until the first output is returned. Different tests may use different boundaries; whether network transmission, queuing, and input processing are included must be clearly stated.

    TTFT is mainly affected by input length, queue time, cache hit rate, and input processing efficiency.

    Evaluations should not only look at the median but also observe higher percentiles. Good median performance does not mean that peak hours or long-input requests are equally smooth. Enterprises need to understand the proportion of slow requests and whether tail latency meets business requirements.

    3.2 Single-Stream Output Speed Measures “How Fast a User Gets the Complete Result”

    Single-stream output speed indicates how many tokens a request generates per second during the generation phase. It directly impacts the time a user waits for a complete answer, making it especially relevant for long answers, text generation, and interactive applications.

    However, faster output does not necessarily mean revenue increases proportionally. If business demand is limited, or if billing is per request rather than per output token, speed improvements may primarily manifest as improved user experience rather than direct revenue growth.

    Therefore, “generation speed” cannot be simply equated with “money-making speed.” It is primarily an experience metric, and its commercial value must be judged in the context of the actual business model.

    3.3 Single-Card Decode Throughput Measures “How Much Generation Work a Unit Resource Can Handle”

    Single-card decode throughput is generally used to describe the number of output tokens per unit of time, calculated on a per-card basis. In multi-card systems, the conversion method and the actual number of working devices must be specified.

    It is not equivalent to single-stream speed. Increasing concurrency and batch size may increase total throughput but reduce the generation speed of individual requests or prolong wait times.

    Therefore, what commercial systems truly need to optimize is the “effective throughput that meets service quality constraints,” rather than extreme throughput divorced from latency requirements.

    4. Unifying Test Conditions for Performance Comparison

    Even if two systems run the same model, their performance data cannot be immediately deemed directly comparable. At least the following conditions must be verified:

    Dimension Content to Unify or Specify
    Model Conditions Parameter size, computation precision, quantization method, output quality requirements
    Request Conditions Input length, output length, concurrency, arrival rate
    Cache Conditions Cache hit rate, hit range, cache warm-up method
    Hardware Conditions Number of devices, memory capacity, inter-device connection method
    Service Conditions Latency targets, timeout policies, failure rates, rate limiting mechanisms
    Measurement Criteria Measurement boundaries, statistical periods, token counting and single-card conversion methods

    The operational cases in the source material include longer inputs and higher cache hit rates. Such conditions have specific business characteristics and cannot directly represent all inference scenarios.

    Cache hits usually reduce the processing work for repeated prefixes but do not mean all computational stages will accelerate at the same ratio. If an enterprise primarily processes independent documents or low-repetition requests, the actual benefits may differ.

    A more reliable approach is to build a test suite based on real traffic, covering short inputs, long inputs, high-repetition prefixes, and low cache hit scenarios separately, and then observe performance changes.

    5. Revenue Per Card Is Not Profit: Economic Viability Requires Complete Accounting

    Revenue per card per hour can reflect the output capacity under certain business conditions, but it is not profit, nor is it a fixed return applicable to all enterprises.

    Revenue is affected by request structure, actual pricing, resource utilization, cache benefits, and billing rules. Costs include hardware procurement or leasing, power, data center facilities, networking, software adaptation, operations, and fault redundancy.

    Therefore, to determine commercial sustainability, two types of accounting must be distinguished:

    • Short-term operational contribution: Whether revenue covers the actual incurred running costs.
    • Long-term economic return: Whether revenue can further cover equipment depreciation, R&D investment, and continuous upgrade costs.

    A system might have a positive short-term operational contribution but not yet achieve profitability under a complete cost accounting scope. Conversely, lower single-card revenue does not mean a lack of commercial value; if the unit resource cost is lower, or if it meets specific scenario requirements, it may still form reasonable economics.

    Enterprises can adopt the following metric for internal accounting:

    Unit Effective Output Cost = Total inference-related costs during the statistical period ÷ Volume of output tokens meeting quality requirements in the same period.

    The term “effective” here is crucial. Resources consumed by timeout failures, substandard quality, and repeated retries cannot be ignored. Otherwise, higher nominal throughput may actually mask the problem of low real delivery efficiency.

    6. Establishing Comprehensive Economic Advantages Requires Systemic Optimization

    6.1 Identifying Bottlenecks for Input Processing and Output Generation Separately

    LLM inference typically comprises two main stages: input processing and step-by-step generation. The former processes the input sequence, while the latter continuously generates new tokens; their resource requirements are not identical.

    Long inputs may increase pressure on input processing; long outputs and high concurrency may increase cache usage and memory bandwidth pressure. Enterprises should determine bottlenecks through measurement rather than applying the same optimization strategy to all requests.

    When the scale is large enough and business characteristics are suitable, deploying the two stages separately can be evaluated. However, this architecture also introduces state transfer, extra communication, and scheduling complexity, which must be validated by actual benefits rather than adopted by default.

    6.2 Setting Clear Boundaries Between Throughput and Latency

    Dynamic batching can organize multiple requests into the same round of computation, improving resource utilization. However, waiting for more requests to join a batch may increase queue time.

    A more reasonable approach is to set waiting budgets and concurrency limits based on business service levels, appropriately distinguishing between short requests, long requests, and high-priority requests.

    The optimization goal should be to increase the number of completed requests that meet latency requirements, not to infinitely increase the batch size.

    6.3 Making Cache Management a Core Engineering Issue

    The generation phase needs to retain the Key-Value (KV) cache corresponding to historical context. As sequence length and concurrency increase, the cache becomes a critical resource constraint.

    Cache management must consider allocation efficiency, fragmentation control, reclamation after request completion, and the security boundaries for cross-request reuse. When user data is involved, permission isolation and privacy requirements cannot be ignored just to improve hit rates.

    Enterprises should also monitor cache eviction, out-of-memory events, and request interruptions to prevent high hit rates from masking capacity risks.

    7. Production-Level Deployment Should Adopt Verifiable Practices

    It is recommended to proceed in the following order:

    Step 1: Define business goals. Clarify input/output length distribution, peak traffic, acceptable latency, error rates, and quality requirements. Avoid designing the system solely based on average requests.

    Step 2: Establish functional and quality baselines. Use a fixed test suite to validate output quality under different precisions, optimization strategies, and runtime environments, ensuring that performance improvements do not come at the cost of significant quality degradation.

    Step 3: Conduct multi-dimensional stress testing. Gradually increase the request arrival rate to observe queuing, tail latency, failure rates, and resource usage, identifying the boundary where the system transitions from stable operation to overload.

    Step 4: Perform fault drills. Validate behavior during device exits, service restarts, network anomalies, and increased cache pressure. Check whether faults can be isolated, recovered, and traced.

    Step 5: Canary release with real traffic. First take on a small percentage of business, compare the quality, latency, and cost of the new and old paths, and then gradually scale up while retaining an executable rollback plan.

    Step 6: Form a continuous optimization loop. Integrate service metrics and cost metrics into the same observation system to prevent the performance team from solely pursuing throughput and the operations team from solely focusing on revenue, which can lead to disconnected goals.

    8. The Long-Term Significance of Open-Sourcing Code: Reducing Ecosystem Construction Costs

    A mature computing ecosystem consists not only of compilers and basic operators but also requires model adaptation methods, performance analysis capabilities, scheduling mechanisms, diagnostic tools, testing systems, and long-term maintenance standards.

    Open-sourcing production-grade implementations can help developers understand key design trade-offs, reduce repetitive trial and error, and improve reproducibility across different environments. However, ecosystem maturity still depends on documentation quality, version compatibility, issue resolution efficiency, and continuous maintenance investment.

    Therefore, a reasonable judgment on the progress of inference on domestic computing power should be: being able to stably handle real business and establish a calculable cost model means crossing an important engineering threshold. However, to form a comprehensive advantage, continuous improvement is needed in effective throughput, tail latency, development efficiency, and full-lifecycle costs.

    Ultimately, what measures a high-standard inference service is not a single successful run or an isolated leading metric, but the long-term delivery of correct, stable, scalable, and economically reasonable results under clear business constraints.