forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
206 lines (161 loc) · 7.11 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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 SOTA_DATA_DIR
SOTA_DATA_DIR_ARG := --sota-data-dir $(SOTA_DATA_DIR)
endif
ifdef SOTA_CHKP_DIR
SOTA_CHKP_DIR_ARG := --sota-checkpoints-dir $(SOTA_CHKP_DIR)
endif
ifdef WEEKLY_MODELS
WEEKLY_MODELS_ARG := --weekly-models $(WEEKLY_MODELS)
endif
ifdef NUM_WORKERS
NUM_WORKERS_ARG := -n${NUM_WORKERS}
endif
install-pre-commit:
pip install pre-commit==3.2.2
###############################################################################
# ONNX backend
install-onnx-test:
pip install -U pip
pip install -e .
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
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
pip install -r examples/post_training_quantization/onnx/mobilenet_v2/requirements.txt
test-onnx:
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} -ra tests/onnx $(DATA_ARG) --junitxml ${JUNITXML_PATH}
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 .
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
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
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:
ONEDNN_MAX_CPU_ISA=AVX2 pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} -ra tests/openvino $(DATA_ARG) \
--junitxml ${JUNITXML_PATH} --dist loadscope
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 .
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
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
pip install -r examples/post_training_quantization/tensorflow/mobilenet_v2/requirements.txt
test-tensorflow:
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} -ra tests/tensorflow -m "not nightly" \
--junitxml ${JUNITXML_PATH} \
$(DATA_ARG)
test-tensorflow-nightly:
pytest ${COVERAGE_ARGS} tests/tensorflow -m 'nightly' \
--junitxml ${JUNITXML_PATH} \
$(DATA_ARG)
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 .
pip install "git+https://github.com/openvinotoolkit/open_model_zoo.git@37f60eb#egg=accuracy_checker&subdirectory=tools/accuracy_checker"
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
install-torch-dev: install-torch-test install-pre-commit
pip install -r examples/post_training_quantization/torch/mobilenet_v2/requirements.txt
pip install -r examples/post_training_quantization/torch/ssd300_vgg16/requirements.txt
install-models-hub-torch:
pip install -U pip
pip install -e .
pip install -r tests/torch/models_hub_test/requirements.txt
# Install wheel to run pip with --no-build-isolation
pip install wheel
pip install --no-build-isolation -r tests/torch/models_hub_test/requirements_secondary.txt
test-torch:
pytest ${COVERAGE_ARGS} tests/torch -m "not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH} $(DATA_ARG)
test-torch-cpu:
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} tests/torch -ra -m "not cuda and not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH}
test-torch-cuda:
pytest ${COVERAGE_ARGS} tests/torch -ra -m "cuda and not weekly and not nightly and not models_hub" --junitxml ${JUNITXML_PATH}
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) $(SOTA_DATA_DIR_ARG) $(SOTA_CHKP_DIR_ARG) ${WEEKLY_MODELS_ARG}
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}
test-models-hub-torch:
pytest tests/torch/models_hub_test --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
test-common:
pytest ${COVERAGE_ARGS} ${NUM_WORKERS_ARG} -ra 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
###############################################################################
# Fuzzing tests
install-fuzz-test: install-common-test
pip install -r tests/cross_fw/sdl/fuzz/requirements.txt
test-fuzz:
python tests/cross_fw/sdl/fuzz/quantize_api.py