-
Notifications
You must be signed in to change notification settings - Fork 40
221 lines (202 loc) · 7.89 KB
/
job_build_mlir_linux.yml
File metadata and controls
221 lines (202 loc) · 7.89 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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: Linux MLIR Build
on:
workflow_call:
inputs:
os:
description: 'OS that is used for building in the form of "ubuntu_20_04"'
type: string
required: true
build-runner:
description: 'Machine on which the builds will run'
type: string
required: true
openvino-organization:
description: 'OpenVINO fork owner to clone'
type: string
required: true
openvino-commit:
description: 'OpenVINO commit to checkout'
type: string
required: true
openvino-cmake-options:
description: 'A string of options passed to OpenVINO CMake'
type: string
required: false
npu-cmake-options:
description: 'A string of options passed to NPU Compiler CMake'
type: string
required: false
build-cache:
description: 'Whether to take previously built OpenVINO/NPU package.'
type: boolean
required: false
default: false
build-cache-key-suffix:
description: 'Cache package suffix'
type: string
required: false
with-tests:
description: 'Whether to build test targets'
type: boolean
required: false
default: false
openvino-install-artifact:
description: 'OpenVINO/NPU build package name to be stored as the action artifact'
type: string
required: true
default: false
defaults:
run:
shell: bash
permissions: read-all
env:
OPENVINO_INSTALL_DIR: ./openvino_install
jobs:
Cache:
name: Cache
if: ${{ inputs.build-cache }}
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.restore.outputs.cache-hit }}
cache-key: ${{ steps.key.outputs.cache_key }}
steps:
- name: Get cache key
id: key
run: |
cache_key="l_ov_dyn_${{ inputs.os }}_cache_${{ inputs.build-cache-key-suffix || github.sha }}"
echo "cache_key=$cache_key" >> $GITHUB_OUTPUT
- name: Restore OpenVINO/NPU package from cache
id: restore
uses: actions/cache/restore@v4
with:
key: ${{ steps.key.outputs.cache_key }}
path: ${{ env.OPENVINO_INSTALL_DIR }}
- name: Upload artifacts
if: ${{ steps.restore.outputs.cache-hit }}
uses: actions/upload-artifact@v4
with:
path: ${{ env.OPENVINO_INSTALL_DIR }}
name: ${{ inputs.openvino-install-artifact }}
Build:
name: Build
needs: Cache
if: ${{ always() && needs.Cache.outputs.cache-hit != 'true' }}
runs-on: ${{ inputs.build-runner }}
timeout-minutes: 240
env:
DEBIAN_FRONTEND: noninteractive
CMAKE_BUILD_TYPE: 'Release'
OPENVINO_REPO: ./openvino
NPU_COMPILER_REPO: ./npu_compiler
OPENVINO_BUILD_DIR: ./openvino_build
NPU_COMPILER_BUILD_DIR: ./npu_compiler_build
steps:
- name: Clone OpenVINO
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
repository: ${{ inputs.openvino-organization }}/openvino
path: ${{ env.OPENVINO_REPO }}
submodules: true
ref: ${{ inputs.openvino-commit }}
- name: Clone NPU Compiler
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
path: ${{ env.NPU_COMPILER_REPO }}
submodules: true
lfs: true
- name: System info
uses: openvinotoolkit/openvino/.github/actions/system_info@master
- name: Install python dependencies
run: |
python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/onnx/tests/requirements.txt
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow/tests/requirements.txt
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow_lite/tests/requirements.txt
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt
- name: Prepare environment
run: |
if [[ "${{ inputs.with-tests }}" == "true" ]]; then
echo "ENABLE_TESTS_FLAG=ON" >> $GITHUB_ENV
else
echo "ENABLE_TESTS_FLAG=OFF" >> $GITHUB_ENV
fi
- name: CMake configure - OpenVINO
run: |
cmake \
${{ inputs.openvino-cmake-options }} \
-G "Ninja Multi-Config" \
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
-DENABLE_LTO=OFF \
-DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
-DENABLE_INTEL_CPU=ON \
-DENABLE_INTEL_GPU=ON \
-DENABLE_INTEL_NPU=ON \
-DENABLE_IMD_BACKEND=OFF \
-DENABLE_ONEDNN_FOR_GPU=OFF \
-DENABLE_AUTO=ON \
-DENABLE_AUTO_BATCH=ON \
-DENABLE_HETERO=ON \
-DENABLE_MULTI=ON \
-DENABLE_TEMPLATE=ON \
-DENABLE_OV_ONNX_FRONTEND=ON \
-DENABLE_OV_PADDLE_FRONTEND=ON \
-DENABLE_OV_TF_FRONTEND=ON \
-DENABLE_OV_TF_LITE_FRONTEND=OFF \
-DENABLE_OV_IR_FRONTEND=ON \
-DENABLE_MLIR_COMPILER=ON \
-DENABLE_PLUGINS_XML=ON \
-DENABLE_PYTHON=ON \
-DENABLE_WHEEL=ON \
-DENABLE_TBBBIND_2_5=ON \
-DENABLE_DEBUG_CAPS=ON \
-DENABLE_NPU_DEBUG_CAPS=ON \
-DENABLE_SANITIZER=OFF \
-DENABLE_THREAD_SANITIZER=OFF \
-DENABLE_UB_SANITIZER=OFF \
-S ${OPENVINO_REPO} \
-B ${OPENVINO_BUILD_DIR}
- name: Cmake build - OpenVINO
run: |
cmake --build ${OPENVINO_BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }}
- name: Cmake install - OpenVINO
run: |
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component python_wheels
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component developer_package
- name: CMake configure - NPU Compiler
run: |
cmake \
${{ inputs.npu-cmake-options }} \
-G "Ninja Multi-Config" \
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
-DOpenVINODeveloperPackage_DIR=$(realpath ${OPENVINO_BUILD_DIR}) \
-DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
-DENABLE_DEVELOPER_BUILD=OFF \
-DENABLE_MLIR_COMPILER=ON \
-DBUILD_COMPILER_FOR_DRIVER=OFF \
-DENABLE_DRIVER_COMPILER_ADAPTER=ON \
-DENABLE_SOURCE_PACKAGE=OFF \
-S ${NPU_COMPILER_REPO} \
-B ${NPU_COMPILER_BUILD_DIR}
- name: Cmake build - NPU Compiler
run: |
cmake --build ${NPU_COMPILER_BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }}
- name: Cmake install - NPU Compiler
run: |
cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
- name: Cache artifacts
if: ${{ inputs.build-cache }}
uses: actions/cache/save@v4
with:
path: ${{ env.OPENVINO_INSTALL_DIR }}
key: ${{ needs.Cache.outputs.cache-key }}
- name: Upload artifacts
id: save_artifact
uses: actions/upload-artifact@v4
with:
path: ${{ env.OPENVINO_INSTALL_DIR }}
name: ${{ inputs.openvino-install-artifact }}