Boosting Inference Throughput by 53.5% on 8 GPUs: A Tuning Guide for Domestic AI Accelerators
This article walks through a systematic tuning practice that raised total inference throughput by up to 53.5% on a single node with eight domestic AI accelerator cards under a fixed SLO. It explains how to build a reproducible baseline, shift from deep tensor parallelism to a TP=2 × DP=4 replica layout, add expert and sequence parallelism, and enable graph mode with kernel compilation, plus a reusable checklist for production rollout.
Boosting Inference Throughput by 53.5% on 8 GPUs: A Tuning Guide for Domestic AI Accelerators
1. Why 8-GPU Setups Need Systematic Tuning
When deploying large generative models on domestic accelerator cards, engineers rarely struggle with “can it run at all.” The harder question is whether the running service actually meets its service level objectives (SLOs). A typical inference service is constrained by three metrics at once: time to first token, inter-token latency, and total request throughput per unit of time. These three pull against each other, so optimizing one in isolation usually causes a regression in another.
A single node with eight cards is the most common deployment shape on domestic compute platforms. It offers enough memory capacity to hold quantized model weights and the key-value cache, but it also introduces inter-card communication overhead. When the parallelism strategy is chosen poorly, communication time quickly eats the gains from parallelism, showing up as “double the cards, nearly the same throughput.” The focus in an 8-GPU environment is therefore not simply piling on resources, but overlapping computation and communication on the timeline, and matching the scheduling granularity of concurrent requests to the hardware topology.
This article follows one typical 8-GPU tuning exercise and abstracts a transferable methodology: establish a comparable baseline first, then adjust the parallelism strategy, enable sequence parallelism, turn on graph and kernel compilation optimizations, and finally compare total throughput under a unified SLO. In practice, total throughput improved by up to about 53.5% under the same service level constraints.
2. Building a Trustworthy Baseline: The Prerequisite for Any Optimization
Many tuning efforts fail because the baseline itself is not trustworthy. A credible baseline needs to satisfy at least four conditions:
- Reproducible configuration: engine version, image tag, model quantization format, resource spec, and launch parameters are all fixed and archived.
- Reproducible workload: input and output length distributions, concurrency levels, and request arrival patterns are fixed, so comparisons never rely on random traffic.
- Consistent metric definitions: be explicit about whether you measure total or per-card throughput, whether queueing time is included, and what the SLO criteria are.
- One variable per comparison: each experiment round changes only one dimension, otherwise results cannot be attributed.
Illustrative baseline launch parameters (structure only, not a specific product interface):
# Baseline: single node, 8 cards, pure tensor parallelism, single replicaengine serve \--model /models/generated-8b-wq4 \--tensor-parallel-size 8 \--data-parallel-size 1 \--max-model-len 8192 \--gpu-memory-utilization 0.90
The baseline answers one question: how much throughput do you get without changing any parameter? Only when that number is stable do the later percentage improvements mean anything.
3. Step One: Moving from Deep Sharding to Replicas
The baseline’s pure tensor parallelism (TP=8) means every layer synchronizes once across all eight cards. That produces many communication events with small data blocks each, which easily turns into synchronization waiting. As concurrent requests increase, this structure forces all requests to share the same communication path, amplifying queueing effects.
The key judgment behind the optimization: on a single node with eight cards, where the model has already been quantized, memory pressure is no longer the main constraint — communication is. So the sharding scheme changes to “tensor parallelism 2 × data parallelism 4,” forming four model replicas. Each replica does two-card tensor parallelism internally, and replicas handle different requests independently.
# Optimized: TP=2 combined with DP=4, no synchronization across replicasengine serve \--model /models/generated-8b-wq4 \--tensor-parallel-size 2 \--data-parallel-size 4 \--max-model-len 8192 \--gpu-memory-utilization 0.90
This change delivers three benefits:
- Smaller communication domain: synchronization happens only between two cards, so fewer participants per sync and a lower probability of waiting.
- Concurrency isolation: the four replicas each maintain an independent batching queue, so one long request does not block short requests on other replicas.
- Fuller batches: with more replicas, the scheduler more easily assembles batch sizes near the throughput optimum, keeping hardware utilization steadier.
Replicas are not unconditionally better, though. If the model is not quantized and the weights do not fit on one card, or if the business values consistency over throughput, a deeper sharding scheme is still required. The decision should rest on measured memory headroom and communication share, not on intuition.
4. Step Two: Adding Expert Parallelism and Sequence Parallelism
On top of replication, introduce expert parallelism to shard the experts of a sparse structure across different cards, so each card computes only the parameters it is routed to and avoids reading ineffective weights. The gains from expert parallelism depend heavily on how sparse the model is and whether routing is balanced, so it must be paired with routing load monitoring to prevent a few cards from being chronically overloaded.
Then enable sequence parallelism. Its value is splitting operations such as normalization and residuals along the sequence dimension across cards, so activations no longer need a full cross-card aggregation. That lowers peak memory usage and shortens the critical path. Sequence parallelism complements tensor parallelism: tensor parallelism splits weight matrices, sequence parallelism splits activation tensors, and together they change the communication pattern from “large blocks, low frequency” to “small blocks, high frequency but overlappable.”
The recommended engineering order is: confirm the parallelism scheme is stable, then turn on sequence parallelism, then tune batching and memory allocation. Re-measure the SLO attainment rate after each item is enabled, so optimizations do not cancel each other out.
5. Step Three: Graph Mode and Kernel Compilation
The first two steps change the execution structure; the third changes how execution happens. When a dynamic graph interprets operators one by one, scheduling overhead and operator dispatch latency take a large share in model structures dense with small operators. Switching to graph mode captures the whole computation graph ahead of time, allowing operator fusion and memory reuse to happen at compile time.
On that basis, enable graph compilation and automatic kernel tuning targeting the domestic accelerator, so the compiler generates an execution plan that fits the hardware’s memory hierarchy and compute unit characteristics. Common compile-time optimizations include operator fusion, constant folding, memory layout reordering, and pipeline scheduling.
# Illustrative: enabling graph mode and compilation (structure only)config = {"graph_mode": True,"compile": {"enable": True,"fuse_ops": True,"tune_kernels": True,},"parallel": {"tp": 2, "dp": 4, "ep": True, "sp": True},}
Note that compilation adds first-start compile time, so in elastic scaling or frequently restarting scenarios, cache the compiled artifacts in persistent storage to avoid recompiling on every cold start. Also prepare a fallback path for compilation failures: service availability takes priority over peak performance.
6. Reading the Results: Where the 53.5% Comes From
Stacking the optimizations above raised total throughput by up to about 53.5% relative to the baseline under a unified SLO. The number breaks down into three contributions:
- Parallelism restructuring contributes the most, mainly from a smaller communication domain and concurrency isolation, usually more than half of the total gain.
- Sequence and expert parallelism come next, showing up as larger usable batch space once peak memory drops.
- Graph and compilation optimizations contribute the least but most consistently, mainly by reducing scheduling and operator dispatch overhead.
More interesting is the shape of the gain curve: the improvement is largest at medium concurrency, negligible at very low concurrency, and limited by queueing and memory bandwidth at very high concurrency. This shows the essence of the optimization is raising “how many concurrent requests a unit of hardware can serve within acceptable latency,” not unconditionally increasing throughput in every scenario.
7. A Reusable Rollout Checklist
- Fix the baseline and workload definitions first; anchor every percentage conclusion to them.
- Examine communication share before deciding whether to shard deeper; prefer replication when memory headroom allows.
- Enable items in the order “parallelism structure → sequence/expert parallelism → graph and compilation,” validating each one separately.
- Prepare persistent caching and a failure fallback for compiled artifacts, covering both cold starts and stability.
- Use monitoring and alerting to continuously track routing balance, batch size distribution, and SLO attainment, turning one-off tuning into a sustainable operating mechanism.
8. Conclusion
Inference performance optimization on domestic compute platforms is moving from parameter trial-and-error toward structured methods. This 8-GPU exercise shows that the key to throughput gains is not any single switch, but the coordinated design of communication, concurrency, and execution mode. Once the baseline, comparison, and attribution process is fixed, teams can reliably reproduce a similar optimization path across different models and hardware specs, bringing the real utilization of domestic compute closer to what the business needs.
