Optimizing LLM Inference Throughput on 8-Card Domestic AI Accelerators: A Practical Guide
A hands-on case study of optimizing Mixture-of-Experts (MoE) model inference on eight domestic AI accelerator cards. By restructuring parallelism from TP=8/DP=1 to TP=2/DP=4 with expert parallelism, sequence parallelism, graph mode, and operator compilation, the optimized deployment achieved up to 53.5% higher total throughput while meeting SLO constraints. This article covers the key deployment challenges, a reusable configuration catalog approach, the tuning workflow, and practical implementation notes for production inference on domestic hardware.
Large language model (LLM) inference deployments often start with a simple goal: get the model running. Teams prepare the container image, load the weights, wire up the service, and verify basic functionality. But once the service moves into stable production operation, the real challenges emerge—under identical models and hardware, different deployment configurations can produce dramatically different throughput, tail latency, resource utilization, and stability. This is especially true in domestic accelerator environments, where the matching relationships between accelerator cards, inference engines, operator libraries, communication libraries, and model architectures are more complex. Relying solely on default configurations often fails to unlock the full capability of the hardware.
This article walks through a real optimization effort: serving a Mixture-of-Experts (MoE) model on eight domestic accelerator cards. We discuss how to turn a one-off tuning result into a reusable deployment recipe, and further generalize it into a repeatable performance optimization methodology. In this case, the optimized configuration improved total throughput by up to 53.5% over the baseline while meeting the service level objective (SLO). The significance lies not just in the number, but in the configuration organization, parallelism strategy choices, and validation methodology behind it.
1. From “It Runs” to “It Runs Well”: Core Challenges of Inference Deployment on Domestic Hardware
Deploying an LLM for inference is not a single step that follows model selection. Real-world deployments involve at least the following decisions:
- Matching the inference engine and image: Different model architectures, quantization schemes, and hardware backends place different requirements on engine versions, dependency libraries, drivers, and image environments. Version mismatches can manifest as startup failures—or as silent but significant performance degradation.
- Resource sizing and card count planning: Model parameter count, quantization precision, context length, concurrent request volume, and memory footprint together determine how many cards you need. Too few cards means the model fails to load or suffers frequent swapping; too many introduces communication overhead and wasted resources.
- Parallelism strategy: Tensor parallelism (TP), data parallelism (DP), and expert parallelism (EP) determine how computation, communication, and memory are distributed across cards. More parallelism is not inherently better—the strategy must match the model architecture, request concurrency pattern, and hardware topology.
- Throughput optimization under SLO constraints: An inference service cannot be judged on peak throughput alone. P99 latency, timeout rate, queuing time, and stability all matter. Chasing throughput without SLO constraints easily yields an “optimal lab configuration” that is unusable in production.
A reusable deployment recipe should therefore record far more than “how many cards were used.” It should capture the model, hardware, engine, image, resource requirements, parallelism parameters, quantization configuration, SLO targets, and baseline-versus-optimized comparison results. That way, subsequent teams can build on existing experience instead of starting from scratch.
2. A Recipe Catalog: Turning Tuning Experience into Comparable Configurations
In domestic accelerator environments, deployment knowledge often lives scattered across scripts, documents, and individual memory, making re-validation expensive. A more effective approach is to build a “deployment recipe catalog”: for each model-and-hardware combination, record a complete, executable set of configurations along with the performance tuning report.
A complete recipe entry typically includes:
- Model information: model type, parameter scale, whether it is MoE, quantization method, maximum context length;
- Hardware information: accelerator card type, card count, per-card memory, interconnect topology;
- Software information: inference engine category, image version, driver and communication library requirements;
- Resources and parallelism: TP, DP, EP, sequence parallelism, batch size range;
- Runtime parameters: graph mode, operator compilation, memory strategy, request scheduling parameters;
- Performance records: baseline and optimized configurations, SLO conditions, throughput and latency metrics;
- Validation conclusions: applicable workloads, known limitations, rollback conditions.
The value of the catalog is comparability and reusability. Users can look up recipes by model or hardware, compare baseline and optimized versions, and understand the purpose behind each parameter change. For deployment systems, cataloged configurations can also serve directly as deployment inputs, reducing errors from manual parameter assembly. As the number of domestic accelerator recipes grows, teams can start from existing configurations, validate and fine-tune them against their own hardware and workloads, rather than rediscovering everything each time.
3. The Eight-Card Case: Reworking Parallelism for a MoE Model
In this practice, we deployed a quantized MoE model on eight domestic accelerator cards. The baseline used TP=8, DP=1—slicing each inference pass across all eight cards via large tensor parallelism. The optimized configuration switched to TP=2, DP=4, combined with expert parallelism. Sequence parallelism, graph mode execution, and operator compilation optimizations were also enabled.
3.1 Characteristics and Bottlenecks of the Baseline
TP=8, DP=1 suits scenarios with high per-request compute and insufficient single-card memory. Tensor parallelism splits matrix computations across cards, reducing per-card compute and memory pressure. But in high-concurrency inference services, oversized TP introduces two problems: first, each forward pass involves a wide cross-card communication domain, so communication waits can become the bottleneck; second, with few data-parallel replicas, concurrent requests cannot be efficiently scheduled across replicas, limiting batching capability.
3.2 The Technical Logic of the Optimized Configuration
Switching to TP=2, DP=4 organizes the eight cards into multiple data-parallel replicas, each retaining a smaller tensor-parallel group. The direct benefits are more processing channels for concurrent requests and a smaller communication domain per forward pass. For a MoE model, adding expert parallelism distributes expert computation across cards, reducing the per-card burden of expert parameters and computation—though this requires attention to communication overhead and load imbalance caused by expert routing.
Sequence parallelism targets long-sequence or large-activation scenarios: it spreads part of the sequence-dimension computation and memory overhead across cards, reducing per-card activation memory and leaving headroom for larger batches or longer contexts. Graph mode execution improves runtime efficiency by reducing host-side scheduling overhead and merging small-operator execution paths; operator compilation brings gains in operator fusion, memory access, and kernel selection. These optimizations must work in concert with the parallelism strategy to deliver stable benefits.
3.3 Interpreting the Results: 53.5% Throughput Gain Under SLO
In final testing, the optimized configuration improved total throughput by up to 53.5% while satisfying the SLO. Three points deserve emphasis:
First, this is a total throughput improvement—it does not necessarily mean per-request latency decreased. The optimization direction was processing more requests per unit of time while holding tail latency and timeout rate steady.
Second, the gains came from combined optimizations, not a single parameter. The TP/DP/EP adjustment reshaped the concurrency and communication structure, sequence parallelism improved memory and long-sequence handling, and graph mode plus operator compilation reduced runtime overhead. All three worked together.
Third, the SLO is the optimization boundary. Any throughput gain must pass regression validation on P99 latency, error rate, queuing time, and stability. A configuration that sacrifices tail latency for throughput is not fit for production.
4. A Reusable Tuning Workflow
A successful tuning effort should be codified into a workflow:
- Establish a baseline: Fix the model, card count, image, and SLO. Collect throughput, P99 latency, memory usage, communication waits, and utilization.
- Locate the bottleneck: Determine whether the constraint is compute, memory, communication, scheduling, or insufficient batching.
- Propose candidate configurations: Design a small set of candidates around TP/DP/EP combinations, batch size, sequence parallelism, graph mode, and operator compilation—avoid blind search.
- Validate incrementally: Compare against the baseline under request distributions close to production, watching tail latency and expert load balance.
- Codify the recipe: Write the effective configuration, performance report, and limitations into the recipe catalog, and keep a rollback configuration.
- Continuously regress: Re-validate whenever the model, engine, driver, or workload changes, to prevent configuration drift.
5. Configuration Organization Example
The following illustrates how parallelism and runtime parameters can be organized. Field names and hierarchy should be adapted to your actual inference engine; this does not represent any specific interface.
# Illustrative configuration organization only, not a real interfacemodel:type: moequantization: int8parallel:tensor_parallel_size: 2data_parallel_size: 4expert_parallel_size: 4sequence_parallel: trueruntime:graph_mode: trueoperator_compile: truemax_batch_size: autoslo:p99_latency_ms: 800timeout_ms: 1000
6. Implementation Notes
First, expert load in a MoE model can be imbalanced. Monitor hot experts and routing distributions to prevent individual cards from becoming bottlenecks. Second, stacking expert parallelism on top of data parallelism complicates communication patterns—pay attention to cross-card communication waits and topology matching. Third, graph mode and operator compilation can introduce cold-start and cache-management issues; production environments should handle warm-up and rollback properly. Finally, evaluate all optimizations under SLO constraints, and build a unified dashboard covering throughput, latency, error rate, and resource utilization to ensure performance gains are explainable, reproducible, and reversible.
In summary, LLM inference optimization on domestic accelerators is not single-parameter tuning—it is a systems engineering effort combining “recipe cataloging + parallelism strategy matching + compilation and scheduling optimization + SLO guardrails.” Recording every practice as a comparable, reusable deployment recipe is what turns a one-time 53.5% throughput gain into a lasting engineering capability for the team.
