vllm: [Bug]: Qwen2VL-2b / Qwen2.5-7b has AssertionError and Cuda error when qps goes higher

Your current environment

The output of `python collect_env.py`
Your output of `python collect_env.py` here
INFO 04-25 16:07:26 [__init__.py:239] Automatically detected platform cuda.
Collecting environment information...
/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
  warnings.warn(
PyTorch version: 2.6.0+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 12.1.0
Clang version: Could not collect
CMake version: version 3.31.1
Libc version: glibc-2.33

Python version: 3.10.12 (main, Jan 16 2025, 13:28:48) [GCC 12.1.0] (64-bit runtime)
Python platform: Linux-5.10.0-1.0.0.39-x86_64-with-glibc2.33
Is CUDA available: True
CUDA runtime version: 12.2.91
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA L20
GPU 1: NVIDIA L20
GPU 2: NVIDIA L20
GPU 3: NVIDIA L20

Nvidia driver version: 535.161.08
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
Byte Order:            Little Endian
CPU(s):                128
On-line CPU(s) list:   0-127
Thread(s) per core:    2
Core(s) per socket:    32
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 106
Model name:            Intel(R) Xeon(R) Platinum 8350C CPU @ 2.60GHz
Stepping:              6
CPU MHz:               3100.000
CPU max MHz:           3500.0000
CPU min MHz:           800.0000
BogoMIPS:              5200.00
Virtualization:        VT-x
L1d cache:             48K
L1i cache:             32K
L2 cache:              1280K
L3 cache:              49152K
NUMA node0 CPU(s):     0-31,64-95
NUMA node1 CPU(s):     32-63,96-127
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 monitor 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 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 rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid fsrm md_clear pconfig flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu11==11.11.3.6
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu11==11.8.87
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu11==11.8.89
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu11==11.8.89
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu11==9.1.0.70
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu11==10.9.0.58
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu11==10.3.0.86
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu11==11.4.1.48
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu11==11.7.5.86
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-cusparselt-cu12==0.6.2
[pip3] nvidia-ml-py==12.570.86
[pip3] nvidia-nccl-cu11==2.21.5
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu11==11.8.86
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.3.0
[pip3] torch==2.6.0
[pip3] torchaudio==2.6.0
[pip3] torchvision==0.21.0
[pip3] transformers==4.51.3
[pip3] triton==3.2.0
[conda] Could not collect
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.8.4
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
	GPU0	GPU1	GPU2	GPU3	NIC0	CPU Affinity	NUMA Affinity	GPU NUMA ID
GPU0	 X 	NODE	SYS	SYS	NODE	0-31,64-95	0		N/A
GPU1	NODE	 X 	SYS	SYS	NODE	0-31,64-95	0		N/A
GPU2	SYS	SYS	 X 	NODE	SYS	32-63,96-127	1		N/A
GPU3	SYS	SYS	NODE	 X 	SYS	32-63,96-127	1		N/A
NIC0	NODE	NODE	SYS	SYS	 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_bond_0

CUDA_HOME=/home/hzh/cuda-12.2/
CUDA_HOME=/home/hzh/cuda-12.2/
LD_LIBRARY_PATH=/home/hzh/python-env/python-3.10.12/lib/python3.10/site-packages/nvidia/nvjitlink/lib/:/home/hzh/python-env/python-3.10.12/lib:/home/work/openmpi-4.1.6//lib/:/home/hzh/nccl_2.22.3-1+cuda12.2_x86_64/lib/:/home/hzh/cudnn-8.9.7-for-cuda-12.2/lib/:/home/hzh/cuda-12.2//targets/x86_64-linux/lib:/home/hzh/cuda-12.2//lib64:/home/hzh/cuda-12.2//lib:/usr/lib64/libcuda.so.1:/home/hzh/python-env/python-3.10.12/lib/python3.10/site-packages/nvidia/nvjitlink/lib/:/home/hzh/python-env/python-3.10.12/lib:/home/work/openmpi-4.1.6//lib/:/home/hzh/nccl_2.22.3-1+cuda12.2_x86_64/lib/:/home/hzh/cudnn-8.9.7-for-cuda-12.2/lib/:/home/hzh/cuda-12.2//targets/x86_64-linux/lib:/home/hzh/cuda-12.2//lib64:/home/hzh/cuda-12.2//lib:/usr/lib64/libcuda.so.1:
CUDA_VISIBLE_DEVICES=1
CUDA_VISIBLE_DEVICES=1
NCCL_HOME=/home/hzh/nccl_2.22.3-1+cuda12.2_x86_64
CUDA_AND_CUDNN_LD_LIBRARY_PATH=/home/hzh/cuda-12.2:/home/hzh/cudnn-8.9.7-for-cuda-12.2
CUDNN_HOME=/home/hzh/cudnn-8.9.7-for-cuda-12.2
NCCL_CUMEM_ENABLE=0
PYTORCH_NVML_BASED_CUDA_CHECK=1
TORCHINDUCTOR_COMPILE_THREADS=1
CUDA_MODULE_LOADING=LAZY

šŸ› Describe the bug

The model Qwen2VL-2b can be successfully deployed, and the output is normal when I sent request 1 by 1. But when I increase the qps to 3 or even more, the assertion error assert query.shape[0] == num_prefill_query_tokens appears. After a few seconds, new error RuntimeError: CUDA error: an illegal memory access was encountered appears and the model can’t process any request.

AssertionError 1 File "/home/hzh/aigcqwen2vl2bvllm/bin/qwen2vl2b/model/qwen2vl2b_infer_engine.py", line 122, in get_qwen2vl2b_res outputs = self.model.generate([llm_inputs], sampling_params=sampling_params) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 1134, in inner return fn(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 470, in generate outputs = self._run_engine(use_tqdm=use_tqdm) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 1409, in _run_engine step_outputs = self.llm_engine.step() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 1431, in step outputs = self.model_executor.execute_model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/executor_base.py", line 140, in execute_model output = self.collective_rpc("execute_model", File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/uniproc_executor.py", line 56, in collective_rpc answer = run_method(self.driver_worker, method, args, kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 2378, in run_method return func(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/worker_base.py", line 420, in execute_model output = self.model_runner.execute_model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/model_runner.py", line 1770, in execute_model hidden_or_intermediate_states = model_executable( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2_vl.py", line 1387, in forward hidden_states = self.language_model.model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/compilation/decorators.py", line 172, in __call__ return self.forward(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 344, in forward hidden_states, residual = layer( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 243, in forward hidden_states = self.self_attn( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 177, in forward attn_output = self.attn(q, k, v) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/attention/layer.py", line 218, in forward torch.ops.vllm.unified_attention_with_output( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/_ops.py", line 1123, in __call__ return self._op(*args, **(kwargs or {})) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/attention/layer.py", line 374, in unified_attention_with_output self.impl.forward(self, File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/attention/backends/flash_attn.py", line 775, in forward assert query.shape[0] == num_prefill_query_tokens AssertionError ]

AssetionError2 File "/home/hzh/aigcqwen2vl2bvllm/bin/qwen2vl2b/model/qwen2vl2b_infer_engine.py", line 122, in get_qwen2vl2b_res outputs = self.model.generate([llm_inputs], sampling_params=sampling_params) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 1134, in inner return fn(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 470, in generate outputs = self._run_engine(use_tqdm=use_tqdm) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 1409, in _run_engine step_outputs = self.llm_engine.step() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 1431, in step outputs = self.model_executor.execute_model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/executor_base.py", line 140, in execute_model output = self.collective_rpc("execute_model", File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/uniproc_executor.py", line 56, in collective_rpc answer = run_method(self.driver_worker, method, args, kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 2378, in run_method return func(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/worker_base.py", line 420, in execute_model output = self.model_runner.execute_model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/model_runner.py", line 1770, in execute_model hidden_or_intermediate_states = model_executable( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2_vl.py", line 1387, in forward hidden_states = self.language_model.model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/compilation/decorators.py", line 172, in __call__ return self.forward(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 344, in forward hidden_states, residual = layer( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 243, in forward hidden_states = self.self_attn( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/model_executor/models/qwen2.py", line 177, in forward attn_output = self.attn(q, k, v) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/attention/layer.py", line 218, in forward torch.ops.vllm.unified_attention_with_output( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/torch/_ops.py", line 1123, in __call__ return self._op(*args, **(kwargs or {})) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/attention/layer.py", line 370, in unified_attention_with_output forward_context: ForwardContext = get_forward_context() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/forward_context.py", line 50, in get_forward_context assert _forward_context is not None, ( AssertionError: Forward context is not set. Please use set_forward_context to set the forward context.

AssertionError3 File "/home/hzh/aigcqwen2vl2bvllm/bin/qwen2vl2b/model/qwen2vl2b_infer_engine.py", line 122, in get_qwen2vl2b_res outputs = self.model.generate([llm_inputs], sampling_params=sampling_params) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 1134, in inner return fn(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 470, in generate outputs = self._run_engine(use_tqdm=use_tqdm) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 1409, in _run_engine step_outputs = self.llm_engine.step() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 1375, in step ) = self.scheduler[virtual_engine].schedule() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/core/scheduler.py", line 1501, in schedule scheduler_outputs: SchedulerOutputs = self._schedule() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/core/scheduler.py", line 1460, in _schedule return self._schedule_default() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/core/scheduler.py", line 1293, in _schedule_default assert len(running_scheduled.prefill_seq_groups) == 0

CUDA Error File "/home/hzh/aigcqwen2vl2bvllm/bin/qwen2vl2b/model/qwen2vl2b_infer_engine.py", line 122, in get_qwen2vl2b_res outputs = self.model.generate([llm_inputs], sampling_params=sampling_params) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 1134, in inner return fn(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 470, in generate outputs = self._run_engine(use_tqdm=use_tqdm) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/entrypoints/llm.py", line 1409, in _run_engine step_outputs = self.llm_engine.step() File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/engine/llm_engine.py", line 1431, in step outputs = self.model_executor.execute_model( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/executor_base.py", line 140, in execute_model output = self.collective_rpc("execute_model", File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/executor/uniproc_executor.py", line 56, in collective_rpc answer = run_method(self.driver_worker, method, args, kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 2378, in run_method return func(*args, **kwargs) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/worker_base.py", line 394, in execute_model inputs = self.prepare_input(execute_model_req) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/worker_base.py", line 379, in prepare_input return self._get_driver_input_and_broadcast(execute_model_req) File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/worker_base.py", line 341, in _get_driver_input_and_broadcast self.model_runner.prepare_model_input( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/model_runner.py", line 1664, in prepare_model_input model_input = self._prepare_model_input_tensors( File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/model_runner.py", line 1228, in _prepare_model_input_tensors return self.builder.build() # type: ignore File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/worker/model_runner.py", line 897, in build input_tokens_tensor = async_tensor_h2d(input_tokens, torch.long, File "/home/hzh/aigcqwen2vl2bvllm/bin/des/python_env/lib/python3.10/site-packages/vllm/utils.py", line 890, in async_tensor_h2d return t.to(device=target_device, non_blocking=True) RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1 Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

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.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (10 by maintainers)

Most upvoted comments

@Ericoool9614

lock = threading.Lock() with lock: outputs = self.model.generate(…your code here…)

For me, it doesn’t affect the performance