LLM Inference Benchmarking Explained: Performance Analysis and Selection Guide for Three Classes of Accelerator Cards
This article explains why peak compute on paper does not translate directly into real inference throughput, using 128-concurrency benchmarks of three representative accelerator cards (referred to as Card A, Card B, and Card C) across two workload shapes: short (512/512) and long (8192/1024). It walks through the test design, the correct way to interpret baseline metrics such as achievable matrix-multiply compute and memory bandwidth, the measured results and an analysis of their causes, and finally a selection framework, a pre-launch validation checklist, and a reusable benchmarking script. The goal is not to crown a single fastest card, but to give readers a reusable, explainable, reproducible methodology for performance analysis.
Introduction: Why “Peak Compute” Doesn’t Equal “Inference Throughput”
When building an in-house LLM inference service or purchasing cloud compute, many teams still base their decisions on the peak compute, memory capacity, and memory bandwidth listed on spec sheets. But an often-overlooked fact is this: the real throughput of online inference is determined jointly by workload shape × model architecture × software stack maturity. Looking at any single peak metric in isolation makes it easy to make a “best on paper, poor in practice” choice.
This article centers on 128-concurrency benchmarks of three representative accelerator cards. For readability, they are referred to below as Card A, Card B, and Card C:
- Card A: A data-center-grade accelerator with high-bandwidth memory, aimed at high-concurrency serving.
- Card B: A professional accelerator that combines graphics rendering with compute.
- Card C: An intelligent-computing accelerator backed by an open-source compute ecosystem.
The three represent typical design trade-offs of the high-bandwidth path, the general-purpose graphics-compute path, and the open-source-ecosystem path. The article walks through the test design, the correct way to interpret baseline metrics, the measured results and an analysis of their causes, and finally a selection framework, a pre-launch validation checklist, and a benchmark script. The goal is not for readers to learn “which card is strongest,” but to grasp a reusable, explainable, reproducible methodology for performance analysis.
1. Test Design: Three Classes of Cards, Two Workload Shapes
1.1 Test subjects and configuration
This round covers three single-card products—Card A, Card B, and Card C—with the following key configuration:
| Item | Card A | Card B | Card C |
|---|---|---|---|
| Product positioning | Data-center inference card with high-bandwidth memory | Professional graphics/server accelerator | Intelligent-computing accelerator with an open-source ecosystem |
| Test power | 450 W | 600 W | 450 W |
| Maximum hardware rated power | 600 W | 600 W | 600 W |
Three points deserve special attention:
- Test power differs. Card A and Card C were tested at the 450 W tier, while Card B was tested at the 600 W tier. This means the measured results for Card A and Card C include some power-limit effect, whereas Card B is already at its hardware power ceiling.
- The server platforms, power limits, driver versions, and compute software stacks are not identical across the three. Most single-card results for Card C are based on a newer software stack in the open-source ecosystem, while its multi-card results use another version of the open-source stack. The comparison tests for Card A and Card B are based on the same major version of a closed-source stack and a matching inference-engine image.
- The conclusions have a limited scope. These differences mean the results more accurately reflect “actual performance under a specific hardware-software combination,” not the chip’s theoretical ceiling under ideal conditions.
Therefore, the focus below is not on “who ranks first,” but on why the ranking changes across different workloads and what mechanisms drive those changes.
1.2 Test method: end-to-end throughput under a unified metric
Requests are issued through a compatible interface exposed by the inference engine. At each data point, a fixed number of concurrent streams continuously send requests, and total throughput (output tokens/s) is computed as the sum of output tokens across all requests ÷ the wall-clock time of the measurement window.
This metric has two advantages:
- It directly corresponds to the “output per unit time” that users perceive, and maps naturally onto token-based cost models;
- It includes the cost of both the prefill and decode phases, so it can’t be “beautified” by a micro-benchmark of a single phase.
The two workload shapes are designed to bias the bottleneck toward different phases:
| Workload shape | Input length | Output length | Input/output token ratio | Main stressed phase | Typical business scenario |
|---|---|---|---|---|---|
| Short | 512 | 512 | 1:1 | Decode-leaning | Multi-turn dialogue, lightweight code completion |
| Long | 8192 | 1024 | 8:1 | Prefill-leaning | Long-document analysis, cross-file code understanding, long-context retrieval augmentation |
Note that “leaning” does not mean “containing only.” Both workloads include prefill and decode; only the dominant phase differs. A long request generates just 1024 tokens per request, yet techniques like chunked prefill split it into multiple scheduling batches, so prefill’s share of end-to-end time rises significantly.
2. Baseline Analysis: What Achievable Compute and Memory Bandwidth Each Tell You
Before interpreting inference throughput, it helps to disentangle two baseline metrics that are often conflated: achievable matrix-multiply compute (MAMF—the floating-point capability a specific matrix-multiply kernel can actually reach) and memory-access bandwidth. Single-card measurements are shown below:
| Metric | Card A | Card B | Card C | Brief interpretation |
|---|---|---|---|---|
| Achievable matmul compute (BF16) | 652 TFLOPS | 419 TFLOPS | 580 TFLOPS | Card A ≈ 1.56× Card B; Card A ≈ 1.12× Card C |
| Achievable matmul compute (FP8) | 1,205 TFLOPS | 820 TFLOPS | 1,120 TFLOPS | Card A ≈ 1.47× Card B; Card A ≈ 1.08× Card C |
| Measured memory-access bandwidth | 4,472 GB/s | 1,540 GB/s | Not provided this round | Card A / Card B ≈ 2.90 (calculated as 4,472 ÷ 1,540); applies only to this bandwidth kernel |
2.1 Achievable compute: measuring “how fast it computes”
Achievable compute answers one question: under a given precision, how fully can a matrix-multiply kernel feed the compute units? Note that:
- At FP8 precision, the three cards improve over their own BF16 by roughly 1.85×, 1.96×, and 1.93× respectively, indicating low-precision compute units are a common feature across all three;
- Numbers across different precisions cannot be ranked directly against each other. BF16, FP8, and even lower 4-bit floating-point formats go through different compute paths, with different kernel implementations, scaling strategies, and numeric-range handling. Low-precision paths differ even more across vendors, so “a bigger nominal number” does not necessarily mean “faster”;
- Achievable compute measures the ceiling of the pure-compute phase. When inference is not bottlenecked by matrix multiplication, this number’s correlation with actual throughput drops noticeably.
2.2 Memory bandwidth: measuring “whether it can move data fast enough”
Memory bandwidth answers a different question: how quickly can model weights and the KV cache be moved to the compute units? Card A’s measured read bandwidth is about 2.90× that of Card B, while its achievable compute is only about 1.5× that of Card B. This “scissors gap” is the key to understanding the measured results below: Card A’s relative advantage shows up mainly in memory-access-intensive scenarios, not compute-intensive ones.
However, a bandwidth kernel measures the peak under a specific access pattern, and real inference accesses are often more scattered:
- In the decode phase, reading the KV cache involves non-contiguous addresses;
- In MoE models, expert weights are read scattered according to routing results;
- Attention computation is also affected by on-chip cache capacity and layout.
So measured bandwidth is only a “theoretical ceiling,” not the effective bandwidth that real inference can sustain.
2.3 Understanding prefill and decode through the Roofline lens
Putting the two metrics together explains why the two workloads behave differently. The Roofline model uses arithmetic intensity (the number of floating-point operations performed per byte of data moved) to judge whether a computation is compute-bound or bandwidth-bound:
- Prefill phase: processes hundreds to thousands of input tokens at once; matrix multiplications are large with ample data reuse, arithmetic intensity is high, and it is closer to compute-bound;
- Decode phase: each step generates only 1 token per sequence, yet in theory it still has to read all activation weights and the KV cache, so arithmetic intensity is low and it is closer to bandwidth-bound.
This also explains the industry rule of thumb that decode is more affected by memory traffic and batching efficiency, while long-input prefill more readily reveals differences in the compute and attention paths.
But it must be emphasized that the final bottleneck depends on the actual model architecture and batch size. Take decode: increasing batch size improves reuse of weight reads, gradually shifting it from bandwidth-bound toward compute-bound. Meanwhile, inference throughput on GPUs is usually measured as “tokens generated per second,” whereas some dedicated inference-chip public materials directly call “tokens generated per second for a single sequence” as token/s—the two differ by a concurrency factor. Before reading any throughput number, first confirm the metric definition.
| Phase | Typical operators | Arithmetic intensity | Main limited resource | Hardware focus | Inference-engine focus |
|---|---|---|---|---|---|
| Prefill | Large-batch matmul, attention | High | Achievable compute, long-sequence attention efficiency | Low-precision compute, on-chip cache | Chunked prefill, prefix caching, long-sequence kernels |
| Decode | Single-token matvec, KV-cache read/write | Low | Memory bandwidth, batching efficiency | Memory bandwidth, memory capacity | High-concurrency scheduling, paged KV-cache management, quantization |
3. Single-Card 128-Concurrency Benchmarks: Results, Anomalies, and Analysis
Reading rule: within the same row, compare only different card types under the same model, same precision, and same workload shape; cross-row comparisons mix in differences in model, precision, and workload.
3.1 MoE model: FP8 vs. BF16 performance
The test model is a MoE-architecture code model with about 30 billion total parameters and about 3 billion activated parameters (referred to below as the “MoE model”). Results (in output tokens/s):
| Precision | Workload shape | Card A | Card B |
|---|---|---|---|
| FP8 | Short (512 / 512) | 7,459 | 3,995 |
| FP8 | Long (8192 / 1024) | 1,820 | 823 |
| BF16 | Short (512 / 512) | 5,240 | 2,881 |
| BF16 | Long (8192 / 1024) | 1,592 | 588 |
Three core conclusions can be drawn:
Conclusion 1: The gap between cards widens as input grows longer. At FP8, Card A leads Card B by about 87% on the short workload and by about 2.21× on the long workload. Since the achievable-compute ratio between the two cards (about 1.56× at BF16, about 1.47× at FP8) is clearly smaller than 2.21×, the widening gap in the long workload cannot be explained by matrix-multiply compute alone. A more reasonable inference is that factors such as long-sequence attention-kernel efficiency, memory-access patterns, and the KV-cache throughput advantage from high-bandwidth memory combine to amplify Card A’s lead.
Conclusion 2: The benefit of FP8 over BF16 depends heavily on card type and workload; there is no fixed speedup ratio.
| Card | Workload shape | Measured FP8 / BF16 ratio | Gap vs. achievable-compute ratio (Card A 1.85× / Card B 1.96×) |
|---|---|---|---|
| Card A | Short | ~1.42× | Reaches ~77% |
| Card A | Long | ~1.14× | Reaches ~62% |
| Card B | Short | ~1.39× | Reaches ~71% |
| Card B | Long | ~1.40× | Reaches ~71% |
The most notable is Card A: on the long workload, FP8 is only about 14% faster than BF16, a sharp contrast to about 42% on the short workload. This shows that in long-input scenarios, Card A’s bottleneck has clearly shifted away from pure matrix-multiply compute, most likely falling on the attention path, routing/scheduling, and memory access. Card B’s FP8 benefit, by contrast, is relatively stable across short and long workloads. From this we can infer that Card B is mainly compute-bound under BF16 long workloads, and switching to FP8 directly relieves that limit.
This has a direct lesson for engineering practice: a “FP8 gives ~40% speedup” figure derived from short-input benchmarks cannot be applied directly to long-input workloads; you must re-test with the real length distribution before launch.
Conclusion 3: The three cards form a complementary landscape. Card A leads in both phases, and its high-bandwidth memory advantage does not depend on higher power—its test power is in fact lower than Card B’s. Card B’s output per watt is not inferior, and it maintains relatively stable FP8 benefits even at its hardware power ceiling. Selection should not look at absolute throughput alone; it should weigh data-center power supply, cooling density, rack-space constraints, and software ecosystem together.
3.2 Dense model: the ranking reverses across the same set of cards
The test model is an 8-billion-parameter dense model (referred to below as the “dense model”), at FP8 precision. Results (in output tokens/s):
| Workload shape | Card A | Card B | Card C |
|---|---|---|---|
| Short (512 / 512) | 11,054 | 8,073 | 11,045 |
| Long (8192 / 1024) | 2,045 | 1,481 | 1,211 |
Finding 1: On the short workload, Card A and Card C are nearly tied. Their throughput differs by only about 0.1%, at the same level; Card B is about 73% of the two.
Finding 2: On the long workload, the ranking becomes Card A > Card B > Card C. Card A is about 1.38× Card B and about 1.69× Card C; Card C, which was in the top tier on the short workload, drops to last on the long workload.
This reversal is worth digging into:
- By nominal achievable compute, Card C’s BF16 and FP8 are about 89% and 93% of Card A’s respectively—a gap far too small to explain the throughput shortfall of up to 41% on the long workload;
- Given the test environment: Card A uses a closed-source software stack, Card C uses an open-source software stack, and their versions and inference-engine images differ. This strongly suggests that software-stack maturity—especially the degree of optimization for long-sequence prefill and attention kernels—is an important systemic factor behind the reversal;
- Card C performs well on decode-heavy short workloads, indicating a solid foundation in memory-access efficiency and concurrency scheduling, with its weakness concentrated in prefill-heavy scenarios.
For developers, this means that when evaluating a card, you must cover the real ratio of long inputs in your own workload. A conclusion that “it performs well in dialogue scenarios” does not automatically apply to long-document or cross-file code workloads.
3.3 Cross-model comparison: model architecture can matter more than the card-type difference
Comparing the two models on the same card yields an easily overlooked observation:
| Card | Dense model FP8 (short) | MoE model FP8 (short) | MoE / dense |
|---|---|---|---|
| Card A | 11,054 | 7,459 | ~67% |
| Card B | 8,073 | 3,995 | ~49% |
The MoE model activates only about 3 billion parameters per token, so in theory decode should read only the weights of the activated experts and be more “bandwidth-frugal” than the 8-billion-parameter dense model. Yet on both cards, the MoE model’s short-workload throughput is clearly lower than the dense model’s—the gap on Card B is nearly half. A reasonable explanation:
- Routing and dispatch overhead: gating computation and token dispatch require extra reads/writes of intermediate tensors, and in the single-token case GEMM degrades into a skinny matrix-vector multiply that can’t make efficient use of the compute units;
- Weight residency and scattered access: although each token activates only some experts, all expert weights must stay resident in memory, and the read locations of activated weights vary dynamically with routing results, giving poor locality;
- Quantization-kernel implementation differences: different cards support quantization of the mixture-of-experts structure to different degrees; the larger gap on Card B shows there is still clear room for optimization here.
The engineering implication: how well the model architecture is adapted may matter more than the card-type difference in determining actual throughput. If a business model lacks thorough optimization on a given software stack, the benefit from swapping hardware may fall well short of upgrading the inference engine or switching the quantization scheme.
4. Selection and Deployment: From Measured Data to Engineering Decisions
4.1 Match hardware capabilities to workload characteristics
| Workload characteristic | Dominant phase | Key resource | Focus | Optimization levers |
|---|---|---|---|---|
| High-concurrency short dialogue, real-time voice interaction, lightweight code completion | Decode | Memory bandwidth and capacity | Token throughput under concurrency, tail latency | Higher concurrency and batching efficiency, FP8 quantization, paged KV-cache management |
| Long-document summarization, contract/paper analysis, cross-file code understanding | Prefill | Achievable compute, long-sequence attention efficiency | Long-input throughput, time to first token (TTFT) | Chunked prefill, prefix caching, appropriate parallelism strategy |
| Mixed short and long, highly fluctuating traffic | Both phases alternating | Overall resource utilization | Performance curves across lengths | Elastic scaling, routing by length tier |
4.2 Weighing self-built vs. cloud compute
In practice, in-house accelerator clusters and cloud inference compute often need to be used in combination. On cloud platforms such as Baidu AI Cloud, users can choose from different product forms—such as GPU cloud servers, elastic container instances, or function compute—to build inference services. Combined with the measurement method in this article, the recommended decision path is:
- Collect a real traffic profile: statistics on the input-length distribution (P50 / P95 / P99), output-length distribution, peak concurrency, and latency targets;
- Build a benchmark with the same metric: reproduce the short and long workloads from this article on candidate hardware-software combinations, and add length combinations closer to your business;
- Establish a cost-per-token model: factoring in instance price, actual utilization, and power/cooling constraints, evaluate the combined cost per million output tokens rather than comparing only card price or nominal compute;
- Validate with canary traffic: before launch, route part of the real traffic to the candidate environment and observe whether throughput, TTFT, inter-token latency, and error rate meet expectations.
4.3 Pre-launch validation checklist
- Unify the metric: clarify whether “output token throughput” includes time to first token, and whether it can be compared directly across card types and frameworks;
- Cover the real length distribution: include at least short and long tiers, and add a medium length closer to your business;
- Fix the concurrency gradient: e.g., 16 / 32 / 64 / 128, plot a “throughput–concurrency” curve, and find the throughput saturation point and the latency knee;
- Record software/hardware versions: keep records of the driver, compute software stack, inference engine, quantization format, and attention backend;
- Watch power and cooling: record measured power, temperature, and whether throttling is triggered, to avoid a short-term peak masking long-term stability issues;
- Run soak tests: observe throughput drift, memory fragmentation, and request error rate over several hours;
- Convert to cost: translate measured throughput into cost per token as the final decision basis.
4.4 A reusable benchmark script skeleton
The script below gives the core logic so readers can reuse it in their own environments:
- The
inferfunction is a schematic implementation and needs to be wired to the compatible interface of the actual inference service; make_promptmust return a prompt of fixed length and cache it locally, so that the cost of constructing the prompt does not distort timing;stream=Falsemakes it easy to obtain the output token count directly from theusagefield; this is suitable only for testing and should not be copied into a production service.
import asyncioimport jsonimport randomimport statisticsimport timeCONCURRENCY = 128 # Number of concurrent streamsTOTAL_REQUESTS = 512 # Total requests; should be a multiple of the concurrency valueINPUT_LEN, OUTPUT_LEN = 512, 512 # Short workload; set to 8192, 1024 for the long workloadENDPOINT = "http://<inference-service-address>/v1/chat/completions" # Compatible inference endpointdef make_prompt(n_tokens: int) -> str:# Build a fixed-length prompt; in real projects, sample from business corpora and truncatereturn "Please read the following content and give a conclusion: " + ("Sample data. " * n_tokens)async def infer(prompt: str) -> dict:"""Send one request to the inference service and return the parsed response"""payload = {"model": "<model-name>","messages": [{"role": "user", "content": prompt}],"max_tokens": OUTPUT_LEN,"temperature": 0, # Fixed decoding for reproducible results"stream": False,}# The connection and sending logic below is schematic; replace it with the async HTTP client you actually use# Key requirement: connection-pool limit no smaller than the concurrency; configure timeouts and retries explicitly...async def main() -> None:prompts = [make_prompt(INPUT_LEN) for _ in range(TOTAL_REQUESTS)]sem = asyncio.Semaphore(CONCURRENCY)results, failures = [], 0async def worker(i: int) -> None:async with sem: # The semaphore keeps in-flight requests at or below CONCURRENCYt0 = time.perf_counter()try:resp = await infer(prompts[i])results.append({"output_tokens": resp["usage"]["completion_tokens"],"latency": time.perf_counter() - t0,})except Exception:nonlocal_dummy = None # placeholder; see note belowfailures_local.append(1)failures_local = []# Warm-up: send a few requests first to trigger engine initialization and cache warm-upawait worker(0)start = time.perf_counter()await asyncio.gather(*(worker(i) for i in range(TOTAL_REQUESTS)))wall = time.perf_counter() - starttotal_out = sum(r["output_tokens"] for r in results)lat = sorted(r["latency"] for r in results)print(json.dumps({"output_tokens_per_s": round(total_out / wall, 1),"requests": len(results),"failed": len(failures_local),"latency_p50_s": round(lat[len(lat) // 2], 3),"latency_p99_s": round(lat[int(len(lat) * 0.99)], 3),}, ensure_ascii=False, indent=2))if __name__ == "__main__":asyncio.run(main())
Two schematic patterns in the script need explaining:
nonlocal_dummyis just a placeholder and can be deleted in actual use;- For
failures_local, a cleaner approach is to declare it withnonlocalinmainand then increment it.
When using the script, also note:
- Failed requests must be counted separately and not included in the throughput numerator;
- It is recommended to record both time to first token (TTFT) and inter-token latency (ITL); together with total throughput, they fully characterize the user experience;
- Start each data point in a separate process, to avoid the previous round’s memory cache affecting the next round’s results;
- Dependency services such as databases and object storage should be warmed up in advance, to avoid mistaking a cold start for a hardware-performance difference.
5. Conclusion
From this round of 128-concurrency benchmarks across three classes of accelerator cards, four broadly applicable conclusions emerge:
- Throughput is a function of workload shape × model architecture × software stack. The ranking of the same set of cards can reverse across different models; a “universally strongest card” does not exist.
- Achievable compute and memory bandwidth are diagnostic tools, not conclusions. They help locate whether the bottleneck is in prefill or decode, but cannot be converted directly into online throughput.
- Quantization benefits vary by card and by workload. You must re-test with the real length distribution of your business to judge the actual value of FP8 and even lower precision.
- Software-stack maturity is a systemic variable. Gaps in long-sequence scenarios often come more from kernel and framework optimization than from nominal hardware parameters.
For developers, the most valuable approach is not to chase spec sheets, but to build an evaluation process that uses a unified metric, covers the real workload, and produces reproducible results—and on that basis to weigh compute cost, operational complexity, and business latency targets together. Whether the final choice is an in-house cluster or cloud compute, data-driven decisions remain the most reliable foundation for cutting costs and improving efficiency in inference services.
