Ana içeriğe geç

NVIDIA H100 GPU üzerinde GPT-OSS-20B işlem hacmi optimizasyonu

Sonuç

gpt-oss-20b-h100

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

Model sunum komutu
vllm serve openai/gpt-oss-20b --async-scheduling

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: 16701.31
Ortalama TPOT(ms): 91.33
Toplam TPS: 19128.79 (+14.5%)
Ortalama TPOT(ms): 86.81
Kısa istem Toplam TPS: 28032.23
Ortalama TPOT(ms): 178.91
Toplam TPS: 32611.91 (+16.3%)
Ortalama TPOT(ms): 75.14
Orta uzunlukta istem Toplam TPS: 32113.65
Ortalama TPOT(ms): 149.76
Toplam TPS: 33149.54 (+3.2%)
Ortalama TPOT(ms): 146.63
Uzun istem Toplam TPS: 33236.17
Ortalama TPOT(ms): 184.26
Toplam TPS: 33823.34 (+1.8%)
Ortalama TPOT(ms): 182.69
Çok uzun istem Toplam TPS: 29730.30
Ortalama TPOT(ms): 239.44
Toplam TPS: 29718.21 (-0.0%)
Ortalama TPOT(ms): 239.49

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.

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

GPT-OSS-20B

Donanım

Tek NVIDIA H100 SXM GPU.

Motor sürümü

  • vLLM: v0.11.0
  • SGLang: v0.5.4.post2
  • 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 openai/gpt-oss-20b --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 openai/gpt-oss-20b --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 openai/gpt-oss-20b
Benchmark sonucu
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  24.81
Total input tokens:                      215312
Total generated tokens:                  193979
Request throughput (req/s):              40.30
Output token throughput (tok/s):         7817.03
Peak output token throughput (tok/s):    15953.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          16493.75
---------------Time to First Token----------------
Mean TTFT (ms):                          4881.62
Median TTFT (ms):                        4791.97
P99 TTFT (ms):                           8166.01
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          91.00
Median TPOT (ms):                        55.52
P99 TPOT (ms):                           237.48
---------------Inter-token Latency----------------
Mean ITL (ms):                           44.98
Median ITL (ms):                         31.92
P99 ITL (ms):                            248.25
==================================================

SGLang

Model sunum betiği
python3 -m sglang.launch_server --model-path openai/gpt-oss-20b
Benchmark sonucu
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  73.05
Total input tokens:                      215312
Total generated tokens:                  195734
Request throughput (req/s):              13.69
Output token throughput (tok/s):         2679.49
Peak output token throughput (tok/s):    13804.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          5626.99
---------------Time to First Token----------------
Mean TTFT (ms):                          10412.75
Median TTFT (ms):                        10326.68
P99 TTFT (ms):                           11920.92
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          314.53
Median TPOT (ms):                        215.95
P99 TPOT (ms):                           1052.78
---------------Inter-token Latency----------------
Mean ITL (ms):                           161.29
Median ITL (ms):                         47.78
P99 ITL (ms):                            1929.13
==================================================

TensorRT-LLM

Model sunum betiği
trtllm-serve openai/gpt-oss-20b
Benchmark sonucu
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  53.03
Total input tokens:                      215312
Total generated tokens:                  191726
Request throughput (req/s):              18.86
Output token throughput (tok/s):         3615.45
Peak output token throughput (tok/s):    18641.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          7675.67
---------------Time to First Token----------------
Mean TTFT (ms):                          12248.87
Median TTFT (ms):                        12024.20
P99 TTFT (ms):                           22142.67
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          224.49
Median TPOT (ms):                        134.32
P99 TPOT (ms):                           552.52
---------------Inter-token Latency----------------
Mean ITL (ms):                           51.52
Median ITL (ms):                         0.07
P99 ITL (ms):                            963.17
==================================================

Sonuç: vLLM (16493.75 tok/s) > TensorRT-LLM (7675.67 tok/s) > SGLang(5626.99 tok/s)

2. vLLM için Asenkron zamanlama

Model sunum betiği
vllm serve openai/gpt-oss-20b --async-scheduling
Benchmark sonucu
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  21.39
Total input tokens:                      215312
Total generated tokens:                  193919
Request throughput (req/s):              46.74
Output token throughput (tok/s):         9064.40
Peak output token throughput (tok/s):    22786.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          19128.79
---------------Time to First Token----------------
Mean TTFT (ms):                          4933.91
Median TTFT (ms):                        4761.74
P99 TTFT (ms):                           8029.82
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          86.81
Median TPOT (ms):                        52.23
P99 TPOT (ms):                           222.47
---------------Inter-token Latency----------------
Mean ITL (ms):                           38.92
Median ITL (ms):                         27.02
P99 ITL (ms):                            236.29
==================================================

5. vLLM için Toplu işteki token sayısını ayarlama

Model sunum betiği
vllm serve openai/gpt-oss-120b --async-scheduling --max-num-batched-tokens 16384
Benchmark sonucu
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  21.56
Total input tokens:                      215312
Total generated tokens:                  194591
Request throughput (req/s):              46.39
Output token throughput (tok/s):         9027.14
Peak output token throughput (tok/s):    21433.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          19015.54
---------------Time to First Token----------------
Mean TTFT (ms):                          4957.11
Median TTFT (ms):                        4698.76
P99 TTFT (ms):                           7875.07
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          104.05
Median TPOT (ms):                        46.28
P99 TPOT (ms):                           443.08
---------------Inter-token Latency----------------
Mean ITL (ms):                           38.42
Median ITL (ms):                         24.01
P99 ITL (ms):                            448.17
==================================================

Optimizasyon seçeneklerinin özeti

Optimizasyon seçeneği İşlem hacmi iyileşmesi
Motor seçimi -
Asenkron zamanlama +16.0%
Toplu işteki token'lar -

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 openai/gpt-oss-20b
Temel benchmark sonuçları
# random 32K input
============ Serving Benchmark Result ============
Successful requests:                     100
Benchmark duration (s):                  107.95
Total input tokens:                      3200000
Total generated tokens:                  9350
Request throughput (req/s):              0.93
Output token throughput (tok/s):         86.62
Total Token throughput (tok/s):          29730.30
---------------Time to First Token----------------
Mean TTFT (ms):                          53687.69
Median TTFT (ms):                        53539.25
P99 TTFT (ms):                           105655.63
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          239.44
Median TPOT (ms):                        273.86
P99 TPOT (ms):                           275.66
---------------Inter-token Latency----------------
Mean ITL (ms):                           247.74
Median ITL (ms):                         266.37
P99 ITL (ms):                            513.87
==================================================

# random 4K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  61.73
Total input tokens:                      1999249
Total generated tokens:                  52309
Request throughput (req/s):              8.10
Output token throughput (tok/s):         847.43
Total Token throughput (tok/s):          33236.17
---------------Time to First Token----------------
Mean TTFT (ms):                          31245.12
Median TTFT (ms):                        30820.97
P99 TTFT (ms):                           58702.17
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          184.26
Median TPOT (ms):                        225.55
P99 TPOT (ms):                           230.22
---------------Inter-token Latency----------------
Mean ITL (ms):                           192.92
Median ITL (ms):                         227.42
P99 ITL (ms):                            458.94
==================================================

# random 2K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  32.58
Total input tokens:                      999120
Total generated tokens:                  47022
Request throughput (req/s):              15.35
Output token throughput (tok/s):         1443.44
Total Token throughput (tok/s):          32113.65
---------------Time to First Token----------------
Mean TTFT (ms):                          16515.86
Median TTFT (ms):                        16363.96
P99 TTFT (ms):                           30359.34
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          149.76
Median TPOT (ms):                        159.20
P99 TPOT (ms):                           225.79
---------------Inter-token Latency----------------
Mean ITL (ms):                           159.21
Median ITL (ms):                         220.69
P99 ITL (ms):                            450.04
==================================================

# random 128 input
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  4.70
Total input tokens:                      127755
Total generated tokens:                  4000
Request throughput (req/s):              212.76
Output token throughput (tok/s):         851.04
Total Token throughput (tok/s):          28032.23
---------------Time to First Token----------------
Mean TTFT (ms):                          3174.14
Median TTFT (ms):                        2892.24
P99 TTFT (ms):                           4415.25
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          178.91
Median TPOT (ms):                        208.03
P99 TPOT (ms):                           246.08
---------------Inter-token Latency----------------
Mean ITL (ms):                           274.82
Median ITL (ms):                         228.45
P99 ITL (ms):                            509.42
==================================================
Optimize edilmiş model sunum betiği
vllm serve openai/gpt-oss-20b --async-scheduling
Optimize edilmiş benchmark sonuçları
# random 32K input
============ Serving Benchmark Result ============
Successful requests:                     100
Benchmark duration (s):                  107.99
Total input tokens:                      3200000
Total generated tokens:                  9404
Request throughput (req/s):              0.93
Output token throughput (tok/s):         87.08
Peak output token throughput (tok/s):    1196.00
Peak concurrent requests:                100.00
Total Token throughput (tok/s):          29718.21
---------------Time to First Token----------------
Mean TTFT (ms):                          53565.41
Median TTFT (ms):                        53436.03
P99 TTFT (ms):                           105793.87
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          239.49
Median TPOT (ms):                        275.30
P99 TPOT (ms):                           276.86
---------------Inter-token Latency----------------
Mean ITL (ms):                           247.68
Median ITL (ms):                         269.91
P99 ITL (ms):                            515.55
==================================================

# random 4K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  60.67
Total input tokens:                      1999249
Total generated tokens:                  52966
Request throughput (req/s):              8.24
Output token throughput (tok/s):         872.95
Peak output token throughput (tok/s):    7931.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          33823.34
---------------Time to First Token----------------
Mean TTFT (ms):                          30513.46
Median TTFT (ms):                        30091.29
P99 TTFT (ms):                           58206.28
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          182.69
Median TPOT (ms):                        224.54
P99 TPOT (ms):                           229.32
---------------Inter-token Latency----------------
Mean ITL (ms):                           191.65
Median ITL (ms):                         226.01
P99 ITL (ms):                            458.93
==================================================

# random 2K input
============ Serving Benchmark Result ============
Successful requests:                     500
Benchmark duration (s):                  31.55
Total input tokens:                      999120
Total generated tokens:                  46814
Request throughput (req/s):              15.85
Output token throughput (tok/s):         1483.71
Peak output token throughput (tok/s):    12476.00
Peak concurrent requests:                500.00
Total Token throughput (tok/s):          33149.54
---------------Time to First Token----------------
Mean TTFT (ms):                          16044.42
Median TTFT (ms):                        16014.33
P99 TTFT (ms):                           29736.08
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          146.63
Median TPOT (ms):                        154.39
P99 TPOT (ms):                           223.69
---------------Inter-token Latency----------------
Mean ITL (ms):                           155.89
Median ITL (ms):                         216.15
P99 ITL (ms):                            447.46
==================================================

# random 128 input
============ Serving Benchmark Result ============
Successful requests:                     1000
Benchmark duration (s):                  4.04
Total input tokens:                      127755
Total generated tokens:                  4000
Request throughput (req/s):              247.52
Output token throughput (tok/s):         990.08
Peak output token throughput (tok/s):    1364.00
Peak concurrent requests:                1000.00
Total Token throughput (tok/s):          32611.91
---------------Time to First Token----------------
Mean TTFT (ms):                          2884.78
Median TTFT (ms):                        2641.45
P99 TTFT (ms):                           3879.45
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          75.14
Median TPOT (ms):                        16.98
P99 TPOT (ms):                           221.60
---------------Inter-token Latency----------------
Mean ITL (ms):                           156.10
Median ITL (ms):                         151.36
P99 ITL (ms):                            452.14
==================================================