Skip to content

[Bug]: Strange metrics when running benchmark_serving under high concurrency #19210

@AsicDyc

Description

@AsicDyc

Your current environment

The output of python collect_env.py
Your output of `python collect_env.py` here
INFO 06-05 16:06:27 [__init__.py:239] Automatically detected platform cuda.
Collecting environment information...
==============================
        System Info
==============================
OS                           : CentOS Linux 7 (Core) (x86_64)
GCC version                  : (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
Clang version                : Could not collect
CMake version                : version 3.25.0-rc2
Libc version                 : glibc-2.17

==============================
       PyTorch Info
==============================
PyTorch version              : 2.6.0+cu124
Is debug build               : False
CUDA used to build PyTorch   : 12.4
ROCM used to build PyTorch   : N/A

==============================
      Python Environment
==============================
Python version               : 3.10.12 (main, Oct 10 2024, 21:53:07) [GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] (64-bit runtime)
Python platform              : Linux-4.18.0-147.mt20200626.413.el8_1.x86_64-x86_64-with-glibc2.17

==============================
       CUDA / GPU Info
==============================
Is CUDA available            : True
CUDA runtime version         : 12.4.99
CUDA_MODULE_LOADING set to   : LAZY
GPU models and configuration : 
GPU 0: NVIDIA A100-SXM4-80GB
GPU 1: NVIDIA A100-SXM4-80GB

Nvidia driver version        : 535.129.03
cuDNN version                : Probably one of the following:
/usr/lib64/libcudnn.so.8.9.7
/usr/lib64/libcudnn_adv_infer.so.8.9.7
/usr/lib64/libcudnn_adv_train.so.8.9.7
/usr/lib64/libcudnn_cnn_infer.so.8.9.7
/usr/lib64/libcudnn_cnn_train.so.8.9.7
/usr/lib64/libcudnn_ops_infer.so.8.9.7
/usr/lib64/libcudnn_ops_train.so.8.9.7
HIP runtime version          : N/A
MIOpen runtime version       : N/A
Is XNNPACK available         : True

==============================
          CPU Info
==============================
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   43 bits physical, 48 bits virtual
CPU(s):                          256
On-line CPU(s) list:             0-24
Off-line CPU(s) list:            25-255
Thread(s) per core:              0
Core(s) per socket:              64
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       AuthenticAMD
CPU family:                      25
Model:                           1
Model name:                      AMD EPYC 7713 64-Core Processor
Stepping:                        1
Frequency boost:                 enabled
CPU MHz:                         3036.840
CPU max MHz:                     2000.0000
CPU min MHz:                     1500.0000
BogoMIPS:                        3981.31
Virtualization:                  AMD-V
L1d cache:                       2 MiB
L1i cache:                       2 MiB
L2 cache:                        32 MiB
L3 cache:                        256 MiB
NUMA node0 CPU(s):               0-63,128-191
NUMA node1 CPU(s):               64-127,192-255
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Vulnerable
Vulnerability Spectre v1:        Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers
Vulnerability Spectre v2:        Vulnerable, IBPB: disabled, STIBP: disabled
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate sme ssbd mba sev ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca

==============================
Versions of relevant libraries
==============================
[pip3] mt-tritonclient==1.0.4
[pip3] mypy==1.15.0
[pip3] mypy_extensions==1.1.0
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-ml-py==12.570.86
[pip3] nvidia-modelopt==0.21.1
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] onnx==1.17.0
[pip3] onnx_graphsurgeon==0.5.8
[pip3] pynvml==12.0.0
[pip3] pyzmq==26.4.0
[pip3] torch==2.6.0
[pip3] torchaudio==2.6.0
[pip3] torchprofile==0.0.4
[pip3] torchvision==0.21.0
[pip3] transformers==4.51.3
[pip3] triton==3.2.0
[pip3] tritonclient==2.44.0
[conda] numpy                     1.19.5                   pypi_0    pypi
[conda] pyzmq                     25.1.1                   pypi_0    pypi

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
Neuron SDK Version           : N/A
vLLM Version                 : 0.8.5.post1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
        GPU0    GPU1    NIC0    NIC1    NIC2    NIC3    NIC4    NIC5    NIC6    NIC7    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV12    SYS     SYS     SYS     SYS     SYS     SYS     PXB     PXB                             N/A
GPU1    NV12     X      SYS     SYS     SYS     SYS     SYS     SYS     PXB     PXB                             N/A
NIC0    SYS     SYS      X      PIX     SYS     SYS     SYS     SYS     SYS     SYS
NIC1    SYS     SYS     PIX      X      SYS     SYS     SYS     SYS     SYS     SYS
NIC2    SYS     SYS     SYS     SYS      X      PIX     SYS     SYS     SYS     SYS
NIC3    SYS     SYS     SYS     SYS     PIX      X      SYS     SYS     SYS     SYS
NIC4    SYS     SYS     SYS     SYS     SYS     SYS      X      PIX     SYS     SYS
NIC5    SYS     SYS     SYS     SYS     SYS     SYS     PIX      X      SYS     SYS
NIC6    PXB     PXB     SYS     SYS     SYS     SYS     SYS     SYS      X      PIX
NIC7    PXB     PXB     SYS     SYS     SYS     SYS     SYS     SYS     PIX      X 

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

NIC Legend:

  NIC0: mlx5_0
  NIC1: mlx5_1
  NIC2: mlx5_2
  NIC3: mlx5_3
  NIC4: mlx5_4
  NIC5: mlx5_5
  NIC6: mlx5_6
  NIC7: mlx5_7

==============================
     Environment Variables
==============================
LD_LIBRARY_PATH=/lib64:/usr/lib64:/lib64:/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/triton_model_server/backends/tensorrtllm/libs:/usr/local/cuda/compat/:/opt/triton_model_server/lib:/opt/triton_model_server/lib64:/usr/local/lib/python3.10/site-packages/torch/lib:/usr/local/lib64:/usr/local/lib:/opt/tritonserver/lib:/opt/tritonserver/lib64:/opt/tritonserver/backends/tensorrtllm:/opt/tritonserver/backends/tensorrtllm/libs:/usr/local/openmpi/lib:/usr/local/lib:/usr/local/openssl/lib::/usr/local/TensorRT-10.3.0.26/lib:/usr/local/TensorRT-10.7.0.23/lib:/usr/local/java/bin:/home/sankuai/conda/envs/codelab/bin:/home/sankuai/conda/condabin:/usr/local/jdk1.8.0_45/bin:/opt/meituan/spark-2.2/sbin:/opt/meituan/spark-2.2/bin:/opt/meituan/hadoop/sbin:/opt/rh/devtoolset-8/root/usr/bin:/opt/tritonserver/perf_tools:/opt/triton_model_server/bin:/opt/tritonserver/bin:/usr/local/openmpi/include:/usr/local/openmpi/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/tritonserver/perf_tools:/opt/triton_model_server/bin:/opt/tritonserver/bin:/usr/local/openmpi/include:/usr/local/openmpi/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/meituan/hadoop/bin:/usr/local/java/bin:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/triton_model_server/backends/tensorrtllm/libs:/usr/local/cuda/compat/:/opt/triton_model_server/lib:/opt/triton_model_server/lib64:/usr/local/lib/python3.10/site-packages/torch/lib:/usr/local/lib64:/usr/local/lib:/opt/tritonserver/lib:/opt/tritonserver/lib64:/opt/tritonserver/backends/tensorrtllm:/opt/tritonserver/backends/tensorrtllm/libs:/usr/local/openmpi/lib:/usr/local/lib:/usr/local/openssl/lib::/usr/local/TensorRT-10.3.0.26/lib:/usr/local/TensorRT-10.7.0.23/lib:/usr/local/java/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/lib64:/usr/lib64:$LD_LIBRARY_PATH:/opt/triton_model_server/backends/tensorrtllm/libs:/usr/local/cuda/compat/:/opt/triton_model_server/lib:/opt/triton_model_server/lib64:/usr/local/lib/python3.10/site-packages/torch/lib:/usr/local/lib64:/usr/local/lib:/opt/tritonserver/lib:/opt/tritonserver/lib64:/opt/tritonserver/backends/tensorrtllm:/opt/tritonserver/backends/tensorrtllm/libs:/usr/local/openmpi/lib:/usr/local/lib:/usr/local/openssl/lib::/usr/local/TensorRT-10.3.0.26/lib:/usr/local/TensorRT-10.7.0.23/lib:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/java/jre/lib/amd64/server:/opt/meituan/hadoop/lib/native:/opt/triton_model_server/backends/tensorrtllm/libs:/usr/local/cuda/compat/:/opt/triton_model_server/lib:/opt/triton_model_server/lib64:/usr/local/lib/python3.10/site-packages/torch/lib:/usr/local/lib64:/usr/local/lib:/opt/tritonserver/lib:/opt/tritonserver/lib64:/opt/tritonserver/backends/tensorrtllm:/opt/tritonserver/backends/tensorrtllm/libs:/usr/local/openmpi/lib:/usr/local/lib:/usr/local/openssl/lib::/usr/local/TensorRT-10.3.0.26/lib:/usr/local/TensorRT-10.7.0.23/lib:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/java/jre/lib/amd64/server:/opt/meituan/hadoop/lib/native
NVIDIA_VISIBLE_DEVICES=GPU-7a1844eb-8b2b-2d4c-41ba-2e4bd62cb4ba,GPU-9b74314e-cb73-75a4-64b0-659c9b7afa2c
NCCL_IB_GID_INDEX=7
NVIDIA_DRIVER_CAPABILITIES=compute,utility
OMP_NUM_THREADS=25
NCCL_CUMEM_ENABLE=0
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

🐛 Describe the bug

When running benchmark_serving.py, I got some strange metrics:

  • I got an expected ttft and an abnormally large tpot for the first inference after the vllm serve started.
    The script I used for server side is:
    VLLM_TORCH_PROFILER_DIR=./outputs/vllm_profile VLLM_RPC_TIMEOUT=1800000 \
        vllm serve ../../data/huggingface.co/Qwen/Qwen3-32B \
            --max-model-len=16384 \
            --max-num-batch-tokens=2048 \
            --max-num-seqs=128 \
            -tp 2 \
            --disable-log-requests
    
    The script I used for client side is:
    python3 benchmarks/benchmark_serving.py --port 8000 \
            --save-result  --save-detailed \
            --result-dir outputs/benchmark \
            --backend vllm \
            --model ../data/huggingface.co/Qwen/Qwen3-32B \
            --dataset-name custom \
            --dataset-path "dataset/custom_all.jsonl" \
            --custom-output-len 10 \
            --num-prompts 16 \
            --max-concurrency 2 \
            --temperature 0.6 \
            --top-p 0.95 \
            --top-k 1 \
            --profile
    
    And the output I got:
    =========== Serving Benchmark Result ===========
    Successful requests: 16
    Benchmark duration (s): 19.65
    Total input tokens: 109554
    Total generated tokens: 160
    Request throughput (req/s): 0.81
    Output token throughput (tok/s): 8.14
    Total Token throughput (tok/s): 5583.69
    ---------------Time to First Token---------------
    Mean TFTT (ms): 1395.23
    Median TFTT (ms): 1535.06
    P99 TFTT (ms): 2659.78
    -----Time per Output Token (excl. 1st token)-----
    Mean TPOT (ms): 116.35
    Median TPOT (ms): 104.55
    P99 TPOT (ms): 208.98
    ---------------Inter-token Latency---------------
    Mean ITL (ms): 116.35
    Median ITL (ms): 27.72
    P99 ITL (ms): 379.71
    ================================================
    
  • I got an abnormally small ttft and an expected tpot for the following inferences, and I noticed the prefix cache hit rate is always bigger than 50%, while in the first inference it's about 10%
    The output I got:
    =========== Serving Benchmark Result ===========
    Successful requests: 16
    Benchmark duration (s): 2.72
    Total input tokens: 109554
    Total generated tokens: 160
    Request throughput (req/s): 5.88
    Output token throughput (tok/s): 58.81
    Total Token throughput (tok/s): 40324.99
    ---------------Time to First Token---------------
    Mean TFTT (ms): 28.29
    Median TFTT (ms): 28.63
    P99 TFTT (ms): 30.06
    -----Time per Output Token (excl. 1st token)-----
    Mean TPOT (ms): 116.35
    Median TPOT (ms): 104.55
    P99 TPOT (ms): 208.98
    ---------------Inter-token Latency---------------
    Mean ITL (ms): 28.49
    Median ITL (ms): 27.48
    P99 ITL (ms): 46.02
    ================================================
    
  • When I set --max-concurrency to 4 and higher, I found similar phenomena
    I reviewed the detailed output json file and found that when tpot is abnormally large, most of the tpot are still as large as expected, only very few tpot are as large as ttft.
    Some other issues also mentioned similar phenomenon, like [Bug]: vllm 0.8.3 abnormal TTFT (too long) in the first serving #16858, but they were not resolved well.

Any advice would be helpful! Looking forward for your response!

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions