forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (128 loc) · 5.49 KB
/
job_onnx_runtime.yml
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
name: ONNX Runtime Integration
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
container:
description: 'JSON to be converted to the value of the "container" configuration for the job'
type: string
required: false
default: '{"image": 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: ${{ fromJSON(inputs.container) }}
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
OPENVINO_REPO: ${{ github.workspace }}/openvino
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 }}/openvino/src/frontends/onnx/tests/ci_utils/onnxruntime
steps:
- name: Download OpenVINO package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: openvino_package
path: ${{ env.INSTALL_DIR }}
# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
run: |
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "ONNX_RUNTIME_REPO=$GITHUB_WORKSPACE/onnxruntime" >> "$GITHUB_ENV"
echo "ONNX_RUNTIME_BUILD_DIR=$GITHUB_WORKSPACE/onnxruntime/build" >> "$GITHUB_ENV"
- name: Extract OpenVINO package
run: |
pushd ${INSTALL_DIR}
pigz -dc openvino_package.tar.gz | tar -xf - -C ${INSTALL_DIR}
popd
- name: Fetch ONNX runtime version and skip tests list
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
src/frontends/onnx/tests/ci_utils/onnxruntime
sparse-checkout-cone-mode: false
path: ${{ env.OPENVINO_REPO }}
- 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: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
repository: 'microsoft/onnxruntime'
path: ${{ env.ONNX_RUNTIME_REPO }}
ref: ${{ env.ONNX_RUNTIME_VERSION }}
submodules: 'recursive'
#
# 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: |
# see https://github.com/microsoft/onnxruntime/issues/13197#issuecomment-1264542497
apt-get update && apt-get install --assume-yes --no-install-recommends language-pack-en
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
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