vllm-project / vllm

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

[Bug]: vllm cpu installation build from source error #8095

Open park12sj opened 2 weeks ago

park12sj commented 2 weeks ago

Your current environment

The output of `python collect_env.py` ```text Collecting environment information... PyTorch version: 2.4.0+cpu Is debug build: False CUDA used to build PyTorch: Could not collect ROCM used to build PyTorch: N/A OS: Ubuntu 22.04.4 LTS (x86_64) GCC version: (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 Clang version: 14.0.0-1ubuntu1.1 CMake version: version 3.26.1 Libc version: glibc-2.35 Python version: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0] (64-bit runtime) Python platform: Linux-4.19.93-1.nbp.el7.x86_64-x86_64-with-glibc2.35 Is CUDA available: False CUDA runtime version: 12.3.107 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: Tesla T4 Nvidia driver version: 535.54.03 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.7 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.7 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 5220 CPU @ 2.20GHz CPU family: 6 Model: 85 Thread(s) per core: 2 Core(s) per socket: 18 Socket(s): 2 Stepping: 7 BogoMIPS: 4400.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 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 hwp_epp 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: Vulnerable Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Spec store bypass: Vulnerable Vulnerability Spectre v1: Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers Vulnerability Spectre v2: Vulnerable, IBPB: disabled, STIBP: disabled Vulnerability Tsx async abort: Vulnerable Versions of relevant libraries: [pip3] numpy==1.26.4 [pip3] pyzmq==26.2.0 [pip3] torch==2.4.0+cpu [pip3] torchvision==0.19.0+cpu [pip3] transformers==4.44.2 [conda] numpy 1.26.4 pypi_0 pypi [conda] pyzmq 26.2.0 pypi_0 pypi [conda] torch 2.4.0+cpu pypi_0 pypi [conda] torchvision 0.19.0+cpu pypi_0 pypi [conda] transformers 4.44.2 pypi_0 pypi ROCM Version: Could not collect Neuron SDK Version: N/A vLLM Version: N/A vLLM Build Flags: CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled GPU Topology: GPU0 CPU Affinity NUMA Affinity GPU NUMA ID GPU0 X 0-17,36-53 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

in https://docs.vllm.ai/en/latest/getting_started/cpu-installation.html#build-from-source

if i execute VLLM_TARGET_DEVICE=cpu python setup.py install

The following error occurs.

/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/module.h:580:38: note:   initializing argument 2 of ‘virtual void torch::nn::Module::clone_(torch::nn::Module&, int)’
  580 |   virtual void clone_(Module& other, const optional<Device>& device);
      |                                      ^~~~~~~~~~~~~~
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h: In instantiation of ‘std::shared_ptr<torch::nn::Module> torch::nn::Cloneable<Derived>::clone(int) const [with Derived = torch::nn::RNNCellImpl]’:
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:35:27:   required from here
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:78:60: error: invalid conversion from ‘c10::TensorOptions (*)(c10::Device)’ to ‘int’ [-fpermissive]
   78 |       copy->children_[child.key()]->clone_(*child.value(), d

...

/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/init.h:99:17: note:   initializing argument 3 of ‘at::Tensor torch::nn::init::kaiming_uniform_(at::Tensor, double, int, int)’
   99 |     FanModeType mode = torch::kFanIn,
      |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h: In instantiation of ‘void torch::nn::ConvNdImpl<D, Derived>::reset_parameters() [with long unsigned int D = 1; Derived = torch::nn::Conv1dImpl]’:
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:101:5:   required from ‘void torch::nn::ConvNdImpl<D, Derived>::reset() [with long unsigned int D = 1; Derived = torch::nn::Conv1dImpl]’
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:33:8:   required from here
/opt/conda/envs/vllm_ipex/lib/python3.10/site-packages/torch/include/torch/csrc/api/include/torch/nn/modules/conv.h:105:27: error: cannot convert ‘const torch::enumtype::kFanIn’ to ‘int’

Before submitting a new issue...

zhouyuan commented 2 weeks ago

@park12sj It seems the torch installed in the testing environment is not compatible with vLLM CPU backend. Could you please check? below torch version should work: torch == 2.4.0+cpu

thanks, -yuan

park12sj commented 2 weeks ago

@zhouyuan

Hello, I'm using that version and I keep getting the same error.

Collecting environment information...
    PyTorch version: 2.4.0+cpu
zhouyuan commented 2 weeks ago

@park12sj Hi, I tried to setup a conda env here but it is difficult for me to reproduce the issue. Would it be convenient for you have a try on the docker approach? As everything should be up to date in docker and CI is running with this for each commit docker build -f Dockerfile.cpu -t vllm-cpu-env --shm-size=4g .

thanks, -yuan