Back to Sglang

README

benchmark/benchmark_vllm_060/README.md

0.5.115.0 KB
Original Source

How to reproduce the benchmark results for SGLang v0.3.0 compared to vLLM v0.6.0

In short, with multi step enabled, in online scenarios that we benchmarked, the Median TTFT of vLLM is 3 times that of SGLang, and the Median ITL is 10 times that of SGLang. Lower Median TTFT and ITL are better. vLLM's multi-step optimization did not improve throughput while ensuring lower Median TTFT and ITL. Also, under maximum throughput benchmark, if vLLM does not set gpu util to 0.95 separately and uses the default configuration instead, its maximum throughput is lower than that of SGLang.

Online benchmark results

Llama 3.1 8B Instruct 1 x A100 80G

RPSNum promptsEngineMedian E2E LatencyMedian TTFTMedian TPOTMedian ITL
41200SGLang1564.1731.9813.1711.93
41200vLLM1691.97100.4814.14129.32
82400SGLang2175.0235.6817.8514.41
82400vLLM2137.16120.3917.09158.63

Llama 3.1 70B Insruct 4 x H100 80G

RPSNum PromptsEngineMedian E2E LatencyMedian TTFTMedian TPOTMedian ITL
41200SGLang3005.2453.9425.0321.67
41200vLLM2915.60179.1523.58231.23
82400SGLang4064.9858.1133.0724.45
82400vLLM3752.38207.1229.15275.32

Offline benchmark results

Llama 3.1 8B Instruct 1 x A100 80G

RPSNum PromptsEngineRequest throughputOutput token throughput
inf5000SGLang22.034281.51
inf5000vLLM21.274132.37

Llama 3.1 70B Insruct 4 x H100 80G

RPSNum PromptsEngineRequest throughputOutput token throughput
inf5000SGLang19.843856.01
inf5000vLLM19.043700.64

Installation

bash
# install sglang v0.3.0
pip install --upgrade pip
pip install "sglang[all]"==0.3.0
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/

# install vllm v0.6.0
pip install vllm==0.6.0

Notes

We referred to the reproduction method in https://github.com/vllm-project/vllm/issues/8176, and added the --num-scheduler-steps 10 parameter when starting the vLLM server. The gpu_memory_utilization of vLLM is by default 0.9 at both TP 1 and TP 4, while SGLang's mem_frac is 0.88 at TP 1 and 0.85 at TP 4, so we manually set it to 0.88 at TP 4.

Online benchmarks

bash
# Llama 3.1 8B Instruct on 1 x A100
python -m sglang.launch_server --model-path meta-llama/Llama-3.1-8B-Instruct --enable-torch-compile --disable-radix-cache
python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-8B-Instruct --disable-log-requests --num-scheduler-steps 10 --max_model_len 4096

# Llama 3.1 70B Instruct on 4 x H100
python -m sglang.launch_server --model-path meta-llama/Llama-3.1-70B-Instruct --disable-radix-cache --tp 4
python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-70B-Instruct --disable-log-requests --num-scheduler-steps 10 --tensor 4 --max_model_len 4096

# bench serving
python3 -m sglang.bench_serving --backend sglang --dataset-name sharegpt --num-prompts 1200 --request-rate 4
python3 -m sglang.bench_serving --backend sglang --dataset-name sharegpt --num-prompts 2400 --request-rate 8
python3 -m sglang.bench_serving --backend vllm --dataset-name sharegpt --num-prompts 1200 --request-rate 4
python3 -m sglang.bench_serving --backend vllm --dataset-name sharegpt --num-prompts 2400 --request-rate 8

Offline benchmarks

bash
# Llama 3.1 8B Instruct on 1 x A100
python -m sglang.launch_server --model-path meta-llama/Llama-3.1-8B-Instruct --enable-torch-compile --disable-radix-cache
python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-8B-Instruct --disable-log-requests --num-scheduler-steps 10 --max_model_len 4096

# Llama 3.1 70B Instruct on 4 x H100
python -m sglang.launch_server --model-path meta-llama/Llama-3.1-70B-Instruct --disable-radix-cache --tp 4 --mem-frac 0.88
python -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-3.1-70B-Instruct --disable-log-requests --num-scheduler-steps 10 --tensor 4 --max_model_len 4096

# bench serving
python3 -m sglang.bench_serving --backend sglang --dataset-name sharegpt --num-prompts 5000
python3 -m sglang.bench_serving --backend vllm --dataset-name sharegpt --num-prompts 5000