Skip to content

Optimizing Qwen3-14B Throughput on NVIDIA H100 GPUs

Conclusion

qwen3-14b-h100

Recommended configuration for optimizing throughput of Qwen3-14B on H100 GPUs:

Serving Command
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8

Comparison of benchmark results before and after optimization:

Benchmark Case baseline (vLLM without any optimizations) Optimized
ShareGPT Total TPS: 6595.66
Mean TPOT(ms): 226.03
Total TPS: 10426.27 (+58.1%)
Mean TPOT(ms): 251.67
Short Prompt Total TPS: 5796.73
Mean TPOT(ms): 525.31
Total TPS: 16884.75 (+191.3%)
Mean TPOT(ms): 927.88
Medium Prompt Total TPS: 10597.19
Mean TPOT(ms): 206.51
Total TPS: 14764.26 (+39.3%)
Mean TPOT(ms): 143.22
Long Prompt Total TPS: 9218.03
Mean TPOT(ms): 132.45
Total TPS: 12257.62 (+33.0%)
Mean TPOT(ms): 84.93
Very Long Prompt Total TPS: 8298.56
Mean TPOT(ms): 277.44
Total TPS: 10014.29 (+20.7%)
Mean TPOT(ms): 215.93

Note

  1. Our benchmark tests do not cover all possible optimization combinations. For example, we select the inference engine that performs best under its default configuration as the starting point for further tuning. This pruning approach yields a local optimum, which may not be the global optimum.
  2. There are other optimization methods that depend on specific user scenarios, including max batch size, schedule configuration, extended KV cache, CUDA graph, Torch Compile, etc. The conclusions in this document can serve as a starting point for more targeted optimizations.
  3. The tests are conducted on specific hardware and software setups. Advances in the inference engine may lead to new conclusions.
  4. Although using quantization may impact accuracy. FP8 quantization can achieves less than 1% accuracy drop for most models. See the evaluation results for more details. Therefore, it is highly recommended to use FP8 quantization for high-throughput serving scenarios.

If there are any missing points or updates reflecting new changes, please let us know.

Optimization Objective

Achieve high throughput under high-concurrency request scenarios.

Experimental Setup

Model

Qwen3-14B

Hardware

NVIDIA H100 GPUs

Engine Version

  • vLLM: v0.11.0
  • SGLang: v0.5.5.post1
  • TensorRT-LLM: v1.2.0rc1

Benchmark Dataset

  1. ShareGPT
  2. Random dataset with varying sequence lengths:
    • Very long prompt: 32000 input tokens, 100 output tokens
    • Long prompt: 4000 input tokens, 200 output tokens
    • Medium prompt: 2000 input tokens, 100 output tokens
    • Short prompt: 128 input tokens, 4 output tokens

Benchmark Script

We use the vLLM bench CLI tool to benchmark the model performance. The following command is used to run the benchmark:

# Prepare the ShareGPT dataset
wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json

# Benchmark on ShareGPT dataset
vllm bench serve --model Qwen/Qwen3-14B --backend openai-chat --endpoint /v1/chat/completions --dataset-name sharegpt --dataset-path ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts 1000

# Benchmark on random dataset (fixed seed for reproducibility)
vllm bench serve --model Qwen/Qwen3-14B --backend openai-chat --endpoint /v1/chat/completions --dataset-name random --random-input-len 4000 --random-output-len 200 --num-prompts 500 --seed 42

Experiment Results

1. Choosing the Inference Engine

vLLM

Serving script
vllm serve Qwen/Qwen3-14B
Benchmark result
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  63.53
Total input tokens:                      217393
Total generated tokens:                  201648
Request throughput (req/s):              15.74
Output token throughput (tok/s):         3173.92
Peak output token throughput (tok/s):    8890.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          6595.66
---------------Time to First Token----------------
Mean TTFT (ms):                          22141.21
Median TTFT (ms):                        21872.31
P99 TTFT (ms):                           31156.86
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          226.03
Median TPOT (ms):                        117.46
P99 TPOT (ms):                           621.87
---------------Inter-token Latency----------------
Mean ITL (ms):                           92.83
Median ITL (ms):                         59.99
P99 ITL (ms):                            627.72
==================================================

SGLang

Serving script
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B
Benchmark result
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  49.86
Total input tokens:                      217393
Total generated tokens:                  201628
Request throughput (req/s):              20.06
Output token throughput (tok/s):         4043.89
Peak output token throughput (tok/s):    12059.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          8403.97
---------------Time to First Token----------------
Mean TTFT (ms):                          9230.85
Median TTFT (ms):                        8812.15
P99 TTFT (ms):                           19581.07
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          235.33
Median TPOT (ms):                        118.67
P99 TPOT (ms):                           1462.03
---------------Inter-token Latency----------------
Mean ITL (ms):                           91.54
Median ITL (ms):                         51.39
P99 ITL (ms):                            442.65
==================================================

TensorRT-LLM

Serving script
trtllm-serve Qwen/Qwen3-14B
Benchmark result
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  50.39
Total input tokens:                      217393
Total generated tokens:                  201612
Request throughput (req/s):              19.84
Output token throughput (tok/s):         4000.99
Peak output token throughput (tok/s):    8281.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          8315.15
---------------Time to First Token----------------
Mean TTFT (ms):                          10230.91
Median TTFT (ms):                        9088.74
P99 TTFT (ms):                           24363.57
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          161.58
Median TPOT (ms):                        107.16
P99 TPOT (ms):                           579.49
---------------Inter-token Latency----------------
Mean ITL (ms):                           84.78
Median ITL (ms):                         0.12
P99 ITL (ms):                            1440.77
==================================================

Result: SGLang (8424.86 tok/s) > TensorRT-LLM (8315.15 tok/s) > vLLM (6595.66 tok/s)

2. Quantization in SGLang

FP8

Serving script
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8
Benchmark result
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  40.21
Total input tokens:                      217393
Total generated tokens:                  201833
Request throughput (req/s):              24.87
Output token throughput (tok/s):         5019.64
Peak output token throughput (tok/s):    14199.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          10426.27
---------------Time to First Token----------------
Mean TTFT (ms):                          7320.60
Median TTFT (ms):                        7110.49
P99 TTFT (ms):                           13187.08
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          251.67
Median TPOT (ms):                        94.53
P99 TPOT (ms):                           1678.80
---------------Inter-token Latency----------------
Mean ITL (ms):                           77.06
Median ITL (ms):                         48.45
P99 ITL (ms):                            383.61
==================================================

3. Attention Backends in SGLang

Serving script
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8 --attention-backend=fa3
Benchmark result
# fa3
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  40.18
Total input tokens:                      217393
Total generated tokens:                  201833
Request throughput (req/s):              24.89
Output token throughput (tok/s):         5023.58
Peak output token throughput (tok/s):    13005.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          10434.44
---------------Time to First Token----------------
Mean TTFT (ms):                          7304.47
Median TTFT (ms):                        7081.19
P99 TTFT (ms):                           13629.09
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          242.72
Median TPOT (ms):                        94.43
P99 TPOT (ms):                           1559.90
---------------Inter-token Latency----------------
Mean ITL (ms):                           76.97
Median ITL (ms):                         47.55
P99 ITL (ms):                            359.57
================================================== 

# --attention-backend=flashinfer
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  45.91
Total input tokens:                      217393
Total generated tokens:                  201462
Request throughput (req/s):              21.78
Output token throughput (tok/s):         4388.17
Peak output token throughput (tok/s):    15814.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          9123.34
---------------Time to First Token----------------
Mean TTFT (ms):                          13440.31
Median TTFT (ms):                        13197.52
P99 TTFT (ms):                           19982.69
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          246.57
Median TPOT (ms):                        95.09
P99 TPOT (ms):                           1613.59
---------------Inter-token Latency----------------
Mean ITL (ms):                           76.95
Median ITL (ms):                         48.29
P99 ITL (ms):                            367.15
==================================================

# --attention-backend=triton
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  41.67
Total input tokens:                      217393
Total generated tokens:                  201602
Request throughput (req/s):              24.00
Output token throughput (tok/s):         4838.09
Peak output token throughput (tok/s):    14024.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          10055.13
---------------Time to First Token----------------
Mean TTFT (ms):                          7297.40
Median TTFT (ms):                        6973.27
P99 TTFT (ms):                           14354.40
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          268.09
Median TPOT (ms):                        100.54
P99 TPOT (ms):                           1810.20
---------------Inter-token Latency----------------
Mean ITL (ms):                           82.50
Median ITL (ms):                         51.79
P99 ITL (ms):                            379.98
==================================================

Summary of Optimization Options

Optimization Option Throughput Improvement
Engine Selection +27.7%
Quantization +23.8%
Attention Backend -

Other Benchmark Cases

We further benchmarked the optimized configuration to evaluate its generalization under various workloads.

Baseline serving script
vllm serve Qwen/Qwen3-14B
Baseline benchmark results
# random 32K input
============ Serving Benchmark Result ============
Successful requests:                     100
Benchmark duration (s):                  386.80
Total input tokens:                      3200000
Total generated tokens:                  9855
Request throughput (req/s):              0.26
Output token throughput (tok/s):         25.48
Peak output token throughput (tok/s):    192.00
Peak concurrent requests:                100.00
Total Token throughput (tok/s):          8298.56
---------------Time to First Token----------------
Mean TTFT (ms):                          191024.43
Median TTFT (ms):                        191051.49
P99 TTFT (ms):                           380407.97
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          277.44
Median TPOT (ms):                        284.52
P99 TPOT (ms):                           324.14
---------------Inter-token Latency----------------
Mean ITL (ms):                           274.38
Median ITL (ms):                         43.48
P99 ITL (ms):                            1101.18
==================================================

# random 4K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  227.57
Total input tokens:                      1997942
Total generated tokens:                  99803
Request throughput (req/s):              2.20
Output token throughput (tok/s):         438.56
Peak output token throughput (tok/s):    1536.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          9218.03
---------------Time to First Token----------------
Mean TTFT (ms):                          112716.92
Median TTFT (ms):                        110734.54
P99 TTFT (ms):                           219749.74
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          132.45
Median TPOT (ms):                        139.68
P99 TPOT (ms):                           161.93
---------------Inter-token Latency----------------
Mean ITL (ms):                           132.11
Median ITL (ms):                         43.93
P99 ITL (ms):                            656.79
==================================================

# random 2K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  98.91
Total input tokens:                      998175
Total generated tokens:                  50000
Request throughput (req/s):              5.06
Output token throughput (tok/s):         505.51
Peak output token throughput (tok/s):    2890.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          10597.19
---------------Time to First Token----------------
Mean TTFT (ms):                          50716.13
Median TTFT (ms):                        49138.28
P99 TTFT (ms):                           94614.51
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          206.51
Median TPOT (ms):                        231.62
P99 TPOT (ms):                           236.67
---------------Inter-token Latency----------------
Mean ITL (ms):                           204.84
Median ITL (ms):                         46.01
P99 ITL (ms):                            642.06
==================================================

# random 128 input
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  22.72
Total input tokens:                      127698
Total generated tokens:                  4000
Request throughput (req/s):              44.02
Output token throughput (tok/s):         176.06
Peak output token throughput (tok/s):    843.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          5796.73
---------------Time to First Token----------------
Mean TTFT (ms):                          18282.75
Median TTFT (ms):                        18061.13
P99 TTFT (ms):                           22564.77
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          525.31
Median TPOT (ms):                        597.29
P99 TPOT (ms):                           610.81
---------------Inter-token Latency----------------
Mean ITL (ms):                           393.98
Median ITL (ms):                         581.28
P99 ITL (ms):                            633.07
==================================================
Optimized serving script
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8
Optimized benchmark results
# random 32K input
============ Serving Benchmark Result ============
Successful requests:                     100
Benchmark duration (s):                  320.54
Total input tokens:                      3200000
Total generated tokens:                  9964
Request throughput (req/s):              0.31
Output token throughput (tok/s):         31.09
Peak output token throughput (tok/s):    250.00
Peak concurrent requests:                100.00
Total Token throughput (tok/s):          10014.29
---------------Time to First Token----------------
Mean TTFT (ms):                          158068.68
Median TTFT (ms):                        157591.30
P99 TTFT (ms):                           313702.45
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          215.93
Median TPOT (ms):                        212.59
P99 TPOT (ms):                           326.36
---------------Inter-token Latency----------------
Mean ITL (ms):                           211.53
Median ITL (ms):                         41.38
P99 ITL (ms):                            5675.37
==================================================

# random 4K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  171.14
Total input tokens:                      1997942
Total generated tokens:                  99814
Request throughput (req/s):              2.92
Output token throughput (tok/s):         583.23
Peak output token throughput (tok/s):    1950.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          12257.62
---------------Time to First Token----------------
Mean TTFT (ms):                          82073.47
Median TTFT (ms):                        85092.81
P99 TTFT (ms):                           165401.79
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          84.93
Median TPOT (ms):                        83.43
P99 TPOT (ms):                           131.23
---------------Inter-token Latency----------------
Mean ITL (ms):                           84.30
Median ITL (ms):                         41.87
P99 ITL (ms):                            89.35
==================================================

# random 2K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  70.99
Total input tokens:                      998175
Total generated tokens:                  50000
Request throughput (req/s):              7.04
Output token throughput (tok/s):         704.28
Peak output token throughput (tok/s):    3496.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          14764.26
---------------Time to First Token----------------
Mean TTFT (ms):                          33245.08
Median TTFT (ms):                        33169.68
P99 TTFT (ms):                           68799.73
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          143.22
Median TPOT (ms):                        146.25
P99 TPOT (ms):                           216.28
---------------Inter-token Latency----------------
Mean ITL (ms):                           140.52
Median ITL (ms):                         45.98
P99 ITL (ms):                            1987.27
==================================================

# random 128 input
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  7.80
Total input tokens:                      127698
Total generated tokens:                  4000
Request throughput (req/s):              128.21
Output token throughput (tok/s):         512.83
Peak output token throughput (tok/s):    3784.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          16884.75
---------------Time to First Token----------------
Mean TTFT (ms):                          4489.43
Median TTFT (ms):                        4057.99
P99 TTFT (ms):                           7239.77
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          927.88
Median TPOT (ms):                        962.87
P99 TPOT (ms):                           1793.61
---------------Inter-token Latency----------------
Mean ITL (ms):                           556.73
Median ITL (ms):                         82.38
P99 ITL (ms):                            5043.60
==================================================