LLM Inference Throughput Optimization on 8-GPU Domestic Accelerators: A Practical Guide
This guide presents a systematic approach to improving inference throughput for quantized large language models on an 8-GPU domestic accelerator platform. It explains how to establish a reproducible baseline, restructure parallelism from a single large-parallelism replica into multiple finer-grained replicas, apply sequence and expert parallelism, and enable graph capture and operator compilation. It also covers a four-stage validation workflow, the metrics to monitor, reusable configuration records, and common pitfalls to avoid. All configurations are given as generic parameters for cross-platform verification.
1. Why 8-GPU Throughput Optimization Needs a Systematic Approach
When deploying large language models on domestic (信创) compute infrastructure, choosing the model and hardware is only the starting point. What actually determines how many concurrent requests a given unit cost can serve is the match between the inference engine and the container image, the combination of GPU count and parallelism strategy, and low-level tuning of compilation and communication. After migrating to domestic accelerator cards, many teams run into three typical problems: they reuse their existing parallelism configuration, which pushes inter-GPU communication to an excessive share of runtime; they focus only on single-request latency and lose sight of total throughput under Service Level Objective (SLO) constraints; and they have no reusable configuration baseline, so every tuning round starts from scratch.
This article uses quantized model inference on an 8-GPU domestic accelerator platform as the scenario and abstracts a general optimization path from it. No specific vendor product is referenced, and all configurations are expressed as generic parameters so they can be compared and validated across different platforms.
2. Establish a Trustworthy Baseline First: Optimization Without a Baseline Cannot Be Measured
The first step of optimization is not changing parameters but fixing the baseline. A baseline must satisfy three conditions:
- Reproducible configuration: engine version, image tag, model quantization format, GPU count, and parallelism degrees are all recorded.
- Reproducible workload: input/output length distribution, concurrency gradient, and request arrival pattern are fixed, so different configurations are never compared under different traffic.
- Consistent metric definitions: the statistical boundary of throughput (whether queueing time is included) and the dimensions used to judge SLOs (time to first token, time per output token, end-to-end latency) are stated explicitly.
A sample baseline record looks like this:
baseline:hardware: 8x domestic acceleratorengine: inference engine with OpenAI-compatible APImodel: quantized MoE modelparallel: { tp: 8, dp: 1 }slo: { ttft_ms: 2000, tpot_ms: 50 }workload: { input_len: 1024, output_len: 512, concurrency: [1,4,8,16,32] }
A common mistake at the baseline stage is pushing tp to the maximum. The higher the tensor parallelism degree, the more finely each layer’s computation is split, and the more reduction operations must cross GPU boundaries. At 8-GPU scale, tp8, dp1 often makes communication the bottleneck, and in MoE structures the All-to-All traffic from expert routing stacks on top of the reduction traffic from tensor parallelism.
3. Restructuring Parallelism: From One Large Replica to Multiple Fine-Grained Replicas
The core idea is to replace “one model spanning all eight GPUs” with “multiple smaller replicas each serving a share of the concurrency.” Changing tp8, dp1 to tp2, dp4 means each GPU holds a larger slice, the communication domain inside a replica is smaller, and the number of data-parallel replicas rises to four, which can absorb more concurrent requests directly.
This adjustment brings three benefits:
- Smaller communication domain: tensor-parallel reductions happen between only two GPUs, fewer cross-GPU hops are needed, and latency is more stable.
- Higher concurrency capacity: the four replicas each maintain an independent batching queue, reducing the probability of requests queueing.
- Complementary expert parallelism: for MoE models, introducing expert parallelism distributes experts across different GPUs and, together with routing computation, reduces hotspots on individual GPUs.
Note that increasing the replica count amplifies memory pressure. Quantized weights, the KV cache, and communication buffers must all be re-accounted for, to avoid a situation where “throughput goes up but preemption and recomputation are triggered frequently.” A rough capacity check can be done with the following:
Per-GPU memory ≈ weight shard + KV cache (concurrency × sequence length × layers × head dim × 2) + communication and temporary buffers
If the check fails, first lower the per-replica concurrency limit or shorten the maximum sequence length rather than blindly reverting the parallelism strategy.
4. Sequence Parallelism and Communication Optimization: Spreading Long-Sequence Computation
In long-context scenarios, intermediate activations of operations such as attention and normalization grow linearly with sequence length. With sequence parallelism enabled, these intermediate results are split along the sequence dimension across the GPUs in the group, lowering peak per-GPU memory, while computation and communication can form a pipeline that hides part of the synchronization overhead. In practice it is usually combined with the data-parallel group and acts inside a replica without changing the number of replicas.
Sample configuration:
# Parallelism and replica configuration (illustrative)--tensor-parallel-size 2 \--data-parallel-size 4 \--enable-expert-parallel \--enable-sequence-parallel \--max-model-len 8192 \--gpu-memory-utilization 0.90
5. Graph and Operator Compilation Optimization: Cutting Scheduling and Launch Overhead
In eager mode, the inference engine dispatches operators one by one, and models with many small operators incur considerable scheduling and launch costs. Once graph capture is enabled, the whole forward pass is frozen into a graph, reducing the number of dispatches from the host; combined with operator compilation and auto-tuning, hot operators such as matrix multiplication and attention can select more suitable implementations and tiling on the target hardware.
For deployment, follow the order “graph first, compilation second; single point first, global second”: enable only graph capture first to verify correctness and stability, then gradually turn on the compilation cache and auto-tuning, running the same workload as a regression at every step, so that if several optimizations are stacked and something regresses, the cause can still be isolated.
6. Phased Validation Workflow and Metric Observation
A four-stage progression is recommended:
- Stage 1: fix the baseline and workload, and record the throughput–latency curve.
- Stage 2: adjust only the parallelism strategy, and observe changes in communication share and concurrency capacity.
- Stage 3: stack sequence parallelism and expert parallelism, watching peak memory and preemption counts.
- Stage 4: enable graph and compilation optimizations, then run the final regression and a long-duration stability test.
The observed metrics should cover at least: SLO attainment rate, total throughput, percentile values of time to first token and time per output token, peak per-GPU memory, communication wait share, average batch size, and preemption and recomputation counts. Only when “throughput improvement” and “no degradation in latency percentiles” are presented together is an optimization conclusion convincing.
7. Capturing Experience: Making Configurations Reusable Assets
If tuning results live only in the terminal output of a single experiment, they never become an organizational capability. It is advisable to organize each solution as a structured entry containing the applicable model size, hardware specification, engine and image, resource requirements, parallelism and optimization switches, and a comparison report of baseline versus optimized version. When the team adds a model or swaps hardware, it can start from the closest entry and run incremental validation instead of repeating the same mistakes. Once enough such entries accumulate, the time cost of selection and capacity planning drops significantly.
8. Common Pitfalls
- Looking only at average throughput and not at latency percentiles, so the production experience falls short.
- Parallelism degrees that do not match available memory, triggering frequent preemption and inflating throughput.
- Enabling many optimizations at once, making problems impossible to attribute.
- A workload distribution inconsistent with production, so conclusions do not transfer.
- No long-duration stability test, so memory fragmentation and cache growth only surface after hours of running.
In summary, throughput optimization on an 8-GPU domestic compute platform is essentially a “resource reallocation under constraints”: with the SLO held fixed, restructure parallelism to shrink the communication domain, use sequence and expert parallelism to improve load balance, and use graph and compilation optimizations to cut scheduling overhead — only the three combined deliver a solid, sizable gain. Turning the process into reusable configurations is where the long-term payoff comes from.
