Skip to content

Commit ea47b47

Browse files
Workflow init (#49)
* Workflow init * Build with tests * Isolate tests * Implement cache * Adding compilation tests * Fix LIT tests * Disable debug cache * Fix Build inputs * Fix Lit tests REQUIRES * FileCheck error: <stdin> is empty.
1 parent 0514ba3 commit ea47b47

File tree

44 files changed

+578
-3128
lines changed

Some content is hidden

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

44 files changed

+578
-3128
lines changed
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
name: Linux MLIR Build
2+
on:
3+
workflow_call:
4+
inputs:
5+
os:
6+
description: 'OS that is used for building in the form of "ubuntu_20_04"'
7+
type: string
8+
required: true
9+
build-runner:
10+
description: 'Machine on which the builds will run'
11+
type: string
12+
required: true
13+
openvino-organization:
14+
description: 'OpenVINO fork owner to clone'
15+
type: string
16+
required: true
17+
openvino-commit:
18+
description: 'OpenVINO commit to checkout'
19+
type: string
20+
required: true
21+
openvino-cmake-options:
22+
description: 'A string of options passed to OpenVINO CMake'
23+
type: string
24+
required: false
25+
npu-cmake-options:
26+
description: 'A string of options passed to NPU Compiler CMake'
27+
type: string
28+
required: false
29+
build-cache:
30+
description: 'Whether to take previously built OpenVINO/NPU package.'
31+
type: boolean
32+
required: false
33+
default: false
34+
build-cache-key-suffix:
35+
description: 'Cache package suffix'
36+
type: string
37+
required: false
38+
with-tests:
39+
description: 'Whether to build test targets'
40+
type: boolean
41+
required: false
42+
default: false
43+
openvino-install-artifact:
44+
description: 'OpenVINO/NPU build package name to be stored as the action artifact'
45+
type: string
46+
required: true
47+
default: false
48+
49+
defaults:
50+
run:
51+
shell: bash
52+
53+
permissions: read-all
54+
55+
env:
56+
OPENVINO_INSTALL_DIR: ./openvino_install
57+
58+
jobs:
59+
Cache:
60+
name: Cache
61+
if: ${{ inputs.build-cache }}
62+
runs-on: ubuntu-latest
63+
outputs:
64+
cache-hit: ${{ steps.restore.outputs.cache-hit }}
65+
cache-key: ${{ steps.key.outputs.cache_key }}
66+
steps:
67+
- name: Get cache key
68+
id: key
69+
run: |
70+
cache_key="l_ov_dyn_${{ inputs.os }}_cache_${{ inputs.build-cache-key-suffix || github.sha }}"
71+
echo "cache_key=$cache_key" >> $GITHUB_OUTPUT
72+
73+
- name: Restore OpenVINO/NPU package from cache
74+
id: restore
75+
uses: actions/cache/restore@v4
76+
with:
77+
key: ${{ steps.key.outputs.cache_key }}
78+
path: ${{ env.OPENVINO_INSTALL_DIR }}
79+
80+
- name: Upload artifacts
81+
if: ${{ steps.restore.outputs.cache-hit }}
82+
uses: actions/upload-artifact@v4
83+
with:
84+
path: ${{ env.OPENVINO_INSTALL_DIR }}
85+
name: ${{ inputs.openvino-install-artifact }}
86+
87+
Build:
88+
name: Build
89+
needs: Cache
90+
if: ${{ always() && needs.Cache.outputs.cache-hit != 'true' }}
91+
runs-on: ${{ inputs.build-runner }}
92+
timeout-minutes: 240
93+
env:
94+
DEBIAN_FRONTEND: noninteractive
95+
CMAKE_BUILD_TYPE: 'Release'
96+
OPENVINO_REPO: ./openvino
97+
NPU_COMPILER_REPO: ./npu_compiler
98+
OPENVINO_BUILD_DIR: ./openvino_build
99+
NPU_COMPILER_BUILD_DIR: ./npu_compiler_build
100+
steps:
101+
- name: Clone OpenVINO
102+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
timeout-minutes: 15
104+
with:
105+
repository: ${{ inputs.openvino-organization }}/openvino
106+
path: ${{ env.OPENVINO_REPO }}
107+
submodules: true
108+
ref: ${{ inputs.openvino-commit }}
109+
110+
- name: Clone NPU Compiler
111+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
112+
timeout-minutes: 15
113+
with:
114+
path: ${{ env.NPU_COMPILER_REPO }}
115+
submodules: true
116+
lfs: true
117+
118+
- name: System info
119+
uses: openvinotoolkit/openvino/.github/actions/system_info@master
120+
121+
- name: Install python dependencies
122+
run: |
123+
python3 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
124+
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/onnx/tests/requirements.txt
125+
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow/tests/requirements.txt
126+
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/tensorflow_lite/tests/requirements.txt
127+
python3 -m pip install -r ${OPENVINO_REPO}/src/frontends/paddle/tests/requirements.txt
128+
129+
- name: Prepare environment
130+
run: |
131+
if [[ "${{ inputs.with-tests }}" == "true" ]]; then
132+
echo "ENABLE_TESTS_FLAG=ON" >> $GITHUB_ENV
133+
else
134+
echo "ENABLE_TESTS_FLAG=OFF" >> $GITHUB_ENV
135+
fi
136+
137+
- name: CMake configure - OpenVINO
138+
run: |
139+
cmake \
140+
${{ inputs.openvino-cmake-options }} \
141+
-G "Ninja Multi-Config" \
142+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
143+
-DENABLE_LTO=OFF \
144+
-DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
145+
-DENABLE_INTEL_CPU=ON \
146+
-DENABLE_INTEL_GPU=ON \
147+
-DENABLE_INTEL_NPU=ON \
148+
-DENABLE_IMD_BACKEND=OFF \
149+
-DENABLE_ONEDNN_FOR_GPU=OFF \
150+
-DENABLE_AUTO=ON \
151+
-DENABLE_AUTO_BATCH=ON \
152+
-DENABLE_HETERO=ON \
153+
-DENABLE_MULTI=ON \
154+
-DENABLE_TEMPLATE=ON \
155+
-DENABLE_OV_ONNX_FRONTEND=ON \
156+
-DENABLE_OV_PADDLE_FRONTEND=ON \
157+
-DENABLE_OV_TF_FRONTEND=ON \
158+
-DENABLE_OV_TF_LITE_FRONTEND=OFF \
159+
-DENABLE_OV_IR_FRONTEND=ON \
160+
-DENABLE_MLIR_COMPILER=ON \
161+
-DENABLE_PLUGINS_XML=ON \
162+
-DENABLE_PYTHON=ON \
163+
-DENABLE_WHEEL=ON \
164+
-DENABLE_TBBBIND_2_5=ON \
165+
-DENABLE_DEBUG_CAPS=ON \
166+
-DENABLE_NPU_DEBUG_CAPS=ON \
167+
-DENABLE_SANITIZER=OFF \
168+
-DENABLE_THREAD_SANITIZER=OFF \
169+
-DENABLE_UB_SANITIZER=OFF \
170+
-S ${OPENVINO_REPO} \
171+
-B ${OPENVINO_BUILD_DIR}
172+
173+
- name: Cmake build - OpenVINO
174+
run: |
175+
cmake --build ${OPENVINO_BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }}
176+
177+
- name: Cmake install - OpenVINO
178+
run: |
179+
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
180+
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component python_wheels
181+
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
182+
cmake --install ${OPENVINO_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component developer_package
183+
184+
- name: CMake configure - NPU Compiler
185+
run: |
186+
cmake \
187+
${{ inputs.npu-cmake-options }} \
188+
-G "Ninja Multi-Config" \
189+
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} \
190+
-DOpenVINODeveloperPackage_DIR=$(realpath ${OPENVINO_BUILD_DIR}) \
191+
-DENABLE_TESTS=${{ env.ENABLE_TESTS_FLAG }} \
192+
-DENABLE_DEVELOPER_BUILD=OFF \
193+
-DENABLE_MLIR_COMPILER=ON \
194+
-DBUILD_COMPILER_FOR_DRIVER=OFF \
195+
-DENABLE_DRIVER_COMPILER_ADAPTER=ON \
196+
-DENABLE_SOURCE_PACKAGE=OFF \
197+
-S ${NPU_COMPILER_REPO} \
198+
-B ${NPU_COMPILER_BUILD_DIR}
199+
200+
- name: Cmake build - NPU Compiler
201+
run: |
202+
cmake --build ${NPU_COMPILER_BUILD_DIR} --parallel $(nproc) --config ${{ env.CMAKE_BUILD_TYPE }}
203+
204+
- name: Cmake install - NPU Compiler
205+
run: |
206+
cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR}
207+
cmake --install ${NPU_COMPILER_BUILD_DIR} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${OPENVINO_INSTALL_DIR} --component tests
208+
209+
- name: Cache artifacts
210+
if: ${{ inputs.build-cache }}
211+
uses: actions/cache/save@v4
212+
with:
213+
path: ${{ env.OPENVINO_INSTALL_DIR }}
214+
key: ${{ needs.Cache.outputs.cache-key }}
215+
216+
- name: Upload artifacts
217+
id: save_artifact
218+
uses: actions/upload-artifact@v4
219+
with:
220+
path: ${{ env.OPENVINO_INSTALL_DIR }}
221+
name: ${{ inputs.openvino-install-artifact }}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Linux MLIR
2+
on:
3+
workflow_call:
4+
inputs:
5+
os:
6+
description: 'OS that is used for building in the form of "ubuntu_20_04"'
7+
type: string
8+
required: true
9+
build-runner:
10+
description: 'Machine on which the builds will run'
11+
type: string
12+
required: true
13+
test-runner:
14+
description: 'Machine on which the tests will run'
15+
type: string
16+
required: false
17+
openvino-cmake-options:
18+
description: 'A string of options passed to OpenVINO CMake'
19+
type: string
20+
required: false
21+
npu-cmake-options:
22+
description: 'A string of options passed to NPU Compiler CMake'
23+
type: string
24+
required: false
25+
build-cache:
26+
description: 'Whether to take previously built OpenVINO/NPU package.'
27+
type: boolean
28+
required: false
29+
default: false
30+
build-cache-key-suffix:
31+
description: 'Cache package suffix'
32+
type: string
33+
required: false
34+
run-unit-tests:
35+
description: 'Whether to run NPU Compiler unit tests'
36+
type: boolean
37+
required: false
38+
default: false
39+
run-lit-tests:
40+
description: 'Whether to run NPU Compiler LIT tests'
41+
type: boolean
42+
required: false
43+
default: false
44+
run-compilation-tests:
45+
description: 'Whether to run NPU Compiler compile_tool tests suites'
46+
type: boolean
47+
required: false
48+
default: false
49+
50+
defaults:
51+
run:
52+
shell: bash
53+
54+
permissions: read-all
55+
56+
env:
57+
OPENVINO_INSTALL_DIR: ./openvino_install
58+
59+
jobs:
60+
Dependencies:
61+
name: Dependencies
62+
runs-on: ubuntu-latest
63+
outputs:
64+
openvino_org: ${{ steps.read_openvino_sha.outputs.ov_org }}
65+
openvino_sha: ${{ steps.read_openvino_sha.outputs.ov_sha }}
66+
omz_org: ${{ steps.read_omz_sha.outputs.omz_org }}
67+
omz_sha: ${{ steps.read_omz_sha.outputs.omz_sha }}
68+
artifact-name: ${{ steps.artifacts.outputs.name }}
69+
env:
70+
OPENVINO_REPO: ./openvino
71+
NPU_COMPILER_REPO: ./npu_compiler
72+
steps:
73+
- name: Get OpenVINO config
74+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
75+
timeout-minutes: 15
76+
with:
77+
sparse-checkout: |
78+
validation/openvino_config.json
79+
sparse-checkout-cone-mode: false
80+
path: ${{ env.NPU_COMPILER_REPO }}
81+
82+
- name: Get integrated OpenVINO version
83+
id: read_openvino_sha
84+
run: |
85+
GITHUB_ORG=$(cat ${NPU_COMPILER_REPO}/validation/openvino_config.json | sed -En 's/.*"([A-Za-z0-9]+)"\s*:\s*"([a-f0-9]{40})".*/\1/p')
86+
COMMIT_SHA=$(cat ${NPU_COMPILER_REPO}/validation/openvino_config.json | sed -En 's/.*"([A-Za-z0-9]+)"\s*:\s*"([a-f0-9]{40})".*/\2/p')
87+
echo "OpenVINO orgranization = $GITHUB_ORG"
88+
echo "OpenVINO commit sha = $COMMIT_SHA"
89+
echo "ov_org=$GITHUB_ORG" >> $GITHUB_OUTPUT
90+
echo "ov_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
91+
92+
- name: Clone OpenVINO
93+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94+
timeout-minutes: 15
95+
with:
96+
sparse-checkout: |
97+
src/plugins/intel_npu/tools/omz_version.json
98+
sparse-checkout-cone-mode: false
99+
repository: ${{ steps.read_openvino_sha.outputs.ov_org }}/openvino
100+
path: ${{ env.OPENVINO_REPO }}
101+
ref: ${{ steps.read_openvino_sha.outputs.ov_sha }}
102+
103+
- name: Get integrated Open Model Zoo version
104+
id: read_omz_sha
105+
run: |
106+
GITHUB_ORG=$(cat ${OPENVINO_REPO}/src/plugins/intel_npu/tools/omz_version.json | sed -En 's/.*"([A-Za-z0-9]+)"\s*:\s*"([a-f0-9]{40})".*/\1/p')
107+
COMMIT_SHA=$(cat ${OPENVINO_REPO}/src/plugins/intel_npu/tools/omz_version.json | sed -En 's/.*"([A-Za-z0-9]+)"\s*:\s*"([a-f0-9]{40})".*/\2/p')
108+
echo "Open Model Zoo orgranization = $GITHUB_ORG"
109+
echo "Open Model Zoo commit sha = $COMMIT_SHA"
110+
echo "omz_org=$GITHUB_ORG" >> $GITHUB_OUTPUT
111+
echo "omz_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
112+
113+
- name: Configure artifacts
114+
id: artifacts
115+
run: echo "name=l_ov_dyn_${{ inputs.os }}_npu_${{ github.sha }}" >> $GITHUB_OUTPUT
116+
117+
Build:
118+
name: Build
119+
needs: Dependencies
120+
uses: ./.github/workflows/job_build_mlir_linux.yml
121+
with:
122+
os: ${{ inputs.os }}
123+
build-runner: ${{ inputs.build-runner }}
124+
openvino-organization: ${{ needs.Dependencies.outputs.openvino_org }}
125+
openvino-commit: ${{ needs.Dependencies.outputs.openvino_sha }}
126+
openvino-cmake-options: ${{ inputs.openvino-cmake-options }}
127+
npu-cmake-options: ${{ inputs.npu-cmake-options }}
128+
build-cache: ${{ inputs.build-cache }}
129+
build-cache-key-suffix: ${{ inputs.build-cache-key-suffix }}
130+
with-tests: ${{ inputs.run-unit-tests || inputs.run-lit-tests }}
131+
openvino-install-artifact: ${{ needs.Dependencies.outputs.artifact-name }}
132+
133+
Test:
134+
name: Test
135+
needs: [Dependencies, Build]
136+
if: ${{ inputs.run-unit-tests || inputs.run-lit-tests || inputs.run-compilation-tests }}
137+
uses: ./.github/workflows/job_test_mlir_linux.yml
138+
with:
139+
test-runner: ${{ inputs.test-runner }}
140+
openvino-install-artifact: ${{ needs.Dependencies.outputs.artifact-name }}
141+
run-unit-tests: ${{ inputs.run-unit-tests }}
142+
run-lit-tests: ${{ inputs.run-lit-tests }}
143+
run-compilation-tests: ${{ inputs.run-compilation-tests }}

0 commit comments

Comments
 (0)