Ascend NPU 성능 테스트

Ascend NPU 성능 테스트 (Performance Testing)

이 페이지는 Ascend NPU에서 SGLang 배포의 성능을 테스트하는 방법을 차근차근 안내해요. 텍스트 생성(Qwen/Qwen2.5-7B-Instruct), 멀티모달 비전(Qwen/Qwen2.5-VL-7B-Instruct), 임베딩(Qwen/Qwen3-Embedding-8B) 세 가지 모델 유형을 온라인과 오프라인 서빙 모드 모두에서 다룬답니다. Evalscope, AISBench, 또는 SGLang에 내장된 벤치마킹 도구를 사용하면 돼요.

이 가이드의 벤치마크 출력 예시는 이해를 돕기 위한 참고용일 뿐이에요. 실제 성능은 하드웨어(예: Ascend A2 시리즈 vs Ascend A3 시리즈), 모델 버전, SGLang 버전, 배포 구성에 따라 달라져요. 정확한 성능 데이터는 항상 여러분의 하드웨어에서 직접 벤치마크를 돌려서 얻어야 해요.

출처: 문서

본문

1. 준비 (Prepare)

1.1 SGLang 서버 시작하기

각 모델 유형에 맞는 플래그로 서버를 실행하세요. 먼저 SGLang이 설치되어 있어야 해요 — 환경 설정은 Ascend NPU 퀵스타트를 참고하세요.

```shell Command theme={null} # The model will be automatically downloaded by sglang or set --model-path to the local path if the model is already downloaded. sglang serve --model-path Qwen/Qwen2.5-7B-Instruct ``` ```shell Command theme={null} # The model will be automatically downloaded by sglang or set --model-path to the local path if the model is already downloaded. sglang serve --model-path Qwen/Qwen2.5-VL-7B-Instruct --mm-attention-backend ascend_attn ``` ```shell Command theme={null} # The model will be automatically downloaded by sglang or set --model-path to the local path if the model is already downloaded. sglang serve --model-path Qwen/Qwen3-Embedding-8B --is-embedding ```

명령어 끝에 &를 붙이면 서버를 백그라운드로 실행할 수 있어요. 또는 새 터미널을 열어 다음 섹션의 벤치마크 명령어를 실행해도 됩니다.

서버는 기본적으로 http://127.0.0.1:30000에 바인딩돼요. 아래의 모든 온라인 벤치마크는 서버가 그 주소에서 실행 중이라고 가정합니다. 임베딩 모델에는 --is-embedding 플래그가 반드시 필요해요.

1.2 벤치마킹 도구 설치하기

bench_servingbench_offline_throughput은 SGLang에 내장되어 있어서 추가 설치가 필요 없어요. Evalscope와 AISBench는 각각 별도의 가상 환경에 설정하면 돼요.

```shell Command theme={null} python3 -m venv .evalscope_venv source .evalscope_venv/bin/activate pip install evalscope[perf] -U ``` ```shell Command theme={null} python3 -m venv .aisbench_venv source .aisbench_venv/bin/activate
git clone https://github.com/AISBench/benchmark.git
cd benchmark/
pip3 install -e ./ --use-pep517

pip3 install -r requirements/api.txt
pip3 install -r requirements/extra.txt
```

`ais_bench -h`를 실행해 설치를 확인하세요.

<Note>AISBench는 Python 3.10-3.12가 필요해요. 설치 후 모든 AISBench 명령어는 `benchmark/` 디렉토리(클론한 저장소 루트)에서 실행해야 해요. 정확한 결과를 위해 모델 config에서 `stream=True`와 `ignore_eos=True`를 설정하세요.</Note>

2. 온라인 서비스: 텍스트 생성 모델

온라인 서빙 엔드포인트로 Qwen/Qwen2.5-7B-Instruct를 테스트해요.

이 섹션의 어떤 벤치마크를 실행하기 전에, SGLang 텍스트 생성 서버가 http://127.0.0.1:30000에서 실행 중인지 확인하세요. 실행 명령은 SGLang 서버 시작하기를 참고하세요.

성능 테스트에는 실제 데이터셋보다 랜덤 데이터셋(--dataset random, --dataset-name random)을 권장해요. 랜덤 데이터셋은 --min-prompt-length / --max-prompt-length--min-tokens / --max-tokens를 고정값으로 지정할 수 있어서 일관되고 반복 가능한 결과를 만들어내요. 실제 데이터셋(ShareGPT, openqa 등)은 입력 길이가 제각각이라 노이즈가 생기고 실행 간 비교가 불안정해져요.

2.1 Evalscope 사용하기

전제 조건: Evalscope 설치 후 가상 환경 활성화(source .evalscope_venv/bin/activate). SGLang 서버가 http://127.0.0.1:30000에서 실행 중.

서버에 대해 성능 테스트를 실행하는 명령어는 다음과 같아요:

evalscope perf \
  --parallel 10 \
  --number 20 \
  --model Qwen/Qwen2.5-7B-Instruct \
  --url http://127.0.0.1:30000/v1/chat/completions \
  --api openai \
  --dataset random \
  --max-tokens 1024 \
  --min-tokens 1024 \
  --prefix-length 0 \
  --min-prompt-length 1024 \
  --max-prompt-length 1024 \
  --tokenizer-path Qwen/Qwen2.5-7B-Instruct \
  --extra-args '{"ignore_eos": true}'

모델이 이미 다운로드되어 있다면, --tokenizer-path를 모델 id 대신 로컬 모델 경로로 지정할 수 있어요.

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

Benchmarking summary:
┌────────────────────────────┬─────────────┐
│ Metric                     │       Value │
├────────────────────────────┼─────────────┤
│ ── General ──              │             │
│ Test Duration (s)          │       89.34 │
│ Concurrency                │          10 │
│ Request Rate (req/s)       │       -1.00 │
│ Total / Success / Failed   │ 20 / 20 / 0 │
│ Req Throughput (req/s)     │        0.22 │
│ ── Latency ──              │             │
│ Avg Latency (s)            │       44.67 │
│ TTFT (ms)                  │      578.51 │
│ TPOT (ms)                  │       43.10 │
│ ITL (ms)                   │       43.12 │
│ ── Tokens ──               │             │
│ Avg Input Tokens           │     1024.00 │
│ Avg Output Tokens          │     1024.00 │
│ Output Throughput (tok/s)  │      229.24 │
│ Total Throughput (tok/s)   │      458.49 │
│ ── Speculative Decoding ── │             │
│ Decoded Tok/Iter           │        1.00 │
│ Spec. Accept Rate          │        0.00 │
└────────────────────────────┴─────────────┘

Percentile results:
┌────────────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│ Metric         │      1% │      5% │     10% │     25% │     50% │     75% │     90% │     95% │     99% │
├────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ Latency (s)    │   44.47 │   44.47 │   44.47 │   44.47 │   44.86 │   44.86 │   44.86 │   44.86 │   44.86 │
│ TTFT (ms)      │  138.12 │  142.07 │  426.17 │  426.87 │  783.67 │  785.26 │  786.85 │  787.97 │  787.97 │
│ ITL (ms)       │   41.84 │   42.14 │   42.22 │   42.36 │   42.57 │   42.80 │   42.99 │   49.24 │   49.84 │
│ TPOT (ms)      │   42.71 │   42.71 │   42.71 │   43.05 │   43.08 │   43.43 │   43.43 │   43.71 │   43.71 │
│ Input tokens   │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │
│ Output tokens  │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │ 1024.00 │
│ Output (tok/s) │   22.83 │   22.83 │   22.83 │   22.83 │   23.02 │   23.03 │   23.03 │   23.03 │   23.03 │
│ Total (tok/s)  │   45.65 │   45.65 │   45.65 │   45.65 │   46.05 │   46.05 │   46.05 │   46.05 │   46.05 │
│ Decode (tok/s) │   22.88 │   23.03 │   23.03 │   23.07 │   23.21 │   23.42 │   23.42 │   23.42 │   23.42 │
└────────────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘
...

자세한 내용은 Evalscope 성능 테스트 가이드를 참고하세요.

2.2 AISBench 사용하기

전제 조건: AISBench 설치 후 가상 환경 활성화(source .aisbench_venv/bin/activate). 모든 명령어는 benchmark/ 디렉토리에서 실행해야 해요. SGLang 서버가 http://127.0.0.1:30000에서 실행 중. 정확한 결과를 위해 모델 config에서 stream=Trueignore_eos=True를 설정하세요.

성능 테스트를 위해 두 개의 파일을 설정해야 해요.

먼저 ais_bench/benchmark/configs/models/vllm_api/vllm_api_stream_chat.py에서 모델과 서버 설정을 설명하세요:

# more details: https://ais-bench-benchmark.readthedocs.io/en/latest/base_tutorials/scenes_intro/performance_benchmark.html
from ais_bench.benchmark.models import VLLMCustomAPIChat
from ais_bench.benchmark.utils.postprocess.model_postprocessors import extract_non_reasoning_content

models = [
    dict(
        attr="service",
        type=VLLMCustomAPIChat,
        abbr="vllm-api-stream-chat",
        path="Qwen/Qwen2.5-7B-Instruct",
        model="Qwen/Qwen2.5-7B-Instruct",
        stream=True,
        request_rate=0,
        use_timestamp=False,
        retry=2,
        api_key="",
        host_ip="127.0.0.1",
        host_port=30000,
        url="",
        max_out_len=512,
        batch_size=32,
        trust_remote_code=False,
        generation_kwargs=dict(
            temperature=0.01,
            ignore_eos=True,
        ),
        pred_postprocessor=dict(type=extract_non_reasoning_content),
    )
]

모델이 이미 다운로드되어 있다면 path를 모델 id 대신 로컬 모델 경로로 지정하세요.

둘째, ais_bench/datasets/synthetic/synthetic_config.py에서 랜덤 프롬프트 길이를 설정하세요:

# more details: https://ais-bench-benchmark.readthedocs.io/en/latest/advanced_tutorials/synthetic_dataset.html
synthetic_config = {
    "Type":"tokenid",
    "RequestCount": 10,
    "TrustRemoteCode": False,
    "StringConfig" : {
        "Input" : {
            "Method": "uniform",
            "Params": {"MinValue": 1, "MaxValue": 200}
        },
        "Output" : {
            "Method": "gaussian",
            "Params": {"Mean": 100, "Var": 200, "MinValue": 1, "MaxValue": 100}
        }
    },
    "TokenIdConfig" : {
        "RequestSize": 10,
        "PrefixLen": 0
    }
}

합성 데이터셋으로 실행하세요:

ais_bench --models vllm_api_stream_chat --datasets synthetic_gen_string -m perf

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

╒══════════════════════════╤═════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤═════╕
│ Performance Parameters   │ Stage   │ Average         │ Min             │ Max             │ Median          │ P75             │ P90             │ P99             │  N  │
╞══════════════════════════╪═════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪═════╡
│ E2EL                     │ total   │ 3896.4 ms       │ 3081.6 ms       │ 4175.3 ms       │ 4013.8 ms       │ 4123.4 ms       │ 4137.1 ms       │ 4171.5 ms       │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ TTFT                     │ total   │ 411.6 ms        │ 346.7 ms        │ 439.7 ms        │ 416.3 ms        │ 426.6 ms        │ 434.4 ms        │ 439.2 ms        │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ TPOT                     │ total   │ 38.3 ms         │ 37.4 ms         │ 39.0 ms         │ 38.3 ms         │ 38.7 ms         │ 38.9 ms         │ 39.0 ms         │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ ITL                      │ total   │ 38.7 ms         │ 0.0 ms          │ 156.5 ms        │ 38.9 ms         │ 39.0 ms         │ 39.2 ms         │ 117.1 ms        │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ InputTokens              │ total   │ 123.4           │ 34.0            │ 228.0           │ 130.5           │ 170.5           │ 217.2           │ 226.92          │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ OutputTokens             │ total   │ 92.1            │ 69.0            │ 100.0           │ 95.0            │ 99.75           │ 100.0           │ 100.0           │ 10  │
├──────────────────────────┼─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────┤
│ OutputTokenThroughput    │ total   │ 23.5937 token/s │ 22.3912 token/s │ 24.2616 token/s │ 23.7399 token/s │ 23.9919 token/s │ 24.2027 token/s │ 24.2557 token/s │ 10  │
╘══════════════════════════╧═════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧═════╛
╒══════════════════════════╤═════════╤══════════════════╕
│ Common Metric            │ Stage   │ Value            │
╞══════════════════════════╪═════════╪══════════════════╡
│ Benchmark Duration       │ total   │ 4175.4485 ms     │
├──────────────────────────┼─────────┼──────────────────┤
│ Total Requests           │ total   │ 10               │
├──────────────────────────┼─────────┼──────────────────┤
│ Failed Requests          │ total   │ 0                │
├──────────────────────────┼─────────┼──────────────────┤
│ Success Requests         │ total   │ 10               │
├──────────────────────────┼─────────┼──────────────────┤
│ Concurrency              │ total   │ 9.3317           │
├──────────────────────────┼─────────┼──────────────────┤
│ Max Concurrency          │ total   │ 32               │
├──────────────────────────┼─────────┼──────────────────┤
│ Request Throughput       │ total   │ 2.395 req/s      │
├──────────────────────────┼─────────┼──────────────────┤
│ Total Input Tokens       │ total   │ 1234             │
├──────────────────────────┼─────────┼──────────────────┤
│ Prefill Token Throughput │ total   │ 299.8329 token/s │
├──────────────────────────┼─────────┼──────────────────┤
│ Total Generated Tokens   │ total   │ 921              │
├──────────────────────────┼─────────┼──────────────────┤
│ Input Token Throughput   │ total   │ 295.5371 token/s │
├──────────────────────────┼─────────┼──────────────────┤
│ Output Token Throughput  │ total   │ 220.5751 token/s │
├──────────────────────────┼─────────┼──────────────────┤
│ Total Token Throughput   │ total   │ 516.1122 token/s │
╘══════════════════════════╧═════════╧══════════════════╛

자세한 내용은 AISBench 문서를 참고하세요.

2.3 bench_serving 사용하기

SGLang에 내장된 bench_serving은 추가 설치가 필요 없어요. 벤치마크를 실행하기 전에 서버가 http://127.0.0.1:30000에서 실행 중인지 확인하세요.

모든 백엔드, 데이터셋, 고급 옵션은 Bench Serving 가이드를 참고하세요.

python -m sglang.bench_serving \
  --backend sglang-oai \
  --base-url http://127.0.0.1:30000 \
  --model Qwen/Qwen2.5-7B-Instruct \
  --dataset-name random \
  --random-input-len 1024 \
  --random-output-len 512 \
  --random-range-ratio 1 \
  --num-prompts 100 \
  --max-concurrency 32
`--dataset-name random`은 ShareGPT 데이터셋에서 토큰 id를 샘플링해 현실적인 입력을 생성해요; 첫 실행 시 ShareGPT가 Hugging Face에서 자동으로 다운로드됩니다.
  1. 네트워크 문제가 있다면 export HF_ENDPOINT=https://hf-mirror.com를 설정해 국내 미러를 사용하세요.
  2. 다운로드가 여전히 실패하면 데이터셋 파일 ShareGPT_V3_unfiltered_cleaned_split.json을 로컬에 직접 다운로드해 서버에 업로드한 뒤, --dataset-path로 파일 디렉토리를 지정해 오프라인으로 실행하세요.

입출력 길이를 고정하려면 --random-range-ratio 1을(일관된 비교에 권장), 균등 분포를 원하면 0(기본값)을 설정하세요. 요청 속도를 제어하려면 --request-rate를 추가하세요. 모든 백엔드, 데이터셋, 고급 옵션은 전체 Bench Serving 가이드를 참고하세요.

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

============ Serving Benchmark Result ============
Backend:                                 sglang-oai
Traffic request rate:                    inf
Max request concurrency:                 32
Successful requests:                     100
Benchmark duration (s):                  47.51
Total input tokens:                      102400
Total input text tokens:                 102400
Total generated tokens:                  51200
Total generated tokens (retokenized):    51195
Request throughput (req/s):              2.10
Input token throughput (tok/s):          2155.35
Output token throughput (tok/s):         1077.68
Peak output token throughput (tok/s):    1587.00
Peak concurrent requests:                64
Total token throughput (tok/s):          3233.03
Concurrency:                             26.93
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   12793.49
Median E2E Latency (ms):                 12940.17
P90 E2E Latency (ms):                    13049.86
P99 E2E Latency (ms):                    13051.61
---------------Time to First Token----------------
Mean TTFT (ms):                          1423.99
Median TTFT (ms):                        1489.29
P99 TTFT (ms):                           2325.56
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          22.25
Median TPOT (ms):                        22.22
P99 TPOT (ms):                           25.08
---------------Inter-Token Latency----------------
Mean ITL (ms):                           22.26
Median ITL (ms):                         20.74
P95 ITL (ms):                            21.40
P99 ITL (ms):                            23.62
Max ITL (ms):                            2229.30
==================================================

SGLang 서빙 벤치마크 결과 — 전체 참고 자료

출력 형식은 bench_serving.py하드코딩되어 있어요. 열 너비, 정렬, 소수점 정밀도를 포함한 모든 형식 결정은 소스에 정적으로 정의되어 있고 커맨드라인 인자로는 바꿀 수 없어요.

테스트 구성 (Test Configuration)
<tr>
  <td><code>Traffic request rate</code></td>
  <td>초당 요청 생성 속도 (req/s). <code>inf</code>는 최대 속도(동시성 제한)를 의미해요. <code>trace</code>는 trace 타임스탬프 모드를 나타냅니다. 고정값은 일정한 도착 간격을 강제해요.</td>
</tr>

<tr>
  <td><code>Max request concurrency</code></td>
  <td>클라이언트 측의 최대 동시 요청 수. 미지정 시 <code>not set</code>로 표시돼요.</td>
</tr>
Parameter Description
Backend 테스트 중인 서빙 백엔드 (예: sglang, vllm).
핵심 통계 및 처리량 지표 (Core Statistics & Throughput Metrics)
Parameter Description Format Specification
Successful requests성공적으로 완료된 총 요청 수 (HTTP 200, 생성 오류 없음).정수, 소수점 없음
Benchmark duration (s)첫 요청 전송부터 마지막 응답 완전 수신까지 걸린 총 시간 (초).소수점 2자리
Total input tokens모든 요청의 총 입력(프롬프트) 토큰 수. 서버 측 토크나이저로 계산돼요.정수, 소수점 없음
Total input text tokensTotal input tokens과 동일해요. 멀티모달 입력의 경우 다를 수 있어요.정수, 소수점 없음
Total generated tokens서버가 실제로 생성한 총 출력 토큰 수 (서버 측 토크나이저 기준).정수, 소수점 없음
Total generated tokens (retokenized)출력 텍스트를 클라이언트가 자체 토크나이저로 다시 토큰화한 값. 큰 차이는 토크나이저 불일치나 출력의 특수 토큰을 나타내요.정수, 소수점 없음
Request throughput (req/s)초당 처리된 성공 요청 수. 공식: Successful requests / Benchmark duration (s).소수점 2자리
Input token throughput (tok/s)초당 처리된 입력 토큰 수. 공식: Total input tokens / Benchmark duration (s).소수점 2자리
Output token throughput (tok/s)초당 생성된 출력 토큰 수. 공식: Total generated tokens / Benchmark duration (s).소수점 2자리
Peak output token throughput (tok/s)테스트 중 관찰된 순간 최대 출력 토큰 생성 속도 (슬라이딩 윈도우로 계산).소수점 2자리
Peak concurrent requests서버 측에서 동시에 처리된 최대 요청 수. 큐잉 때문에 클라이언트 측 Max request concurrency를 초과할 수 있어요.정수, 소수점 없음
Total token throughput (tok/s)입력과 출력 토큰 처리량의 합. 공식: Input token throughput + Output token throughput.소수점 2자리
Concurrency테스트 중 평균 동시 요청 수 (Little's Law). 공식: Sum of all E2E latencies / Benchmark duration.소수점 2자리
종단 간 지연 시간 (End-to-End Latency, E2E)
StatisticDescriptionFormat
Mean E2E Latency (ms)산술 평균소수점 2자리
Median E2E Latency (ms)50번째 백분위소수점 2자리
P90 E2E Latency (ms)90번째 백분위 (요청의 90%가 이 값 이하의 지연 시간)소수점 2자리
P99 E2E Latency (ms)99번째 백분위소수점 2자리
첫 토큰까지의 시간 (Time to First Token, TTFT)
StatisticDescriptionFormat
Mean TTFT (ms)산술 평균소수점 2자리
Median TTFT (ms)50번째 백분위소수점 2자리
P99 TTFT (ms)99번째 백분위소수점 2자리
출력 토큰당 시간 (Time per Output Token, TPOT) — 첫 토큰 제외

공식: (E2E Latency - TTFT) / (Number of output tokens - 1)

StatisticDescriptionFormat
Mean TPOT (ms)산술 평균소수점 2자리
Median TPOT (ms)50번째 백분위소수점 2자리
P99 TPOT (ms)99번째 백분위소수점 2자리
토큰 간 지연 시간 (Inter-Token Latency, ITL)
StatisticDescriptionFormat
Mean ITL (ms)평균 토큰 간 간격소수점 2자리
Median ITL (ms)토큰 간 간격의 50번째 백분위소수점 2자리
P95 ITL (ms)95번째 백분위 (스톨 감지에 사용)소수점 2자리
P99 ITL (ms)99번째 백분위소수점 2자리
Max ITL (ms)관찰된 최대 토큰 간 간격; 심각한 블로킹 이벤트 식별에 유용소수점 2자리

3. 온라인 서비스: 멀티모달 모델

비전-언어 작업용으로 Qwen/Qwen2.5-VL-7B-Instruct를 테스트해요.

이 섹션의 어떤 벤치마크를 실행하기 전에 SGLang 멀티모달 서버가 http://127.0.0.1:30000에서 실행 중인지 확인하세요. SGLang 서버 시작하기를 참고하고 실행 명령은 Multimodal 탭을 사용하세요.

일관되고 반복 가능한 결과를 위해 --random-range-ratio 1로 입출력 길이를 고정하거나, 균등 분포를 위해 0(기본값)을 설정하세요.

3.1 Evalscope 사용하기

전제 조건: Evalscope 설치 후 가상 환경 활성화(source .evalscope_venv/bin/activate). SGLang 멀티모달 서버가 http://127.0.0.1:30000에서 실행 중.

Evalscope의 perf 도구는 OpenAI 호환 /v1/chat/completions 엔드포인트를 사용해요. 이미지 생성과 함께 랜덤 멀티모달 데이터를 쓰려면 --dataset random_vl을 사용하세요:

evalscope perf \
  --parallel 10 \
  --number 20 \
  --model Qwen/Qwen2.5-VL-7B-Instruct \
  --url http://127.0.0.1:30000/v1/chat/completions \
  --api openai \
  --dataset random_vl \
  --min-tokens 1024 \
  --max-tokens 1024 \
  --prefix-length 0 \
  --min-prompt-length 1024 \
  --max-prompt-length 1024 \
  --image-width 512 \
  --image-height 512 \
  --image-format RGB \
  --image-num 1 \
  --tokenizer-path Qwen/Qwen2.5-VL-7B-Instruct \
  --extra-args '{"ignore_eos": true}'

모델이 이미 다운로드되어 있다면 --tokenizer-path를 모델 id 대신 로컬 모델 경로로 지정할 수 있어요.

3.2 AISBench 사용하기

전제 조건: AISBench 설치 후 가상 환경 활성화(source .aisbench_venv/bin/activate). 모든 명령어는 benchmark/ 디렉토리에서 실행. SGLang 멀티모달 서버가 http://127.0.0.1:30000에서 실행 중. AISBench에는 내장 멀티모달 데이터셋이 없어요 — 직접 제공해야 합니다.

먼저 ais_bench/benchmark/configs/models/vllm_api/vllm_api_stream_chat.py를 편집해 비전 모델을 설정하세요:

from ais_bench.benchmark.models import VLLMCustomAPIChat
from ais_bench.benchmark.utils.postprocess.model_postprocessors import extract_non_reasoning_content

models = [
    dict(
        attr="service",
        type=VLLMCustomAPIChat,
        abbr="vllm-api-stream-chat",
        path="Qwen/Qwen2.5-VL-7B-Instruct",
        model="Qwen/Qwen2.5-VL-7B-Instruct",
        stream=True,
        request_rate=0,
        use_timestamp=False,
        retry=2,
        api_key="",
        host_ip="127.0.0.1",
        host_port=30000,
        url="",
        max_out_len=256,
        batch_size=16,
        trust_remote_code=False,
        generation_kwargs=dict(
            temperature=0.01,
            ignore_eos=True,
        ),
        pred_postprocessor=dict(type=extract_non_reasoning_content),
    )
]

모델이 이미 다운로드되어 있다면 path를 모델 id 대신 로컬 모델 경로로 지정하세요.

다음으로 mmstar 같은 멀티모달 데이터셋을 다운로드하세요:

# Download the mmstar dataset (from within the benchmark/ directory)
cd ais_bench/datasets
mkdir mmstar
cd mmstar
wget https://www.modelscope.cn/datasets/evalscope/MMStar/resolve/master/MMStar.tsv

성능 테스트를 실행하세요:

ais_bench --models vllm_api_stream_chat --datasets mmstar_gen -m perf

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

╒══════════════════════════╤═════════╤═════════════════╤════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤═════════════════╤══════╕
│ Performance Parameters   │ Stage   │ Average         │ Min            │ Max             │ Median          │ P75             │ P90             │ P99             │  N   │
╞══════════════════════════╪═════════╪═════════════════╪════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪═════════════════╪══════╡
│ E2EL                     │ total   │ 6190.9 ms       │ 5071.4 ms      │ 8464.8 ms       │ 6126.6 ms       │ 6475.2 ms       │ 6833.5 ms       │ 7897.9 ms       │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ TTFT                     │ total   │ 693.3 ms        │ 96.0 ms        │ 2161.5 ms       │ 747.4 ms        │ 870.9 ms        │ 1032.3 ms       │ 1620.8 ms       │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ TPOT                     │ total   │ 21.6 ms         │ 17.8 ms        │ 32.1 ms         │ 21.3 ms         │ 23.1 ms         │ 24.5 ms         │ 29.1 ms         │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ ITL                      │ total   │ 25.5 ms         │ 0.0 ms         │ 1951.1 ms       │ 18.8 ms         │ 19.7 ms         │ 37.3 ms         │ 121.8 ms        │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ InputTokens              │ total   │ 0.0             │ 0.0            │ 0.0             │ 0.0             │ 0.0             │ 0.0             │ 0.0             │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ OutputTokens             │ total   │ 256.0           │ 256.0          │ 256.0           │ 256.0           │ 256.0           │ 256.0           │ 256.0           │ 1500 │
├──────────────────────────┼─────────┼─────────────────┼────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼──────┤
│ OutputTokenThroughput    │ total   │ 41.6779 token/s │ 30.243 token/s │ 50.4791 token/s │ 41.7847 token/s │ 44.6424 token/s │ 45.6484 token/s │ 46.0932 token/s │ 1500 │
╘══════════════════════════╧═════════╧═════════════════╧════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧═════════════════╧══════╛
╒═════════════════════════╤═════════╤══════════════════╕
│ Common Metric           │ Stage   │ Value            │
╞═════════════════════════╪═════════╪══════════════════╡
│ Benchmark Duration      │ total   │ 582099.6816 ms   │
├─────────────────────────┼─────────┼──────────────────┤
│ Total Requests          │ total   │ 1500             │
├─────────────────────────┼─────────┼──────────────────┤
│ Failed Requests         │ total   │ 0                │
├─────────────────────────┼─────────┼──────────────────┤
│ Success Requests        │ total   │ 1500             │
├─────────────────────────┼─────────┼──────────────────┤
│ Concurrency             │ total   │ 15.9532          │
├─────────────────────────┼─────────┼──────────────────┤
│ Max Concurrency         │ total   │ 16               │
├─────────────────────────┼─────────┼──────────────────┤
│ Request Throughput      │ total   │ 2.5769 req/s     │
├─────────────────────────┼─────────┼──────────────────┤
│ Total Input Tokens      │ total   │ 0                │
├─────────────────────────┼─────────┼──────────────────┤
│ Total Generated Tokens  │ total   │ 384000           │
├─────────────────────────┼─────────┼──────────────────┤
│ Input Token Throughput  │ total   │ 0.0 token/s      │
├─────────────────────────┼─────────┼──────────────────┤
│ Output Token Throughput │ total   │ 659.6808 token/s │
├─────────────────────────┼─────────┼──────────────────┤
│ Total Token Throughput  │ total   │ 659.6808 token/s │
╘═════════════════════════╧═════════╧══════════════════╛

자세한 내용은 AISBench 문서를 참고하세요.

3.3 bench_serving 사용하기 (이미지 데이터셋)

이미지 데이터셋에는 --dataset-name image를 설정하세요. bench_serving이 이미지 입력이 포함된 랜덤 프롬프트를 생성해요. 벤치마크를 실행하기 전에 서버가 http://127.0.0.1:30000에서 실행 중인지 확인하세요.

이미지 관련 플래그 전체 목록은 Bench Serving 가이드를 참고하세요.

python -m sglang.bench_serving \
  --backend sglang \
  --base-url http://127.0.0.1:30000 \
  --model Qwen/Qwen2.5-VL-7B-Instruct \
  --dataset-name image \
  --random-input-len 1024 \
  --random-output-len 512 \
  --random-range-ratio 1 \
  --num-prompts 32 \
  --max-concurrency 16 \
  --image-count 1 \
  --image-resolution 720p

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

============ Serving Benchmark Result ============
Backend:                                 sglang
Traffic request rate:                    inf
Max request concurrency:                 16
Successful requests:                     32
Benchmark duration (s):                  51.74
Total input tokens:                      73464
Total input text tokens:                 35128
Total input vision tokens:               38336
Total generated tokens:                  16384
Total generated tokens (retokenized):    9300
Request throughput (req/s):              0.62
Input token throughput (tok/s):          1419.96
Output token throughput (tok/s):         316.68
Peak output token throughput (tok/s):    800.00
Peak concurrent requests:                32
Total token throughput (tok/s):          1736.64
Concurrency:                             15.98
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   25841.84
Median E2E Latency (ms):                 25842.85
P90 E2E Latency (ms):                    26296.42
P99 E2E Latency (ms):                    26303.13
---------------Time to First Token----------------
Mean TTFT (ms):                          12211.59
Median TTFT (ms):                        14405.77
P99 TTFT (ms):                           15837.60
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          26.67
Median TPOT (ms):                        21.75
P99 TPOT (ms):                           41.89
---------------Inter-Token Latency----------------
Mean ITL (ms):                           26.67
Median ITL (ms):                         20.34
P95 ITL (ms):                            20.85
P99 ITL (ms):                            21.70
Max ITL (ms):                            11309.91
==================================================

4. 온라인 서비스: 임베딩 모델

임베딩 API 엔드포인트에서 Qwen/Qwen3-Embedding-8B를 테스트해요.

이 섹션의 어떤 벤치마크를 실행하기 전에 SGLang 임베딩 서버가 --is-embedding과 함께 http://127.0.0.1:30000에서 실행 중인지 확인하세요. SGLang 서버 시작하기를 참고하고 실행 명령은 Embedding 탭을 사용하세요. AISBench는 임베딩 엔드포인트를 지원하지 않아요 — bench_serving이나 Evalscope를 사용하세요.

4.1 Evalscope 사용하기

전제 조건: Evalscope 설치 후 가상 환경 활성화(source .evalscope_venv/bin/activate). SGLang 임베딩 서버가 --is-embedding과 함께 http://127.0.0.1:30000에서 실행 중.

Evalscope는 임베딩 평가를 지원해요. 임베딩 API를 직접 성능 테스트하려면:

evalscope perf \
  --parallel 10 \
  --number 20 \
  --model Qwen/Qwen3-Embedding-8B \
  --url http://127.0.0.1:30000/v1/embeddings \
  --api openai_embedding \
  --dataset random_embedding \
  --min-prompt-length 1024 \
  --max-prompt-length 1024 \
  --tokenizer-path Qwen/Qwen3-Embedding-8B

모델이 이미 다운로드되어 있다면 --tokenizer-path를 모델 id 대신 로컬 모델 경로로 지정할 수 있어요.

Evalscope의 임베딩 성능 테스트 지원은 버전에 따라 다를 수 있어요. perf 명령이 임베딩 엔드포인트를 받아들이지 않으면 기본 옵션으로 bench_serving + --backend sglang-embedding을 사용하세요.

4.2 bench_serving 사용하기 (임베딩 백엔드)

bench_serving은 SGLang에 내장되어 있어요. /v1/embeddings 엔드포인트를 대상으로 하려면 --backend sglang-embedding을 사용하세요. 서버가 --is-embedding과 함께 http://127.0.0.1:30000에서 실행 중인지 확인하세요.

python -m sglang.bench_serving \
  --backend sglang-embedding \
  --base-url http://127.0.0.1:30000 \
  --model Qwen/Qwen3-Embedding-8B \
  --dataset-name random \
  --random-input-len 512 \
  --random-output-len 0 \
  --num-prompts 1000 \
  --max-concurrency 64 \
  --request-rate 32

--dataset-name random은 ShareGPT 데이터셋에서 토큰 id를 샘플링해요; 첫 실행 시 ShareGPT가 Hugging Face에서 자동으로 다운로드됩니다. 네트워크가 없으면 export HF_ENDPOINT=https://hf-mirror.com을 설정하세요. 임베딩 벤치마크에는 --random-output-len 0을 설정하세요 — 출력 토큰이 생성되지 않아요.

출력 예시 (참고용일 뿐 — 실제 결과는 하드웨어와 구성에 따라 달라져요):

============ Serving Benchmark Result ============
Backend:                                 sglang-embedding
Traffic request rate:                    32.0
Max request concurrency:                 64
Successful requests:                     1000
Benchmark duration (s):                  31.86
Total input tokens:                      257891
Total input text tokens:                 257891
Request throughput (req/s):              31.39
Input token throughput (tok/s):          8094.67
Peak concurrent requests:                62
Concurrency:                             6.67
----------------End-to-End Latency----------------
Mean E2E Latency (ms):                   212.34
Median E2E Latency (ms):                 160.97
P90 E2E Latency (ms):                    267.31
P99 E2E Latency (ms):                    1445.94
==================================================

5. 오프라인 성능 테스트

SGLang의 Engine API는 HTTP 서버 없이 프로세스 내에서 추론을 실행해 최대 처리량을 측정할 수 있어요. bench_offline_throughput은 SGLang에 내장되어 있어 추가 설치나 실행 중인 서버가 필요 없어요.

bench_offline_throughput은 현재 텍스트 생성(LLM) 벤치마크만 지원해요. 멀티모달과 임베딩 모델은 지원되지 않습니다.

5.1 bench_offline_throughput 사용하기

bench_offline_throughput은 내부적으로 Engine API를 사용하며 HTTP 오버헤드 없이 순수 추론 처리량을 측정해요:

python -m sglang.benchmark.offline_throughput \
  --model-path Qwen/Qwen2.5-7B-Instruct \
  --dataset-name random \
  --random-input-len 1024 \
  --random-output-len 512 \
  --num-prompts 500

--dataset-name random은 ShareGPT 데이터셋에서 토큰 id를 샘플링해요; 첫 실행 시 ShareGPT가 Hugging Face에서 자동으로 다운로드됩니다. 네트워크가 없으면 export HF_ENDPOINT=https://hf-mirror.com을 설정하세요.

--dataset-name random--random-input-len, --random-output-len을 쓰면 입출력 토큰 수를 완전히 제어할 수 있어요. 고정 길이의 랜덤 데이터는 실제 데이터셋의 변동을 제거해 실행 간 처리량 비교를 결정적이고 신뢰할 수 있게 만들어요.

참고 자료 (See also)

더 알아보기 (Learn more)