Open smallccn opened 1 month ago
It could be fixed by below change. Not sure it's the best code for this issue or not.
diff --git a/csrc/cpu/utils.cpp b/csrc/cpu/utils.cpp
index 1138a55d..fc8378ad 100644
--- a/csrc/cpu/utils.cpp
+++ b/csrc/cpu/utils.cpp
@@ -5,6 +5,9 @@
#include "cpu_types.hpp"
+#include <sys/syscall.h>
+#define gettid() syscall(SYS_gettid)
+
std::string init_cpu_threads_env(const std::string& cpu_ids) {
bitmask* omp_cpu_mask = numa_parse_cpustring(cpu_ids.c_str());
TORCH_CHECK(omp_cpu_mask->size > 0);
It could be fixed by below change. Not sure it's the best code for this issue or not.
diff --git a/csrc/cpu/utils.cpp b/csrc/cpu/utils.cpp index 1138a55d..fc8378ad 100644 --- a/csrc/cpu/utils.cpp +++ b/csrc/cpu/utils.cpp @@ -5,6 +5,9 @@ #include "cpu_types.hpp" +#include <sys/syscall.h> +#define gettid() syscall(SYS_gettid) + std::string init_cpu_threads_env(const std::string& cpu_ids) { bitmask* omp_cpu_mask = numa_parse_cpustring(cpu_ids.c_str()); TORCH_CHECK(omp_cpu_mask->size > 0);
it works!
Your current environment
The output of `python collect_env.py`
```text Collecting environment information... WARNING 10-25 14:14:20 _custom_ops.py:19] Failed to import from vllm._C with ImportError('/home/wwei/project/product/vllm/vllm/_C.abi3.so: undefined symbol: dnnl_memory_desc_destroy') INFO 10-25 14:14:20 importing.py:10] Triton not installed; certain GPU-related functions will not be available. 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: Rocky Linux 8.10 (Green Obsidian) (x86_64) GCC version: (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6) Clang version: Could not collect CMake version: version 3.26.4 Libc version: glibc-2.28 Python version: 3.10.15 (main, Oct 3 2024, 07:27:34) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-4.18.0-513.9.1.el8_9.x86_64-x86_64-with-glibc2.28 Is CUDA available: False CUDA runtime version: 11.8.89 CUDA_MODULE_LOADING set to: N/A GPU models and configuration: GPU 0: Quadro P2200 GPU 1: Quadro P2200 GPU 2: Quadro P2200 GPU 3: Quadro P2200 Nvidia driver version: 520.61.05 cuDNN version: Probably one of the following: /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn.so.8 /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 /usr/local/cuda-11.4/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 /usr/local/cuda-11.4/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 CPU(s): 96 On-line CPU(s) list: 0-95 Thread(s) per core: 2 Core(s) per socket: 24 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 85 Model name: Intel(R) Xeon(R) Gold 5220R CPU @ 2.20GHz Stepping: 7 CPU MHz: 2200.000 CPU max MHz: 4000.0000 CPU min MHz: 1000.0000 BogoMIPS: 4400.00 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 1024K L3 cache: 36608K NUMA node0 CPU(s): 0-23,48-71 NUMA node1 CPU(s): 24-47,72-95 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 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 hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear flush_l1d arch_capabilities Versions of relevant libraries: [pip3] intel_extension_for_pytorch==2.4.0+gitfbaa4bc [pip3] numpy==1.26.4 [pip3] onnxruntime==1.16.0 [pip3] pytorch-lightning==2.4.0 [pip3] pytorch-triton==2.1.0+e6216047b8 [pip3] pytorch-wpe==0.0.1 [pip3] pyzmq==26.2.0 [pip3] torch==2.4.0+cpu [pip3] torch-complex==0.4.4 [pip3] torchmetrics==1.4.3 [pip3] torchvision==0.19.0+cpu [pip3] transformers==4.45.2 [conda] intel-extension-for-pytorch 2.4.0+gitfbaa4bc pypi_0 pypi [conda] magma-cuda118 2.6.1 1 pytorch [conda] mkl-include 2024.2.2 pypi_0 pypi [conda] mkl-static 2024.2.2 pypi_0 pypi [conda] numpy 1.26.4 pypi_0 pypi [conda] pytorch-lightning 2.4.0 pypi_0 pypi [conda] pytorch-triton 2.1.0+e6216047b8 pypi_0 pypi [conda] pytorch-wpe 0.0.1 pypi_0 pypi [conda] pyzmq 26.2.0 pypi_0 pypi [conda] torch 2.4.0+cpu pypi_0 pypi [conda] torch-complex 0.4.4 pypi_0 pypi [conda] torchmetrics 1.4.3 pypi_0 pypi [conda] torchvision 0.19.0+cpu pypi_0 pypi [conda] transformers 4.45.2 pypi_0 pypi ROCM Version: Could not collect Neuron SDK Version: N/A vLLM Version: 0.6.4.dev0+gfd47e57f.d20241025 vLLM Build Flags: CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled GPU Topology: GPU0 GPU1 GPU2 GPU3 CPU Affinity NUMA Affinity GPU0 X NODE SYS SYS 0-23,48-71 0 GPU1 NODE X SYS SYS 0-23,48-71 0 GPU2 SYS SYS X NODE 24-47,72-95 1 GPU3 SYS SYS NODE X 24-47,72-95 1 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 ```Model Input Dumps
No response
🐛 Describe the bug
VLLM_TARGET_DEVICE=cpu python setup.py develop running develop /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated. !!
!! easy_install.initialize_options(self) /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!
!! self.initialize_options() running egg_info writing vllm.egg-info/PKG-INFO writing dependency_links to vllm.egg-info/dependency_links.txt writing entry points to vllm.egg-info/entry_points.txt writing requirements to vllm.egg-info/requires.txt writing top-level names to vllm.egg-info/top_level.txt reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'vllm.egg-info/SOURCES.txt' running build_ext -- Build type: RelWithDebInfo -- Target device: cpu -- Found python matching: /home/wwei/miniconda/envs/vllm/bin/python. CMake Warning at /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:22 (message): static library kineto_LIBRARY-NOTFOUND not found. Call Stack (most recent call first): /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/torch/share/cmake/Torch/TorchConfig.cmake:120 (append_torchlib_if_found) CMakeLists.txt:70 (find_package)
-- Enabling core extension. CMake Warning at cmake/cpu_extension.cmake:69 (message): Disable AVX512-BF16 ISA support, no avx512_bf16 found in local CPU flags. If cross-compilation is required, please set env VLLM_CPU_AVX512BF16=1. Call Stack (most recent call first): CMakeLists.txt:111 (include)
-- CPU extension compile flags: -fopenmp;-DVLLM_CPU_EXTENSION;-mavx512f;-mavx512vl;-mavx512bw;-mavx512dq -- Enabling C extension. -- Configuring done (1.5s) -- Generating done (0.0s) -- Build files have been written to: /home/wwei/project/product/vllm/build/temp.linux-x86_64-cpython-310 [1/2] Building CXX object CMakeFiles/_C.dir/csrc/cpu/utils.cpp.o FAILED: CMakeFiles/_C.dir/csrc/cpu/utils.cpp.o /opt/rh/gcc-toolset-13/root/usr/bin/c++ -DPy_LIMITED_API=3 -DTORCH_EXTENSION_NAME=_C -DUSE_C10D_GLOO -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -D_C_EXPORTS -I/home/wwei/project/product/vllm/csrc -isystem /home/wwei/miniconda/envs/vllm/include/python3.10 -isystem /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/torch/include -isystem /home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -O2 -g -DNDEBUG -fPIC -fopenmp -DVLLM_CPU_EXTENSION -mavx512f -mavx512vl -mavx512bw -mavx512dq -D_GLIBCXX_USE_CXX11_ABI=0 -MD -MT CMakeFiles/_C.dir/csrc/cpu/utils.cpp.o -MF CMakeFiles/_C.dir/csrc/cpu/utils.cpp.o.d -o CMakeFiles/_C.dir/csrc/cpu/utils.cpp.o -c /home/wwei/project/product/vllm/csrc/cpu/utils.cpp /home/wwei/project/product/vllm/csrc/cpu/utils.cpp: In function ‘std::string init_cpu_threads_env(const std::string&)’: /home/wwei/project/product/vllm/csrc/cpu/utils.cpp:72:38: error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’? 72 | thread_core_mapping.emplace_back(gettid(), omp_cpu_ids[i]); | ^
setup(
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/init.py", line 117, in setup
return distutils.core.setup(*attrs)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 183, in setup
return run_commands(dist)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
dist.run_commands()
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
self.run_command(cmd)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/dist.py", line 950, in run_command
super().run_command(command)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/command/develop.py", line 35, in run
self.install_for_development()
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/command/develop.py", line 112, in install_for_development
self.run_command('build_ext')
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
self.distribution.run_command(command)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/dist.py", line 950, in run_command
super().run_command(command)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 98, in run
_build_ext.run(self)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
self.build_extensions()
File "/home/wwei/project/product/vllm/setup.py", line 241, in build_extensions
subprocess.check_call(["cmake", build_args], cwd=self.build_temp)
File "/home/wwei/miniconda/envs/vllm/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '-j=96', '--target=_core_C', '--target=_C']' returned non-zero exit status 1.
(vllm)
~| getuid ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/wwei/project/product/vllm/setup.py", line 478, inBefore submitting a new issue...