Add onnx runtime tests to CI (#4861)
* change docker approach * Experiment with run onnx runtime tests over MS Azure * experiment to run bnaries directly * enable all tests * Set tests execution as separated scripts * Configurations update: - Add new yml file for onnx_runtime check - Add specific tag to checkout for onnx runtime * Rename according to conventions * Change OpenVINO release version
This commit is contained in:
parent
4d112b1f90
commit
9f330d28bd
6
.ci/azure/ci_utils/onnxruntime/skip_tests
Normal file
6
.ci/azure/ci_utils/onnxruntime/skip_tests
Normal file
@ -0,0 +1,6 @@
|
||||
TransposeOpTest.NHWC2NCHW
|
||||
TransposeOpTest.NCHW2NHWC
|
||||
TransposeOpTest.TwoDim_int16
|
||||
GatherOpTest.Gather_axis1_indices2d_int16
|
||||
SoftmaxOperator.ThreeDimsAxis1
|
||||
SoftmaxOperator.ThreeDimsAxis0
|
1
.ci/azure/ci_utils/onnxruntime/version
Normal file
1
.ci/azure/ci_utils/onnxruntime/version
Normal file
@ -0,0 +1 @@
|
||||
rel-1.7.1
|
155
.ci/azure/linux_onnxruntime.yml
Normal file
155
.ci/azure/linux_onnxruntime.yml
Normal file
@ -0,0 +1,155 @@
|
||||
jobs:
|
||||
- job: onnxruntime
|
||||
timeoutInMinutes: 90
|
||||
|
||||
pool:
|
||||
name: LIN_VMSS_VENV_ONNX_WU2
|
||||
|
||||
variables:
|
||||
system.debug: true
|
||||
VSTS_HTTP_RETRY: 5
|
||||
VSTS_HTTP_TIMEOUT: 200
|
||||
WORKERS_NUMBER: 8
|
||||
BUILD_TYPE: Release
|
||||
REPO_DIR: $(Build.Repository.LocalPath)
|
||||
ONNXRUNTIME_REPO_DIR: $(REPO_DIR)/../onnxruntime
|
||||
WORK_DIR: $(Pipeline.Workspace)/_w
|
||||
MODELS_DIR: /mount/cinfsshare/onnxtestdata
|
||||
TMP_DIR: /mnt/tmp
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
BUILD_DIR: $(WORK_DIR)/build
|
||||
ONNXRUNTIME_UTILS: $(REPO_DIR)/.ci/azure/ci_utils/onnxruntime
|
||||
ONNXRUNTIME_BUILD_DIR: $(ONNXRUNTIME_REPO_DIR)/build
|
||||
steps:
|
||||
- script: |
|
||||
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2019-06-01"
|
||||
whoami
|
||||
uname -a
|
||||
echo Python3 info ; which python3 ; python3 --version
|
||||
echo Python info ; which python ; python --version
|
||||
echo Java info ; which java ; java -version
|
||||
echo gcc info ; which gcc ; gcc --version
|
||||
lsb_release
|
||||
env
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
cat /etc/fstab
|
||||
vmstat -s
|
||||
df
|
||||
lsblk -o NAME,HCTL,SIZE,MOUNTPOINT | grep -i "sd"
|
||||
free -h
|
||||
displayName: 'System info'
|
||||
|
||||
- script: |
|
||||
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
|
||||
sudo rm -rf $(TMP_DIR) ; sudo mkdir $(TMP_DIR) ; sudo chmod 777 -R $(TMP_DIR)
|
||||
sudo mkdir -p $(MODELS_DIR)
|
||||
sudo apt --assume-yes install nfs-common
|
||||
sudo mount -vvv -t nfs cinfsshare.file.core.windows.net:/cinfsshare/onnxtestdata $(MODELS_DIR) -o vers=4,minorversion=1,sec=sys
|
||||
displayName: 'Make dirs'
|
||||
|
||||
- checkout: self
|
||||
clean: true
|
||||
lfs: false
|
||||
submodules: recursive
|
||||
path: openvino
|
||||
|
||||
- script: |
|
||||
branch=`tr -s '\n ' < $(ONNXRUNTIME_UTILS)/version`
|
||||
git clone --branch $branch --single-branch --recursive https://github.com/microsoft/onnxruntime.git $(ONNXRUNTIME_REPO_DIR)
|
||||
displayName: 'Clone onnxruntime'
|
||||
|
||||
- script: |
|
||||
sudo apt --assume-yes install libusb-1.0-0-dev
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/requirements.txt
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||
# Speed up build
|
||||
wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
|
||||
unzip ninja-linux.zip
|
||||
sudo cp -v ninja /usr/local/bin/
|
||||
# Speed up tests
|
||||
git clone https://github.com/google/gtest-parallel.git
|
||||
workingDirectory: $(WORK_DIR)
|
||||
displayName: 'Install dependencies'
|
||||
|
||||
- task: CMake@1
|
||||
inputs:
|
||||
# CMake must get Python 3.x version by default
|
||||
cmakeArgs: >
|
||||
-GNinja
|
||||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
|
||||
-DENABLE_PYTHON=ON
|
||||
-DPYTHON_EXECUTABLE=/usr/bin/python3.6
|
||||
-DENABLE_VPU=OFF
|
||||
-DENABLE_GNA=OFF
|
||||
-DENABLE_OPENCV=OFF
|
||||
-DENABLE_CPPLINT=OFF
|
||||
-DENABLE_TESTS=OFF
|
||||
-DENABLE_MKL_DNN=ON
|
||||
-DENABLE_CLDNN=OFF
|
||||
-DENABLE_PROFILING_ITT=OFF
|
||||
-DENABLE_SAMPLES=OFF
|
||||
-DENABLE_SPEECH_DEMO=OFF
|
||||
-DENABLE_PYTHON=ON
|
||||
-DNGRAPH_ONNX_IMPORT_ENABLE=ON
|
||||
-DNGRAPH_INTERPRETER_ENABLE=ON
|
||||
-DNGRAPH_DEBUG_ENABLE=OFF
|
||||
-DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=ON
|
||||
$(REPO_DIR)
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
|
||||
- script: ninja
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Build Lin'
|
||||
|
||||
- script: ls -alR $(REPO_DIR)/bin/
|
||||
displayName: 'List files'
|
||||
|
||||
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
|
||||
workingDirectory: $(BUILD_DIR)
|
||||
displayName: 'Install'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
echo "202X.X" > $(INSTALL_DIR)/deployment_tools/inference_engine/version.txt
|
||||
./build.sh --config RelWithDebInfo --use_openvino CPU_FP32 --build_shared_lib --parallel --skip_tests --build_dir $(ONNXRUNTIME_BUILD_DIR)
|
||||
workingDirectory: $(ONNXRUNTIME_REPO_DIR)
|
||||
displayName: 'Build ONNX Runtime'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
skip_tests=`tr -s '\n ' ':' < $(ONNXRUNTIME_UTILS)/skip_tests`
|
||||
./onnxruntime_test_all --gtest_filter=-$skip_tests
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_test_all'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
./onnxruntime_shared_lib_test
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_shared_lib_test'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
./onnxruntime_global_thread_pools_test
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_global_thread_pools_test'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
./onnxruntime_api_tests_without_env
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run onnxruntime_api_tests_without_env'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
./onnx_test_runner "$(ONNXRUNTIME_REPO_DIR)/cmake/external/onnx/onnx/backend/test/data/pytorch-converted"
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run pytorch-converted tests'
|
||||
|
||||
- script: |
|
||||
source $(INSTALL_DIR)/bin/setupvars.sh
|
||||
./onnx_test_runner "$(ONNXRUNTIME_REPO_DIR)/cmake/external/onnx/onnx/backend/test/data/pytorch-operator"
|
||||
workingDirectory: $(ONNXRUNTIME_BUILD_DIR)/RelWithDebInfo
|
||||
displayName: 'Run pytorch-operator tests'
|
Loading…
Reference in New Issue
Block a user