forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (127 loc) · 5.36 KB
/
job_onnx_runtime.yml
File metadata and controls
146 lines (127 loc) · 5.36 KB
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
name: ONNX Runtime Integration
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
image:
description: 'Docker image to use for the job'
type: string
required: false
default: null
sccache-azure-key-prefix:
description: 'Key prefix for the cache folder on the Azure'
type: string
required: true
permissions: read-all
jobs:
ONNX_Runtime:
name: ONNX Runtime Integration
timeout-minutes: 60
runs-on: ${{ inputs.runner }}
container:
image: ${{ inputs.image }}
volumes:
- /mount:/mount
- /home/runner/secrets/:/secrets:ro
- ${{ github.workspace }}:${{ github.workspace }} # Needed as ${{ github.workspace }} is not working correctly when using Docker
options: "-e SCCACHE_AZURE_BLOB_CONTAINER -e HF_TOKEN"
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
INSTALL_DIR: ${{ github.workspace }}/install
CMAKE_GENERATOR: 'Ninja Multi-Config'
CMAKE_CXX_COMPILER_LAUNCHER: sccache
CMAKE_C_COMPILER_LAUNCHER: sccache
SCCACHE_IGNORE_SERVER_IO_ERROR: 1
SCCACHE_SERVER_PORT: 35555
SCCACHE_AZURE_KEY_PREFIX: ${{ inputs.sccache-azure-key-prefix }}
ONNX_RUNTIME_REPO: ${{ github.workspace }}/onnxruntime
ONNX_RUNTIME_BUILD_DIR: ${{ github.workspace }}/onnxruntime/build
ONNX_RUNTIME_UTILS: ${{ github.workspace }}/src/frontends/onnx/tests/ci_utils/onnxruntime
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
shell: bash
run: |
SCCACHE_AZURE_CONNECTION_STRING="$(cat /secrets/sccache/connection-string)"
echo "::add-mask::${SCCACHE_AZURE_CONNECTION_STRING}"
echo "SCCACHE_AZURE_CONNECTION_STRING=${SCCACHE_AZURE_CONNECTION_STRING}" >> $GITHUB_ENV
echo "✓ Connection string loaded and masked"
- name: Fetch ONNX runtime version and skip tests list
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
sparse-checkout: |
src/frontends/onnx/tests/ci_utils/onnxruntime
sparse-checkout-cone-mode: false
- name: Get ONNX runtime version
run: |
hash=`tr -s '\n ' < ./version`
echo "ONNX_RUNTIME_VERSION=$hash" >> "$GITHUB_ENV"
working-directory: ${{ env.ONNX_RUNTIME_UTILS }}
- name: Clone ONNX Runtime
uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
timeout-minutes: 15
with:
repository: 'microsoft/onnxruntime'
path: ${{ env.ONNX_RUNTIME_REPO }}
ref: ${{ env.ONNX_RUNTIME_VERSION }}
submodules: 'recursive'
- name: Download OpenVINO package
uses: akashchi/download-artifact@d59a9c15fec3fdb7c9adf09464124d00f9c11415
with:
name: openvino_package
path: ${{ env.INSTALL_DIR }}
- name: Extract OpenVINO package
run: pigz -dc openvino_package.tar.gz | tar -xf - -v
working-directory: ${{ env.INSTALL_DIR }}
#
# Tests
#
- name: Build Lin ONNX Runtime
run: |
source ${INSTALL_DIR}/setupvars.sh
${ONNX_RUNTIME_REPO}/build.sh \
--config RelWithDebInfo \
--use_openvino CPU \
--build_shared_lib \
--parallel $(nproc) \
--skip_tests \
--compile_no_warning_as_error \
--allow_running_as_root \
--build_dir ${ONNX_RUNTIME_BUILD_DIR}
env:
CXXFLAGS: "-Wno-error=deprecated-declarations"
- name: Show sccache stats
run: ${SCCACHE_PATH} --show-stats
- name: Run onnxruntime_test_all
if: ${{ runner.arch != 'ARM64' }} # Ticket: 126277
run: |
source ${INSTALL_DIR}/setupvars.sh
skip_tests=$(tr -s '\n ' ':' < ${ONNX_RUNTIME_UTILS}/skip_tests)
./onnxruntime_test_all --gtest_filter=-$skip_tests
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo
- name: Run onnxruntime_shared_lib_test
run: |
source ${INSTALL_DIR}/setupvars.sh
./onnxruntime_shared_lib_test --gtest_filter=-CApiTest.test_custom_op_openvino_wrapper_library
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo
- name: Run onnxruntime_global_thread_pools_test
run: |
source ${INSTALL_DIR}/setupvars.sh
./onnxruntime_global_thread_pools_test
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo
- name: Run pytorch-converted tests
run: |
source ${INSTALL_DIR}/setupvars.sh
./onnx_test_runner "${ONNX_RUNTIME_REPO}/cmake/external/onnx/onnx/backend/test/data/pytorch-converted"
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo
- name: Run pytorch-operator tests
run: |
source ${INSTALL_DIR}/setupvars.sh
./onnx_test_runner "${ONNX_RUNTIME_REPO}/cmake/external/onnx/onnx/backend/test/data/pytorch-operator"
working-directory: ${{ env.ONNX_RUNTIME_BUILD_DIR }}/RelWithDebInfo/RelWithDebInfo