跳到正文
DEV Community· GyeongSeon·· 43 分鐘前AI 評分51

vllm bench serve 如何比較 graph、node 與基準線的服務開銷

vllm bench serve

AI 導讀

這份操作流程使用 `vllm bench serve` 和 Qwen/Qwen3-32B-FP8,分別比較 graph、node 與基準線的固定並發開銷,以及固定請求率下的運行影響。

正文

GyeongSeon

0. 워밍업 (모든 조건 공통, 서버 Pod 기동 직후 1회)

vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 7 \
  --request-rate inf \
  --max-concurrency 8 \
  --num-prompts 20

워밍업에는 --profile과 --save-result를 넣지 않습니다. 측정 결과에도 포함하지 않습니다.

1. 유형 A: 오버헤드 크기 측정 (concurrency 고정)

아래는 graph / node 조건용(--profile 포함)입니다. node 조건에서 실행할 때는 파일명의 graph_를 node_로 바꾸세요.

A-1. concurrency 1

for RUN in 1 2 3; do
vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 42 \
  --request-rate inf \
  --max-concurrency 1 \
  --num-prompts 10 \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,99 \
  --profile \
  --save-result --result-dir /data/bench \
  --result-filename graph_A_c1_r${RUN}.json
done

A-2. concurrency 8

for RUN in 1 2 3; do
vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 42 \
  --request-rate inf \
  --max-concurrency 8 \
  --num-prompts 32 \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,99 \
  --profile \
  --save-result --result-dir /data/bench \
  --result-filename graph_A_c8_r${RUN}.json
done

A-3. concurrency 64

for RUN in 1 2 3; do
vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 42 \
  --request-rate inf \
  --max-concurrency 64 \
  --num-prompts 256 \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,99 \
  --profile \
  --save-result --result-dir /data/bench \
  --result-filename graph_A_c64_r${RUN}.json
done

A-4. concurrency 128

for RUN in 1 2 3; do
vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 42 \
  --request-rate inf \
  --max-concurrency 128 \
  --num-prompts 512 \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,99 \
  --profile \
  --save-result --result-dir /data/bench \
  --result-filename graph_A_c128_r${RUN}.json
done

기준선 조건에서는 위 A-1~A-4와 똑같이 실행하되 두 가지만 바꿉니다.

  • --profile 줄을 삭제합니다.
  • 파일명을 baseline_A_c{N}_r${RUN}.json으로 바꿉니다.

2. 유형 B: 운영 영향 측정 (request-rate 고정)

--request-rate 3.4는 자리표시입니다. 기준선 A-4 결과의 Request throughput (req/s) × 0.85로 바꾸세요. 세 조건 모두 같은 값을 써야 합니다.

graph / node 조건용

for RUN in 1 2 3; do
vllm bench serve \
  --base-url http://vllm-svc:8000 \
  --model Qwen/Qwen3-32B-FP8 \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 1024 \
  --random-range-ratio 0 \
  --ignore-eos \
  --seed 42 \
  --request-rate 3.4 \
  --max-concurrency 256 \
  --num-prompts 600 \
  --percentile-metrics ttft,tpot,itl,e2el \
  --metric-percentiles 50,99 \
  --profile \
  --save-result --result-dir /data/bench \
  --result-filename graph_B_r${RUN}.json
done

기준선 조건에서는 --profile을 빼고 파일명을 baseline_B_r${RUN}.json으로 바꿉니다.

--max-concurrency 256은 서버의 --max-num-seqs와 같게 맞춰야 합니다. 앞서 말씀드린 대로 KV 로그를 보고 200 정도로 낮췄다면 여기도 200으로 바꾸세요.

확인할 점

  • 모델 이름: --model은 요청의 모델명과 토크나이저 로딩에 함께 쓰입니다. 서버를 --served-model-name으로 다른 이름으로 띄웠다면, 벤치 명령에도 --served-model-name <그 이름>을 추가해야 합니다.
  • 조건별 Pod 구성: 한 Pod에서는 한 조건(graph 또는 node)의 한 concurrency 구간만 실행합니다. 3회 측정 후 vLLM을 정상 종료해야 nsys 리포트가 저장됩니다. 기준선은 리포트가 없으므로 한 Pod에서 A-1~A-4와 유형 B를 이어서 실행해도 됩니다.
  • 실행 순서: 기준선 A-4를 먼저 돌려야 유형 B의 rate를 정할 수 있습니다.

來源:DEV Community · dev.to