vllm-project / vllm

A high-throughput and memory-efficient inference and serving engine for LLMs
https://docs.vllm.ai
Apache License 2.0
26.72k stars 3.91k forks source link

[Usage]: How can I determine the maximum number of concurrent requests? #8031

Open zhangyan1986 opened 2 weeks ago

zhangyan1986 commented 2 weeks ago

Your current environment

PyTorch version: 2.3.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.1 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.29.5
Libc version: glibc-2.27

Python version: 3.10.14 (main, May  6 2024, 19:42:50) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-4.15.0-29-generic-x86_64-with-glibc2.27
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: Tesla V100-PCIE-32GB
GPU 1: Tesla V100-PCIE-32GB
GPU 2: Tesla V100-PCIE-32GB
GPU 3: Tesla V100-PCIE-32GB
GPU 4: Tesla V100-PCIE-32GB
GPU 5: Tesla V100-PCIE-32GB
GPU 6: Tesla V100-PCIE-32GB
GPU 7: Tesla V100-PCIE-32GB

Nvidia driver version: 535.129.03
cuDNN version: Probably one of the following:
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.6.0
/home/username/cuda/cuda-11.8/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.6.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              80
On-line CPU(s) list: 0-79
Thread(s) per core:  2
Core(s) per socket:  20
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz
Stepping:            7
CPU MHz:             1043.433
CPU max MHz:         2501.0000
CPU min MHz:         1000.0000
BogoMIPS:            5000.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            28160K
NUMA node0 CPU(s):   0-19,40-59
NUMA node1 CPU(s):   20-39,60-79
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] torch==2.3.0
[pip3] transformers==4.41.2
[pip3] triton==2.3.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
[conda] torch                     2.3.0                    pypi_0    pypi
[conda] transformers              4.41.2                   pypi_0    pypi
[conda] triton                    2.3.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.5.0.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    GPU2    GPU3    GPU4    GPU5    GPU6    GPU7    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X  PIX PIX PIX SYS SYS SYS SYS 0-19,40-59  0       N/A
GPU1    PIX  X  PIX PIX SYS SYS SYS SYS 0-19,40-59  0       N/A
GPU2    PIX PIX  X  PIX SYS SYS SYS SYS 0-19,40-59  0       N/A
GPU3    PIX PIX PIX  X  SYS SYS SYS SYS 0-19,40-59  0       N/A
GPU4    SYS SYS SYS SYS  X  PIX PIX PIX 20-39,60-79 1       N/A
GPU5    SYS SYS SYS SYS PIX  X  PIX PIX 20-39,60-79 1       N/A
GPU6    SYS SYS SYS SYS PIX PIX  X  PIX 20-39,60-79 1       N/A
GPU7    SYS SYS SYS SYS PIX PIX PIX  X  20-39,60-79 1       N/A

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

How would you like to use vllm

I have deployed the QWen2-7B model on a single V100 GPU using vllm and am providing HTTP services through FastAPI.

Assuming each request has an input of 5000 tokens and an output of 500 tokens, how can I determine the maximum number of concurrent requests that a single V100 can support?

For example, if the model's inference performance is 50 tokens/s, then when 10 inference tasks are running concurrently, can I assume that the performance for each inference task averages down to 5 tokens/s?

Furthermore, if this maximum number is exceeded, will there be an Out Of Memory issue, or will the requests be handled according to a queuing mechanism?

Currently, I am estimating the GPU requirements for a knowledge base application scenario. Given that evaluating GPU resources differs significantly from traditional IT architecture assessments, I hope you can provide me with more guidance. Thank you.

Before submitting a new issue...

AlpinDale commented 2 weeks ago

A good heuristic is num_gpu_blocks * block_size / max_model_len. That should give you the minimum concurrency, i.e. how many concurrent requests with max_model_len tokens in them you can handle.