Knowledge Base · Learning paths
LLM Deployment Explained: Key Metrics, MoE Testing, and Optimization Guide
This guide breaks down the essential metrics for large language model deployment including TTFT, TPOT, throughput, GPU memory usage, and cost per million tokens. Using real-world MoE model testing, it analyzes differences between Prefill and Decode phases, the long-context slowdown phenomenon, and delivers practical advice on hardware selection, performance tuning, and production monitoring.
Translated from Chinese by AI. Spotted an issue? Use the feedback button.
🔗 Original Link: https://x.com/wquguru/status/2093634146082152683
WquGuru · X · @wquguru · 2026-08-29 17:37
📌 This article is a reprint. All copyrights belong to the original author. The full text is subject to the original link.
Preface
When deploying large language models (LLMs), the metrics you truly need to focus on can be summarized in one sentence: Is the Time to First Token (TTFT) fast enough? Is the output smooth and continuous (TPOT/ITL)? Does throughput drop under high concurrency (system throughput)? Can the model fit in VRAM with sufficient headroom (VRAM + KV cache)? And what is the actual cost per million tokens?
Who is this article for:
- Those who want to understand the real VRAM and bandwidth requirements for different model sizes to avoid buying the wrong hardware configuration.
- Those selecting appropriate models and quantized versions for RAG, long-document processing, AI agent, and similar production scenarios.
- Those troubleshooting high-concurrency throughput bottlenecks, stuttering output, and severe slowdowns with long contexts.
- Those diagnosing sudden TTFT spikes, P99 latency jitter, VRAM over-allocation, and false-positive OOM crashes.
- Those calculating the real Total Cost of Ownership (TCO) per million tokens to determine the break-even point between self-hosting and commercial APIs.
Reading Guide:
- If you are about to purchase hardware or evaluate costs: read Section 4 (VRAM Calculation), Section 6 (Cost Analysis), and Section 8 (Hardware Selection Guide).
- If you are optimizing performance or troubleshooting throughput bottlenecks: read Sections 2 & 3 (Latency & Throughput), Section 7 (Advanced Optimization), and Section 9 (Real-World Testing Pitfalls).
- If you are performing model selection for specific use cases (RAG / Agent / Chat) and building testing toolchains and monitoring systems: read Section 10 (Common Benchmarking and Monitoring Tools).
- If your model service is about to go into production: read Section 5 (Service Quality and Probing).
1. Real-World Case Study First
Let’s take the newly released Ling-3.0-Flash at the end of July as an example. This is a Mixture-of-Experts (MoE) model. Unlike dense models such as Qwen 3.8 27B, a key characteristic of MoE models is that their total parameters and activated parameters differ. This model has 124B total parameters but activates only about 5.1B per token. It is positioned as a high cost-performance solution and a fast execution layer for production-grade AI agents, priced at just a fraction of Qwen 3.8 27B.
In real deployments, the same model can show several times difference in throughput and latency depending on the workload or context length. This section uses comprehensive measurements from a real server to turn these abstract metrics into concrete numbers.
Test Environment and Model Under Test
- Hardware Platform: NVIDIA DGX Spark (GB10 Grace-Blackwell) with 121 GB unified memory (CPU and GPU share the same memory space, no additional system memory buffer).
- Test Model: Ling-3.0-flash-INT4 (124B MoE / 5.1B activated parameters, KDA+MLA hybrid attention).
- Inference Engine: vLLM (with CUDA Graphs and MTP speculative decoding enabled), --max-model-len 16384.
- Measurement Standard: Uniformly counted using the usage.completion_tokens returned by the API.
| Core Metric | Measured Result | Notes & Pitfalls to Avoid |
|---|---|---|
| Single-request TTFT | 215 ms | Real compute + transfer latency for short prompts |
| High-concurrency TTFT | 20.7 s (20 concurrent requests) | Most of the time is spent waiting in the queue, not due to slow model computation |
| Single-stream Decode Speed | 39.4 tok/s | Stable output generation speed |
| High-concurrency Aggregate Throughput | 242.1 tok/s | System output when running at 16 concurrent saturation |
| VRAM & Cold Start | Weights resident: 71.7 GiB, total usage: 103/121 GB | Cold start takes approximately 8 minutes (engine initialization: 49.8 s) |
When first encountering terms like TTFT, single-stream decode speed, high-concurrency aggregate throughput, and VRAM & cold start, many people feel lost—just as I did. The good news is, by the end of this article, you will have built a comprehensive understanding of edge-side model deployment.
II. Latency Metrics (Most Directly Perceived by Users)
- Prefill Time
Large language model (LLM) inference consists of two distinct phases:
-
Prefill: Processes your entire input prompt at once, performing the “forward scan” of attention computation. This phase is compute-intensive — the GPU’s compute units are fully utilized.
-
Decode: Generates the response token by token. This phase is memory-bandwidth-intensive — the GPU spends most of its time waiting for data to be fetched from VRAM, and compute utilization is often only a fraction of peak.
Prefill Time refers to the internal time taken from “the model reading the complete prompt until it starts producing the first output token.” It directly affects TTFT, so the two are often mentioned together, but they are not the same (see below).
- TTFT (Time to First Token, First Token Latency)
Definition: The time from when the request is sent to the server until the first output token is received.
This is the most critical latency metric in interactive conversational scenarios. It directly answers the question: “How long after I ask my question until I see the first word appear?” For a 70B model running on a single H100 GPU, TTFT for short prompts is typically a few hundred milliseconds to two seconds. With very long prompts (tens of thousands of tokens), TTFT increases significantly.
Note that TTFT = Prefill Time + queuing/waiting time. When the system is busy and your request has to wait in a queue, a large portion of TTFT may actually be “queuing delay” rather than slow model computation.
- TPOT / ITL (Per-Token Interval, i.e. “Decoding Latency”)
After the first two words, the rest of the response appears one token at a time. There are two common ways to measure this “token generation speed”:
| Term | English | Meaning |
|---|---|---|
| ITL | Inter-Token Latency | Time interval between each token (measured per token, with statistics such as P50/P95/P99) |
| TPOT | Time Per Output Token | Total time from the first token to the last token in a response, divided by the number of output tokens (average) |
Industry documentation and benchmarks (such as MLPerf Inference and the vLLM/SGLang community) primarily use TTFT + TPOT. These metrics describe the “steady-state token generation speed,” independent of the first token and largely independent of input length. A common range for an INT4-quantized 70B model on a single H100 is 50–120 tokens/second (roughly 8–20 ms per token), varying with context length.
Important Pattern: The decode phase is limited by memory bandwidth, so output speed decreases as context length grows (because the KV cache becomes larger and more data must be moved each step). This “long-context slowdown” is something every self-hosted deployment must understand.
This degradation happens earlier and more sharply than most people expect. Section 9 includes a real-world curve: on the same machine and model, as prompt length increases from 300 to 15K tokens, decode speed drops from 39.0 to 18.2 tok/s — already halved within a 16K context window. At 49K tokens it falls to 7.1 tok/s, which is 5.6× slower.
- End-to-End Latency and Percentiles (P95 / P99)
-
End-to-End Latency: The total time from sending the request until the complete response is received. It equals TTFT + total generation time. This metric matters more for tasks like document summarization and code generation.
-
P95 / P99 Latency: Never rely on averages alone! Averages hide tail behavior. P95 represents the latency of the slowest 5% of requests; P99 represents the slowest 1%. In production environments, you must look at P95/P99 rather than mean values. If P99 is significantly higher than P50, it indicates occasional system jitter (GC pauses, queue congestion, OOM retries, etc.). Such instability is far more dangerous than a “good average” performance.
III. Throughput Metrics (How Much Work the System Can Handle)
1. Tokens per Second (TPS)
The most commonly used yet most frequently misunderstood metric. You must distinguish between three different measurement scopes:
| Scope | Description |
|---|---|
| Overall TPS | Total tokens generated by the system per second (input + output combined, or output-only — depends on how the report defines it) |
| Prefill Throughput | Throughput during the prefill phase; critical for “long-document reading” tasks |
| Decode Throughput | Throughput during the decode phase; especially important for “conversational” workloads. Often directly tied to the maximum TPS per GPU |
On a single H100, a 70B INT4 model typically reaches a decode throughput ceiling of around 100+ tokens/s. A 7B model on a consumer-grade 4090 can exceed 200 tokens/s (smaller models have higher compute intensity and are more FLOPs-bound than memory-bandwidth-bound).
2. Requests per Second (QPS)
Measures “how many concurrent conversation streams the system can serve.” In interactive scenarios, one QPS often corresponds to dozens of concurrent conversations. The relationship between QPS and TPS depends on concurrency: 10 concurrent conversations × 50 tokens/s per conversation = 500 tokens/s system-wide.
3. Continuous Batching (Continuous Batching / Chunked Prefill) Effectiveness
Early inference frameworks used “static batching”: the system had to wait for an entire batch to finish generation before starting the next one. This caused the GPU to idle while waiting for users to think, severely hurting throughput. Modern frameworks (vLLM’s continuous batching, SGLang, TGI, etc.) insert new requests during token generation gaps, keeping the GPU fully utilized.
The key indicator for whether this optimization is working is: under the same VRAM usage, does system throughput continue to scale linearly as concurrency increases? Systems without effective continuous batching experience a cliff-like drop in TPS once concurrency rises. Well-implemented systems can sustain dozens or even hundreds of concurrent requests.
Note that there are two different causes for a “cliff” that produce nearly identical-looking curves: one is that continuous batching is not working; the other is simply that the --max-num-seqs (or equivalent) concurrency slot limit has been reached and is queueing requests. In Section 9.2, two curves from the exact same machine are shown side-by-side — at 8 concurrent requests, one achieves 104.9 tok/s with TTFT increasing 24×, while the other reaches 167.9 tok/s. The only difference is a single parameter. When you see a cliff, first check the batch size / slot limit before blaming the framework.
4. System Throughput vs. Single-Node Throughput
When scaling across multiple GPUs, pay attention to linear scaling efficiency: Does N GPUs deliver approximately N× the throughput? In practice, communication overhead often results in 70–90% efficiency. The standard metric is Efficiency Ratio = Measured multi-GPU throughput ÷ (Single-GPU throughput × Number of GPUs). A ratio below 0.7 usually indicates that the parallelization strategy or interconnect (NVLink/PCIe) has become the bottleneck.
Four, Resource Metrics (Can Your Machine Handle It?)
- VRAM Usage (Whether the Model Fits Is the First Hurdle)
Total VRAM = Weight memory + KV cache + Runtime fragmentation overhead.
-
Rough formula for weight memory: Number of parameters (in billions) × bytes per parameter.
BF16/FP16 uses 2 bytes per parameter; INT4 uses approximately 0.7 bytes (including a small amount of metadata, commonly calculated as 0.75). -
Common reference ranges:
| Model | FP16/BF16 | FP8 | INT4 (AWQ/GPTQ) |
|---|---|---|---|
| 7B | ~14 GB | ~7–8 GB | ~5–6 GB |
| 30B | ~60 GB | ~32 GB | ~18–20 GB |
| 70B | ~140 GB (+fragmentation ≈150+ GB) | ~72 GB (+fragmentation ≈90 GB) | ~40–45 GB |
| 7B (128K context — KV cache calculated separately) | — | — | See KV cache quick reference below |
Rule of thumb: After calculating the theoretical value, multiply by a 1.2 safety factor to reserve space for KV cache and fragmentation. A 70B INT4 model may fit on a single card, but even moderate concurrency can cause OOM due to insufficient KV cache. This is exactly why you sometimes see “it loads but still crashes.”
- KV Cache Calculation (The Longer the Context, the More VRAM It Consumes)
KV cache stores the results of attention computations to avoid redundant calculations. The longer the context window and the higher the concurrency, the more VRAM it occupies. The general formula is:
KV cache (bytes) ≈ 2 × L (layers) × KV heads × Head_Dim × Sequence Length (S) × Batch Size (B) × bytes per element
The 2 accounts for separate Key and Value caches. Taking Llama-3-70B as an example (80 layers, GQA, 8 KV heads, head_dim=128, BF16 = 2 bytes):
-
Per token: 2 × 80 × 8 × 128 × 2 = 327,680 B ≈ 0.31 MB/token
-
At 4K context → ~1.3 GB; at 128K context → ~40 GB
This means that with long context (≥32K) + high concurrency, KV cache can easily exceed the model weights themselves and become the primary VRAM bottleneck. This is also why many deployment solutions apply quantization to long-context KV cache (KV quantization) or offload it to CPU.
The opposite mistake is equally common and more insidious: allocating the full KV pool based on maximum context × maximum concurrency, when only a few percent is actually used. Section 9.3 shows a real-world case of 24× over-allocation (pool sized for 1,098,590 tokens, but only ~46,000 actually used, with GPU KV cache usage at just 4.2%). Reducing this parameter freed up memory and delivered significantly higher aggregate throughput.
--gpu-memory-utilization is typically tuned in recipes to “make it fit,” not to “make it run stably.” When copying someone else’s recipe, it’s worth measuring this value yourself.
- GPU Utilization and Memory Bandwidth Utilization
-
GPU Utilization (%): The percentage of streaming multiprocessors (SMs) that are active. During decoding, even 30% utilization can be normal (if the workload is memory-bandwidth bound). You cannot judge performance based solely on utilization.
-
Memory Bandwidth Utilization: LLM decoding is typically memory-bound. This is the real factor determining token generation speed. When comparing hardware, pay attention to bandwidth (GB/s): H100 SXM ≈ 3 TB/s, H200 ≈ 4.8 TB/s, A100 ≈ 2 TB/s, RTX 4090 ≈ 1 TB/s. A several-fold difference in bandwidth usually translates to a several-fold difference in output speed for the same model.
- Precision and Quantization Loss
-
FP16/BF16: Lossless, best quality, but doubles memory usage and is more likely to be memory-bandwidth bound.
-
INT8: Halves memory usage; quality degradation is negligible in most scenarios.
-
INT4 (AWQ/GPTQ): Reduces memory to about 1/4. For conversational tasks the difference is usually imperceptible, but on complex reasoning or long-chain thinking tasks it may cause a 1–5 percentage point drop in quality.
Quantization distortion metrics: Run before-and-after evaluations on authoritative benchmarks (MMLU, GSM8K, HumanEval, MAUSt, etc.). The more aggressive the quantization, the larger the score drop. Always test INT4 on your own relevant task types before adopting it in production.
Five: Service Quality and Reliability Metrics (What Truly Matters in Production)
- P95/P99 Latency and Queue Wait Time
Even if “pure compute latency” is fast, you must also look at queue wait time — how long a request has to wait in the queue before it can enter a running task. This is the core conflict in multi-user, shared-GPU scenarios: a single request may be fast, but as soon as many users arrive, everyone becomes slow.
Recommended monitoring panels: TTFT-P50/P95, TPOT-P50/P95, and Queue Wait Time-P50/P95 — track each separately.
- Error Rate and OOM Frequency
-
OOM (Out of Memory) retries can cause sporadic requests to experience latency explosions and are a common reason for P99 latency spikes.
-
Key metrics: Error rate (including timeouts, OOM, and parsing failures), retry count, and parsing error rate.
-
<strong>/health</strong> returning 200 does not mean the inference engine is generating tokens. Most inference frameworks only health-check the API server, while the actual work is done by the backend engine process — the two can fail independently. A proper liveness probe should trigger one real generation (send a 1-token request and verify it returns), not just check a port or process.
-
However, liveness conditions must not rely on “request timeout”. In a system that allows queuing, requests are expected to wait under heavy load. Using timeout as a liveness signal would cause your service to be restarted during traffic peaks. Instead, liveness should check whether “the engine is still making progress” (e.g., whether Avg generation throughput in the engine logs remains 0 across multiple sampling periods), not how fast any single request completes.
- Availability (Uptime)
-
The percentage of time the service is available to external users (99.9% ≈ less than 44 minutes of downtime per month).
-
Combine with proper health checks and graceful restarts to prevent a single OOM from killing the entire process.
- Timeout Configuration and Streaming Experience
It is strongly recommended to enable streaming output: as soon as tokens are generated, they are sent back to the user immediately. This eliminates the need to wait for the entire response, making perceived latency close to TTFT. At the same time, set reasonable request timeouts to prevent a single extremely long request from blocking connections.
Six: Cost-Related Metrics (Is the Money Well Spent?)
- Cost per Token
The most intuitive comparison baseline:
| Approach | Reference Cost (Output Tokens) |
|---|---|
| Cloud API Service | Small/medium models: ~$0.10–$1 per million<br>Flagship models: $15–$75 per million |
| Self-hosted H100 | Approximately $0.10–$0.5 per million (depending on hardware depreciation, electricity, and utilization) |
Note that API pricing usually differs between input and output tokens — always normalize the comparison. Self-deployment typically only becomes cost-effective when monthly volume reaches tens of billions of tokens, depending on your hardware acquisition cost and electricity rates.
- Tokens per Dollar & Tokens per kWh
-
Used to compare efficiency across different hardware options — deciding which GPU to buy or whether to rent cloud instances.
-
When self-hosting, power consumption must be factored in (H100 SXM ≈ 700W, 4090 ≈ 450W). Solutions with higher tokens/kWh are significantly cheaper in the long run.
- Hardware Depreciation and TCO (Total Cost of Ownership)
The cost of self-deployment = amortized hardware purchase (typically depreciated over 3–4 years) + electricity + colocation/network + operations labor. Self-hosting makes sense for high-frequency, steady workloads when the team already has idle GPUs. For low-frequency or highly bursty traffic, renting cloud resources is usually more flexible.
7. Exclusive Metrics for Advanced Optimization Techniques
These are your “feel gauges” when tuning models. Once you enable optimizations, keep a close eye on these numbers:
- Speculative Decoding (Speculative Sampling / Draft Verification)
A small draft model first guesses a sequence of tokens, which the large model then verifies in a single pass.
Key Metrics:
-
Speedup: Actual throughput ÷ baseline throughput. Typical range is 1.5–3× (most noticeable under decode-bound workloads and low-to-medium concurrency).
-
Accept Rate: The percentage of draft tokens accepted by the large model. This directly determines the acceleration effect. The closer the draft model is to the target model, the higher the accept rate.
-
Cost: Requires deploying an additional small model (extra weight memory footprint). Offers limited benefit in high-concurrency or prefill-dominant scenarios.
-
Measurement Pitfall (the easiest of the three to get wrong): After enabling speculative decoding, calculating tok/s based on SSE chunk count will systematically underestimate performance. Accepted draft tokens and their verification tokens are packed into the same chunk. In Section 9.5, this mistake turned a real 41 tok/s into a reported 20.5 tok/s — almost exactly the same as the “speculative decoding disabled” baseline, making the wrong number look perfectly believable.
Correct approach: Usestream_options: {"include_usage": true}and readusage.completion_tokens.
- Prefix Caching (Prefix Caching / Prompt Caching)
Stores the already-computed KV cache for common prefix tokens in the prompt so they can be reused (e.g., the same system prompt or the same long document).
Key Metrics:
-
Hit Rate: Percentage of time the prefix is found in cache, allowing that portion of Prefill to be skipped. In real-world workloads (Agent scenarios, RAG with fixed documents), hit rates of 50%–70% are achievable.
-
Latency Reduction: When a hit occurs, the Prefill phase for that request can drop to 1/x of original cost, bringing overall TTFT down by 40%–90%. When there is no hit, it may introduce a slight overhead.
-
Note that caches have a lifecycle. If the hit rate is too low, it indicates low prefix repetition in your workload and this optimization may not be worthwhile.
- Quantization Quality Degradation
As mentioned earlier, measure quality loss from INT8/INT4 using benchmarks such as MMLU, GSM8K, and HumanEval. Ensure the degradation stays within an acceptable range.
- Multi-GPU Parallel Scaling Efficiency
-
When a model doesn’t fit on a single card, use DP (Data Parallel replication) / TP (Tensor Parallel weight sharding) / PP (Pipeline Parallel).
-
Metric: The linear scaling efficiency ratio mentioned earlier. With multiple cards, also monitor communication overhead (NVLink systems perform better than PCIe). Models above 70B almost always require multi-GPU setups.
- Long-Context Specific Metrics
For long-context deployments, pay special attention to: KV cache ratio (% of total VRAM), decode slowdown ratio for long sequences (how much TPS drops from 2K to 32K), and whether KV cache quantization/offloading, FlashAttention, PagedAttention, or other memory optimization techniques are enabled.
8. Real Hardware Reference Values and Selection Guide
| GPU | VRAM | Bandwidth | Recommended Deployment Tier |
|---|---|---|---|
| RTX 3090/4090 | 24 GB | ~1 TB/s | 7B models INT4/FP8, personal/small team |
| RTX 6000 Ada / A6000 | 48 GB | ~900 GB/s | 30B models INT4, small batch inference |
| A100 80 GB | 80 GB | ~2 TB/s | 70B INT4 on single card, small and medium enterprises |
| H100 SXM (80G) | 80 GB | 3 TB/s + 900 GB/s NVLink | 70B FP8/BF16 or INT4 with high concurrency, primary production choice |
| H200 | 141 GB | 4.8 TB/s | 70B BF16 on single card / long context / high concurrency |
| H20 (Export Version) | 96 GB | Lower compute & bandwidth | 70B INT4 on single card, budget-constrained scenarios |
Self-deployment starting guidelines:
- 7B and below: A single 24G consumer GPU is sufficient. Prioritize TPOT and QPS metrics.
- 70B class: Requires H100/A100 80G or dual A800/H20 cards. INT4 can save VRAM but requires quality validation.
- Long documents / enterprise RAG: Focus on total KV cache size, prefix cache hit rate, and performance degradation with long context.
- Multi-user online services: Focus on continuous batching, P95/P99 latency, queue time, and OOM prevention.
IX. Real-World Benchmark: Ling-3.0-Flash On-Device Measurement
The previous chapters provided definitions and reference ranges for various metrics. However, in actual deployment, the same model can exhibit several-fold differences in throughput and latency when the workload or context length changes. This section uses a complete measurement from a real server (introduced in Section I) as an example, translating all metrics into concrete numbers.
Test Environment and Target Model
-
Hardware Platform: NVIDIA DGX Spark (GB10 Grace-Blackwell), 121 GB unified memory (CPU/GPU shared memory space, no additional system memory buffer)
-
Test Model: Ling-3.0-flash-INT4 (124B MoE / 5.1B activated parameters, KDA+MLA hybrid attention)
-
Inference Engine: vLLM (with CUDA Graphs and MTP speculative decoding enabled), --max-model-len 16384
-
Statistics Basis: Uniformly counted using the API-returned usage.completion_tokens
- Latency and Throughput: Distinguishing “Compute Time” from “Queue Time”
| Core Metric | Measured Performance | Notes & Common Pitfalls |
|---|---|---|
| Single-Request TTFT | 215 ms | Real compute + transfer latency for short prompts |
| High-Concurrency TTFT | 20.7 s (20 concurrent requests) | Most of the time is spent waiting in the queue for scheduling, not due to slow model computation |
| Single-Stream Decode Speed | 39.4 tok/s | Stable token generation speed |
| High-Concurrency Aggregate Throughput | 242.1 tok/s | System output when running at 16 concurrent saturation |
| VRAM & Cold Start | Model weights resident at 71.7 GiB, total usage 103/121 GB | Cold start takes approximately 8 minutes (engine initialization 49.8 s) |
Key Takeaway: When monitoring alerts show TTFT spiking, first check the system’s concurrent queue and queuing time. Do not immediately blame insufficient model compute power.
- Concurrency Scaling: Identifying “False Throughput Cliffs”
| Concurrency | Limited Slots (seqs 4) Aggregate Throughput |
Expanded Slots (seqs 16) Aggregate Throughput |
|---|---|---|
| 1 | 37.1 tok/s | 36.3 tok/s |
| 4 | 106.6 tok/s | 92.3 tok/s |
| 8 | 104.9 tok/s (TTFT surges to 5.2s) | 167.9 tok/s |
| 16 | — | 242.1 tok/s |
-
False Cliff: Under the
seqs 4configuration, at 8 concurrent requests throughput stops increasing and latency spikes dramatically. It appears as if “continuous batching has failed,” but it is actually caused by the server-side parameter limiting the number of concurrent slots. -
Scaling Cost: Scaling from 1 to 16 concurrent requests increases total throughput by 6.7× (36.3 → 242.1 tok/s), but per-request generation speed drops from 36.3 to 15.1 tok/s. When deploying on a single machine, a trade-off must be made between “single-stream user experience” and “system throughput.”
- KV Cache VRAM Trap: Over-Allocation Can Hurt Performance
Following conventional wisdom by setting --gpu-memory-utilization to 0.80 allocates a 21 GiB KV Cache pool (approximately 1.1 million tokens). However, when running 4 complex requests, only about 46,000 tokens were actually used (utilization rate of just 4.2%, resulting in 24× over-allocation of VRAM).
| Configuration | Single-Stream Speed | 16-Stream Aggregate Throughput | Remaining Available VRAM | KV Pool Size |
|---|---|---|---|---|
utilization 0.80 / seqs 16 |
28.7 tok/s | 226.8 tok/s | 18 GB | 20.8 GiB |
utilization 0.70 / seqs 16 |
36.3 tok/s | 242.1 tok/s | 30 GB | 9.67 GiB |
Key Takeaway: Blindly maximizing the KV cache pool crowds out system runtime buffers. If monitoring shows GPU KV cache usage consistently in the single digits, proactively lowering the utilization parameter can free up to 12 GB of VRAM, while actually improving both throughput and single-stream speed.
- Long-Context Slowdown Curve: Prefill and Decode Show Completely Opposite Trends
In Needle In A Haystack long-context tests (generating 128 tokens):
| Prompt Length | Prefill Speed | TTFT | Decode Speed |
|---|---|---|---|
| 269 tokens | 838 tok/s | 0.32 s | 39.0 tok/s |
| 2,971 tokens | 2,441 tok/s | 1.22 s | 32.4 tok/s |
| 10,815 tokens | 2,693 tok/s | 4.02 s | 20.5 tok/s (nearly halved) |
| 14,738 tokens | 2,671 tok/s | 5.52 s | 18.2 tok/s |
| 49,000 tokens | 2,429 tok/s | — | 7.1 tok/s (5.6× slower) |
-
Prefill remains constant: From 3K to 49K tokens, Prefill speed stays stable at over 2,400 tok/s (the advantage of the hybrid linear attention architecture is evident).
-
Decode continues to degrade: As context length increases, the memory access overhead of moving the KV Cache at each step grows dramatically. Speed is already halved around 11K tokens.
-
Key pitfall to avoid: When evaluating long-context performance, test points must be placed in the middle of the context window (e.g., 8K–16K). Never test only the very beginning and end, and do not mistake stable Prefill speed for stable Decode speed.
- Speculative Sampling: Identifying Client-Side Statistical Traps
-
Acceleration ceiling is limited by acceptance length: Real-world testing shows an MTP acceptance rate of 65.4%, producing an average of 1.65 tokens per verification step. This caps the acceleration benefit at approximately 1.6×.
-
Statistical trap: After enabling speculative sampling, multiple accepted tokens are merged into the same SSE Chunk. If the client calculates speed simply by counting the number of Chunks, it will report a misleading 20.5 tok/s (falsely suggesting that speculative sampling is ineffective). The correct approach is to read usage.completion_tokens from the response, which reveals the true speed of 41 tok/s.
- Quality Evaluation: Two Major Blind Spots in Metric Interpretation
-
Chain-of-Thought Truncation Trap: In IFEval evaluations, enabling thinking mode caused the score to drop sharply from 0.789 to 0.207. Investigation revealed that max_tokens was set to 2048, causing the Chain of Thought to be forcibly truncated before completion. Insufficient output limits manifest in quality tests as “low scores” rather than explicit errors.
-
Tool Calling (Function Calling) Must Be Evaluated in Layers: The overall BFCL-v3 score is 0.744, but when broken down: single-turn calling reaches 0.887 (sufficient for production use), while multi-turn autonomous looping is only 0.438. When building Agent systems, orchestration should be driven by outer workflow logic rather than relying entirely on the model’s long-chain autonomous planning.
10. Common Benchmarking and Monitoring Tools
| Use Case | Primary Metrics | Secondary Focus | Acceptable Trade-offs |
|---|---|---|---|
| Chatbots / Intelligent Customer Service | TTFT, TPOT (output token speed per stream) | System concurrent QPS, P95 latency | Prefill maximum throughput |
| Long Document Analysis / Knowledge Base Q&A | Prefill throughput, End-to-end processing time | Overall system throughput | Absolute first-token TTFT |
| AI Agents / Automation Tools | Tool-calling hierarchical accuracy, TTFT, P95 | Format adherence stability | Extreme concurrent throughput |
| Offline Batch Data Processing | Overall system throughput (tok/s), Cost per token | Total task completion time | Interactive response latency |
| Ultra-Long Context RAG | KV Cache capacity, Prefix Cache hit rate | Long-context decode degradation | First-token latency |
Tool Recommendations:
Inference Engine Built-in Tools
- vLLM bench serve / SGLang benchmarking suite: Quickly test TTFT, TPOT, system throughput, and speculative sampling acceptance rate.
Professional Performance Testing Tools
- NVIDIA GenAI-Perf: Standardized large language model benchmarking tool that outputs TTFT/TPOT percentiles and per-million-token cost calculations compliant with MLPerf specifications.
Quality and Accuracy Evaluation Frameworks
- EvalScope / lm-evaluation-harness: Used to quantify benchmark accuracy regression before and after quantization or parameter tuning (covering IFEval, HumanEval, GSM8K, etc.).
Hardware and Runtime Monitoring
-
Prometheus + Grafana: Connect to the inference framework’s /metrics endpoint to continuously monitor P95/P99 latency, queuing time, and GPU memory usage.
-
nvidia-smi / gpustat: Real-time observation of GPU compute utilization, memory allocation, and power consumption.
Related Links:
- Model for testing: https://huggingface.co/inclusionAI/Ling-3.0-flash
- DGX Spark reference recipe: https://github.com/sudoingX/dgx-spark-ling
- lm-evaluation-harness: https://github.com/eleutherai/lm-evaluation-harness
- vLLM: https://github.com/vllm-project/vllm
The definitions and reference values in this article are compiled from the open-source inference community (vLLM/SGLang/TGI) metric definitions, the MLPerf Inference benchmark system, and current mainstream hardware specifications. All numbers marked as “Sample” in Section 9 and the self-checklist are from actual tests of Ling-3.0-flash-INT4 on DGX Spark conducted between August 17–18, 2026. The configuration and scripts are fully reproducible. Specific values will vary with model version, quantization scheme, framework parameters, and environment—always refer to your own measurements.