forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
183 lines (146 loc) · 6.13 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
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
JUNITXML_PATH ?= nncf-tests.xml
ifdef NNCF_COVERAGE
COVERAGE_ARGS ?= --cov=./ --cov-report=xml
else
COVERAGE_ARGS :=
endif
ifdef DATA
DATA_ARG := --data $(DATA)
endif
ifdef WEEKLY_MODELS
WEEKLY_MODELS_ARG := --weekly-models $(WEEKLY_MODELS)
endif
install-pre-commit:
pip install pre-commit==3.2.2
install-pylint:
pip install pylint==2.13.9
pip install pylintfileheader==0.3.2
###############################################################################
# ONNX backend
install-onnx-test:
pip install -U pip
pip install -e .[onnx]
pip install -r tests/onnx/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
pip install -r tests/onnx/benchmarking/requirements.txt
install-onnx-dev: install-onnx-test install-pre-commit install-pylint
pip install -r examples/post_training_quantization/onnx/mobilenet_v2/requirements.txt
test-onnx:
pytest ${COVERAGE_ARGS} tests/onnx $(DATA_ARG) --junitxml ${JUNITXML_PATH}
pylint-onnx:
pylint --rcfile .pylintrc \
$(shell python3 tools/collect_pylint_input_files_for_backend.py onnx)
test-install-onnx:
pytest tests/cross_fw/install -s \
--backend onnx \
--junitxml ${JUNITXML_PATH}
test-examples-onnx:
pytest tests/cross_fw/examples -s \
--backend onnx \
--junitxml ${JUNITXML_PATH}
###############################################################################
# OpenVino backend
install-openvino-test:
pip install -U pip
pip install -e .[openvino]
pip install -r tests/openvino/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
install-openvino-dev: install-openvino-test install-pre-commit install-pylint
pip install -r examples/experimental/openvino/bert/requirements.txt
pip install -r examples/experimental/openvino/yolo_v5/requirements.txt
pip install -r examples/post_training_quantization/openvino/mobilenet_v2/requirements.txt
pip install -r examples/post_training_quantization/openvino/anomaly_stfpm_quantize_with_accuracy_control/requirements.txt
pip install -r examples/post_training_quantization/openvino/yolov8/requirements.txt
pip install -r examples/post_training_quantization/openvino/yolov8_quantize_with_accuracy_control/requirements.txt
test-openvino:
pytest ${COVERAGE_ARGS} tests/openvino $(DATA_ARG) --junitxml ${JUNITXML_PATH}
pylint-openvino:
pylint --rcfile .pylintrc \
$(shell python3 tools/collect_pylint_input_files_for_backend.py openvino)
test-install-openvino:
pytest tests/cross_fw/install -s \
--backend openvino \
--junitxml ${JUNITXML_PATH}
test-examples-openvino:
pytest tests/cross_fw/examples -s \
--backend openvino \
--junitxml ${JUNITXML_PATH}
###############################################################################
# TensorFlow backend
install-tensorflow-test:
pip install -U pip
pip install -e .[tf]
pip install -r tests/tensorflow/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
pip install -r examples/tensorflow/requirements.txt
install-tensorflow-dev: install-tensorflow-test install-pre-commit install-pylint
pip install -r examples/post_training_quantization/tensorflow/mobilenet_v2/requirements.txt
test-tensorflow:
pytest ${COVERAGE_ARGS} tests/common tests/tensorflow \
--junitxml ${JUNITXML_PATH} \
$(DATA_ARG)
pylint-tensorflow:
pylint --rcfile .pylintrc \
$(shell python3 tools/collect_pylint_input_files_for_backend.py tensorflow)
test-install-tensorflow:
pytest tests/cross_fw/install -s --backend tf --junitxml ${JUNITXML_PATH}
test-examples-tensorflow:
pytest tests/cross_fw/examples -s --backend tf --junitxml ${JUNITXML_PATH}
###############################################################################
# PyTorch backend
install-torch-test:
pip install -U pip
pip install -e .[torch]
pip install -r tests/torch/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
pip install -r examples/torch/requirements.txt
install-torch-dev: install-torch-test install-pre-commit install-pylint
pip install -r examples/post_training_quantization/torch/mobilenet_v2/requirements.txt
pip install -r examples/post_training_quantization/torch/ssd300_vgg16/requirements.txt
test-torch:
pytest ${COVERAGE_ARGS} tests/common tests/torch -m "not weekly and not nightly" --junitxml ${JUNITXML_PATH} $(DATA_ARG)
test-torch-nightly:
pytest ${COVERAGE_ARGS} tests/torch -m nightly --junitxml ${JUNITXML_PATH} $(DATA_ARG)
test-torch-weekly:
pytest ${COVERAGE_ARGS} tests/torch -m weekly --junitxml ${JUNITXML_PATH} $(DATA_ARG) ${WEEKLY_MODELS_ARG}
COMMON_PYFILES := $(shell python3 tools/collect_pylint_input_files_for_backend.py common)
pylint-torch:
pylint --rcfile .pylintrc \
$(COMMON_PYFILES) \
$(shell python3 tools/collect_pylint_input_files_for_backend.py torch)
test-install-torch-cpu:
pytest tests/cross_fw/install -s \
--backend torch \
--host-configuration cpu \
--junitxml ${JUNITXML_PATH}
test-install-torch-gpu:
pytest tests/cross_fw/install -s \
--backend torch \
--junitxml ${JUNITXML_PATH}
test-examples-torch:
pytest tests/cross_fw/examples -s \
--backend torch \
--junitxml ${JUNITXML_PATH}
###############################################################################
# Common part
install-common-test:
pip install -U pip
pip install -e .
pip install -r tests/common/requirements.txt
pip install -r tests/cross_fw/install/requirements.txt
pip install -r tests/cross_fw/examples/requirements.txt
pylint-common:
pylint --rcfile .pylintrc \
$(COMMON_PYFILES)
test-common:
pytest ${COVERAGE_ARGS} tests/common $(DATA_ARG) --junitxml ${JUNITXML_PATH}
test-examples:
pytest tests/cross_fw/examples -s --junitxml ${JUNITXML_PATH}
###############################################################################
# Pre commit check
pre-commit:
pre-commit run -a