Multi-GPU Inference Optimization on Chinese AI Accelerators: Parallelism and Communication Tuning
Optimizing multi-device LLM inference requires balancing throughput against latency service-level objectives. This article examines a shift from TP8/DP1 to TP2/DP4 with expert parallelism, supported by quantization, sequence parallelism, and graph and kernel compilation optimizations. It also explains how to benchmark throughput under consistent SLO constraints and document configurations for reuse, drawing on an eight-accelerator test that reported up to 53.5% higher throughput.
1. Understanding Multi-Device Inference Bottlenecks
In large language model serving, throughput and latency often compete. To keep time to first token (TTFT) and time per output token (TPOT) within service-level objectives (SLOs), teams frequently choose a high degree of tensor parallelism—for example, using all eight accelerators in a single TP8 group.
This configuration can deliver good latency for individual requests, but several bottlenecks become apparent under high concurrency:
- Communication overhead becomes more prominent. Higher tensor parallelism distributes collective operations such as AllReduce across more devices during token generation. As concurrency increases, communication can account for a growing share of execution time.
- Compute and communication become harder to overlap. Tensor parallelism divides each layer into smaller workloads. Smaller per-device matrix multiplications can reduce compute utilization and leave less opportunity to hide communication behind computation.
- Request scheduling has limited independence. With TP8/DP1, all requests share one distributed model replica. This limits the scheduling space for independent batches and can make it harder to use the available memory and compute efficiently.
Identifying these bottlenecks provides the basis for choosing the next optimization steps.
2. Start with the Parallelism Strategy
A typical optimization path is to move from high tensor parallelism and low data parallelism to a combination of lower tensor parallelism, higher data parallelism, and—when serving mixture-of-experts (MoE) models—expert parallelism.
For example, an eight-device deployment can move from TP8/DP1 to TP2/DP4, with expert parallelism configured for the MoE model. The potential benefits fall into three areas:
- Lower tensor-parallel communication overhead. Reducing TP from eight devices to two reduces the scope of cross-device communication within each TP group, helping prevent communication from dominating throughput.
- More independent request scheduling. DP4 provides four serving replicas that can schedule independent batches. This creates more room for aggregate throughput to scale as request concurrency increases.
- Better alignment with MoE architecture. Expert parallelism distributes experts across devices and activates them through token routing, avoiding the memory cost of replicating every expert in full.
Memory capacity is an important constraint. With fewer devices sharing each tensor-parallel model replica, each device must hold a larger weight shard. In the configuration described here, quantization is a prerequisite: low-bit weights make room for both the TP2 weight shards and the KV cache. Quantization can also improve per-token compute throughput.
3. Add Communication and Compilation Optimizations
After adjusting the parallelism strategy, two additional optimization categories can be applied.
Sequence Parallelism
In conventional tensor-parallel implementations, operations such as LayerNorm—and dropout where applicable—may be replicated along the sequence dimension.
Sequence parallelism partitions these operations along that dimension. AllGather and ReduceScatter coordinate data movement around the attention and MLP computation regions. This can reduce communication overhead further, with particularly useful gains for long-context workloads.
Graph Execution and Kernel Compilation
Enabling the inference engine’s graph execution mode allows optimizations such as operator fusion, memory planning, and execution scheduling.
Hardware-specific kernel compilation can further optimize kernels for the model’s actual tensor shapes, reducing operator launch overhead and improving memory-access efficiency.
These optimizations typically do not require changes to model code, making them relatively low-effort tuning options.
The following YAML illustrates the configuration structure. It is a generic example rather than a ready-to-run configuration for a specific engine:
parallel_config:tensor_parallel_size: 2data_parallel_size: 4expert_parallel_size: 4optimizations:sequence_parallel: truegraph_mode: truekernel_compile: truequantization:weight_bits: 8
4. Validate Throughput Under SLO Constraints
The goal is not to maximize an isolated performance metric. It is to maximize aggregate throughput while meeting the required SLOs.
Start by defining a fixed set of latency constraints, such as a P99 TTFT limit and a maximum per-token generation latency. Then load-test the baseline and optimized configurations under the same constraints, recording aggregate throughput across different concurrency levels.
In the reported test on eight Chinese-developed AI accelerators, the combined optimizations—TP2/DP4 with expert parallelism, sequence parallelism, graph execution, and kernel compilation—delivered up to approximately 53.5% higher aggregate throughput than the TP8/DP1 baseline while meeting the SLOs.
The throughput curve’s saturation point also shifted to higher concurrency. In practical terms, the optimized configuration sustained efficient operation across a wider range of medium-to-high request concurrency.
5. Make Optimization Results Reusable
The value of a tuning exercise increases when its results become reusable deployment assets.
A practical approach is to organize deployment configurations by model × hardware × configuration. Each entry should record:
- Inference engine and container image versions.
- Resource requirements, including accelerator count and device memory capacity.
- Key settings, including parallelism strategy and quantization method.
- Performance comparisons between the baseline and optimized configurations.
If a deployment platform can automatically synchronize these configuration packages, users can start from an established setup and run smaller validation and tuning exercises for their own hardware and workloads.
For teams deploying on Chinese-developed accelerators, maintaining a baseline, optimized configuration, and benchmark report together can substantially reduce the effort required to reproduce and adapt a deployment.
6. Conclusion
Multi-device inference optimization follows a clear sequence: match the parallelism strategy to the hardware topology and workload, improve communication and execution efficiency, and measure the gains under consistent SLO constraints.
The move from TP8/DP1 to TP2/DP4 with expert parallelism illustrates why a default configuration is not necessarily the most efficient one. Understanding the bottlenecks and tuning against measured results are essential to improving the cost-performance of LLM inference on Chinese-developed AI accelerators.
