vllm-project / vllm

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

[Bug]: install vllm ocurr the building error #7785

Open Mysnake opened 3 weeks ago

Mysnake commented 3 weeks ago

Your current environment

Building wheels for collected packages: vllm Building wheel for vllm (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for vllm (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [71 lines of output] /tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/torch/_subclasses/functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.) cpu = _conversion_method_template(device=torch.device("cpu")) fatal: not a git repository (or any of the parent directories): .git

:56: RuntimeWarning: Failed to get commit hash: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128. running bdist_wheel running build running build_py running build_ext CMake Error at CMakeLists.txt:3 (project): Running '/tmp/pip-build-env-bxpa0h4m/overlay/bin/ninja' '--version' failed with: no such file or directory -- Configuring incomplete, errors occurred! Traceback (most recent call last): File "/home/dj/anaconda3/envs/vllm/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/home/dj/anaconda3/envs/vllm/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/dj/anaconda3/envs/vllm/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel return _build_backend().build_wheel(wheel_directory, config_settings, File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 420, in build_wheel return self._build_with_temp_dir( File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 402, in _build_with_temp_dir self.run_setup() File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 474, in File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 111, in setup return distutils.core.setup(**attrs) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 184, in setup return run_commands(dist) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 200, in run_commands dist.run_commands() File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 964, in run_commands self.run_command(cmd) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 948, in run_command super().run_command(command) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_command cmd_obj.run() File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/command/bdist_wheel.py", line 384, in run self.run_command("build") File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 948, in run_command super().run_command(command) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_command cmd_obj.run() File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run self.run_command(cmd_name) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command self.distribution.run_command(command) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 948, in run_command super().run_command(command) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 983, in run_command cmd_obj.run() File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 96, in run _build_ext.run(self) File "/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run self.build_extensions() File "", line 226, in build_extensions File "", line 208, in configure File "/home/dj/anaconda3/envs/vllm/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/home/dj/vllm', '-G', 'Ninja', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/dj/vllm/build/lib.linux-x86_64-cpython-310/vllm', '-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=build/temp.linux-x86_64-cpython-310', '-DVLLM_TARGET_DEVICE=cuda', '-DVLLM_PYTHON_EXECUTABLE=/home/dj/anaconda3/envs/vllm/bin/python', '-DVLLM_PYTHON_PATH=/home/dj/anaconda3/envs/vllm/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process:/tmp/pip-build-env-o_ebi3i5/site:/home/dj/anaconda3/envs/vllm/lib/python310.zip:/home/dj/anaconda3/envs/vllm/lib/python3.10:/home/dj/anaconda3/envs/vllm/lib/python3.10/lib-dynload:/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages:/tmp/pip-build-env-o_ebi3i5/normal/lib/python3.10/site-packages:/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/setuptools/_vendor', '-DNVCC_THREADS=1', '-DCMAKE_JOB_POOL_COMPILE:STRING=compile', '-DCMAKE_JOB_POOLS:STRING=compile=128']' returned non-zero exit status 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for vllm Failed to build vllm ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (vllm) ### 🐛 Describe the bug install vllm ocurr the building error
mgoin commented 3 weeks ago

Based on this log

/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/torch/_subclasses/functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)

it seems you are having problems with a compatible numpy version for pytorch. I would recommend making a fresh virtual environment and installing vLLM from scratch

youkaichao commented 3 weeks ago

@mgoin looks like this is the cause:

fatal: not a git repository (or any of the parent directories): .git :56: RuntimeWarning: Failed to get commit hash:

dbtzy commented 3 weeks ago

Based on this log

/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/torch/_subclasses/functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)

it seems you are having problems with a compatible numpy version for pytorch. I would recommend making a fresh virtual environment and installing vLLM from scratch

I seem the same problems on v0.5.5. I create a new conda env, but it still exists.

dbtzy commented 3 weeks ago

Based on this log

/tmp/pip-build-env-o_ebi3i5/overlay/lib/python3.10/site-packages/torch/_subclasses/functional_tensor.py:258: UserWarning: Failed to initialize NumPy: No module named 'numpy' (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)

it seems you are having problems with a compatible numpy version for pytorch. I would recommend making a fresh virtual environment and installing vLLM from scratch

I seem the same problems on v0.5.5. I create a new conda env, but it still exists.

I cleaning up existing builds (via python setup.py clean) and then re-running pip install -e . works.