Optimizing Eight-Card LLM Inference: Boosting Effective Throughput Under Service Constraints

    This article discusses how to optimize large language model inference deployed across eight accelerator cards, focusing on improving effective throughput while satisfying service-level objectives such as latency, success rate, and tail latency. It covers establishing a fair baseline, choosing parallelization strategies, reducing communication bottlenecks, leveraging graph execution and operator compilation, and aligning request scheduling with KV cache management. The piece emphasizes a phased, reproducible experiment approach and warns against drawing universal conclusions from single-case numbers.

    I. Optimization Goal: Deliver More Qualified Requests, Not Just Peak Throughput

    In eight-card large language model (LLM) inference, increasing request concurrency typically raises device utilization, but it can also lengthen queueing time, delay the first output token, and introduce noticeable pauses during generation. Therefore, comparing only “requests processed per second” or “tokens generated per second” is insufficient to judge whether a solution is production-ready.

    A more meaningful goal is to maximize the sustained effective throughput the system can deliver while meeting service-level objectives (SLOs). SLOs may include:

    • Time to first token (TTFT): the interval from request submission to the first output token.
    • Inter-token latency (ITL): the time gap between consecutive output tokens, reflecting streaming fluency.
    • End-to-end latency: total time from request submission to full result completion.
    • Success rate and timeout rate: reliability under load.
    • Tail latency: behavior of slower requests, avoiding the masking of poor user experience by averages.

    Given a specific load and statistical window, effective throughput can be expressed as:

    Effective throughput = Number of successful requests meeting the agreed SLO ÷ Test duration

    If token throughput is used, clearly state whether it counts input tokens, output tokens, or both, and also report the request-level SLO attainment rate.

    The reference case cited in the original material reports that a quantized model on eight domestic accelerator cards achieved up to a 53.5% total throughput improvement over baseline under the same service objectives, after adjustments in parallel layout, communication, and compiled execution. However, the source does not fully disclose request length distributions, SLO thresholds, the optimized parallel configuration, or software versions. This number should therefore be treated as an observation under specific test conditions, not as a guaranteed benefit for other models or workloads.

    II. Establish a Fair Baseline: Fix the Comparison Conditions First

    The most common problem in performance optimization is not the lack of improvement but the inability to identify where the improvement actually comes from.

    For example, if input lengths differ between baseline and optimized runs, or if the optimized setup allows looser response time, a higher throughput number does not prove that execution efficiency truly improved.

    1. Fix Hardware and Runtime Environment

    At minimum, record the number of accelerator cards, per-card available memory, inter-card interconnect topology, host CPU and memory resources, and the versions of the inference runtime, drivers, and compilation components.

    Even with eight cards, different communication topologies yield different collective communication costs. The same device count does not imply identical communication capability.

    During testing, avoid resource contention from other workloads. Monitor device temperature, power limits, and abnormal frequency throttling to prevent environmental fluctuations from being mistaken for configuration differences.

    2. Fix Model and Quantization Conditions

    Keep the model architecture, weight version, quantization precision, and key inference settings identical across comparisons.

    Quantization reduces weight memory footprint and some data movement, but actual gains depend on the hardware compute path, operator implementations, and additional conversion overhead. Do not assume that lower precision always leads to higher throughput.

    Additionally, performance validation after quantization cannot replace quality validation. Use a fixed set of business samples to verify output quality, ensuring that speedup is not achieved by sacrificing model usability.

    3. Fix Request Distribution and Load Generation

    At minimum, document input length, output length, arrival rate, concurrency level, and the ratio of short to long requests.

    Fixed-concurrency stress testing observes how the system handles sustained requests waiting in queue; fixed-arrival-rate testing simulates continuous external traffic. Both are complementary, but their results should not be conflated.

    Load tests must also differentiate the warm-up phase from the stable phase. Time spent on weight loading, initial compilation, and cache building should be recorded separately, not silently merged into steady-state results.

    III. Parallel Strategies: Balance Single-Request Efficiency and Overall Concurrency

    Deploying a model on eight cards does not necessarily mean every request must be processed by all eight cards. Different parallelization schemes can be used, with the core trade-off among memory capacity, compute efficiency, and communication overhead.

    1. Tensor Parallelism: Reduces Per-Card Pressure but Adds Synchronization

    Tensor parallelism splits some tensor operations across multiple cards. It distributes weights and computation and may improve per-request execution time.

    However, splitting typically introduces cross-card data exchange. When the per-card compute becomes smaller, the fixed cost of communication and synchronization may dominate. This is especially true during token-by-token generation, where each step’s compute is relatively limited and communication latency can easily become the bottleneck.

    Thus, higher tensor parallelism is not always better. Decisions should consider whether the model fits in memory, per-request latency requirements, and the communication share.

    2. Data Parallelism: More Replicas for Higher Concurrency

    In inference services, data parallelism usually means deploying multiple model replicas, with different replicas handling different requests.

    The baseline in the cited material uses a combination of two-way tensor parallelism and four-way data parallelism. In other words, each service replica runs on two cards, and the eight cards form four replicas.

    This layout helps handle multiple requests simultaneously, but real-world effectiveness depends on whether request routing is balanced. If some replicas continuously process long requests while others sit idle, overall utilization may still be low.

    Also, multiple replicas typically require separate model states and runtime caches, so memory budgets must be recalculated accordingly.

    3. Expert Parallelism: Look Beyond Total Volume to Load Distribution

    For models with expert structures, different experts can be assigned to different devices.

    Beyond communication volume, pay attention to expert load balance. If some experts consistently receive more tokens, the associated devices can become hotspots that slow the entire execution.

    Therefore, examine expert compute time, cross-card data redistribution cost, and wait-time differences among devices. Expert parallelism also cannot be treated as a simple multiplicative factor independent of other parallel dimensions; the specific resource organization depends on model structure and runtime implementation.

    The cited material does not disclose the final optimized layout, so it is not possible to infer that a fixed combination is the sole reason for the throughput gain. The transferable lesson is to search configurations around the actual bottleneck, rather than copying a specific parallel number.

    IV. Communication Optimization: Reduce Waiting on the Critical Path

    Communication costs in multi-card inference include not only data transfer but also synchronization waits and scheduling overhead.

    1. Determine Whether Communication Is a Real Bottleneck

    Long communication time alone does not mean it must be optimized. If communication can be overlapped with computation, its impact on end-to-end time may be small.

    More important questions are:

    • Are devices frequently waiting for others to finish?
    • Does collective communication directly block the next compute step?
    • Is there significant variance in completion time across devices?
    • Are small data transfers too frequent?
    • Do communication and computation contend for the same critical resources?

    The goal is not to minimize all communication metrics but to shorten the critical path of request execution.

    2. Sequence-Dimension Splitting Must Be Verified with Workload

    If the model structure and runtime support it, you can distribute some computation or intermediate states along sequence-related dimensions to relieve per-card pressure.

    However, such adjustments may also introduce new data exchanges. The benefits can differ greatly between long inputs with large batches and short inputs with small batches.

    Therefore, sequence-related parallel optimizations should be tested separately for prompt processing and token-by-token generation phases. Do not extrapolate results from one request shape to all business scenarios.

    V. Graph Execution and Operator Compilation: Reduce Overhead in Repeated Execution

    LLM inference involves a large amount of repeated computation. For relatively stable execution paths, graph execution and compilation can reduce host scheduling, operator launch, and intermediate data movement costs.

    1. Benefits of Graph Execution Depend on Dynamic Shapes

    When batch sizes, input lengths, or cache states change continuously, the runtime may need to handle multiple execution shapes.

    If shapes within the supported range can reuse existing graphs, scheduling overhead drops. If requests frequently trigger new graph construction or fall back to a generic path, gains may be limited.

    A common technique is bucketing request lengths or batch sizes to increase shape reuse. But bucketing can add padding computation, so weigh the reuse benefit against the extra compute cost.

    2. Compilation Optimization Cannot Be Judged Solely by Single Operators

    Operator fusion, memory-access optimization, and intermediate-result reuse can shorten local computation.

    However, making one operator faster does not guarantee the whole system runs faster. If the system is bottlenecked by queueing, communication, or memory bandwidth, speeding up individual operators may not significantly raise service throughput.

    Validation should measure device execution time, request latency, and effective throughput together, avoiding the substitution of microbenchmark results for full service tests.

    VI. Request Scheduling and Cache Management Determine Whether Optimizations Deliver

    Parallel and compilation optimizations address execution efficiency; service scheduling decides whether those efficiency gains translate into user-visible benefits.

    1. Avoid Long and Short Requests Dragging Each Other Down

    Long-input requests may consume significant compute during prompt processing; long-output requests hold generation slots and cache space for extended periods.

    If the scheduling policy only maximizes batch size, short requests may be delayed by long ones. Consider phase-aware scheduling, length-aware grouping, or splitting prompt processing, depending on TTFT and generation continuity requirements.

    There is no universally optimal configuration; validate strategies against business goals.

    2. Focus on KV Cache, Not Just Weight Size

    Loading a model into memory does not guarantee high concurrency capacity.

    As contexts lengthen and active requests grow, the KV cache used for attention computation continuously consumes device memory. If space runs out, the system may reduce accepted concurrency or trigger extra data movement and recomputation.

    Therefore, monitor cache usage, available capacity, allocation failures, and request waits. Throughput optimization cannot be conducted independently of cache capacity planning.

    VII. Phased Experiments to Confirm the Source of Gains

    Recommended experiment sequence:

    1. Fix quantization, request data, and service objectives to establish a repeatable baseline.
    2. Adjust only the parallel layout; record changes in throughput, latency, memory, and communication.
    3. Introduce communication-related optimizations on the better layout.
    4. Enable graph execution and operator compilation; measure steady-state benefit and warm-up cost.
    5. Tune request scheduling and concurrency limits to find the maximum stable load under SLO constraints.
    6. Run a long-duration stress test to verify reliability.

    Each phase should keep a rollback-able configuration and be repeated.

    The throughput improvement ratio can be calculated as:

    Improvement ratio = (optimized throughput ÷ baseline throughput − 1) × 100%

    Before calculating, confirm that both datasets use the same statistical definition and satisfy the same SLO set. In addition to reporting the peak, provide variance across multiple runs, not just the best result.

    VIII. Preserve Reusable Configurations, Not Just Performance Numbers

    A truly valuable optimization deliverable includes model conditions, hardware environment, parallel layout, runtime options, load data, observed metrics, and rollback methods.

    For different workloads, also articulate the applicability boundary. For example, a scheme optimized for high concurrency with short requests may not suit long-context analysis; a scheme that prioritizes low TTFT may not achieve the highest total token throughput.

    Ultimately, eight-card inference optimization is not a single-toggle speedup but a systematic balance among compute, communication, memory, and scheduling. The 53.5% improvement in the cited case can serve as a research clue, but the more reusable part is the validation methodology: fix comparison conditions, define effective output via service objectives, iteratively identify bottlenecks, and confirm gains under realistic business load.