vllm-project / vllm

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

[Bug]: bus error (core dumped) #3916

Closed jeejeelee closed 6 months ago

jeejeelee commented 6 months ago

Your current environment

Collecting environment information...
PyTorch version: 2.2.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: version 3.26.0
Libc version: glibc-2.31

Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 535.129.03
cuDNN version: Probably one of the following:
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-12.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
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
Address sizes:                      46 bits physical, 48 bits virtual
CPU(s):                             8
On-line CPU(s) list:                0-7
Thread(s) per core:                 2
Core(s) per socket:                 4
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          GenuineIntel
CPU family:                         6
Model:                              63
Model name:                         Intel(R) Xeon(R) CPU E5-1630 v3 @ 3.70GHz
Stepping:                           2
CPU MHz:                            3135.261
CPU max MHz:                        3800.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           7383.23
L1d cache:                          128 KiB
L1i cache:                          128 KiB
L2 cache:                           1 MiB
L3 cache:                           10 MiB
NUMA node0 CPU(s):                  0-7
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX unsupported
Vulnerability L1tf:                 Mitigation; PTE Inversion
Vulnerability Mds:                  Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
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
Vulnerability Srbds:                Not affected
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 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 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 cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d

Versions of relevant libraries:
[pip3] mypy==0.991
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] torch==2.2.1
[pip3] torch-tb-profiler==0.4.3
[pip3] triton==2.2.0
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] torch                     2.2.1                    pypi_0    pypi
[conda] torch-tb-profiler         0.4.3                    pypi_0    pypi
[conda] triton                    2.2.0                    pypi_0    pypiROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.4.0.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-7 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

🐛 Describe the bug

I build the vllm from source, and encountered the following error:

2293159 bus error (core dumped)

Minimal code to reproduce the error:

pytest test_model_runner.py
jeejeelee commented 6 months ago

The error occurred while executing this code. I have tested this on different devices, and all encountered the same error.

esmeetu commented 6 months ago

@jeejeelee Could you put up the whole error log?

jeejeelee commented 6 months ago

@jeejeelee Could you put up the whole error log?

Thanks , the whole error log as follow:

[1]    2297008 bus error (core dumped)  pytest test_model_runner.py
esmeetu commented 6 months ago

@jeejeelee 🥲 Is it good for you to run the vllm engine? Is that error only related to test_model_runner?

jeejeelee commented 6 months ago

Is it good for you to run the vllm engine? Is that error only related to test_model_runner?

Nope, actually, I encountered this error while running offline_inference.py, and then encountered the same error when running pytest test_model_runner.py.

By the way, I'm curious if you encountered this error while building the source from source.

It's possible it's an issue with my environment, but I've tested it on both RTX3090 and A800, and the error occurred in both cases

I also ran the following command:

ldd libnccl.so.2.18.1

And encountered an error in the result:

ldd: exited with unknown exit code (135)

Thanks for your response

jeejeelee commented 6 months ago

After reinstalling NCCL from https://github.com/NVIDIA/nccl, I successfully resolved this error

youkaichao commented 6 months ago

I also ran the following command:

ldd libnccl.so.2.18.1

And encountered an error in the result:

ldd: exited with unknown exit code (135)

This usually means the library is corrupted. Glad that it is resolved by reinstalling nccl 👍

jeejeelee commented 6 months ago

@youkaichao Thanks for your reponse. Although reinstalling solved the error, I am curious about where the libnccl.so.2.18. in .config/vllm/nccl/cu12 came from. It should be libnccl.so.2.18 that caused this error , so replacing it after reinstalling nccl fixed this error.

youkaichao commented 6 months ago

It is downloaded from https://developer.download.nvidia.com/compute/redist/nccl/ .

Can you give more details of your environment? I need to check what caused the problem. The downloaded nccl should work for x86_64 in general.

You can report your environment by executing https://github.com/vllm-project/vllm/blob/main/collect_env.py .

jeejeelee commented 6 months ago

@youkaichao

As mentioned earlier, the environment information I provided was generated using collect_env.py. I am glad to assist you in analyzing this problem, if you need any additional information from me,feel free to reach out to me

youkaichao commented 6 months ago

Uh, I see. Can you please download and unzip this wheel https://pypi.org/project/nvidia-nccl-cu12/2.18.3/#files , and see if ldd for the .so file inside also core dump?

jeejeelee commented 6 months ago

@youkaichao

$ unzip nvidia_nccl_cu12-2.18.3-py3-none-manylinux1_x86_64.whl                                                            
      Archive:  nvidia_nccl_cu12-2.18.3-py3-none-manylinux1_x86_64.whl                                                            
      inflating: nvidia/__init__.py                                                                                             
      inflating: nvidia/nccl/__init__.py                                                                                        
      inflating: nvidia/nccl/include/__init__.py                                                                                
      inflating: nvidia/nccl/include/nccl.h                                                                                     
      inflating: nvidia/nccl/include/nccl_net.h                                                                                 
      inflating: nvidia/nccl/lib/__init__.py                                                                                    
      inflating: nvidia/nccl/lib/libnccl.so.2                                                                                   
      inflating: nvidia_nccl_cu12-2.18.3.dist-info/License.txt                                                                  
      inflating: nvidia_nccl_cu12-2.18.3.dist-info/METADATA                                                                     
      inflating: nvidia_nccl_cu12-2.18.3.dist-info/WHEEL                                                                        
      inflating: nvidia_nccl_cu12-2.18.3.dist-info/top_level.txt                                                                
      inflating: nvidia_nccl_cu12-2.18.3.dist-info/RECORD 

and then:

ldd libnccl.so.2 
      linux-vdso.so.1 (0x00007ffffb1bc000)
      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f16d3bbd000)
      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f16d3bb3000)
      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f16d3bad000)
      libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f16d39cb000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f16d387c000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f16d3861000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f16d366d000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f16e4853000)

The ldd result looks like correct. Actually, I build the source by the following command:

VLLM_INSTALL_PUNICA_KERNELS=1 pip install -e .  -i https://pypi.tuna.tsinghua.edu.cn/simple

the installed vllm-nccl-cu12 is

vllm-nccl-cu12            2.18.1.0.1.0

The size of the libnccl.so you provided the link for is 277MB, whereas the one I downloaded is only 45MB.

The reason might be the addition of the Tsinghua mirror ?

youkaichao commented 6 months ago

whereas the one I downloaded is only 45MB.

Which one is 45MB? I checked the https://pypi.tuna.tsinghua.edu.cn/simple/nvidia-nccl-cu12/ , and the file is over 200MB.

You can see the installation script at https://github.com/vllm-project/vllm-nccl/blob/main/setup.py , can you try to download it yourself? It might be some problem of your installation, e.g. incomplete download?

jeejeelee commented 6 months ago

@youkaichao
The nccl.so installed using the Tsinghua mirror only occupy 45MB.

The problem indeed arose due to incomplete downloads. It appears that the issue was indeed related to my network. After reconfiguring my network settings and reinstalling vllm, nccl.so is now displaying correctly when using ldd, and I am no longer encountering the previously mentioned core dumped.

Thank you once again for your helpful feedback.

dachengai commented 6 months ago

@youkaichao The nccl.so installed using the Tsinghua mirror only occupy 45MB.

The problem indeed arose due to incomplete downloads. It appears that the issue was indeed related to my network. After reconfiguring my network settings and reinstalling vllm, nccl.so is now displaying correctly when using ldd, and I am no longer encountering the previously mentioned core dumped.

Thank you once again for your helpful feedback.

how to fix this error! change to aliyun mirror ?

jeejeelee commented 6 months ago

@youkaichao The nccl.so installed using the Tsinghua mirror only occupy 45MB. The problem indeed arose due to incomplete downloads. It appears that the issue was indeed related to my network. After reconfiguring my network settings and reinstalling vllm, nccl.so is now displaying correctly when using ldd, and I am no longer encountering the previously mentioned core dumped. Thank you once again for your helpful feedback.

how to fix this error! change to aliyun mirror ?

Reinstalling NCCL from https://github.com/NVIDIA/nccl