Ana içeriğe geç

NVIDIA H100 GPU üzerinde Qwen3-14B işlem hacmi optimizasyonu

Sonuç

qwen3-14b-h100

H100 GPU üzerinde Qwen3-14B işlem hacmini optimize etmek için önerilen yapılandırma:

Model sunum komutu
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8

Optimizasyon öncesi ve sonrası benchmark sonuçlarının karşılaştırması:

Benchmark senaryosu temel yapılandırma (optimizasyonsuz vLLM) Optimize edilmiş
ShareGPT Toplam TPS: 6595.66
Ortalama TPOT(ms): 226.03
Toplam TPS: 10426.27 (+58.1%)
Ortalama TPOT(ms): 251.67
Kısa istem Toplam TPS: 5796.73
Ortalama TPOT(ms): 525.31
Toplam TPS: 16884.75 (+191.3%)
Ortalama TPOT(ms): 927.88
Orta uzunlukta istem Toplam TPS: 10597.19
Ortalama TPOT(ms): 206.51
Toplam TPS: 14764.26 (+39.3%)
Ortalama TPOT(ms): 143.22
Uzun istem Toplam TPS: 9218.03
Ortalama TPOT(ms): 132.45
Toplam TPS: 12257.62 (+33.0%)
Ortalama TPOT(ms): 84.93
Çok uzun istem Toplam TPS: 8298.56
Ortalama TPOT(ms): 277.44
Toplam TPS: 10014.29 (+20.7%)
Ortalama TPOT(ms): 215.93

Not

  1. Benchmark testlerimiz olası tüm optimizasyon birleşimlerini kapsamaz. Örneğin, varsayılan yapılandırmasında en iyi performansı gösteren çıkarım motorunu sonraki ayarlamalar için başlangıç noktası olarak seçeriz. Bu eleme yaklaşımı yerel bir optimum verir; bu, genel optimum olmayabilir.
  2. En büyük toplu iş boyutu, zamanlama yapılandırması, genişletilmiş KV önbelleği, CUDA graph, Torch Compile gibi belirli kullanım senaryolarına bağlı başka optimizasyonlar da vardır. Bu belgedeki sonuçlar, daha hedefli optimizasyonlar için başlangıç noktası olabilir.
  3. Testler belirli donanım ve yazılım yapılandırmalarında yürütülmüştür. Çıkarım motorlarındaki gelişmeler sonuçları değiştirebilir.
  4. Nicemleme doğruluğu etkileyebilir; ancak FP8 nicemleme çoğu modelde %1'den az doğruluk kaybı sağlayabilir. Ayrıntılar için değerlendirme sonuçlarına bakın. Bu nedenle yüksek işlem hacimli sunum senaryolarında FP8 nicemleme önemle önerilir.

Eksik noktalar veya yeni değişiklikleri yansıtacak güncellemeler varsa bize bildirin.

Optimizasyon hedefi

Yüksek eş zamanlı isteklerde yüksek işlem hacmi sağlar.

Deney kurulumu

Model

Qwen3-14B

Donanım

Tek NVIDIA H100 SXM GPU.

Motor sürümü

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

Benchmark veri kümesi

  1. ShareGPT
  2. Farklı dizi uzunluklarına sahip rastgele veri kümesi:
    • Çok uzun istem: 32000 giriş token'ı, 100 çıkış token'ı
    • Uzun istem: 4000 giriş token'ı, 200 çıkış token'ı
    • Orta uzunlukta istem: 2000 giriş token'ı, 100 çıkış token'ı
    • Kısa istem: 128 giriş token'ı, 4 çıkış token'ı

Benchmark betiği

Model performansını ölçmek için vLLM bench CLI aracını kullanıyoruz. Benchmark şu komutla çalıştırılır:

1
2
3
4
5
6
7
8
# 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

Deney sonuçları

1. Çıkarım motoru seçimi

vLLM

Model sunum betiği
vllm serve Qwen/Qwen3-14B
Benchmark sonucu
============ 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

Model sunum betiği
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B
Benchmark sonucu
============ 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

Model sunum betiği
trtllm-serve Qwen/Qwen3-14B
Benchmark sonucu
============ 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
==================================================

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

2. SGLang için Quantization

FP8

Model sunum betiği
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8
Benchmark sonucu
============ 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. SGLang için Dikkat arka uçları

Model sunum betiği
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8 --attention-backend=fa3
Benchmark sonucu
# 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
==================================================

Optimizasyon seçeneklerinin özeti

Optimizasyon seçeneği İşlem hacmi iyileşmesi
Motor seçimi +27.7%
Quantization +23.8%
Dikkat arka ucu -

Diğer benchmark senaryoları

Optimize edilmiş yapılandırmanın farklı iş yüklerine genellenebilirliğini değerlendirmek için ek benchmark testleri yaptık.

Temel model sunum betiği
vllm serve Qwen/Qwen3-14B
Temel benchmark sonuçları
# 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
==================================================
Optimize edilmiş model sunum betiği
python3 -m sglang.launch_server --model-path Qwen/Qwen3-14B-FP8
Optimize edilmiş benchmark sonuçları
# 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
==================================================