[ci][build] add tests for python only compilation (#10915)
Signed-off-by: youkaichao <youkaichao@gmail.com>
This commit is contained in:
parent
a43065272f
commit
9743d64e4e
@ -50,9 +50,9 @@ steps:
|
|||||||
- tests/multimodal
|
- tests/multimodal
|
||||||
- tests/test_utils
|
- tests/test_utils
|
||||||
- tests/worker
|
- tests/worker
|
||||||
- tests/test_lazy_torch_compile.py
|
- tests/standalone_tests/lazy_torch_compile.py
|
||||||
commands:
|
commands:
|
||||||
- python3 test_lazy_torch_compile.py
|
- python3 standalone_tests/lazy_torch_compile.py
|
||||||
- pytest -v -s mq_llm_engine # MQLLMEngine
|
- pytest -v -s mq_llm_engine # MQLLMEngine
|
||||||
- pytest -v -s async_engine # AsyncLLMEngine
|
- pytest -v -s async_engine # AsyncLLMEngine
|
||||||
- NUM_SCHEDULER_STEPS=4 pytest -v -s async_engine/test_async_llm_engine.py
|
- NUM_SCHEDULER_STEPS=4 pytest -v -s async_engine/test_async_llm_engine.py
|
||||||
@ -61,6 +61,13 @@ steps:
|
|||||||
- pytest -v -s test_utils.py # Utils
|
- pytest -v -s test_utils.py # Utils
|
||||||
- pytest -v -s worker # Worker
|
- pytest -v -s worker # Worker
|
||||||
|
|
||||||
|
- label: Python-only Installation Test
|
||||||
|
source_file_dependencies:
|
||||||
|
- tests/standalone_tests/python_only_compile.sh
|
||||||
|
- setup.py
|
||||||
|
commands:
|
||||||
|
- bash standalone_tests/python_only_compile.sh
|
||||||
|
|
||||||
- label: Basic Correctness Test # 30min
|
- label: Basic Correctness Test # 30min
|
||||||
#mirror_hardwares: [amd]
|
#mirror_hardwares: [amd]
|
||||||
fast_check: true
|
fast_check: true
|
||||||
|
13
setup.py
13
setup.py
@ -465,14 +465,15 @@ def get_vllm_version() -> str:
|
|||||||
if envs.VLLM_TARGET_DEVICE == "empty":
|
if envs.VLLM_TARGET_DEVICE == "empty":
|
||||||
version += f"{sep}empty"
|
version += f"{sep}empty"
|
||||||
elif _is_cuda():
|
elif _is_cuda():
|
||||||
cuda_version = str(get_nvcc_cuda_version())
|
|
||||||
if cuda_version != MAIN_CUDA_VERSION:
|
|
||||||
cuda_version_str = cuda_version.replace(".", "")[:3]
|
|
||||||
# skip this for source tarball, required for pypi
|
|
||||||
if "sdist" not in sys.argv:
|
|
||||||
version += f"{sep}cu{cuda_version_str}"
|
|
||||||
if envs.VLLM_USE_PRECOMPILED:
|
if envs.VLLM_USE_PRECOMPILED:
|
||||||
version += ".precompiled"
|
version += ".precompiled"
|
||||||
|
else:
|
||||||
|
cuda_version = str(get_nvcc_cuda_version())
|
||||||
|
if cuda_version != MAIN_CUDA_VERSION:
|
||||||
|
cuda_version_str = cuda_version.replace(".", "")[:3]
|
||||||
|
# skip this for source tarball, required for pypi
|
||||||
|
if "sdist" not in sys.argv:
|
||||||
|
version += f"{sep}cu{cuda_version_str}"
|
||||||
elif _is_hip():
|
elif _is_hip():
|
||||||
# Get the HIP version
|
# Get the HIP version
|
||||||
hipcc_version = get_hipcc_rocm_version()
|
hipcc_version = get_hipcc_rocm_version()
|
||||||
|
30
tests/standalone_tests/python_only_compile.sh
Normal file
30
tests/standalone_tests/python_only_compile.sh
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script tests if the python only compilation works correctly
|
||||||
|
# for users who do not have any compilers installed on their system
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
cd /vllm-workspace/
|
||||||
|
|
||||||
|
# uninstall vllm
|
||||||
|
pip3 uninstall -y vllm
|
||||||
|
# restore the original files
|
||||||
|
mv test_docs/vllm ./vllm
|
||||||
|
|
||||||
|
# remove all compilers
|
||||||
|
apt remove --purge build-essential -y
|
||||||
|
apt autoremove -y
|
||||||
|
|
||||||
|
echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py
|
||||||
|
|
||||||
|
VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
|
||||||
|
|
||||||
|
# Run the script
|
||||||
|
python3 -c 'import vllm'
|
||||||
|
|
||||||
|
# Check if the clangd log file was created
|
||||||
|
if [ ! -f /tmp/changed.file ]; then
|
||||||
|
echo "changed.file was not created, python only compilation failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user