-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Performance]: Why does VLLM perform worse than TGI in Speculative decoding? #7540
Comments
Please, teachers, provide some help。 @cadedaniel , @youkaichao |
Maybe you should consider the parameter Speculative decoding does not always improve token goodput under high workloads. If your SLO availability is abnormal, it is probably because some incoming requests are arranged in the pending queue. In addition, the definition of the indicators in the benchmark results you provided is vague. Hence, the data in the current table is a bit difficult to understand. |
Can you share metrics from the log, including |
Thank you very much for your help, below are some metrics data. @cadedaniel metrics log The metrics results for each request The return results of the Metrics API Thank you again for your help. |
Dear Professor @cadedaniel , I have further experimented with this issue. I would like to ask if my speculation is correct, and if so, how should I optimize this scenario. |
@skylee-01 I wonder if you could try the same test but adding |
Some thoughts:
|
I'm confused about the nsys results. It seems there are four prefill phases between two decoding phases, how can that be possible? |
Dear Professor @cadedaniel : 1、Below are some logs you need: qps=25 and --scheduler-delay-factor=0.5 2、We have tested the latest 0.5.5 version of VLLM, and there was no significant change in the results. The latest version should have resolved the architectural issues. 3、We attempted to test with the option --scheduler-delay-factor=0.5. Although the QPS did not increase, the scheduling order of prefill and decode was optimized according to the log analysis。Below is the optimized nsight。 4、 I haven't found out how TGI prints the throughput, but from the stress test logs, it seems that both vllm and TGI have consistent output for each query Problem Analysis: After the scheduling optimization, the QPS did not increase, which is very strange. So I further investigated the issue. I found that there were intermittent delays of 300ms, which severely affected the QPS increase because our metric is 100% availability within 500ms. An answer's output is within 200ms, and if there is a 300ms delay, it would cause queries near this node to exceed the 500ms limit Speculative decoding 300ms issue The issue of a 300ms delay can also occur without using speculative decoding. Some details about the 300ms issue Upon further investigation, the cause of the problem could not be identified, and the location of the code and the time of occurrence are both random. nsys: https://github.com/skylee-01/experimental_data/blob/main/vllm_300ms_delay.zip |
Thank you for your response. This issue occurs in scenarios with high QPS. |
Thank you very much for your reply. Your suggestions are excellent. We have experimented with this parameter, and although it did not improve QPS, we have mastered the method of optimizing scheduling through learning about this parameter. |
From the perspective of nsys, the pre-fill and decoding stages are separate. Could you please advise on how to use the continuous batch processing feature? @youkaichao |
Proposal to improve performance
Hello Teacher, it is a great honor to witness your magnificent work. The team I am part of is currently trying to migrate the inference service from TGI to vLLM. However, we have encountered some issues in the effectiveness evaluation and hope that the teachers can provide guidance.
question:
1、Could you please explain why the GPU utilization of vLLM is lower than that of TGI? Is it possible to increase the GPU utilization by adjusting parameters?
2、Why is the QPS of vLLM lower than that of TGI? How should this be considered and optimized?
Report of performance regression
Experimental DataScenario: In the agent scenario, the number of prompt tokens is between 30-40, and the number of output tokens is between 10-20. We have trained a small n-gram model as a draft model (with an accuracy rate of 70% when predicting num_speculative_tokens=4). We used 2,000 different data entries for stress testing.
🚀vLLM
Startup Parameters:
python3 vllm/entrypoints/openai/api_server.py
--served-model-name base_model
--port XXX
--model XX
--max_model_len 1000
--speculative_model="[ngram_pool]"
--num_speculative_tokens 4
--use_v2_block_manager \
QPS: 16 (availability at 500ms is 100%)
GPU Utilization: 70%
🚗TGI
Startup Parameters:
docker run -it --gpus=device=2 --network host
--model-id model_path
--num-shard 1 --port xxx --router-name=xx --max-top-n-tokens=1 --max-input-length=640 --max-total-tokens=960
--waiting-served-ratio=0.5 --max-batch-prefill-tokens=5120 --max-batch-total-tokens=16000 --max-waiting-tokens=16000
--cloudml-opt 1 --cloudml-opt-verbose 1 --trust-remote-code --speculate=4
QPS: 35 (availability at 500ms is 100%)
GPU Utilization:80%
Misc discussion on performance
No response
Your current environment (if you think it is necessary)
Collecting environment information...
WARNING 08-15 03:20:34 _custom_ops.py:14] Failed to import from vllm._C with ImportError('/home/work/lisiqi23_work/vllm/_C.abi3.so: undefined symbol: _ZN5torch3jit11parseSchemaERKSs')
PyTorch version: 2.4.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.29.5
Libc version: glibc-2.35
Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.4.54-1.0.0.std7c.el7.2.x86_64-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 3090
GPU 2: NVIDIA GeForce RTX 3090
GPU 3: NVIDIA GeForce RTX 3090
GPU 4: NVIDIA GeForce RTX 3090
GPU 5: NVIDIA GeForce RTX 3090
GPU 6: NVIDIA GeForce RTX 3090
GPU 7: NVIDIA GeForce RTX 3090
Nvidia driver version: 535.104.05
cuDNN version: Could not collect
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
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
CPU family: 6
Model: 85
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 2
Stepping: 7
Frequency boost: enabled
CPU max MHz: 2601.0000
CPU min MHz: 1000.0000
BogoMIPS: 5200.00
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 tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid 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 md_clear flush_l1d arch_capabilities
Virtualization: VT-x
L1d cache: 1.1 MiB (36 instances)
L1i cache: 1.1 MiB (36 instances)
L2 cache: 36 MiB (36 instances)
L3 cache: 49.5 MiB (2 instances)
NUMA node(s): 2
NUMA node0 CPU(s): 0-17,36-53
NUMA node1 CPU(s): 18-35,54-71
Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Mitigation; TSX disabled
Versions of relevant libraries:
[pip3] numpy==1.26.0
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] pyzmq==26.0.3
[pip3] torch==2.4.0
[pip3] torchvision==0.19.0
[pip3] transformers==4.44.0
[pip3] triton==3.0.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.5.2@
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0 GPU1 GPU2 GPU3 GPU4 GPU5 GPU6 GPU7 NIC0 NIC1 CPU AffinityNUMA Affinity GPU NUMA ID
GPU0 X PIX PIX PIX NODE NODE NODE NODE SYS SYS 0-17,36-53 0 N/A
GPU1 PIX X PIX PIX NODE NODE NODE NODE SYS SYS 0-17,36-53 0 N/A
GPU2 PIX PIX X PIX NODE NODE NODE NODE SYS SYS 0-17,36-53 0 N/A
GPU3 PIX PIX PIX X NODE NODE NODE NODE SYS SYS 0-17,36-53 0 N/A
GPU4 NODE NODE NODE NODE X PIX PIX PIX SYS SYS 0-17,36-53 0 N/A
GPU5 NODE NODE NODE NODE PIX X PIX PIX SYS SYS 0-17,36-53 0 N/A
GPU6 NODE NODE NODE NODE PIX PIX X PIX SYS SYS 0-17,36-53 0 N/A
GPU7 NODE NODE NODE NODE PIX PIX PIX X SYS SYS 0-17,36-53 0 N/A
NIC0 SYS SYS SYS SYS SYS SYS SYS SYS X PIX
NIC1 SYS SYS 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
The text was updated successfully, but these errors were encountered: