Multi-GPU Inference Parallelism Tuning: How We Improved Throughput by Over 50%

    A practical case study on optimizing LLM inference throughput on an 8-GPU NPU cluster. By rebalancing tensor/data parallelism ratios, enabling expert parallelism, applying sequence-parallel communication optimizations, and leveraging graph compilation, the team achieved up to a 53.5% throughput gain under SLO latency constraints. The article details the tuning methodology, validation approach, and how to make deployment configurations reusable across teams.

    Multi-GPU Inference Parallelism Tuning: How We Improved Throughput by Over 50%

    In production LLM inference, there is often a significant engineering gap between “the model runs” and “the model runs efficiently.” With identical hardware and the same model, different parallelism strategies and compilation configurations can produce throughput differences of more than 50%. This article walks through a real-world tuning case on an 8-GPU domestic NPU cluster, systematically covering the reasoning, techniques, and validation methods behind inference performance optimization. We hope it serves as a reusable reference for engineering teams working on model deployment.

    1. Case Background: Starting from the Baseline Deployment

    The subject of this exercise is an open-source large language model with a Mixture-of-Experts (MoE) architecture, deployed on an 8-GPU inference node running quantized model weights. The inference framework is a domestic NPU-adapted version of a mainstream open-source high-throughput inference engine.

    The baseline used the most common configuration: tensor parallelism of 8 (TP8) and data parallelism of 1 (DP1). This setup is simple to implement, keeps single-request latency manageable, and is the easiest parallelism strategy to “get running first.” However, under high-concurrency production traffic, TP8 means every GPU must participate in communication coordination for every forward pass. Cross-GPU communication overhead scales linearly with the degree of parallelism, making it difficult to fully exploit cluster-wide throughput.

    Once the service level objective (SLO)—the latency constraint per request—was clearly defined, the tuning goal became straightforward: maximize total node throughput without breaching the latency ceiling.

    2. Tuning Lever 1: Rebalancing the Parallelism Strategy

    This was the highest-impact part of the optimization. The configuration was changed from TP8/DP1 to TP2/DP4, with expert parallelism introduced.

    The reasoning behind this adjustment is worth unpacking:

    • Lower tensor parallelism to reduce communication density. With TP2, each GPU only communicates frequently with one peer for tensor-sharding operations, significantly reducing communication volume and synchronization waits. For hardware with strong compute capability and sufficient per-GPU memory to hold the sharded weights, lowering TP is almost always the first direction to explore for throughput optimization.
    • Use data parallelism to absorb concurrency. DP4 effectively creates four independent inference instances on a single node, each handling a separate request stream. Data parallelism incurs almost no cross-instance communication overhead and scales nearly linearly—making it a “clean” way to boost overall throughput.
    • Match expert parallelism to the MoE structure. For MoE models, expert-layer parameters are naturally suited to being sharded across GPUs along the expert dimension. With expert parallelism, each GPU holds only a subset of experts, and the routing dispatch mechanism both reduces per-GPU memory pressure and balances the expert computation load across devices.

    It is important to emphasize that there is no universally optimal TP/DP ratio. It depends on model size, per-GPU memory capacity, interconnect bandwidth, and the latency requirements of the workload. The right approach is to build configuration-versus-performance comparison experiments: fix the SLO, sweep several candidate ratios, and let the load-test data speak.

    3. Tuning Lever 2: Deep Optimizations at the Communication and Compilation Layers

    Beyond restructuring parallelism, two categories of low-level optimizations were enabled:

    1. Sequence-parallel communication optimization. In traditional tensor parallelism, redundant activation communication occurs between the attention and feed-forward layers. Through parallelism along the sequence dimension combined with communication fusion techniques, part of the element-wise computation can be distributed across GPUs along the sequence axis, reducing redundant communication and further lowering the communication share in long-sequence scenarios. These gains are especially pronounced with long inputs and large batch sizes.

    2. Graph compilation and operator compilation optimization. Domestic NPUs typically provide computation graph capture and operator-level compilation acceleration. With graph mode enabled, the large number of small operators in the inference process are consolidated into a complete computation graph, eliminating the scheduling overhead of dispatching operators one by one. Combined with compiler optimizations for specific operators (such as operator fusion and memory layout reordering), this can meaningfully improve kernel execution efficiency. This layer of optimization does not change model semantics—it is essentially “free” performance—and we recommend enabling and validating it by default in all production deployments.

    4. Validation Methodology: Throughput Comparison Under SLO Constraints

    The most common mistake in performance tuning is “looking only at peak throughput, not at latency.” A sound comparison methodology should satisfy three conditions:

    1. Unify the SLO definition. Clearly specify the upper bounds for time-to-first-token and per-token latency, and compare all approaches under the same constraint.
    2. Build load tests that reflect real production traffic. This includes input/output length distributions, request arrival patterns (e.g., Poisson arrivals), and concurrency ramp-up processes. Avoid drawing distorted conclusions from uniform short requests.
    3. Layered attribution. Record throughput and latency curves for both baseline and optimized configurations at different concurrency levels, identifying which optimization item each gain comes from, so the findings can be transferred and reused on other models.

    Under this methodology, the final results of this case show that, while satisfying the SLO, the optimized configuration improved total node throughput by up to 53.5% over the baseline. This figure comes from the combined effect of the parallelism rebalancing, sequence parallelism, and compilation optimizations.

    5. Lessons Learned: Making Deployment Configurations Reusable

    The value of a single case is limited; the greater value lies in structuring tuning experience so it is searchable and reusable. We recommend that teams consolidate knowledge in units of “deployment configurations”: each configuration is organized around a specific model and hardware combination, recording the inference engine and runtime image versions, resource requirements, parallelism settings, validated optimization items, and performance reports for both baseline and optimized states. When new team members take over or the platform switches to different hardware, they can perform incremental validation starting from existing configurations rather than exploring from scratch.

    General-purpose cloud capabilities such as container platforms, monitoring and alerting, and logging services—for example, those offered by Baidu AI Cloud—can support automated deployment and performance observability for such inference services, helping teams close the “configure–load-test–iterate” loop faster.

    6. Conclusion

    LLM inference performance optimization is not a collection of isolated tricks, but a systematic methodology: treat the SLO as the boundary condition, use the parallelism ratio as the largest lever, apply communication and compilation optimizations as supplementary gains, validate with disciplined load testing, and finally consolidate results into reusable configurations. We hope this breakdown helps readers reproduce—or even surpass—this 50% throughput improvement on their own hardware and workloads.