Operator Optimization Near Hardware Limits: What It Means for LLM Inference on Domestic Accelerators

    This article explains what it means when core operators are optimized close to the theoretical hardware limits of domestic accelerator cards. It separates three distinct layers—hardware peak capability, operator implementation efficiency, and system-level service quality—and clarifies common misreadings around training versus inference, single-operator speedups versus end-to-end model gains, and single-card results versus cross-hardware comparisons. Using attention and single-precision TopK as examples, it shows why operator-level gains are bounded by Amdahl's law and why service-level metrics such as throughput, latency, memory usage, cost per million tokens, and stability matter more. It also outlines what reusable software stacks require and what to check before adopting domestic compute.

    1. The takeaway first: meaningful engineering progress, but read it correctly

    A notable type of engineering progress has recently emerged in the industry: several core operators have been optimized on specific domestic accelerator cards to approach the hardware’s theoretical limits. For engineering teams, the value of this work is real—it shows that low-level operator libraries, compiler stacks, and hardware characteristics are forming a tighter collaboration. For readers who do not work in AI, however, three misreadings are the most common: treating “training” and “inference” as the same thing; treating a “single operator’s speedup” as “the whole model’s speedup”; and reading “an operator is faster on a given card” as “domestic chips have comprehensively surpassed a class of mainstream international hardware.”

    To understand this correctly, three layers need to be separated: hardware peak capability, operator implementation efficiency, and system-level service capability. These are different dimensions. They cannot substitute for one another, and they cannot simply be multiplied together.

    2. Training vs. inference: two fundamentally different workloads

    In the resource consumption structure of large language models, training accounts for a substantial share, and the training process directly determines the model’s capability ceiling. Training is a highly synchronous, long-cycle workload that is extremely sensitive to cluster interconnect and stability: it requires forward computation, backpropagation, gradient synchronization, and optimizer state maintenance, while also handling communication bottlenecks, fault recovery, and checkpoint saving under large-scale parallelism. It is closer to a one-time, heavy investment in infrastructure.

    Inference is different. A single inference typically involves several orders of magnitude less computation than training, but real business traffic is massively concurrent: many users asking questions at the same time, while first-token latency, overall response speed, long context, memory usage, and service cost all have to be balanced. Inference is closer to a continuously operated, high-concurrency service system, where the difficulty shifts from “can it be computed” to “can it serve millions of requests stably, cheaply, and quickly.”

    An intuitive judgment: the cost of a single training run is far higher than a single question-answer interaction, but once a model is deployed it is called repeatedly, and cumulative inference overhead can well exceed the total training cost. So the importance of inference optimization will keep rising in the commercialization phase.

    3. What single-operator optimization actually optimizes: attention and TopK as examples

    The original progress mentioned two typical kinds of work: one that deeply optimizes attention computation, and another that fills in and optimizes single-precision floating-point TopK capability on a domestic platform. In general terms, they correspond to two high-frequency hotspots in the inference path.

    3.1 Attention: balancing memory access and computational intensity

    The core difficulty of the attention mechanism is not just multiply-add operations, but the scale of intermediate results, cache hit rate, and memory bandwidth pressure. Common engineering techniques include tiled computation, operator fusion, reducing intermediate tensors written back to memory, improving data reuse, and adjusting data layout for the hardware’s memory hierarchy. The optimization goal is usually not a single peak of “compute utilization,” but making computation and memory access overlap as much as possible and reducing bubbles.

    Illustrative pseudocode (expressing only the tiling and fusion idea, not a specific API):

    1. for q_block in queries:
    2. for k_block in keys:
    3. scores = matmul(q_block, transpose(k_block))
    4. scores = softmax_fused(scores) # fused, avoids a large intermediate tensor
    5. out += matmul(scores, v_block)

    3.2 TopK: simple on the surface, hard in parallelism and memory access

    TopK commonly appears in sampling, retrieval, routing, and sparse selection. Its difficulty lies in the fact that the candidate set is large and highly parallel, but the selection logic has many branches, which easily leads to load imbalance and randomized memory access. Filling in single-precision TopK support and optimizing it means more algorithm paths can land efficiently on that platform, reducing the awkwardness of “it runs, but slowly.”

    3.3 Why a single-operator multiplier cannot be extrapolated to the whole model

    The bar chart in the original content compares an “optimized operator” with a “native general implementation” on the same platform. It measures operator implementation efficiency, not cross-hardware performance. Whole-model gains are constrained by Amdahl’s law: if an operator accounts for only a small fraction of end-to-end latency, even a tenfold speedup of that operator yields limited overall improvement. The right approach is to profile the full path, find the real hotspots, and then check whether the optimization lands on the critical path.

    4. From “fast operator” to “good service”: how inference systems should really be evaluated

    For deployers, more convincing metrics are not a single operator’s peak number but service-level metrics:

    • Throughput: requests served per second, output tokens per second;
    • Latency: first-token latency, end-to-end latency, latency jitter under long context;
    • Resources: memory usage, maximum batch concurrency, concurrent sessions a single card can carry;
    • Cost: cost per million tokens, cost per request, cost fluctuation from peak and off-peak elasticity;
    • Stability: long-running stability, fault recovery, performance regression after version upgrades.

    Around these goals, inference systems typically use engineering techniques such as continuous batching, cache management, request scheduling, priority queues, and timeout and degradation policies. They are complementary to operator optimization: operators determine “how fast a single step is,” while the system determines “how stable and how expensive the whole thing is.”

    5. The key for domestic compute is not single-point peak, but reusable software ecosystems

    The question I care more about is whether these optimizations can be consolidated into a stable, usable, reusable software stack. Reusability includes at least four layers:

    1. Operator library coverage: whether high-frequency operators are complete and whether uncommon paths have fallback options;
    2. Compiler and tuning toolchain: whether it supports automatic tuning, performance regression, and observability;
    3. Framework adaptation cost: whether migrating a business requires only minor changes or a large amount of hand-written adaptation;
    4. Operations system: whether monitoring and alerting, logging services, container platform scheduling, and elastic scaling are mature.

    For cloud deployment, a common approach is to containerize model services, use object storage to keep models and checkpoints, use a message queue to smooth out request peaks, and use monitoring, alerting, and logging services to locate long-tail latency. These general capabilities determine the business experience more than any single-point number.

    6. The boundary of “has training already been completed on domestic chips”

    The publicly confirmable information currently usually only indicates that some training stages used domestic chips, which is different from “full pretraining has been comprehensively migrated to a domestic platform.” To judge the maturity of a training migration, look at: large-scale parallel stability, interconnect communication efficiency, framework and operator completeness, fault recovery mechanisms, and reproducibility of long-cycle training. Inference optimization going first is a reasonable path, because inference has a short feedback cycle and its gains can be directly converted into cost and service experience.

    7. A checklist for technology decision-makers

    • Profile end to end first, confirm the share of hotspot operators, then assess the upper bound of optimization gains;
    • Accept on service-level metrics: throughput, latency, memory, cost per million tokens;
    • Require long-run stability and regression reports to avoid “fast in a demo, slow in production”;
    • Assess migration cost: operator coverage, fallback paths, toolchain, and observability;
    • Treat healthy competition as a long-term positive and keep tracking ecosystem maturity rather than single-point peaks.

    Overall, core operators approaching hardware limits is an important signal that the domestic compute ecosystem is maturing, but it is only the starting point. What really determines success or failure is whether single-point optimizations can be turned into stable, reusable, operable inference service capability.