Skip to content

Commit d3f03a4

Browse files
committed
Adding compilation tests
1 parent f4f720e commit d3f03a4

File tree

5 files changed

+332
-100
lines changed

5 files changed

+332
-100
lines changed

.github/workflows/job_build_test_mlir_linux.yml .github/workflows/job_build_mlir_linux.yml

+38-89
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux MLIR
1+
name: Linux MLIR Build
22
on:
33
workflow_call:
44
inputs:
@@ -10,10 +10,14 @@ on:
1010
description: 'Machine on which the builds will run'
1111
type: string
1212
required: true
13-
test-runner:
14-
description: 'Machine on which the tests will run'
13+
openvino-organization:
14+
description: 'OpenVINO fork owner to clone'
1515
type: string
16-
required: false
16+
required: true
17+
openvino-commit:
18+
description: 'OpenVINO commit to checkout'
19+
type: string
20+
required: true
1721
openvino-cmake-options:
1822
description: 'A string of options passed to OpenVINO CMake'
1923
type: string
@@ -31,66 +35,61 @@ on:
3135
description: 'Cache package suffix'
3236
type: string
3337
required: false
34-
run-tests:
35-
description: 'Whether to run NPU Compiler tests'
38+
with-tests:
39+
description: 'Whether to build test targets'
3640
type: boolean
3741
required: false
3842
default: false
39-
run-unit-tests:
40-
description: 'Whether to run NPU Compiler unit tests'
41-
type: boolean
42-
required: false
43-
default: true
44-
run-lit-tests:
45-
description: 'Whether to run NPU Compiler LIT tests'
46-
type: boolean
47-
required: false
48-
default: true
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
4952

5053
permissions: read-all
5154

5255
env:
5356
OPENVINO_INSTALL_DIR: ./openvino_install
54-
OPENVINO_INSTALL_ARTIFACT_NAME: l_ov_dyn_${{ inputs.os }}_npu_${{ github.sha }}
5557

5658
jobs:
5759
Cache:
5860
name: Cache
5961
if: ${{ inputs.build-cache }}
60-
runs-on: ${{ inputs.build-runner }}
62+
runs-on: ubuntu-latest
6163
outputs:
62-
hit: ${{ steps.restore.outputs.hit }}
63-
key: ${{ steps.key.outputs.key }}
64+
cache-hit: ${{ steps.restore.outputs.cache-hit }}
65+
cache-key: ${{ steps.key.outputs.cache_key }}
6466
steps:
6567
- name: Get cache key
6668
id: key
6769
run: |
68-
key="l_ov_dyn_${{ inputs.os }}_cache_${{ inputs.build-cache-key-suffix || github.sha }}"
69-
echo "key=$key" >> $GITHUB_OUTPUT
70+
cache_key="l_ov_dyn_${{ inputs.os }}_cache_${{ inputs.build-cache-key-suffix || github.sha }}"
71+
echo "cache_key=$cache_key" >> $GITHUB_OUTPUT
7072
7173
- name: Restore OpenVINO/NPU package from cache
7274
id: restore
7375
uses: actions/cache/restore@v4
7476
with:
75-
key: ${{ steps.key.outputs.key }}
77+
key: ${{ steps.key.outputs.cache_key }}
7678
path: ${{ env.OPENVINO_INSTALL_DIR }}
7779

7880
- name: Upload artifacts
79-
if: ${{ steps.restore.outputs.hit }}
81+
if: ${{ steps.restore.outputs.cache-hit }}
8082
uses: actions/upload-artifact@v4
8183
with:
8284
path: ${{ env.OPENVINO_INSTALL_DIR }}
83-
name: ${{ env.OPENVINO_INSTALL_ARTIFACT_NAME }}
85+
name: ${{ inputs.openvino-install-artifact }}
8486

8587
Build:
8688
name: Build
8789
needs: Cache
88-
if: needs.Cache.outputs.hit != 'true'
90+
if: needs.Cache.outputs.cache-hit != 'true'
8991
runs-on: ${{ inputs.build-runner }}
9092
timeout-minutes: 240
91-
defaults:
92-
run:
93-
shell: bash
9493
env:
9594
DEBIAN_FRONTEND: noninteractive
9695
CMAKE_BUILD_TYPE: 'Release'
@@ -99,32 +98,22 @@ jobs:
9998
OPENVINO_BUILD_DIR: ./openvino_build
10099
NPU_COMPILER_BUILD_DIR: ./npu_compiler_build
101100
steps:
102-
- name: Clone NPU Compiler
101+
- name: Clone OpenVINO
103102
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
104103
timeout-minutes: 15
105104
with:
106-
path: ${{ env.NPU_COMPILER_REPO }}
105+
repository: ${{ inputs.openvino-organization }}/openvino
106+
path: ${{ env.OPENVINO_REPO }}
107107
submodules: true
108-
lfs: true
108+
ref: ${{ inputs.openvino-commit }}
109109

110-
- name: Get integrated OpenVINO version
111-
id: read_openvino_sha
112-
run: |
113-
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')
114-
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')
115-
echo "github_org=$GITHUB_ORG"
116-
echo "commit_sha=$COMMIT_SHA"
117-
echo "github_org=$GITHUB_ORG" >> $GITHUB_OUTPUT
118-
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
119-
120-
- name: Clone OpenVINO
110+
- name: Clone NPU Compiler
121111
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
122112
timeout-minutes: 15
123113
with:
124-
repository: ${{ steps.read_openvino_sha.outputs.github_org }}/openvino
125-
path: ${{ env.OPENVINO_REPO }}
114+
path: ${{ env.NPU_COMPILER_REPO }}
126115
submodules: true
127-
ref: ${{ steps.read_openvino_sha.outputs.commit_sha }}
116+
lfs: true
128117

129118
- name: System info
130119
uses: openvinotoolkit/openvino/.github/actions/system_info@master
@@ -139,7 +128,7 @@ jobs:
139128
140129
- name: Prepare environment
141130
run: |
142-
if [[ "${{ inputs.run-tests }}" == "true" ]]; then
131+
if [[ "${{ inputs.with-tests }}" == "true" ]]; then
143132
echo "ENABLE_TESTS_FLAG=ON" >> $GITHUB_ENV
144133
else
145134
echo "ENABLE_TESTS_FLAG=OFF" >> $GITHUB_ENV
@@ -222,51 +211,11 @@ jobs:
222211
uses: actions/cache/save@v4
223212
with:
224213
path: ${{ env.OPENVINO_INSTALL_DIR }}
225-
key: ${{ needs.Cache.outputs.key }}
214+
key: ${{ needs.Cache.outputs.cache-key }}
226215

227216
- name: Upload artifacts
228217
id: save_artifact
229218
uses: actions/upload-artifact@v4
230219
with:
231220
path: ${{ env.OPENVINO_INSTALL_DIR }}
232-
name: ${{ env.OPENVINO_INSTALL_ARTIFACT_NAME }}
233-
234-
Test:
235-
name: Unit Tests
236-
needs: [Cache, Build]
237-
if: |
238-
inputs.run-tests &&
239-
(needs.Cache.result == 'skipped' || needs.Cache.result == 'success') &&
240-
(needs.Build.result == 'skipped' || needs.Build.result == 'success')
241-
runs-on: ${{ inputs.test-runner }}
242-
timeout-minutes: 240
243-
defaults:
244-
run:
245-
shell: bash
246-
steps:
247-
- name: Download artifacts
248-
uses: actions/download-artifact@v4
249-
with:
250-
name: ${{ env.OPENVINO_INSTALL_ARTIFACT_NAME }}
251-
path: ${{ env.OPENVINO_INSTALL_DIR }}
252-
253-
- name: Run OV NPU Unit tests
254-
if: ${{ inputs.run-unit-tests }}
255-
run: |
256-
${OPENVINO_INSTALL_DIR}/tests/ov_npu_unit_tests
257-
258-
- name: Run NPU Unit tests
259-
if: ${{ inputs.run-unit-tests }}
260-
run: |
261-
${OPENVINO_INSTALL_DIR}/tests/npuUnitTests
262-
263-
- name: Run NPU LIT tests
264-
if: ${{ inputs.run-lit-tests }}
265-
run: |
266-
export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/prof_parser
267-
export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/npu-loader
268-
export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/npu-lsp-server
269-
export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/vpux-opt
270-
export PATH=$PATH:${OPENVINO_INSTALL_DIR}/tools/vpux-translate
271-
python3 ${OPENVINO_INSTALL_DIR}/tests/lit-tests/lit-tool/lit.py -v --param arch=NPU37XX NPU/NPU
272-
python3 ${OPENVINO_INSTALL_DIR}/tests/lit-tests/lit-tool/lit.py -v --param arch=NPU40XX NPU/NPU
221+
name: ${{ inputs.openvino-install-artifact }}

.github/workflows/job_mlir_linux.yml

+143
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.ov_org }}
125+
openvino-commit: ${{ needs.Dependencies.outputs.ov_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)