LLM Inference Throughput Optimization on 8 Domestic AI Accelerators: A Practical Guide
This guide explains why adding more accelerators does not automatically increase inference throughput, and how to maximize total throughput under a fixed SLO. It covers a reusable deployment recipe catalog for capturing tuning experience, plus a case study on a quantized Mixture-of-Experts model running on eight domestic AI accelerators. Three key optimizations are detailed: rebalancing tensor, data, and expert parallelism; sequence parallelism with memory reallocation for larger batches; and graph mode with operator compilation. The optimized configuration achieved up to 53.5% higher total throughput than the baseline, and the article closes with measurement practices and common pitfalls to avoid.
1. The Problem: More Cards Does Not Mean More Throughput
When deploying large-parameter inference services on domestic AI accelerators, a common pattern appears: enough cards have been allocated and memory is not overflowing, yet the concurrency and total throughput the service can handle under a defined service level objective (SLO) still stay flat. The cause is usually not the total compute available, but three things: a parallelization scheme that does not match the hardware interconnect topology, redundant communication from attention and expert layers under long sequences, and a compute graph and operators that never go through a compilation optimization path.
One premise needs to be clear up front: throughput and latency constrain each other. Discussing throughput without an SLO has no engineering value, because scaling batch size without limit will always push the numbers up while first-token latency and per-request latency break through the business bottom line. Every optimization discussed here therefore targets a single objective: maximizing total throughput under the constraint of meeting the SLO.
2. A Reusable Deployment Recipe Catalog: Turning Personal Notes into Team Assets
Getting a large model running in a domestic technology stack environment starts with picking the model, but that is only the first step. What actually consumes time is the chain of decisions that follows: how the inference engine matches the base image, how many cards the model needs, how tensor parallelism and data parallelism should be balanced, and which optimizations genuinely help the current workload.
One effective approach is to structure this information as browsable deployment recipe entries. Each entry is built around a specific model and hardware combination and records the inference engine, image, resource requirements, and key deployment parameters; entries that already have tuning results also keep the baseline and optimized versions along with their reports. The team can search along two dimensions, model or hardware, compare configurations side by side, and have the deployment backend sync those configurations automatically, cutting the repeated cost of trial and error from scratch on every release. The value of this kind of catalog is that optimization experience no longer depends on any one person; it becomes a team asset that can be reviewed, rolled back, and iterated on.
3. Case Study: Quantized Model Inference in an 8-Card Environment
The subject of this practice is a large-parameter model with an expert structure, using quantized weights, deployed on eight domestic AI accelerators on a domestic adaptation of a mainstream open-source inference engine.
The baseline configuration uses pure tensor parallelism, with a tensor parallel degree of 8 and a data parallel degree of 1. This configuration is the simplest to implement, but the problems become obvious as concurrency rises: every layer performs one reduction communication across all eight cards, communication overhead scales linearly with the number of cards, and the operator size on each individual card is small, giving a poor compute-to-memory-access ratio, so part of each card’s time is spent waiting on synchronization.
The optimized configuration makes three key adjustments:
- Parallelization strategy redesign: tensor parallel degree reduced to 2, data parallel degree raised to 4, and expert parallelism introduced to carry the partitioning of the expert layers;
- Sequence parallelism enabled, so intermediate activations along the sequence dimension in attention computation are also partitioned, reducing per-card activation memory and redundant computation;
- Graph mode and operator compilation optimization turned on to cut operator dispatch and scheduling overhead.
Under the same SLO, total throughput after optimization improved by up to 53.5% over the baseline.
4. Key Optimization 1: From One-Size-Fits-All to Layered Parallelism
The essence of a parallelization strategy is mapping different parts of the model onto parallel groups in different dimensions, so that the parts with heavy communication stay within a high-bandwidth domain and the parts with light communication spread across domains.
Take a single 8-card node as an example: cards within the node are usually connected by a high-bandwidth interconnect, while bandwidth drops noticeably across nodes. A general principle follows: keep the most communication-intensive tensor parallel group within the eight cards of a single node, and distribute data parallel replicas across different card groups so requests on different replicas do not interfere with each other. Reducing the tensor parallel degree from 8 to 2 means a single reduction involves only two cards, which sharply shortens the communication radius; raising the data parallel degree to 4 lets four replica groups process different requests in parallel, which naturally increases concurrency capacity.
Introducing expert parallelism is a second layer of benefit. In a model with an expert structure, each token activates only a few experts during inference; if the expert layers are still carried by tensor parallelism, this produces a large amount of ineffective partitioning and synchronization. With expert parallelism, experts are distributed across cards, and combined with the All-to-All exchange of routing results, the number of cards actually participating in computation fits the activation sparsity more closely.
An illustrative configuration comparison follows (structure only, not a specific API):
# Baseline: large communication radius, high synchronization overheadparallel:tensor: 8data: 1expert: null# Optimized: short-radius tensor parallel + multi-replica data parallel + expert parallelparallel:tensor: 2data: 4expert: truesequence_parallel: truegraph_mode: truecompile:kernel_fusion: true
5. Key Optimization 2: Sequence Parallelism and Memory Reallocation
In long-context scenarios, intermediate activations in the attention layers grow with sequence length, memory pressure on each card rises, and that in turn limits the batch size that fits, ultimately pushing throughput down. The idea behind sequence parallelism is to partition these intermediate results along the sequence dimension, spreading activation memory across multiple cards in the group and freeing the saved memory for a larger batch size. The larger the batch, the higher the arithmetic intensity of matrix multiplications and the lower the compute cost per token, which is the direct source of the throughput gain.
Note that sequence parallelism introduces additional communication, so it is not an unconditional win: when sequences are short and the batch is already large, the benefit may be canceled out by communication. In engineering terms, treat it as a switch that needs validation against the workload, not something enabled by default.
6. Key Optimization 3: Graph Mode and Operator Compilation
In eager mode, operators for each layer of the model are dispatched one by one, and the framework side carries considerable scheduling and host overhead, which is especially visible in models dense with small operators. With graph mode enabled, the whole graph is captured and optimized as a unit, releasing opportunities such as operator fusion, constant folding, and memory reuse; combined with operator compilation targeting domestic hardware, hot operators can be turned into implementations that fit the hardware instruction pipeline more closely.
For adoption, follow a “locate first, then optimize” order: use the operator timing and communication timing statistics provided by the runtime to find the top few hotspots, then validate the actual benefit of compilation optimization on those hotspots, avoiding a global rollout that introduces regressions that are hard to attribute.
7. Validation Method and Common Pitfalls
Whether an optimization holds depends on whether the measurement is trustworthy. Fix the following conditions before running a comparison: the same model and quantization precision, the same input and output length distribution, the same concurrency gradient, and the same SLO threshold. Metrics should cover at least total throughput, first-token latency, per-request end-to-end latency, memory usage, and card utilization.
There are four common pitfalls: looking only at throughput and not at the latency distribution, since tail latency above target means unusable; load testing with a single fixed length, since a different length distribution in production can reverse the conclusion; pushing parallelism degrees up blindly, letting communication overhead swallow the gains; and setting the baseline configuration itself too conservatively, which inflates the improvement number. A reproducible practice is to archive the baseline and optimized configurations, the load test parameters, and the result reports together, forming a baseline system that supports continuous comparison.
8. Summary
On eight domestic accelerators, a throughput bottleneck is usually a configuration problem rather than a hardware problem. Advancing in the order of layered parallelism, sequence-dimension partitioning, then graph and operator compilation, and running comparisons under a unified SLO and unified load test conditions, is a fairly reliable optimization path. Capturing every tuning result as a searchable, rollback-capable recipe entry is what lets a team keep accumulating performance gains on domestic compute instead of repeatedly paying the same trial-and-error cost.
