Diffusion Models Benchmark Documentation

Diffusion Models Benchmark Documentation (확산 모델 벤치마크 문서)

sglang.multimodal_gen.benchmarks.bench_serving은 diffusion 모델의 온라인 서빙 처리량과 지연 시간을 벤치마킹하는 명령줄 도구예요. 요청된 작업에서 이미지 또는 비디오 API를 선택하며, 요청 속도·데이터셋 종류·프로파일링을 유연하게 구성할 수 있어요.

출처: 문서

본문

sglang.multimodal_gen.benchmarks.bench_serving은 diffusion 모델의 온라인 서빙 처리량과 지연 시간을 벤치마킹하도록 설계된 명령줄 도구예요. 요청된 작업에서 이미지 또는 비디오 API를 선택하고, 요청 속도·데이터셋 종류·프로파일링을 유연하게 구성할 수 있어요.

1. Quick Start (빠른 시작)

1.1 저동시성 벤치마킹

로컬 서버(포트 30000)에서 vbench 데이터셋으로 비디오/이미지 1개를 생성하는 벤치마크를 실행해요.

# For text to video: such as Wan2.2-T2V-A14B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task text-to-video --num-prompts 1 --max-concurrency 1

# For image to video: such as Wan2.2-I2V-A14B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-video --num-prompts 1 --max-concurrency 1

# For image-text to video: such as Wan2.2-TI2V-5B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-video --num-prompts 1 --max-concurrency 1

# For text to image: such as Qwen-Image
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task text-to-image --num-prompts 1 --max-concurrency 1

# For image-text to image: such as Qwen-Image-Edit
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-image --num-prompts 1 --max-concurrency 1

1.2 고동시성 벤치마킹

로컬 서버(포트 30000)에서 vbench 데이터셋으로 비디오/이미지 20개를 생성하는 벤치마크를 실행해요.

# For text to video: such as Wan2.2-T2V-A14B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task text-to-video --num-prompts 20 --max-concurrency 20

# For image to video: such as Wan2.2-I2V-A14B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-video --num-prompts 20 --max-concurrency 20

# For image-text to video: such as Wan2.2-TI2V-5B-Diffusers
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-video --num-prompts 20 --max-concurrency 20

# For text to image: such as Qwen-Image
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task text-to-image --num-prompts 20 --max-concurrency 20

# For image-text to image: such as Qwen-Image-Edit
python3 -m sglang.multimodal_gen.benchmarks.bench_serving \
    --dataset vbench --task image-to-image --num-prompts 20 --max-concurrency 20

2. Parameter Reference (파라미터 참조)

2.1 Connection Settings

Argument Default Description
--base-url None 서버의 base URL (예: http://localhost:30000). 지정하면 --host--port를 덮어써요.
--host None 서버 호스트 (예: 127.0.0.1).
--port None 서버 포트.
--model None 모델 이름 또는 경로.

2.2 Workload & Task Configuration

Argument Choices Description
--task text-to-video, image-to-video, text-to-image, image-to-image, video-to-video 모델 메타데이터에서 추론할 수 없을 때 생성 작업을 정의.
--dataset vbench, random 프롬프트/입력의 출처.
--dataset-path None (선택) 내장 프리셋을 쓰지 않을 때 로컬 데이터셋 파일 경로.
--num-prompts None 벤치마크 동안 실행할 총 프롬프트/요청 수.

2.3 Generation Parameters

Argument Description
--width 생성될 이미지 또는 비디오의 타겟 너비.
--height 생성될 이미지 또는 비디오의 타겟 높이.
--num-frames 생성할 프레임 수 (비디오 백엔드 한정).
--fps 초당 프레임(FPS) 설정 (비디오 백엔드 한정).

2.4 Concurrency & Load Control

Argument Description
--request-rate 초당 시작 요청 수. inf로 설정하면 모든 요청이 즉시 전송돼요(burst). 숫자로 설정하면 도착 시간이 Poisson 프로세스를 따르게 돼요.
--max-concurrency 동시에 실행할 수 있는 최대 요청 수. 세마포어 또는 업스트림 한도를 시뮬레이션해요. request-rate가 높아도 실제 처리 속도는 이 값으로 제한돼요.

2.5 Logging & Output

Argument Description
--output-file 벤치마크 메트릭을 저장할 경로 (JSON 형식).
--disable-tqdm 설정 시 콘솔 진행률 바를 비활성화.

3. Metrics (메트릭)

  • Request Throughput (req/s), Output Throughput (tok/s)
  • Latency Mean (ms): 스텝당 시간
  • Peak Memory Max (ms): 실행 중 최대 메모리 사용량

더 알아보기 (Learn more)