forked from llumnix-project/llumnix-ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
198 lines (146 loc) · 7.84 KB
/
Copy pathMakefile
File metadata and controls
198 lines (146 loc) · 7.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Copyright (c) 2024, Alibaba Group;
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
.PHONY: init
init:
@git submodule update --init --recursive --remote
.PHONY: vllm_install
vllm_install:
@pip install -e .[vllm]
.PHONY: bladellm_install
bladellm_install:
@pip install -e .[bladellm]
@make proto
.PHONY: vllm_v1_install
vllm_v1_install:
@pip install -e .[vllm_v1]
.PHONY: lint
lint: check_pylint_installed check_pytest_installed
@err=0; \
pylint --rcfile=.pylintrc -s n --jobs=128 ./llumnix setup.py --ignore=llumnix/backends/bladellm/proto || err=1; \
pylint --rcfile=.pylintrc \
--disable=protected-access,super-init-not-called,unused-argument,redefined-outer-name,invalid-name \
-s n --jobs=128 ./tests/e2e_test ./tests/unit_test ./tests/conftest.py || err=1; \
if [ "$$err" -ne "0" ]; then exit 1; fi
.PHONY: clean
clean: proto-clean
###################################### proto begin ######################################
.PHONY: proto
proto:
@find . -type d -name "proto" -not -path "./build/*" | while read dir; do \
dir_base=$$(dirname $$dir); \
find $$dir -name "*.proto" | while read proto_file; do \
echo "Compiling $$proto_file"; \
PYTHONWARNINGS="ignore::DeprecationWarning" python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. $$proto_file; \
done; \
done;
.PHONY: proto-clean
proto-clean:
@find . -name "*_pb2_grpc.py" | xargs rm -f
@find . -name "*_pb2.py" | xargs rm -f
####################################### proto end #######################################
###################################### test begin #######################################
.PHONY: vllm_test
vllm_test: check_pytest_installed vllm_unit_test vllm_offline_test vllm_correctness_test vllm_bench_test vllm_migration_test vllm_register_service_test
.PHONY: bladellm_test
bladellm_test: check_pytest_installed bladellm_correctness_test bladellm_bench_test bladellm_migration_test bladellm_register_service_test bladellm_server_test
.PHONY: vllm_v1_test
vllm_v1_test: check_pytest_installed vllm_v1_unit_test vllm_v1_correctness_test vllm_v1_bench_test vllm_v1_register_service_test
.PHONY: bladellm_unit_test
bladellm_unit_test: check_pytest_installed
@pytest -v --timer-top-n=999 --ignore=third_party --disable-warnings ./tests/unit_test/**/bladellm/
.PHONY: vllm_unit_test
vllm_unit_test: check_pytest_installed
@pytest -v --timer-top-n=999 --ignore=third_party --ignore-glob="tests/**/bladellm" --ignore-glob="tests/**/vllm_v1" --disable-warnings ./tests/unit_test/
.PHONY: vllm_v1_unit_test
vllm_v1_unit_test: check_pytest_installed
@VLLM_USE_V1=1 pytest -v --timer-top-n=999 --ignore=third_party --disable-warnings ./tests/unit_test/**/vllm_v1
.PHONY: vllm_offline_test
vllm_offline_test:
@python examples/offline_inference.py
.PHONY: vllm_correctness_test
vllm_correctness_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM and not _v1 or not engine_' --tb=long ./tests/e2e_test/test_correctness.py
.PHONY: vllm_v1_correctness_test
vllm_v1_correctness_test: check_pytest_installed
@NCCL_SOCKET_IFNAME=eth0 pytest -v -x -s -k 'engine_vLLM_v1 or not engine_' --tb=long ./tests/e2e_test/test_correctness.py
.PHONY: bladellm_correctness_test
bladellm_correctness_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_correctness.py
.PHONY: vllm_trace_test
vllm_trace_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM and not _v1 or not engine_' --tb=long ./tests/e2e_test/test_trace_request.py
.PHONY: bladellm_trace_test
bladellm_trace_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_trace_request.py
.PHONY: vllm_bench_test
vllm_bench_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM and not _v1 or not engine_' --tb=long ./tests/e2e_test/test_bench.py
.PHONY: vllm_v1_bench_test
vllm_v1_bench_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM_v1 or not engine_' --tb=long ./tests/e2e_test/test_bench.py
.PHONY: bladellm_bench_test
bladellm_bench_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_bench.py
.PHONY: vllm_migration_test
vllm_migration_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM and not _v1 or not engine_' --tb=long ./tests/e2e_test/test_migration.py
.PHONY: bladellm_migration_test
bladellm_migration_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_migration.py
.PHONY: vllm_register_service_test
vllm_register_service_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM and not _v1 or not engine_' --tb=long ./tests/e2e_test/test_register_service.py
.PHONY: vllm_v1_register_service_test
vllm_v1_register_service_test: check_pytest_installed
@pytest -v -x -s -k 'engine_vLLM_v1 or not engine_' --tb=long ./tests/e2e_test/test_register_service.py
.PHONY: bladellm_register_service_test
bladellm_register_service_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_register_service.py
.PHONY: bladellm_server_test
bladellm_server_test: check_pytest_installed
@pytest -v -x -s -k 'engine_BladeLLM or not engine_' --tb=long ./tests/e2e_test/test_server.py
####################################### test end ########################################
#################### pygloo install for gloo migration backend begin ####################
BAZEL_CMD = bazel
PYGLOO_DIR = third_party/pygloo
.PHONY: pygloo
pygloo: init
@./tools/pygloo_install.sh
##################### pygloo install for gloo migration backend end #####################
###################################### cupy begin #######################################
.PHONY: cupy-cuda
cupy-cuda:
@./tools/cupy_cuda_install.sh
####################################### cupy end ########################################
##################################### pylint begin ######################################
PYLINT_VERSION = 2.12.2
.PHONY: check_pylint_installed
check_pylint_installed:
@python3 -c "import pylint; assert pylint.__version__ == '$(PYLINT_VERSION)'" 2>/dev/null || { \
echo "pylint is not installed or version does not match $(PYLINT_VERSION). Installing..."; \
python3 -m pip install --force-reinstall pylint==$(PYLINT_VERSION); }
###################################### pylint end #######################################
##################################### pytest begin ######################################
.PHONY: check_pytest_installed
check_pytest_installed:
@python3 -m pip show pytest > /dev/null 2>&1 || { \
echo "pytest is not installed. Installing pytest ..."; \
python3 -m pip install pytest; }
@python3 -m pip show pytest-asyncio > /dev/null 2>&1 || { \
echo "pytest-asyncio is not installed. Installing pytest-asyncio ..."; \
python3 -m pip install pytest-asyncio; }
@python3 -m pip show pytest-timeout > /dev/null 2>&1 || { \
echo "pytest-timeout is not installed. Installing pytest-timeout ..."; \
python3 -m pip install -i https://mirrors.aliyun.com/pypi/simple/ pytest-timeout; }
@python3 -m pip show pytest-timer > /dev/null 2>&1 || { \
echo "pytest-timer is not installed. Installing pytest-timer ..."; \
python3 -m pip install -i https://mirrors.aliyun.com/pypi/simple/ pytest-timer; }
###################################### pytest end #######################################