Deploying Large Language Model Inference on 8 Domestic AI Accelerator Cards: Throughput Gains from Parallelism Strategy to Compilation Optimization

    This article presents a case study of deploying a quantized, lightweight Mixture-of-Experts (MoE) large language model on eight domestic AI accelerator cards. It outlines common deployment problems, a way to document reusable configurations, and how a tuning process raised total throughput by up to 53.5% under the same TTFT and TPOT latency targets. The changes covered were a new parallelism layout (TP2 with DP4 and expert parallelism), sequence parallelism, and graph mode with kernel compilation. Readers get a step-by-step tuning method that the author considers applicable across models and hardware.

    1. Background: Practical Challenges of Running LLMs on Domestic Compute

    As domestic computing infrastructure, known in China as Xinchuang, becomes more widely adopted, more teams are moving large language model inference services onto domestic AI accelerator cards. Choosing a model and hardware, however, is only the first step. During real deployments, developers typically encounter several recurring problems:

    1. Matching inference engines and images is difficult. Inference engines vary widely in how well they support a given hardware platform. A slightly incorrect combination of versions can cause unsupported operators or performance regressions.
    2. Few references exist for parallelism strategies. How tensor parallelism (TP), data parallelism (DP), and expert parallelism (EP) are combined determines the balance between communication overhead and compute efficiency. Best-practice material for domestic chips is relatively scarce.
    3. Throughput bottlenecks under SLO pressure. Online services usually have explicit targets for time to first token (TTFT) and time per output token (TPOT). Simply adding more cards does not produce linear throughput gains while still meeting those SLOs.

    This article presents a concrete case. An open-source large language model, a lightweight variant with a Mixture-of-Experts architecture, was deployed as a quantized model on eight of the latest domestic accelerator cards. The deployment used a hardware-adapted version of a mainstream inference engine. Through systematic tuning, total throughput rose by up to 53.5% while meeting the same SLO constraints.

    2. Documenting Deployments So Tuning Experience Can Be Reused

    In a Xinchuang environment, the most time-consuming part of inference deployment is rarely getting a demo running. It is repeated trial and error to find a workable configuration. For this reason, recording deployment experience in a structured form matters. A reusable deployment plan typically includes the following elements:

    • Inference engine and image versions: The exact engine version and its hardware adaptation plugin version, so the environment can be reproduced.
    • Resource requirements: Number of cards, memory usage (device and host), and the ratio of CPU and host resources.
    • Parallelism and deployment parameters: The TP/DP/EP combination, quantization method, context length, and scheduling parameters.
    • Baseline and optimization comparison: Performance data under the same workload, so the gain from each optimization can be evaluated.

    Organizing deployments this way means that when a team faces a new model or new hardware, it can start from an existing configuration, verify it quickly, and then adjust it for its own workload. It does not have to start from scratch.

    3. Optimization Case Study

    3.1 Baseline Configuration and Problem Identification

    The baseline used a standard TP8 / DP1 configuration. This means eight cards perform tensor parallelism, and a single replica serves all requests. The advantage of this setup is that it splits the model weights across multiple cards, which makes it possible to deploy a model that does not fit on one card. It also performs well on decoding latency for individual requests.

    Under high concurrency, however, the limits of TP8 became clear:

    • Every decoding step requires an All-Reduce across all eight cards. The number of communication rounds grows with the number of participating cards, so inter-card communication becomes the main bottleneck.
    • All requests share one inference replica, which limits scheduling flexibility and makes it hard to take full advantage of the expert routing in MoE models.
    • Computation and communication alternate, so NPU compute units sit idle while they wait for communication.

    3.2 Adjusting the Parallelism Strategy: TP2 + DP4 with Expert Parallelism

    The optimized plan changed the parallelism layout to TP2 / DP4 and added expert parallelism:

    1. Baseline: TP=8, DP=1
    2. Optimized: TP=2, DP=4, EP=on

    The reasoning behind each change is as follows:

    1. Lower the tensor parallelism degree. With TP reduced from 8 to 2, each decoding step’s All-Reduce involves only two cards. Communication volume and synchronization overhead drop significantly.
    2. Raise the data parallelism degree. Four independent replicas can process requests in different batches at the same time. Scheduling becomes more flexible and batching becomes more efficient, so overall throughput rises.
    3. Introduce expert parallelism. In an MoE model, expert parameters are naturally suited to being split across cards. With expert parallelism, each card holds different experts, and tokens are dispatched across cards according to routing results. This avoids the pattern in tensor parallelism where every card participates in every layer, which reduces unnecessary communication.

    Together, these three changes shift the approach from mainly splitting weights to mainly splitting traffic and experts. This fits the compute characteristics of MoE models under high-concurrency inference workloads more closely.

    3.3 Communication Optimization: Sequence Parallelism

    While reducing the TP degree, the optimized plan also enabled sequence parallelism. The core idea is to split the sequence dimension (the KV Cache) across the cards in a TP group during attention computation. This distributes work that would otherwise run over the full sequence on a single card. The benefits are:

    • Lower KV Cache memory usage per card, which frees room for larger batches.
    • Less communication in the attention step, with some All-Reduce operations replaced by lighter communication patterns.
    • Particularly noticeable gains in long-context scenarios.

    3.4 Graph Mode and Operator Compilation Optimization

    NPU vendors typically provide graph mode and operator compilation features. The optimized plan enabled the relevant settings:

    • Computation graph optimization: Switching from eager execution to graph mode lets the compiler optimize the entire graph. It fuses operators, optimizes memory layout, and schedules execution. This reduces operator launch overhead and intermediate result reads and writes.
    • Kernel compilation optimization: Hardware-specific compilation targets the quantized and attention operators of the model. This makes better use of on-chip cache and matrix compute units, which improves the efficiency of individual operators.

    These optimizations do not require changes to model logic. They are a low-cost, predictable source of gains. The recommended approach is to enable them as a second phase, after the parallelism strategy is adjusted.

    4. Results

    Under the same SLO constraints, with fixed TTFT and TPOT upper limits, the test results were as follows:

    Configuration Parallel layout Key optimizations Relative total throughput gain under SLO
    Baseline TP8 / DP1 None None
    Optimized TP2 / DP4 + EP Sequence parallelism + graph and kernel compilation Up to +53.5%

    The gain was achieved without sacrificing latency metrics. For online services, this matters more than peak throughput figures viewed alone.

    5. A Reusable Tuning Method

    Looking back at the whole case, the following general path for tuning LLM inference on domestic compute can be extracted:

    1. Establish a baseline. Start with a conservative, general-purpose configuration (for example, a high TP degree) to get the service running. Record SLO and throughput data.
    2. Locate bottlenecks. Observe the share of time spent on communication, NPU utilization, and batch saturation to determine whether the bottleneck is communication or computation.
    3. Adjust the parallel topology. For high-concurrency workloads, prioritize lowering TP and raising DP. For MoE models, add expert parallelism.
    4. Layer on communication and compilation optimizations. Enable sequence parallelism, graph mode, and operator compilation to extract more performance from the hardware.
    5. Revalidate. Every optimization must be re-benchmarked under SLO constraints to confirm the balance between throughput and latency.

    6. Conclusion

    Optimizing LLM inference on domestic compute depends on understanding the communication topology and compute characteristics of the hardware, and then matching the parallelism strategy to them. This case reduced TP, increased DP, and added EP. Combined with sequence parallelism and compilation optimization, these changes raised SLO-constrained throughput by up to 53.5% on an eight-card setup. The approach is not tied to a specific model or hardware model, so the author considers it transferable. The goal is to help teams deploying inference services in Xinchuang environments.