A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 05:45 UTC
[ci][build] add tests for python only compilation (#10915)
Signed-off-by: youkaichao <youkaichao@gmail.com>
youkaichao committed
Dec 5, 2024 at 08:54 UTC
9743d64e4e04a88174c76553fcbffa33a18c7db5
4 files changed
+46
-8
.buildkite/test-pipeline.yaml
+9
-2
@@ -50,9 +50,9 @@ steps:
50
- tests/multimodal
51
- tests/test_utils
52
- tests/worker
53
- - tests/test_lazy_torch_compile.py
53
+ - tests/standalone_tests/lazy_torch_compile.py
54
commands:
55
- - python3 test_lazy_torch_compile.py
55
+ - python3 standalone_tests/lazy_torch_compile.py
56
- pytest -v -s mq_llm_engine # MQLLMEngine
57
- pytest -v -s async_engine # AsyncLLMEngine
58
- NUM_SCHEDULER_STEPS=4 pytest -v -s async_engine/test_async_llm_engine.py
@@ -61,6 +61,13 @@ steps:
61
- pytest -v -s test_utils.py # Utils
62
- pytest -v -s worker # Worker
63
64
+- label: Python-only Installation Test
65
+ source_file_dependencies:
66
+ - tests/standalone_tests/python_only_compile.sh
67
+ - setup.py
68
+ commands:
69
+ - bash standalone_tests/python_only_compile.sh
70
+
71
- label: Basic Correctness Test # 30min
72
#mirror_hardwares: [amd]
73
fast_check: true
setup.py
+7
-6
@@ -465,14 +465,15 @@ def get_vllm_version() -> str:
465
if envs.VLLM_TARGET_DEVICE == "empty":
466
version += f"{sep}empty"
467
elif _is_cuda():
468
- cuda_version = str(get_nvcc_cuda_version())
469
- if cuda_version != MAIN_CUDA_VERSION:
470
- cuda_version_str = cuda_version.replace(".", "")[:3]
471
- # skip this for source tarball, required for pypi
472
- if "sdist" not in sys.argv:
473
- version += f"{sep}cu{cuda_version_str}"
468
if envs.VLLM_USE_PRECOMPILED:
469
version += ".precompiled"
470
+ else:
471
+ cuda_version = str(get_nvcc_cuda_version())
472
+ if cuda_version != MAIN_CUDA_VERSION:
473
+ cuda_version_str = cuda_version.replace(".", "")[:3]
474
+ # skip this for source tarball, required for pypi
475
+ if "sdist" not in sys.argv:
476
+ version += f"{sep}cu{cuda_version_str}"
477
elif _is_hip():
478
# Get the HIP version
479
hipcc_version = get_hipcc_rocm_version()
tests/standalone_tests/lazy_torch_compile.py
renamed
tests/standalone_tests/python_only_compile.sh
new
+30
@@ -0,0 +1,30 @@
1
+#!/bin/bash
2
+# This script tests if the python only compilation works correctly
3
+# for users who do not have any compilers installed on their system
4
+
5
+set -e
6
+set -x
7
+
8
+cd /vllm-workspace/
9
+
10
+# uninstall vllm
11
+pip3 uninstall -y vllm
12
+# restore the original files
13
+mv test_docs/vllm ./vllm
14
+
15
+# remove all compilers
16
+apt remove --purge build-essential -y
17
+apt autoremove -y
18
+
19
+echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py
20
+
21
+VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
22
+
23
+# Run the script
24
+python3 -c 'import vllm'
25
+
26
+# Check if the clangd log file was created
27
+if [ ! -f /tmp/changed.file ]; then
28
+ echo "changed.file was not created, python only compilation failed"
29
+ exit 1
30
+fi