Throughput Tuning and Validation for Deploying LLMs on an 8-Card Domestic NPU Cluster
This article explains why LLM deployment on domestic NPUs requires dedicated tuning rather than reusing GPU-oriented configurations. It covers four common deployment problems, a structured catalog for preserving deployment configurations, baseline bottleneck analysis with profiling tools, a parallel strategy adjustment from TP8+DP1 to TP2+DP4 combined with expert parallelism (EP), three categories of compiler and operator optimizations with verifiable metrics, and a test environment template for reproducing the reported 53.5% throughput gain. Readers will learn a measurement-first methodology: profile before tuning, adjust parallelism based on evidence, and validate each optimization independently.
1. Why Deployments on Domestic NPUs Need Dedicated Tuning
The same model can perform very differently on different hardware. Domestic NPUs differ from the mainstream GPU ecosystem in instruction sets, inter-chip interconnect bandwidth, and operator libraries, so configurations carried over directly from other platforms often fail to deliver the expected throughput. Engineering teams need to measure performance on their own hardware rather than relying on generic experience.
Four types of problems commonly arise during deployment: mismatches between the inference engine, drivers, and image versions; inaccurate memory requirement estimates; parallel strategy choices made without supporting evidence; and hardware features that the compiler does not fully exploit. The following sections address each of these in turn.
2. Preserving Configurations in a Deployment Catalog
If deployment knowledge stays only in personal notes, it becomes hard to reuse when a different person takes over or a software version changes. It is recommended to organize each “model plus hardware” combination into a structured catalog containing at least the following fields:
- Inference engine version and image digest, for exact reproduction;
- Driver and runtime versions;
- Number of cards, the parallel strategy values (TP, DP, EP), and the role of each card;
- Memory allocation ratio, KV Cache block size, and PagedAttention-related parameters;
- Two complete parameter sets: baseline configuration and optimized configuration;
- Stress test commands, input/output length distributions, concurrency level, and number of repetitions.
Entries should be validated before being written into the catalog. The image digest must be pullable, the product of the parallel dimensions must match the card count (for example, TP2 × DP4 = 8 cards), and parameter values must fall within the ranges supported by the engine. Entries that fail validation should not enter the one-click deployment pipeline.
3. Baseline Evaluation: Identify the Bottleneck First
This article uses a lightweight mixture-of-experts (MoE) model as an example. The baseline uses TP8+DP1, meaning all layers are sharded across the 8 cards. Tensor parallelism requires multiple AllReduce synchronizations during the forward pass of each layer. When the model is small, each computation step is short, so the proportion of synchronization overhead rises accordingly. As concurrent requests increase, the compute units may spend most of their time waiting for communication.
Bottlenecks should not be judged by intuition alone. Use profiling tools to record the proportion of time spent on computation, communication, and idle states within each inference step. Only when the communication share is clearly high should you consider reducing the tensor parallelism degree. Baseline data should also be collected this way and correspond one-to-one with the numbers presented later.
4. Adjusting the Parallel Strategy: TP2+DP4 with Expert Parallelism
The optimized plan changes the parallel strategy to TP2+DP4 and runs the model with expert parallelism (EP). The 8 cards are divided into 4 data-parallel groups of 2 cards each.
- With tensor parallelism reduced to 2, fewer participants are involved in each intra-group AllReduce, lowering per-synchronization latency.
- The data-parallel groups are independent of one another and can process 4 batches of requests simultaneously, improving concurrency.
- Each 2-card group holds one complete model replica, with experts partitioned across the two cards in the group.
This mapping is the topology used in this article’s tests. When migrating to a different card count or model, three points must be re-verified: whether each DP group holds a complete set of experts; whether the EP degree and TP degree comply with the parameter constraints of the engine in use; and whether the parallel dimensions in the launch parameters match the physical topology. If any one of these is inconsistent, the performance data cannot be reproduced.
The purpose of adjusting the parallel strategy is to let multiple cards handle concurrent requests more effectively. When the model fits in memory, less sharding generally means less communication.
5. Compiler and Operator Optimizations: Verifiable Items
Low-level optimizations fall into the following three categories. Each should carry checkable metrics to confirm that the optimization actually took effect.
- Sequence parallelism: For long-input scenarios, the sequence dimension is sharded across multiple cards, reducing per-card peak memory. Check items: per-card peak memory and throughput changes under long-sequence inputs.
- Graph optimization and operator fusion: Use the graph compilation tools provided by the NPU to rewrite the inference computation graph. Check items: the number of computation graph nodes before and after fusion, kernel-level latency of the main operators, and memory access counts for intermediate results.
- Computation-communication overlap: Place mutually independent computation and communication tasks into parallel streams. Check items: the proportion of communication wait time before and after enabling, and whether any new synchronization waits appear.
The benefit of each of the three optimization categories must be measured separately. If they are tested together, it becomes impossible to attribute gains to any individual item.
6. Test Environment and Results
The table below lists the information required to reproduce the results in this article. Items marked “To be filled in” must be completed based on actual test records; throughput figures should not be cited before these are provided.
| Item | Value |
|---|---|
| Model, parameter count, quantization method | To be filled in |
| NPU model and driver version | To be filled in |
| Inference engine version and image digest | To be filled in |
| SLO metrics (e.g., time to first token, per-token latency limit) | To be filled in |
| Concurrency level | To be filled in |
| Input/output length distribution | To be filled in |
| Baseline configuration | TP8+DP1 |
| Optimized configuration | TP2+DP4, combined with EP, with compiler optimizations enabled |
| Throughput unit | To be filled in (e.g., tokens/s) |
| Number of test repetitions and statistical method | To be filled in |
| Throughput change under SLO constraints | To be filled in |
The original test report gives a throughput improvement of 53.5%. This figure corresponds only to the test conditions listed in the table above; results may differ substantially with other models, workloads, or software versions.
7. Conclusion and Applicability Boundaries
When deploying LLMs on domestic NPUs, the recommended sequence is: measure the bottleneck first, then adjust the parallelism strategy, and finally verify the benefit of each compiler optimization item by item. By preserving configurations in a structured catalog, teams can reproduce results under identical conditions and find suitable deployment plans for new models more quickly.
The approach in this article applies to deployments of similar lightweight models on comparable topologies. Performance gains depend on model scale, request patterns, and software versions, and cannot be taken as a universal guarantee. Before going live, teams should re-run stress tests under their own workloads and rely on their actual measured data.
