Optimizing Multi-Card Inference Throughput on Domestic AI Accelerators: A Reusable Deployment Practice
Deploying large language models on domestic AI accelerators requires more than selecting a model. This article presents a structured approach to building reusable deployment方案 catalogs, explains the trade-offs between tensor, data, and expert parallelism, and describes an eight-card case that changed from TP8/DP1 to TP2/DP4. With sequence parallelism, communication-computation overlap, graph compilation, and operator compilation, the optimized configuration achieved up to a 53.5% throughput improvement under the same SLO constraints. The article also outlines validation procedures, configuration examples, and the limits of reusing performance results across different environments.
1. Why Deploying LLMs on Domestic AI Accelerators Involves More Than Model Selection
In environments that use domestic AI infrastructure, selecting a model is only the first step. The inference engine and container image must be compatible, the required number of accelerator cards must be determined, parallelism strategies must be configured, and optimizations must be evaluated against the actual workload. All of these factors directly affect deployment efficiency and final performance.
Common challenges include configuration details scattered across scripts and documents, the absence of reliable baseline configurations, inconsistent performance measurement, and optimization experience that is difficult to reuse. As a result, teams often repeat the same trial-and-error process from scratch.
A deployment solution catalog turns operational experience into structured, searchable, and reusable entries. Each entry focuses on a specific model category and hardware profile, recording the inference engine type, image version, resource requirements, parallelism parameters, optimization switches, SLO definitions, and baseline and optimized reports.
Users can first filter the catalog by model or hardware to identify similar solutions, then validate and adjust them in their own environments instead of starting with an empty configuration. For solutions that already have performance-tuning results, the catalog should retain both the baseline and optimized versions, along with their corresponding reports. This makes it easier to compare the benefits and limitations of different configurations.
2. Information Model and Reuse Mechanism for Deployment Solutions
A reusable deployment solution should contain, at minimum, the following information:
- Model identity: Parameter scale, quantization method, architecture type—dense or mixture-of-experts—and typical input and output length distributions.
- Hardware profile: Accelerator type, number of cards, interconnect topology, per-card memory, and host resource constraints.
- Runtime information: Inference engine type, container image version, and version of the adaptation layer for the domestic accelerator backend.
- Resource requirements: Number of cards, memory consumption, host memory, storage, and network requirements.
- Parallelism configuration: Combinations of tensor parallelism (TP), data parallelism (DP), expert parallelism (EP), and pipeline parallelism (PP).
- Optimization switches: Sequence parallelism, communication-computation overlap, graph compilation, and operator compilation.
- SLO definitions: Time to first token (TTFT), time per output token (TPOT), P99 latency, error rate, and throughput compliance rate.
- Result reports: Baseline and optimized configurations, load-testing conditions, throughput improvement, and resource changes.
The reuse process can be summarized as filter, review, validate, benchmark, and formalize:
- Filter for similar solutions by model or hardware.
- Review the configuration details and performance reports.
- Run a small-scale validation in the target environment, confirming image versions, topology, and resource consistency.
- Benchmark the baseline and candidate configurations using consistent metrics.
- Record the validation results as a new solution or update the existing entry.
On Baidu AI Cloud, general-purpose container platforms, object storage, logging, and monitoring and alerting services can support the solution catalog, report storage, and deployment pipelines. However, the solution content should remain hardware- and engine-neutral. A result from one tuning exercise should not be presented as a universal performance guarantee.
3. An Eight-Card Case: From TP8/DP1 to TP2/DP4
This case used eight domestic accelerator cards to deploy a quantized large language model. The runtime consisted of a general-purpose inference engine and its adaptation layer for the domestic accelerator backend.
The baseline configuration used TP8 and DP1: the model was split across eight tensor-parallel partitions, with a single data-parallel replica. This configuration can be suitable for low-latency, single-request scenarios. However, the large tensor-parallel group generates frequent cross-card collective communication, which can limit concurrent throughput.
The optimized configuration changed to TP2 and DP4. Tensor parallelism was reduced to two partitions, while data parallelism was increased to four replicas. Expert parallelism was also used when running the mixture-of-experts model.
The main trade-offs are as follows:
- A larger TP degree splits each layer more finely and reduces per-card memory pressure, but increases communication and synchronization overhead.
- More DP replicas allow the system to process more concurrent requests and improve aggregate throughput, but require sufficient memory capacity and effective load balancing.
- EP distributes expert computation across multiple cards and is suitable for sparsely activated architectures.
For high-concurrency inference workloads with clearly defined SLO requirements, reducing TP and increasing DP can often produce better throughput.
In addition to changing the parallelism configuration, the optimized setup enabled sequence parallelism to reduce activation memory pressure for long sequences. Communication-computation overlap was enabled to hide part of the collective communication overhead. Graph compilation and operator compilation were also used to reduce scheduling and operator launch costs.
Together, these changes improved both computation and communication efficiency. Under the same SLO constraints, the optimized configuration achieved a maximum total throughput improvement of 53.5% compared with the baseline.
This figure applies only to the specific model, hardware topology, input and output distributions, and SLO definitions used in the case. It should not be treated as a general performance improvement for all workloads.
4. Implementation and Validation: Define Metrics First
Whether an optimization can be reproduced depends largely on the validation methodology. The following process is recommended:
- Define the SLO methodology: Specify TTFT, TPOT, P99 latency, error rate, and throughput compliance rate. Keep the input and output length distributions and concurrency levels fixed.
- Establish a baseline: Use the catalog baseline or create a local baseline. Complete warm-up testing, run the benchmark, and save the original report.
- Scan parameters: Perform a limited scan of TP, DP, and EP combinations, as well as sequence parallelism, communication overlap, graph compilation, and operator compilation options.
- Prepare a comparison report: Compare throughput, latency, and resource consumption for the baseline and optimized configurations under the same SLO definitions. Avoid reporting average values alone.
- Use staged rollout and rollback: Begin with a small amount of traffic. Monitor queue length, batch size, communication time, operator time, memory usage, and P99 latency while maintaining a fast rollback path.
A configuration example is shown below:
model_ref: <quantized large language model>hardware_profile: <eight-card domestic accelerator topology>engine_image: <general-purpose inference engine and domestic accelerator backend image>resources:cards: 8parallel:tp: 2dp: 4ep: trueoptimizations:sequence_parallel: truecomm_overlap: truegraph_compile: trueoperator_compile: trueslo:ttft_ms_p99: <target value>tpot_ms_p99: <target value>min_throughput: <target value>
5. Reuse Recommendations and Boundaries
When reusing a solution from the catalog, do not copy its parameters directly. First confirm that the hardware topology, interconnect bandwidth, image version, and quantization method are consistent. Then run a small-scale benchmark before gradually increasing concurrency after the expected benefits have been confirmed.
Performance data must be compared using the same methodology, especially the SLO definitions, input and output length distributions, and concurrency model. Model architecture, quantization precision, the proportion of long sequences, expert routing distribution, and interconnect topology can all affect the final result.
The catalog itself should also be versioned. Outdated solutions should clearly state their applicable conditions and limitations so that they do not mislead future users.
For team collaboration, the platform team can maintain the catalog structure and review rules, while application teams submit benchmark reports. After review and approval, the results can be added to the catalog. When combined with general-purpose Baidu AI Cloud services, container platforms can provide environment isolation, object storage can retain images and reports, and logging and monitoring services can support observability. This creates a closed loop covering baseline creation, optimization, validation, and rollback.
6. Conclusion
Turning one-time tuning work into a reusable asset requires three foundations: a structured deployment solution catalog, an explainable analysis of parallelism trade-offs, and consistent SLO validation.
By adjusting TP, DP, and EP combinations and enabling sequence parallelism, communication-computation overlap, graph compilation, and operator compilation, the eight-card domestic accelerator case achieved up to a 53.5% improvement in total throughput under the same SLO constraints.
The value of this result is not the number alone. More importantly, it provides a verifiable, comparable, and reusable engineering process that can reduce trial-and-error costs and improve deployment efficiency for large language models running on domestic AI infrastructure.
