Optimizing LLM Throughput on 8 Domestic AI Accelerators: A Practical Guide
This article presents a practical methodology for improving inference throughput when deploying a quantized large language model on 8 domestic AI accelerators. Starting from a baseline of tensor parallelism 8 and data parallelism 1 (TP8/DP1), it explains how to restructure parallelism (TP2/DP4 and expert parallelism for MoE models), enable sequence parallelism with topology-aware communication, and apply graph mode with operator compilation. It also covers a reusable deployment-plan approach and a closed-loop validation process based on SLO boundaries, latency percentiles, memory usage, and card utilization. With these optimizations, total throughput improved by up to 53.5% under the same SLO.
1. Background: Inference Throughput Bottlenecks on Domestic Compute
Deploying a large language model in a domestic, self-reliant IT environment starts with choosing the model, but that is only the first step. What really determines whether a service can go live is the match between the inference engine and the container image, the accelerator count, the parallelism strategy, and which optimizations actually fit the current workload. If any of these is misconfigured, expensive compute ends up sitting at low utilization.
Consider a quantized large language model deployed on 8 of the latest domestic AI accelerators. The baseline configuration uses tensor parallelism 8 and data parallelism 1 (TP8/DP1). This setup is simple to implement, but in high-concurrency, long-context online serving scenarios, communication overhead and batching efficiency become the main bottlenecks. After systematic tuning, total throughput improved by up to 53.5% while meeting the same service level objective (SLO). This article strips out product-specific details and abstracts a general methodology.
2. Overall Approach: Turning Deployment Experience into Reusable Plans
In our practice, the most effective approach is to organize the four-element tuple of “model, hardware, engine, and parameters” into a browsable catalog of deployment plans. Each plan centers on a specific model and hardware combination and records the inference engine, container image, resource requirements, and deployment parameters. For plans that already have tuning results, both the baseline version, the optimized version, and the corresponding report are retained. This way, a new workload can start from an existing configuration and validate it against its own hardware and load, instead of trial-and-error from scratch. The optimizations described below were completed under this approach.
3. Breakdown of Optimization Techniques
3.1 Adjusting the Parallelism Strategy to Handle More Concurrency
TP8 means every layer’s computation is split across 8 cards, with collective communication at every layer. When there are not enough concurrent requests, splitting too finely actually reduces per-card compute density. Switching to TP2/DP4 replicates the model into 4 replicas, each using only 2 cards. The communication domain shrinks from 8 cards to 2, cross-card synchronization costs drop significantly, and replica-level parallelism naturally absorbs more concurrent requests. For models using a Mixture-of-Experts (MoE) structure, expert parallelism (EP) can be introduced further to distribute different experts across different cards, avoiding the memory and compute hotspots caused by a single card hosting all experts.
The parallelism selection logic can be expressed with the following pseudocode:
# Pseudocode: search for a parallelism combination under constraintsfor tp in [1, 2, 4, 8]:for dp in [8 // tp]:for ep in candidate_ep(tp, dp):cfg = build_config(tp=tp, dp=dp, ep=ep)if fits_memory(cfg) and meets_slo(benchmark(cfg)):record(cfg)
The core criterion is that a smaller communication domain is better, but per-card memory and compute density must both satisfy the constraints.
3.2 Sequence Parallelism and Communication Optimization
In long-sequence scenarios, activations for operations such as attention and normalization grow linearly with sequence length. Enabling sequence parallelism splits the sequence dimension across the cards in the communication group, reducing per-card activation memory pressure and distributing otherwise redundant computation. Combined with topology-aware scheduling at the communication-library level, collective communication can better align with inter-card interconnect bandwidth, reducing idle waiting.
3.3 Graph Mode and Operator Compilation Optimization
Dynamic graph execution introduces substantial operator dispatch and scheduling overhead. Switching to graph mode captures the entire computation graph, so compilation optimizations such as operator fusion, constant folding, and memory reuse can take effect. Applying compile-time specialization for the operator library of domestic chips can further compress critical-path latency. In engineering practice, it is recommended to enable a compilation cache to avoid repeated compilation on every cold start.
4. Validation Method and Risk Notes
Tuning must be a closed loop: fix the input distribution and concurrency gradient, increase load step by step to the SLO boundary, and record throughput, latency percentiles (P50/P95/P99), memory usage, and card utilization. Note that quantized models may exhibit precision drift on extreme low-probability branches, so quality spot checks on the business side should be retained. Parallelism is not always better when larger; watch out for “negative optimization” where the communication share overtakes the compute share.
5. Conclusion
Improving throughput on domestic compute is essentially about aligning hardware characteristics, model structure, and workload characteristics. Reconstructing the parallelism strategy, sequence parallelism, and graph and compilation optimizations form a transferable tuning framework. Combined with a plan-based approach to accumulating experience, teams can significantly shorten the time from model selection to going live and truly turn compute into business throughput.
