Optimizing LLM Inference Throughput on Domestic AI Accelerator Cards: A Multi-GPU Deployment Guide
Deploying large language models on domestic AI accelerator cards involves far more than raw chip compute power—model architecture, memory capacity, inter-device communication, parallelism strategy, compilation, and request workloads all shape real-world service quality. This article walks through a real optimization case: serving a quantized mixture-of-experts (MoE) LLM on an 8-card accelerator node, where combined parallelism strategies and low-level execution optimizations improved effective throughput by up to 53.5% under service-level objectives. You'll learn why single-replica tensor parallelism often hits bottlenecks, how to combine tensor, data, expert, and sequence parallelism, and how to build a testing and deployment checklist for production.
Optimizing LLM Inference Throughput on Domestic AI Accelerator Cards: A Multi-GPU Deployment Guide
When deploying large language models on domestic AI accelerator cards, the factors that truly determine service quality go beyond theoretical chip compute power. Model architecture, memory capacity, inter-card communication, parallelism strategy, compilation choices, and request workloads all play a role. This is especially true for large-parameter models with mixture-of-experts (MoE) structures: blindly applying a single tensor parallelism scheme can lead to excessive communication overhead, underutilized devices, or long request queueing times.
This article is based on a real optimization case: running inference for a quantized MoE LLM on 8 domestic AI accelerator cards, and distills the key methods for multi-card deployment. Under identical service-level objective (SLO) constraints, adjusting the parallelism strategy and low-level execution paths improved total system throughput by up to 53.5%. Note that this result comes from testing under specific model, hardware, software stack, and workload conditions—it should not be treated as a universal conclusion for all models or business scenarios. Real deployments still need to be validated against your own request lengths, concurrency levels, and latency requirements.
1. From “It Runs” to “It’s Deliverable”: Deployment Goals
Putting an LLM into production typically requires meeting requirements at three levels:
- Functional correctness: The model can load, run inference, and return results.
- Resource control: GPU memory, accelerator count, and host resources stay within reasonable bounds.
- Service stability: Under target concurrency and request lengths, time-to-first-token (TTFT), end-to-end latency, and throughput all meet service-level objectives.
Many deployment plans only check whether the model can start, ignoring service-level objectives. For online inference, fast single-request speed does not mean high overall throughput. If the system keeps many devices idle to reduce per-request latency, overall resource utilization may be poor. Conversely, pushing too hard for throughput can increase queueing time and eventually violate latency constraints.
So the first step in optimization is defining the objective function. Common metrics include:
- Time to first token (TTFT): Time from when a user sends a request to receiving the first output token;
- End-to-end latency: Total time from request arrival to complete result delivery;
- Token inter-arrival time: Average interval between adjacent tokens during generation;
- Total throughput: Tokens generated by the system per unit of time;
- Effective throughput: Throughput counted only from requests that meet service-level objectives;
- Device utilization: Actual usage of compute units, memory bandwidth, and communication links.
The “53.5% throughput improvement” in this case refers to effective throughput under SLO constraints—not a theoretical peak obtained by simply inflating batch sizes.
2. Why the Baseline Approach Hits Bottlenecks
The baseline deployment used a single replica with 8-way tensor parallelism across the 8 cards. In other words, one model replica was sharded across all 8 cards, and every request required multiple devices to cooperate on computation.
This approach is straightforward and suits scenarios where the model is too large to fit on a single card. But it has several potential problems.
1. Frequent inter-card communication
Tensor parallelism splits matrix computations across multiple devices, requiring repeated aggregation, reduction, or data exchange during computation. With many model layers and token-by-token execution in the generation phase, communication operations recur across many small steps. At that point, communication latency can approach or even exceed the compute time of a single step.
2. Insufficient parallelism during generation
The prefill phase usually processes longer input sequences with larger matrix computations, so devices can maintain high utilization more easily. Once generation begins, each step processes far less data, per-step parallel efficiency drops, and cross-card synchronization still exists—creating a state of “compute waiting on communication.”
3. A single replica struggles to handle concurrency
When all devices serve one model replica, multiple requests must share the same set of execution resources. If the scheduler cannot effectively batch requests, some devices sit idle; even with higher concurrency, synchronization overhead and memory pressure can cause latency to spike.
4. MoE structural characteristics go unused
In a mixture-of-experts model, not every token activates all parameters. A routing module selects a subset of experts for each input. If you still apply the simple sharding scheme designed for dense models, you cannot exploit the independence between experts, and some devices may end up load-imbalanced.
3. Core Optimization: From Pure Tensor Parallelism to Combined Parallelism
The optimization replaced the original 8-card single-replica configuration with a combination of “smaller tensor parallel groups + multi-replica data parallelism,” combined with expert parallelism. The basic idea:
- Use smaller tensor parallel groups to reduce the synchronization scope within each group per request;
- Deploy multiple inference replicas across the 8 cards to increase concurrency capacity;
- Use data parallelism so different replicas handle different requests;
- For the MoE structure, distribute expert computation across more suitable device groups;
- Balance load across replicas based on request scheduling.
This is not simply adding more replicas—it’s rebalancing between model sharding granularity and request scheduling.
1. Don’t blindly expand tensor parallelism
Larger tensor parallel groups don’t automatically mean better performance. As the group grows, a single step can theoretically be shared across more devices, but the number of communication operations and synchronization participants also increases. For the small-batch, short-compute tasks typical of the generation phase, communication overhead can become a much larger share of total time.
With smaller tensor parallel groups, a single request only synchronizes across fewer devices, communication paths are shorter, and execution forms a more stable pipeline. The freed-up devices can then host additional replicas, improving the system’s ability to handle concurrent requests.
2. Data parallelism improves resource reuse
The key value of data parallelism is letting multiple model replicas work simultaneously. While one replica handles the generation phase of one request, others can process new requests. For online services with bursty request arrivals, multiple replicas generally keep devices busier than a single replica.
That said, data parallelism introduces replica management, load balancing, and memory-footprint concerns. During deployment, pay attention to:
- Whether each replica holds complete model weights or can access the required weight shards;
- Whether request distribution across replicas is balanced;
- Whether long-context requests monopolize a single replica;
- Whether each replica has sufficient cache/KV memory;
- Whether the scheduler can route requests based on queue length and estimated generation volume.
3. Expert parallelism fits MoE models
For MoE models, expert parallelism distributes different experts’ computation across multiple devices or device groups. Input tokens are routed to the compute units responsible for their assigned experts, and results are merged back into the main flow.
Expert parallelism pays off in two ways: it reduces the expert computation load per device, and it better exploits the model’s sparse activation. But its performance depends heavily on routing communication and load balancing. If many tokens concentrate on a few experts, the devices hosting those experts become hotspots and can negate the benefits of parallelism.
In practice, you should monitor expert hit distribution, inter-device communication volume, expert queue lengths, and compute wait times—not just overall device utilization.
4. Sequence-Level Optimization: Reducing Long-Sequence Pressure
Beyond tensor, data, and expert parallelism, this case also enabled sequence-dimension parallelism. The goal is to split long inputs or portions of sequence computation during generation across different devices, reducing per-device compute and cache pressure in long-context scenarios.
Sequence parallelism generally suits these scenarios:
- Long input contexts;
- Large length variance across requests in a batch;
- High proportion of attention computation;
- Tight single-device cache capacity;
- A need to improve concurrency for long-sequence requests.
However, sequence-dimension sharding introduces additional data exchange. For short sequences, communication costs may exceed compute gains; for highly variable request lengths, it must be paired with dynamic batching and sensible padding strategies. Whether to enable sequence parallelism should therefore be decided through real workload testing.
A reliable validation method: build three workloads with short, medium, and long inputs, record TTFT, generation throughput, communication share, and memory usage for each, and then determine the configuration appropriate for production.
5. Compilation and Kernel Optimization: Making the Hardware Deliver
Parallelism strategy answers “how to distribute tasks”; compilation and kernel optimization answer “how to execute tasks efficiently.” On domestic AI accelerator cards, a model that runs does not mean every operator is on the optimal execution path.
1. Graph-level compilation
Graph compilation analyzes continuous computation, fuses compatible operators, and reduces intermediate tensor reads/writes and scheduling overhead. For inference, graph-level optimization typically lowers fixed execution costs—especially valuable for models with stable structures executed repeatedly.
Graph compilation can be affected by dynamic input shapes, though. If request lengths vary frequently, the compilation cache hit rate drops, potentially adding compilation overhead. In production, define common input length ranges sensibly and minimize unnecessary shape variation.
2. Kernel compilation and cache reuse
On first run, some compute kernels may need to be compiled or have execution plans selected. If this happens at service startup, the impact is mostly on startup time; if triggered repeatedly during runtime, it can cause visible jitter.
Complete warmup for typical shapes and typical operators before formal load testing, and save reusable compilation artifacts. After going live, monitor for new input shapes, compilation cache misses, or abnormal kernel selections.
3. Quantization benefits depend on operator support
Quantization reduces weight storage and memory access pressure, but the final gain depends on how well the hardware supports the corresponding data types and operators. If some operators still fall back to less efficient execution paths, the benefits of quantization can be offset by conversion and dispatch overhead.
So when evaluating quantization, don’t just compare model sizes. Also observe:
- Weight loading time;
- Memory usage;
- Number of compute type conversions;
- Execution time of key operators;
- Throughput stability over long-running sessions.
6. Performance Testing Should Center on Service-Level Objectives
Reproducing or verifying throughput gains like these requires more than a single inference run. Build a test matrix covering the following:
1. Request dimension
Cover different input lengths, output lengths, and concurrency levels at minimum. For online services, also simulate uneven request lengths—real traffic rarely holds a fixed shape.
2. Metric dimension
Record TTFT, end-to-end latency, token inter-arrival time, total throughput, effective throughput, memory usage, device utilization, and communication time share simultaneously. Looking only at throughput can hide long-tail requests and queueing delays.
3. Stability dimension
A single load test cannot reflect long-term behavior. Run sustained tests of sufficient duration and watch for memory growth, cache management issues, request queueing, device temperature, and throughput fluctuations.
4. Comparison dimension
Baseline and optimized configurations must use the same model version, quantization method, input distribution, service-level objectives, and test duration. Otherwise, performance differences may come from changing test conditions rather than the parallelism strategy itself.
7. Deployment Checklist
Before adopting a similar approach in production, check the following in order:
- Confirm the model is suitable for quantization and multi-card sharding;
- Define latency and throughput targets for the online service;
- Evaluate per-card memory, cache capacity, and maximum context length;
- Test different tensor parallelism sizes;
- For MoE models, check whether expert load is balanced;
- Verify data parallel replicas can reliably distribute requests;
- Test sequence parallelism benefits at different input lengths;
- Complete graph compilation, kernel compilation, and runtime warmup;
- Compare effective throughput between baseline and optimized configurations—not just peak numbers;
- Run long-duration stability and failure-recovery tests.
Conclusion
Performance optimization for LLMs on domestic AI accelerator cards is fundamentally a systems engineering problem spanning compute, communication, storage, and scheduling. Simply scaling up parallelism does not guarantee higher throughput. Only by choosing the right parallelism combination based on model structure and business workload can you reduce unnecessary synchronization, improve device utilization, and achieve stable gains under SLO constraints.
In this case, shrinking tensor parallel groups, adding data parallel replicas, introducing expert parallelism and sequence-level optimization, and pairing them with graph compilation and kernel execution optimizations delivered up to 53.5% improvement in effective throughput. For real teams, the more important lesson is not to copy a specific configuration, but to establish a measurable, comparable, repeatable optimization process: define objectives first, then locate bottlenecks, adjust the parallelism strategy, and finally validate gains through complete load testing. That’s how a one-off tuning exercise becomes a reusable deployment methodology.
