Skip to content
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

[Bug]: Crash with Qwen2-Audio Model in vLLM During Audio Processing #10627

Open
1 task done
jiahansu opened this issue Nov 25, 2024 · 2 comments
Open
1 task done

[Bug]: Crash with Qwen2-Audio Model in vLLM During Audio Processing #10627

jiahansu opened this issue Nov 25, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jiahansu
Copy link

Your current environment

The output of `python collect_env.py`
Collecting environment information...
PyTorch version: 2.5.1+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.35

Python version: 3.12.7 | packaged by Anaconda, Inc. | (main, Oct  4 2024, 13:27:36) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-122-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.4.131
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA RTX A6000
Nvidia driver version: 560.35.03
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):                               64
On-line CPU(s) list:                  0-63
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz
CPU family:                           6
Model:                                79
Thread(s) per core:                   2
Core(s) per socket:                   16
Socket(s):                            2
Stepping:                             1
CPU max MHz:                          3000.0000
CPU min MHz:                          1200.0000
BogoMIPS:                             4200.09
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 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 cdp_l3 invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts md_clear flush_l1d
Virtualization:                       VT-x
L1d cache:                            1 MiB (32 instances)
L1i cache:                            1 MiB (32 instances)
L2 cache:                             8 MiB (32 instances)
L3 cache:                             80 MiB (2 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-15,32-47
NUMA node1 CPU(s):                    16-31,48-63
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          KVM: Mitigation: VMX disabled
Vulnerability L1tf:                   Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:                    Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:               Mitigation; PTI
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   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; Retpolines; IBPB conditional; IBRS_FW; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Mitigation; Clear CPU buffers; SMT vulnerable

Versions of relevant libraries:
[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-ml-py==12.560.30
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] pyzmq==26.2.0
[pip3] torch==2.5.1
[pip3] torchvision==0.20.1
[pip3] transformers==4.46.2
[pip3] triton==3.1.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-cublas-cu12        12.4.5.8                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.4.127                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.2.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.5.147               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.6.1.9                 pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.3.1.170               pypi_0    pypi
[conda] nvidia-ml-py              12.560.30                pypi_0    pypi
[conda] nvidia-nccl-cu12          2.21.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.4.127                 pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.4.127                 pypi_0    pypi
[conda] pyzmq                     26.2.0                   pypi_0    pypi
[conda] torch                     2.5.1                    pypi_0    pypi
[conda] torchvision               0.20.1                   pypi_0    pypi
[conda] transformers              4.46.2                   pypi_0    pypi
[conda] triton                    3.1.0                    pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.4.post1
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      0-15,32-47      0               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

NVIDIA_VISIBLE_DEVICES=GPU-72601697-9e67-4365-1e25-cff04423fb9f
NVIDIA_REQUIRE_CUDA=cuda>=12.4 brand=tesla,driver>=470,driver<471 brand=unknown,driver>=470,driver<471 brand=nvidia,driver>=470,driver<471 brand=nvidiartx,driver>=470,driver<471 brand=geforce,driver>=470,driver<471 brand=geforcertx,driver>=470,driver<471 brand=quadro,driver>=470,driver<471 brand=quadrortx,driver>=470,driver<471 brand=titan,driver>=470,driver<471 brand=titanrtx,driver>=470,driver<471 brand=tesla,driver>=525,driver<526 brand=unknown,driver>=525,driver<526 brand=nvidia,driver>=525,driver<526 brand=nvidiartx,driver>=525,driver<526 brand=geforce,driver>=525,driver<526 brand=geforcertx,driver>=525,driver<526 brand=quadro,driver>=525,driver<526 brand=quadrortx,driver>=525,driver<526 brand=titan,driver>=525,driver<526 brand=titanrtx,driver>=525,driver<526 brand=tesla,driver>=535,driver<536 brand=unknown,driver>=535,driver<536 brand=nvidia,driver>=535,driver<536 brand=nvidiartx,driver>=535,driver<536 brand=geforce,driver>=535,driver<536 brand=geforcertx,driver>=535,driver<536 brand=quadro,driver>=535,driver<536 brand=quadrortx,driver>=535,driver<536 brand=titan,driver>=535,driver<536 brand=titanrtx,driver>=535,driver<536
NCCL_VERSION=2.21.5-1
NVIDIA_DRIVER_CAPABILITIES=compute,display,graphics,utility,video
NVIDIA_PRODUCT_NAME=CUDA
CUDA_VERSION=12.4.1
LD_LIBRARY_PATH=/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/cv2/../../lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
CUDA_MODULE_LOADING=LAZY

Model Input Dumps

dump.zip

🐛 Describe the bug

When running the Qwen2-Audio model with vLLM for audio transcription tasks, the process may crash with a RuntimeError due to a shape mismatch during tensor operations.

Host the Qwen2-Audio Server:

vllm serve Qwen/Qwen2-Audio-7B-Instruct--dtype=bfloat16 --port=5000 --served-model-name qwen2-audio-7b-instruct --gpu_memory_utilization=0.95

Submit an audio file for text transcription:

curl https://mtt0f4kcgk6iw5-5000.proxy.runpod.net//v1/chat/completions \
    -X POST \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "qwen2-audio-7b-instruc", "max_tokens":512, "temperature":0.01,
    "messages" : [{ "role": "user", "content": [ {"type": "audio_url", "audio_url": {"url": "xxx.mp3"}}, {"type": "text", "text": “提取文本"}]}]  }'

Error log:

NFO 11-24 17:46:31 logger.py:37] Received request chatcmpl-247fa5bbcca64896b269dc58fe916d23: prompt: '<|im_start|>system\nYou are responsible for transcribing audio recordings into text.<|im_end|>\n<|im_start|>user\nAudio 1: <|audio_bos|><|AUDIO|><|audio_eos|>\n提取文字<|im_end|>\n<|im_start|>assistant\n', params: SamplingParams(n=1, presence_penalty=0.0, frequency_penalty=0.0, repetition_penalty=1.0, temperature=0.01, top_p=1.0, top_k=-1, min_p=0.0, seed=None, stop=[], stop_token_ids=[], bad_words=[], include_stop_str_in_output=False, ignore_eos=False, max_tokens=512, min_tokens=0, logprobs=None, prompt_logprobs=None, skip_special_tokens=True, spaces_between_special_tokens=True, truncate_prompt_tokens=None, guided_decoding=None), prompt_token_ids: None, lora_request: None, prompt_adapter_request: None.
INFO 11-24 17:46:31 preprocess.py:215] Your model uses the legacy input pipeline instead of the new multi-modal processor. Please note that the legacy pipeline will be removed in a future release. For more details, see: https://github.com/vllm-project/vllm/issues/10114
INFO 11-24 17:46:31 engine.py:267] Added request chatcmpl-247fa5bbcca64896b269dc58fe916d23.
INFO 11-24 17:46:32 model_runner_base.py:120] Writing input of failed execution to /tmp/err_execute_model_input_20241124-174632.pkl...
INFO 11-24 17:46:32 model_runner_base.py:149] Completed writing input of failed execution to /tmp/err_execute_model_input_20241124-174632.pkl.
CRITICAL 11-24 17:46:32 launcher.py:99] MQLLMEngine is already dead, terminating server process
INFO:     100.64.0.25:41350 - "POST /v1/chat/completions HTTP/1.1" 500 Internal Server Error
ERROR 11-24 17:46:32 engine.py:135] RuntimeError('Error in model execution (input dumped to /tmp/err_execute_model_input_20241124-174632.pkl): shape mismatch: value tensor of shape [211, 4096] cannot be broadcast to indexing result of shape [212, 4096]')
ERROR 11-24 17:46:32 engine.py:135] Traceback (most recent call last):
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/worker/model_runner_base.py", line 116, in _wrapper
ERROR 11-24 17:46:32 engine.py:135]     return func(*args, **kwargs)
ERROR 11-24 17:46:32 engine.py:135]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/worker/model_runner.py", line 1654, in execute_model
ERROR 11-24 17:46:32 engine.py:135]     hidden_or_intermediate_states = model_executable(
ERROR 11-24 17:46:32 engine.py:135]                                     ^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
ERROR 11-24 17:46:32 engine.py:135]     return self._call_impl(*args, **kwargs)
ERROR 11-24 17:46:32 engine.py:135]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
ERROR 11-24 17:46:32 engine.py:135]     return forward_call(*args, **kwargs)
ERROR 11-24 17:46:32 engine.py:135]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/models/qwen2_audio.py", line 396, in forward
ERROR 11-24 17:46:32 engine.py:135]     inputs_embeds[mask, :] = masked_audio_features
ERROR 11-24 17:46:32 engine.py:135]     ~~~~~~~~~~~~~^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135] RuntimeError: shape mismatch: value tensor of shape [211, 4096] cannot be broadcast to indexing result of shape [212, 4096]
ERROR 11-24 17:46:32 engine.py:135] 
ERROR 11-24 17:46:32 engine.py:135] The above exception was the direct cause of the following exception:
ERROR 11-24 17:46:32 engine.py:135] 
ERROR 11-24 17:46:32 engine.py:135] Traceback (most recent call last):
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/engine/multiprocessing/engine.py", line 133, in start
ERROR 11-24 17:46:32 engine.py:135]     self.run_engine_loop()
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/engine/multiprocessing/engine.py", line 196, in run_engine_loop
ERROR 11-24 17:46:32 engine.py:135]     request_outputs = self.engine_step()
ERROR 11-24 17:46:32 engine.py:135]                       ^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/engine/multiprocessing/engine.py", line 214, in engine_step
ERROR 11-24 17:46:32 engine.py:135]     raise e
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/engine/multiprocessing/engine.py", line 205, in engine_step
ERROR 11-24 17:46:32 engine.py:135]     return self.engine.step()
ERROR 11-24 17:46:32 engine.py:135]            ^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/engine/llm_engine.py", line 1454, in step
ERROR 11-24 17:46:32 engine.py:135]     outputs = self.model_executor.execute_model(
ERROR 11-24 17:46:32 engine.py:135]               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/executor/gpu_executor.py", line 125, in execute_model
ERROR 11-24 17:46:32 engine.py:135]     output = self.driver_worker.execute_model(execute_model_req)
ERROR 11-24 17:46:32 engine.py:135]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/worker/worker_base.py", line 343, in execute_model
ERROR 11-24 17:46:32 engine.py:135]     output = self.model_runner.execute_model(
ERROR 11-24 17:46:32 engine.py:135]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
ERROR 11-24 17:46:32 engine.py:135]     return func(*args, **kwargs)
ERROR 11-24 17:46:32 engine.py:135]            ^^^^^^^^^^^^^^^^^^^^^
ERROR 11-24 17:46:32 engine.py:135]   File "/workspace/miniconda3/envs/vllm/lib/python3.12/site-packages/vllm/worker/model_runner_base.py", line 152, in _wrapper
ERROR 11-24 17:46:32 engine.py:135]     raise type(err)(
ERROR 11-24 17:46:32 engine.py:135] RuntimeError: Error in model execution (input dumped to /tmp/err_execute_model_input_20241124-174632.pkl): shape mismatch: value tensor of shape [211, 4096] cannot be broadcast to indexing result of shape [212, 4096]

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.
@jiahansu jiahansu added the bug Something isn't working label Nov 25, 2024
@DarkLight1337
Copy link
Member

DarkLight1337 commented Nov 25, 2024

Are you able to reproduce this with a particular example? Or does this just happen randomly?

I have noticed occasional errors with MiniCPM-V similar to this one in the CI, but retrying always fixes it.

@jiahansu
Copy link
Author

Are you able to reproduce this with a particular example? Or does this just happen randomly?

I have noticed occasional errors with MiniCPM-V similar to this one in the CI, but retrying always fixes it.

I’m not entirely sure because the input sound is captured from the microphone. It’s likely that this issue only occurs with a specific audio clip. I’ll try to reproduce the problem and upload the corresponding audio clip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants