LLM Inference Optimization on Domestic 8-Card NPUs: Parallel Strategy Tuning for 53.5% Higher Throughput
This article examines why default deployment configurations often underperform when large language models run on domestic AI accelerator cards, using an 8-card MoE inference case. It explains the bottlenecks of a baseline TP=8/DP=1 setup, then describes a reworked parallel strategy with TP=2, DP=4, and expert parallelism, together with sequence parallelism and graph/kernel compilation optimizations. Under fixed latency SLOs and identical workload and quantization settings, the tuned configuration achieved up to 53.5% higher total throughput. The article also outlines how to capture tuned configurations as reusable deployment profiles and summarizes practical guidelines for SLO-constrained evaluation.
1. Background: Choosing the Model Is Only the First Step on Domestic Compute
As the domestic AI accelerator ecosystem matures, more teams are deploying large language models on domestic AI accelerator cards. In practice, however, a common confusion appears after model weights are downloaded and the inference service is started: performance often falls noticeably short of expectations. First-token latency may be too high, concurrent throughput may be insufficient, or concurrency may have to be reduced sharply just to meet latency SLOs.
The root cause is that LLM inference performance is not determined by hardware compute alone. It is jointly determined by hardware characteristics, the inference engine, parallel strategy, communication optimization, compilation optimization, and other factors. For the same model and the same batch of cards, different deployment configurations can produce several-fold throughput differences.
An industry test case illustrates this point. On a domestic NPU accelerator platform, systematic tuning of a large-parameter MoE model achieved up to 53.5% higher 8-card total throughput than the baseline configuration while meeting the same latency SLO. Behind this number is a reusable optimization methodology. This article breaks it down into three levels.
2. Why the Baseline Is Often Not Optimal
2.1 Typical Baseline Configuration
Default deployment options provided by the community usually prioritize “getting it running.” For an 8-card deployment, the most common baseline configuration is:
- Tensor parallelism TP=8, data parallelism DP=1
That is, each layer of the model is split across 8 cards, and all cards process the same batch of requests together. This configuration distributes memory pressure evenly and is simple to deploy, but it has clear structural weaknesses for high-concurrency online serving.
2.2 Three Bottlenecks of TP=8 Under High Concurrency
(1) Communication overhead scales linearly with parallelism. Tensor parallelism requires multiple All-Reduce communications during the computation of each layer. The higher the parallelism, the greater the number of communications and the volume of communication data. Domestic NPU clusters differ from GPU clusters in interconnect bandwidth and topology, so communication can become a more significant bottleneck than computation.
(2) Compute granularity is fragmented. After splitting across 8 cards, the matrix size processed by each card at a time becomes smaller, the arithmetic intensity of operators drops, and it becomes difficult to fully utilize NPU compute. A large amount of time is spent waiting and synchronizing.
(3) Request-level concurrency cannot be exploited. DP=1 means all requests share the same set of model instances, and batch scheduling space is limited. As requests increase, they can only queue and accumulate batches within one instance; they cannot scale horizontally.
3. Optimization Path: Parallel Strategy Redesign + Communication and Compilation Optimization
3.1 Adjust the Parallel Strategy: TP=2, DP=4 + Expert Parallelism
For the inference workload of an MoE model, the optimization plan adjusts the parallel configuration to TP=2, DP=4, combined with expert parallelism. The logic behind this adjustment deserves careful analysis:
- Lower TP and higher DP: TP is reduced from 8 to 2, greatly reducing the number and scale of All-Reduce communications per layer, while increasing the matrix granularity of each computation and improving NPU utilization. With DP increased from 1 to 4, the system can maintain four independent request batches at the same time, directly multiplying request-level concurrency.
- Introduce expert parallelism (EP): The many expert parameters in an MoE model are naturally suited to sharding across cards. Expert parallelism lets different cards host different experts, and routed tokens only need the necessary All-to-All communication among the cards hosting the relevant experts. This avoids the inefficient pattern of repeatedly splitting the entire expert layer.
This combination of small TP + large DP + EP essentially makes the communication pattern better match the model structure and hardware topology. An illustrative configuration is shown below:
# Deployment parameter example (using common inference framework semantics)parallel_config:tensor_parallel_size: 2 # Reduce intra-layer splitting granularitydata_parallel_size: 4 # Increase request-level concurrencyexpert_parallel_size: 4 # Shard experts across cards
3.2 Sequence Parallelism: Reducing Memory and Communication Pressure for Long Sequences
After lowering TP, a single card needs to carry a longer sequence context. To address this, the optimization plan enables sequence parallelism: the input sequence is split along its dimension across cards in the parallel group, the communication volume in attention computation decreases with the sequence split ratio, and activation memory usage drops significantly. This is especially effective for long-context inference workloads—the longer the sequence, the more obvious the benefit.
3.3 Graph and Kernel Compilation Optimization
The software stack for domestic NPUs usually supports two types of compilation optimization, both of which were enabled in this case:
- Graph optimization (graph mode): switching from per-operator eager execution to whole-graph sinking execution. The framework can perform operator fusion, memory reuse planning, and pipeline scheduling in advance, reducing host-side scheduling overhead.
- Kernel compilation optimization: for key operators in the model, such as attention, GEMM, and MoE routing, enable deep compilation or auto-tuning so that kernel generation can select the optimal implementation based on actual shapes and hardware characteristics.
These two optimizations do not change model semantics, but they significantly improve the core metric of “compute and communication efficiency.”
4. Validation: Throughput Comparison Under the Same SLO
Evaluating an inference optimization plan requires controlled variables. This test followed these principles:
- Fixed SLO constraints: use upper limits on first-token latency (TTFT) and time per output token (TPOT) as hard constraints, and count throughput only within the concurrency range that meets the SLO.
- Fixed workload characteristics: keep the input/output length distribution and request arrival pattern consistent.
- Compare the same quantized version: the baseline and optimized plans use the same model quantization artifact, eliminating interference from quantization precision differences.
Under these fair conditions, the tuned configuration achieved up to 53.5% higher total throughput in the 8-card environment. It should be noted that the specific improvement depends heavily on the number of experts in the model, the request sequence length distribution, and how tight the SLO is. Actual gains should be confirmed with load tests based on your own workload.
5. Making Optimization Experience Reusable: The Value of Deployment Profiles
The broader significance of this case lies at the methodology level. LLM deployment optimization is highly experience-dependent: how to choose a parallel strategy, which optimization switches are worth enabling, and how much resource quota to allocate. If this knowledge exists only in individual tuning notes, it is difficult to reuse at scale.
An effective organizational approach is to build a structured deployment profile catalog. Each profile records the inference engine, image version, resource requirements, and deployment parameters for a specific “model + hardware” combination. For profiles that have completed performance tuning, further capture the baseline configuration, optimized configuration, and benchmark report. Users can search by model or hardware, compare configurations side by side, and make incremental adjustments based on existing profiles and their own workloads rather than starting from scratch.
This idea of “turning experience into assets” can also be implemented through internal configuration management, documentation platforms, or cloud container services and monitoring/alerting systems. The core is to bind tuned configurations with validated data so that the output of each tuning effort can be used directly by the next person.
6. Summary
When deploying LLMs on domestic compute, the performance gap is often not in the hardware itself, but in whether the deployment configuration matches hardware characteristics, model structure, and workload features. The core conclusions of this case can be summarized in three points:
- Be cautious with large TP for high-concurrency online serving; prioritize combinations of “low TP + high DP + expert parallelism.”
- Communication and compilation optimization are essential steps on domestic NPUs; sequence parallelism, graph mode, and kernel compilation usually bring stable additional gains.
- Optimization must be evaluated under SLO constraints; discussing throughput without latency constraints is meaningless.
For teams using domestic compute, it is recommended to start from a mature baseline configuration, validate and adjust each step along the path above, and use load-test data from your own workload to confirm the real gain of each optimization.
