Skip to content

Commit 0d2ca8c

Browse files
committed
Merge branch 'master' into executorch_benchmark_support
2 parents 68efc47 + fc8f2ba commit 0d2ca8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+637
-199
lines changed

.github/workflows/codestyle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
codestyle:
77
strategy:
88
matrix:
9-
os: [ubuntu-20.04]
9+
os: [ubuntu-22.04]
1010
runs-on: ${{ matrix.os }}
1111
steps:
1212
- name: Code checkout

.github/workflows/smoke_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
smoke_test_benchmark:
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04]
15+
os: [ubuntu-22.04]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Code checkout
@@ -55,7 +55,7 @@ jobs:
5555
smoke_test_benchmark_caffe:
5656
strategy:
5757
matrix:
58-
os: [ubuntu-20.04]
58+
os: [ubuntu-22.04]
5959
runs-on: ${{ matrix.os }}
6060
steps:
6161
- name: Code checkout
@@ -94,7 +94,7 @@ jobs:
9494
smoke_test_quantization:
9595
strategy:
9696
matrix:
97-
os: [ubuntu-20.04]
97+
os: [ubuntu-22.04]
9898
runs-on: ${{ matrix.os }}
9999
steps:
100100
- name: Code checkout

.github/workflows/unit_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
unit_test:
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04]
15+
os: [ubuntu-22.04]
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Code checkout

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ DLI supports inference using the following frameworks:
3232
- [RKNN][rknn] (C++ API).
3333
- [ncnn][ncnn] (Python API).
3434
- [PaddlePaddle][PaddlePaddle] (Python API).
35+
- [ExecuTorch][executorch] (C++ API)
3536

3637
More information about DLI is available on the web-site
3738
([here][dli-ru-web-page] (in Russian)
@@ -47,8 +48,8 @@ Please consider citing the following papers.
4748

4849
1. Kustikova V., Vasilyev E., Khvatov A., Kumbrasiev P., Rybkin R.,
4950
Kogteva N. DLI: Deep Learning Inference Benchmark //
50-
Communications in Computer and Information Science.
51-
V.1129. 2019. P. 542-553.
51+
Communications in Computer and Information
52+
Science. - 2019. - V. 1129. - P. 542-553.
5253

5354
1. Sidorova A.K., Alibekov M.R., Makarov A.A., Vasiliev E.P.,
5455
Kustikova V.D. Automation of collecting performance indicators
@@ -73,10 +74,11 @@ Please consider citing the following papers.
7374
and Programming. - 2024. - Vol. 25(2). - P. 127-141. -
7475
[https://num-meth.ru/index.php/journal/article/view/1332/1264][nummeth2023].
7576
(In Russian)
77+
7678
1. Mukhin I., Rodimkov Y., Vasiliev E., Volokitin V., Sidorova A.,
7779
Kozinov E., Meyerov I., Kustikova V. Benchmarking Deep Learning
7880
Inference on RISC-V CPUs // Springer Lecture Notes in Computer
79-
Science. – 2024. – Accepted.
81+
Science. – 2025. – Vol. 15406. - P. 331-346.
8082

8183
## Repo structure
8284

@@ -97,12 +99,12 @@ Please consider citing the following papers.
9799
- `OpenCV` is a directory of Dockerfiles for OpenCV.
98100
- `OpenVINO_DLDT` is a directory of Dockerfiles for Intel®
99101
Distribution of OpenVINO™ Toolkit.
102+
- `PaddlePaddle` is a directory of Dockerfiles for PaddlePaddle.
100103
- `PyTorch` is a directory of Dockerfiles for PyTorch.
101-
- `TVM` is a directory of Dockerfiles for Apache TVM.
102104
- `TensorFlow` is a directory of Dockerfiles for Intel® Optimizations
103105
for TensorFlow.
104106
- `TensorFlowLite` is a directory of Dockerfiles for TensorFlow Lite.
105-
- `PaddlePaddle` is a directory of Dockerfiles for PaddlePaddle.
107+
- `TVM` is a directory of Dockerfiles for Apache TVM.
106108

107109
- `docs` directory contains auxiliary documentation. Please, find
108110
complete documentation at the [Wiki page][dli-wiki].
@@ -138,6 +140,9 @@ Please consider citing the following papers.
138140
is a table that confirms correctness of inference implementation
139141
based on Intel® Distribution of OpenVINO™ toolkit for models trained
140142
by Intel engineers and available in [Open Model Zoo][open-model-zoo].
143+
- [`validation_results_paddlepaddle.md`](results/validation/validation_results_paddlepaddle.md)
144+
is a table that confirms correctness of inference implementation
145+
based on PaddlePaddle.
141146
- [`validation_results_pytorch.md`](results/validation/validation_results_pytorch.md)
142147
is a table that confirms correctness of inference implementation
143148
based on PyTorch for [TorchVision][torchvision].
@@ -161,9 +166,11 @@ Please consider citing the following papers.
161166
- [`onnxruntime_models_checklist.md`](results/onnxruntime_models_checklist.md) contains a list
162167
of deep models inferred by ONNX Runtime checked in the DLI benchmark.
163168
- [`opencv_models_checklist.md`](results/opencv_models_checklist.md) contains a list
164-
of deep models inferred by OpenCV DNN.
169+
of deep models inferred by OpenCV DNN checked in the DLI benchmark.
165170
- [`openvino_models_checklist.md`](results/openvino_models_checklist.md) contains a list
166171
of deep models inferred by the OpenVINO toolkit checked in the DLI benchmark.
172+
- [`paddlepaddle_models_checklist.md`](results/paddlepaddle_models_checklist.md)
173+
containsa list deep models inferred by PaddlePaddle checked in the DLI benchmark.
167174
- [`pytorch_models_checklist.md`](results/pytorch_models_checklist.md) contains a list
168175
of deep models inferred by PyTorch checked in the DLI benchmark.
169176
- [`tensorflow_models_checklist.md`](results/tensorflow_models_checklist.md) contains a list
@@ -179,14 +186,17 @@ Please consider citing the following papers.
179186
using Accuracy Checker of Intel® Distribution of OpenVINO™ toolkit.
180187
- `benchmark` is a set of scripts to estimate inference
181188
performance of different models at the single local computer.
182-
- `build_scripts` is a directory to build inference frameworks for different platforms.
189+
- `build_scripts` is a directory to build inference frameworks for different
190+
platforms.
183191
- `config_maker`contains GUI-application to make configuration files
184-
of the benchmark components.
192+
of the benchmark components. Application supports outdated version
193+
of configuration files. It is required to update (one of the future tasks).
185194
- `configs` contains template configuration files.
186195
- `cpp_dl_benchmark` contains C++ tools that allow to measure
187196
deep learning models inference performance with
188197
[ONNX Runtime][onnx-runtime-github], [OpenCV DNN][opencv-dnn],
189-
[PyTorch][pytorch] and [TensorFlow Lite][tensorflow-lite] in C++ API implementation.
198+
[PyTorch][pytorch], [ExecuTorch][executorch] and
199+
[TensorFlow Lite][tensorflow-lite] in C++ API implementation.
190200
This implementation inspired by [OpenVINO Benchmark C++ tool][benchmark-app]
191201
as a reference and stick to its measurement methodology,
192202
thus provide consistent performance results.
@@ -199,15 +209,15 @@ Please consider citing the following papers.
199209
- `model_converters` contains converters of deep models.
200210
- `node_info` contains a set of functions to get information about
201211
computational node.
202-
- `quantization` contains scripts to quantize model to INT8-precision
203-
using Post-Training Optimization Tool (POT)
204-
of Intel® Distribution of OpenVINO™ toolkit.
212+
- `quantization` contains scripts to quantize model
213+
using Post-Training Optimization Tool (POT) of Intel® Distribution
214+
of OpenVINO™ toolkit, TensorFlow Lite and TVM internal tools.
205215
- `remote_control` contains scripts to execute benchmark
206216
remotely.
207217
- `tvm_autotuning` contains scripts to optimize Apache TVM models.
208218
- `utils` is a package of auxiliary utilities.
209219

210-
- `test` contains smoke tests.
220+
- `tests` contains smoke tests.
211221

212222
- `requirements.txt` is a list of special requirements for the DLI
213223
benchmark without inference frameworks.
@@ -271,6 +281,7 @@ Report questions, issues and suggestions, using:
271281
[rknn]: https://github.com/rockchip-linux/rknn-toolkit2
272282
[ncnn]: https://github.com/Tencent/ncnn
273283
[PaddlePaddle]: https://www.paddlepaddle.org.cn/en
284+
[executorch]: https://pytorch.org/executorch-overview
274285
[benchmark-app]: https://github.com/openvinotoolkit/openvino/tree/master/samples/cpp/benchmark_app
275286
[dli-ru-web-page]: http://hpc-education.unn.ru/dli-ru
276287
[dli-web-page]: http://hpc-education.unn.ru/dli

demo/benchmark_configs/TVM.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<ChannelSwap></ChannelSwap>
3131
<Target>llvm</Target>
3232
<Layout>NCHW</Layout>
33-
<VirtualMachine>False</VirtualMachine>
33+
<HighLevelAPI>Relay</HighLevelAPI>
3434
<OptimizationLevel>3</OptimizationLevel>
3535
</FrameworkDependent>
3636
</Test>

docker/TVM/Dockerfile

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,60 @@ WORKDIR /root/
55
# Installing miniconda
66
RUN wget -q --no-check-certificate -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
77
bash Miniconda3-latest-Linux-x86_64.sh -b && \
8-
./miniconda3/bin/conda create -n tvm-env -y python=3.7.16 && \
8+
./miniconda3/bin/conda create -n tvm-env -y python=3.8.20 && \
99
rm -rf /root/miniconda3/pkgs/* && \
1010
rm ~/Miniconda3-latest-Linux-x86_64.sh -f
11-
11+
1212
ENV PATH /root/miniconda3/envs/tvm-env/bin:/root/miniconda3/bin:$PATH
1313
RUN echo "source activate tvm-env" > ~/.bashrc
1414
RUN export LD_LIBRARY_PATH=/root/miniconda3/envs/tvm-env/lib:${LD_LIBRARY_PATH}
1515
RUN conda config --add channels intel
1616

1717
# Installing dependencies
18-
RUN python3 -m pip install pycocotools docker PyYAML
18+
RUN python3 -m pip install pycocotools docker PyYAML gluoncv[full] opencv-python Cython psutil
1919
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6
20-
RUN python3 -m pip install gluoncv[full]
21-
RUN python3 -m pip install opencv-python
22-
20+
RUN apt-get update && apt-get install -y -qq --no-install-recommends cmake software-properties-common
21+
RUN apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" && \
22+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
23+
RUN apt-get update && \
24+
apt-get install -y -qq --no-install-recommends llvm-19 llvm-19-dev && \
25+
rm -rf /var/lib/apt/lists/*
26+
2327
# Installing Apache-TVM
24-
RUN python3 -m pip install apache-tvm==0.14.dev264
28+
ARG TVM_VERSION=v0.19.0
29+
30+
RUN git clone --recursive https://github.com/apache/tvm tvm --branch ${TVM_VERSION} --single-branch
31+
ENV TVM_BUILD_DIR=/tmp/build-tvm
32+
RUN mkdir $TVM_BUILD_DIR && cd $TVM_BUILD_DIR
33+
RUN cp /root/tvm/cmake/config.cmake .
34+
RUN echo "set(CMAKE_BUILD_TYPE RelWithDebInfo)" >> config.cmake
35+
RUN echo "set(USE_LLVM /usr/bin/llvm-config-19)" >> config.cmake
36+
RUN echo "set(HIDE_PRIVATE_SYMBOLS ON)" >> config.cmake
37+
RUN echo "set(USE_CUDA OFF)" >> config.cmake
38+
RUN echo "set(USE_METAL OFF)" >> config.cmake
39+
RUN echo "set(USE_VULKAN OFF)" >> config.cmake
40+
RUN echo "set(USE_OPENCL OFF)" >> config.cmake
41+
RUN echo "set(USE_CUBLAS OFF)" >> config.cmake
42+
RUN echo "set(USE_CUDNN OFF)" >> config.cmake
43+
RUN echo "set(USE_CUTLASS OFF)" >> config.cmake
44+
45+
RUN /bin/bash -c 'cmake /root/tvm/ && cmake --build . -- -j$(nproc --all)'
46+
47+
WORKDIR /root/
48+
RUN export TVM_LIBRARY_PATH=$TVM_BUILD_DIR
49+
RUN python3 -m pip install -e /root/tvm/python
2550

2651
# ARG
2752
ARG TORCH_VERSION=2.0.1
2853
ARG TORCHVISION_VERSION=0.15.2
2954
ARG TFLite_VERSION=2.14.0
3055
ARG MXNET_VERSION=1.9.1
3156
ARG ONNX_VERSION=1.15.0
32-
ARG CAFFE_VERSION=1.1.0
3357

3458
ARG PyTorch
3559
ARG TFLite
3660
ARG MXNet
3761
ARG ONNX
38-
ARG CAFFE
3962

4063
RUN if [ "${PyTorch}" = "true" ]; then \
4164
python3 -m pip install torch==${TORCH_VERSION} torchvision==${TORCHVISION_VERSION}; \
@@ -65,14 +88,6 @@ RUN if [ "$ONNX" = "true" ]; then \
6588
python3 -m pip install onnxruntime==${ONNX_VERSION} && python3 -m pip install onnx==${ONNX_VERSION}; \
6689
fi
6790

68-
RUN if [ "$CAFFE" = "true" ]; then \
69-
/bin/bash -c "conda install -n tvm-env -y -c intel openvino-ie4py-ubuntu20=2022.1.0"; \
70-
/bin/bash -c "conda install -n tvm-env -y -c intel scikit-image=0.17.2"; \
71-
/bin/bash -c "conda install -n tvm-env -y -c intel caffe"; \
72-
/bin/bash -c "conda install -n tvm-env -y -c anaconda libgcc-ng=11.2.0"; \
73-
/bin/bash -c "conda install -n tvm-env -y -c defaults protobuf=3.17.2 libprotobuf=3.17.2 requests=2.27.1"; \
74-
fi
75-
7691
WORKDIR /tmp/open_model_zoo/
7792
RUN git remote add omz_custom_tvm https://github.com/itlab-vision/open_model_zoo_tvm.git && \
7893
git fetch omz_custom_tvm && \

requirements_frameworks.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dglgo==0.0.2
1717

1818
tflite
1919

20+
paddleslim==2.6.0
2021
paddlepaddle==2.6.0
2122
--extra-index-url https://mirror.baidu.com/pypi/simple
2223

src/benchmark/frameworks/config_parser/test_reporter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def prepare_framework_params(self):
7676
match_parameter_description['tensor_rt_precision'] = 'TensorRT precision'
7777
match_parameter_description['compile_with_backend'] = 'Pytorch compile backend'
7878

79+
match_parameter_description['high_level_api'] = 'TVM HighLevelAPI'
80+
match_parameter_description['opt_level'] = 'TVM OptimizationLevel'
81+
7982
for parameter, description in match_parameter_description.items():
8083
if hasattr(self.dep_parameters, parameter) and getattr(self.dep_parameters, parameter) is not None:
8184
parameters.update({description: getattr(self.dep_parameters, parameter)})

src/benchmark/frameworks/paddlepaddle/paddlepaddle_process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def _fill_command_line(self):
2424
model = self._test.model.model
2525
params = self._test.model.weight
2626
dataset = self._test.dataset.path if self._test.dataset else None
27+
iteration = self._test.indep_parameters.iteration
2728
batch = self._test.indep_parameters.batch_size
2829
device = self._test.indep_parameters.device
2930

30-
common_params = (f'-m {model} -p {params} -i {dataset} -b {batch} -d {device} '
31+
common_params = (f'-m {model} -p {params} -ni {iteration} -i {dataset} -b {batch} -d {device} '
3132
f'--report_path {self.report_path}')
3233

3334
common_params = self._add_optional_argument_to_cmd_line(common_params, '-i', dataset)

src/benchmark/frameworks/tvm/tvm_parameters_parser.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def parse_parameters(self, curr_test):
1515
CONFIG_FRAMEWORK_DEPENDENT_STD_TAG = 'Std'
1616
CONFIG_FRAMEWORK_DEPENDENT_CHANNEL_SWAP_TAG = 'ChannelSwap'
1717
CONFIG_FRAMEWORK_DEPENDENT_LAYOUT_TAG = 'Layout'
18-
CONFIG_FRAMEWORK_DEPENDENT_VIRTUAL_MACHINE = 'VirtualMachine'
18+
CONFIG_FRAMEWORK_DEPENDENT_HIGH_LEVEL_API = 'HighLevelAPI'
1919

2020
dep_parameters_tag = curr_test.getElementsByTagName(CONFIG_FRAMEWORK_DEPENDENT_TAG)[0]
2121

@@ -39,8 +39,8 @@ def parse_parameters(self, curr_test):
3939
CONFIG_FRAMEWORK_DEPENDENT_LAYOUT_TAG)[0].firstChild
4040
_target = dep_parameters_tag.getElementsByTagName(
4141
CONFIG_FRAMEWORK_DEPENDENT_TARGET)[0].firstChild
42-
_vm = dep_parameters_tag.getElementsByTagName(
43-
CONFIG_FRAMEWORK_DEPENDENT_VIRTUAL_MACHINE)[0].firstChild
42+
_high_level_api = dep_parameters_tag.getElementsByTagName(
43+
CONFIG_FRAMEWORK_DEPENDENT_HIGH_LEVEL_API)[0].firstChild
4444

4545
return TVMParameters(
4646
framework=_framework.data if _framework else None,
@@ -53,14 +53,15 @@ def parse_parameters(self, curr_test):
5353
optimization_level=_optimization_level.data if _optimization_level else None,
5454
layout=_layout.data if _layout else None,
5555
target=_target.data if _target else None,
56-
vm=_vm.data if _vm else None,
56+
high_level_api=_high_level_api.data if _high_level_api else None,
5757
)
5858

5959

6060
class TVMParameters(FrameworkParameters):
6161
def __init__(self, framework, input_name, input_shape,
6262
normalize, mean, std, channel_swap,
63-
optimization_level, layout, target, vm):
63+
optimization_level, layout, target,
64+
high_level_api):
6465
self.framework = None
6566
self.input_name = None
6667
self.input_shape = None
@@ -71,7 +72,7 @@ def __init__(self, framework, input_name, input_shape,
7172
self.optimization_level = None
7273
self.layout = None
7374
self.target = 'llvm'
74-
self.vm = None
75+
self.high_level_api = None
7576

7677
if self._framework_is_correct(framework):
7778
self.framework = framework
@@ -93,8 +94,8 @@ def __init__(self, framework, input_name, input_shape,
9394
self.layout = layout
9495
if self._parameter_is_not_none(target):
9596
self.target = target
96-
if self._parameter_is_not_none(vm):
97-
self.vm = vm
97+
if self._parameter_is_not_none(high_level_api):
98+
self.high_level_api = high_level_api
9899

99100
@staticmethod
100101
def _framework_is_correct(framework):

0 commit comments

Comments
 (0)