-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
131 lines (96 loc) · 4.31 KB
/
Makefile
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
# 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
.PHONY: install
install:
@pip install -e .[vllm]
.PHONY: lint
lint: check_pylint_installed check_pytest_installed
@pylint --rcfile=.pylintrc -s n --jobs=128 ./llumnix
@pylint --rcfile=.pylintrc \
--disable=protected-access,super-init-not-called,unused-argument,redefined-outer-name,invalid-name \
-s n --jobs=128 ./tests
.PHONY: clean
clean: proto-clean
###################################### proto begin ######################################
.PHONY: proto
proto:
@find . -type d -name "proto" | 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: test
test: check_pytest_installed
@pytest -v --ignore=third_party/ --ignore=tests/e2e_test --disable-warnings
@python examlpes/offline_inference.py
@pytest -v -x -s --tb=long ./tests/e2e_test/test_e2e.py
@pytest -v -x -s --tb=long ./tests/e2e_test/test_bench.py
@pytest -v -x -s --tb=long ./tests/e2e_test/test_migration.py
.PHONY: unit_test
unit_test: check_pytest_installed
@pytest -v --ignore=third_party/ --ignore=tests/e2e_test --disable-warnings
.PHONY: offline_test
offline_test:
@python examlpes/offline_inference.py
.PHONY: e2e_test
e2e_test:
@pytest -v -x -s --tb=long ./tests/e2e_test/test_e2e.py
.PHONY: bench_test
bench_test:
@pytest -v -x -s --tb=long ./tests/e2e_test/test_bench.py
.PHONY: migration_test
migration_test:
@pytest -v -x -s --tb=long ./tests/e2e_test/test_migration.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 -m pip show pylint > /dev/null 2>&1 || { \
echo "pylint is not installed. Installing pylint $(PYLINT_VERSION)..."; \
python3 -m pip install 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 pylint-pytest > /dev/null 2>&1 || { \
echo "pylint-pytest is not installed. Installing pylint-pytest ..."; \
python3 -m pip install pylint-pytest; }
###################################### pytest end #######################################