Skip to content

Commit 3741127

Browse files
committed
Refactoring
1 parent c83524d commit 3741127

11 files changed

+475
-433
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Linux DRIVER 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+
driver-cmake-options:
14+
description: 'Custom CMake options for NPU Driver build'
15+
type: string
16+
required: false
17+
outputs:
18+
driver-install-artifact:
19+
description: 'Driver build package name to be stored as the action artifact'
20+
value: ${{ jobs.BuildDRIVER.outputs.driver-install-artifact }}
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
permissions: read-all
27+
28+
env:
29+
DRIVER_INSTALL_ARTIFACT: l_ov_cid_${{ inputs.os }}_npu_${{ github.sha }}
30+
31+
jobs:
32+
BuildDRIVER:
33+
name: Build DRIVER
34+
runs-on: ${{ inputs.build-runner }}
35+
timeout-minutes: 240
36+
outputs:
37+
driver-install-artifact: ${{ steps.set_artifact_name.outputs.driver-install-artifact }}
38+
env:
39+
DEBIAN_FRONTEND: noninteractive
40+
NPU_DRIVER_REPO: ./npu_driver
41+
NPU_DRIVER_BUILD_DIR: ./npu_driver_build
42+
NPU_DRIVER_INSTALL_DIR: ./npu_driver_install
43+
steps:
44+
- name: Get version
45+
uses: ./.github/workflows/versions.yml
46+
id: versions
47+
48+
- name: Clone Linux NPU Driver
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
50+
timeout-minutes: 15
51+
with:
52+
repository: intel/linux-npu-driver
53+
path: ${{ env.NPU_DRIVER_REPO }}
54+
submodules: true
55+
56+
- name: System info
57+
uses: openvinotoolkit/openvino/.github/actions/system_info@master
58+
59+
- name: Install system packages
60+
run: |
61+
sudo apt update
62+
sudo apt install -y build-essential git git-lfs cmake libudev-dev libboost-all-dev libssl-dev
63+
64+
- name: Configure OpenVINO and NPU Compiler versions
65+
run: |
66+
sed -i "s|^set(OPENVINO_REPOSITORY .*|set(OPENVINO_REPOSITORY https://github.com/${{ steps.versions.outputs.openvino-repository }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
67+
sed -i '/GIT_REPOSITORY/{n;s|https://github.com/openvinotoolkit/npu_plugin.git|https://github.com/${{ steps.versions.outputs.npu-compiler-repository }}.git|}' ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
68+
sed -i "s|^set(NPU_COMPILER_TAG .*|set(NPU_COMPILER_TAG ${{ steps.versions.outputs.npu-compiler-tag }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
69+
sed -i "s|^set(NPU_COMPILER_REVISION .*|set(NPU_COMPILER_REVISION ${{ steps.versions.outputs.npu-compiler-sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
70+
sed -i "s|^set(NPU_COMPILER_OPENVINO_REVISION .*|set(NPU_COMPILER_OPENVINO_REVISION ${{ steps.versions.outputs.openvino-sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
71+
cat ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
72+
73+
- name: CMake configure - Linux NPU Driver
74+
run: |
75+
cmake \
76+
${{ inputs.driver-cmake-options }} \
77+
-DENABLE_OPENVINO_PACKAGE=ON \
78+
-DENABLE_NPU_COMPILER_BUILD=ON \
79+
-DCMAKE_INSTALL_PREFIX=$(realpath ${NPU_DRIVER_INSTALL_DIR}) \
80+
-S ${NPU_DRIVER_REPO} \
81+
-B ${NPU_DRIVER_BUILD_DIR}
82+
83+
- name: CMake build - Linux NPU Driver - deb packages
84+
run: |
85+
cmake \
86+
--build ${NPU_DRIVER_BUILD_DIR} \
87+
--parallel $(nproc) \
88+
--target package
89+
90+
- name: Copy packages
91+
run: |
92+
mkdir -p ${NPU_DRIVER_INSTALL_DIR}/packages
93+
mv ${NPU_DRIVER_BUILD_DIR}/intel-{level-zero-npu,fw-npu,driver-compiler-npu}*.*deb ${NPU_DRIVER_INSTALL_DIR}/packages/
94+
ls -a ${NPU_DRIVER_INSTALL_DIR}
95+
ls -a ${NPU_DRIVER_INSTALL_DIR}/packages
96+
97+
- name: Set artifacts name to outputs
98+
id: set_artifact_name
99+
run: |
100+
echo "driver-install-artifact=$DRIVER_INSTALL_ARTIFACT" >> $GITHUB_OUTPUT

.github/workflows/job_build_mlir_linux.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ on:
1010
description: 'Machine on which the builds will run'
1111
type: string
1212
required: true
13-
openvino-repository:
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
2113
openvino-cmake-options:
2214
description: 'A string of options passed to OpenVINO CMake'
2315
type: string
@@ -27,7 +19,7 @@ on:
2719
type: string
2820
required: false
2921
build-cache:
30-
description: 'Whether to take previously built OpenVINO/NPU package.'
22+
description: 'Whether to take previously built OpenVINO/NPU package'
3123
type: boolean
3224
required: false
3325
default: false
@@ -40,11 +32,10 @@ on:
4032
type: boolean
4133
required: false
4234
default: false
35+
outputs:
4336
openvino-install-artifact:
4437
description: 'OpenVINO/NPU build package name to be stored as the action artifact'
45-
type: string
46-
required: true
47-
default: false
38+
value: ${{ jobs.BuildMLIR.outputs.openvino-install-artifact }}
4839

4940
defaults:
5041
run:
@@ -54,6 +45,7 @@ permissions: read-all
5445

5546
env:
5647
OPENVINO_INSTALL_DIR: ./openvino_install
48+
OPENVINO_INSTALL_ARTIFACT: l_ov_dyn_${{ inputs.os }}_npu_${{ github.sha }}
5749

5850
jobs:
5951
Cache:
@@ -82,14 +74,16 @@ jobs:
8274
uses: actions/upload-artifact@v4
8375
with:
8476
path: ${{ env.OPENVINO_INSTALL_DIR }}
85-
name: ${{ inputs.openvino-install-artifact }}
77+
name: ${{ env.OPENVINO_INSTALL_ARTIFACT }}
8678

87-
Build:
88-
name: Build
79+
BuildMLIR:
80+
name: Build MLIR
8981
needs: Cache
9082
if: ${{ always() && needs.Cache.outputs.cache-hit != 'true' }}
9183
runs-on: ${{ inputs.build-runner }}
9284
timeout-minutes: 240
85+
outputs:
86+
openvino-install-artifact: ${{ steps.set_artifact_name.outputs.openvino-install-artifact }}
9387
env:
9488
DEBIAN_FRONTEND: noninteractive
9589
CMAKE_BUILD_TYPE: 'Release'
@@ -98,14 +92,18 @@ jobs:
9892
OPENVINO_BUILD_DIR: ./openvino_build
9993
NPU_COMPILER_BUILD_DIR: ./npu_compiler_build
10094
steps:
95+
- name: Get version
96+
uses: ./.github/workflows/versions.yml
97+
id: versions
98+
10199
- name: Clone OpenVINO
102100
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103101
timeout-minutes: 15
104102
with:
105-
repository: ${{ inputs.openvino-repository }}
103+
repository: ${{ steps.versions.outputs.openvino-repository }}
106104
path: ${{ env.OPENVINO_REPO }}
107105
submodules: true
108-
ref: ${{ inputs.openvino-commit }}
106+
ref: ${{ steps.versions.outputs.openvino-sha }}
109107

110108
- name: Clone NPU Compiler
111109
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -218,4 +216,9 @@ jobs:
218216
uses: actions/upload-artifact@v4
219217
with:
220218
path: ${{ env.OPENVINO_INSTALL_DIR }}
221-
name: ${{ inputs.openvino-install-artifact }}
219+
name: ${{ env.openvino-install-artifact }}
220+
221+
- name: Set artifacts name to outputs
222+
id: set_artifact_name
223+
run: |
224+
echo "openvino-install-artifact=$OPENVINO_INSTALL_ARTIFACT" >> $GITHUB_OUTPUT

.github/workflows/job_test_mlir_linux.yml renamed to .github/workflows/job_compilation_tests_linux.yml

Lines changed: 17 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,19 @@ on:
55
test-runner:
66
description: 'Machine on which the tests will run'
77
type: string
8-
required: false
8+
required: true
99
openvino-install-artifact:
1010
description: 'OpenVINO/NPU build package name to be downloaded for tests'
1111
type: string
1212
required: true
13-
default: false
14-
run-unit-tests:
15-
description: 'Whether to run NPU Compiler unit tests'
16-
type: boolean
17-
required: false
18-
default: false
19-
run-lit-tests:
20-
description: 'Whether to run NPU Compiler LIT tests'
21-
type: boolean
22-
required: false
23-
default: false
24-
run-compilation-tests:
25-
description: 'Whether to run NPU Compiler compile_tool tests suites'
26-
type: boolean
13+
driver-install-artifact:
14+
description: 'NPU Driver build package name to be downloaded for tests'
15+
type: string
2716
required: false
28-
default: false
17+
compiler-type:
18+
description: 'MLIR or DRIVER'
19+
type: string
20+
required: true
2921

3022
defaults:
3123
run:
@@ -37,61 +29,6 @@ env:
3729
OPENVINO_INSTALL_DIR: ./openvino_install
3830

3931
jobs:
40-
UnitTests:
41-
name: Unit Tests
42-
if: ${{ inputs.run-unit-tests || inputs.run-lit-tests }}
43-
runs-on: ${{ inputs.test-runner }}
44-
timeout-minutes: 60
45-
steps:
46-
- name: Download artifacts
47-
uses: actions/download-artifact@v4
48-
with:
49-
name: ${{ inputs.openvino-install-artifact }}
50-
path: ${{ env.OPENVINO_INSTALL_DIR }}
51-
52-
- name: Prepare environment
53-
run: |
54-
echo "PROF_PARSER_PATH=$(realpath "${OPENVINO_INSTALL_DIR}/tools/prof_parser")" >> $GITHUB_ENV
55-
echo "LSP_SERVER_PATH=$(realpath "${OPENVINO_INSTALL_DIR}/tools/npu-lsp-server")" >> $GITHUB_ENV
56-
echo "VPUX_OPT_PATH=$(realpath "${OPENVINO_INSTALL_DIR}/tools/vpux-opt")" >> $GITHUB_ENV
57-
chmod +x ${OPENVINO_INSTALL_DIR}/setupvars.sh
58-
chmod +x ${OPENVINO_INSTALL_DIR}/tests/FileCheck
59-
chmod +x ${OPENVINO_INSTALL_DIR}/tests/flatc
60-
chmod +x ${OPENVINO_INSTALL_DIR}/tests/not
61-
chmod +x ${OPENVINO_INSTALL_DIR}/tools/prof_parser/prof_parser
62-
chmod +x ${OPENVINO_INSTALL_DIR}/tools/npu-lsp-server/npu-lsp-server
63-
chmod +x ${OPENVINO_INSTALL_DIR}/tools/vpux-opt/vpux-opt
64-
65-
- name: Run OV NPU Unit tests
66-
if: ${{ inputs.run-unit-tests }}
67-
run: |
68-
source ${OPENVINO_INSTALL_DIR}/setupvars.sh
69-
chmod +x ${OPENVINO_INSTALL_DIR}/tests/ov_npu_unit_tests
70-
${OPENVINO_INSTALL_DIR}/tests/ov_npu_unit_tests
71-
72-
- name: Run NPU Unit tests
73-
if: ${{ inputs.run-unit-tests }}
74-
run: |
75-
source ${OPENVINO_INSTALL_DIR}/setupvars.sh
76-
chmod +x ${OPENVINO_INSTALL_DIR}/tests/npuUnitTests
77-
${OPENVINO_INSTALL_DIR}/tests/npuUnitTests
78-
79-
- name: Run NPU37XX LIT tests
80-
if: ${{ inputs.run-lit-tests }}
81-
run: |
82-
source ${OPENVINO_INSTALL_DIR}/setupvars.sh
83-
export PATH=$PATH:${PROF_PARSER_PATH}:${LSP_SERVER_PATH}:${VPUX_OPT_PATH}
84-
cd ${OPENVINO_INSTALL_DIR}/tests/lit-tests
85-
python3 ./lit-tool/lit.py -v --param arch=NPU37XX NPU/NPU
86-
87-
- name: Run NPU40XX LIT tests
88-
if: ${{ inputs.run-lit-tests }}
89-
run: |
90-
source ${OPENVINO_INSTALL_DIR}/setupvars.sh
91-
export PATH=$PATH:${PROF_PARSER_PATH}:${LSP_SERVER_PATH}:${VPUX_OPT_PATH}
92-
cd ${OPENVINO_INSTALL_DIR}/tests/lit-tests
93-
python3 ./lit-tool/lit.py -v --param arch=NPU40XX NPU/NPU
94-
9532
# TODO: This is a demonstration job. It will be separated into downloading and compilation actions and a config.
9633
CompilationTests:
9734
name: Compilation tests
@@ -101,17 +38,24 @@ jobs:
10138
env:
10239
MODELS_DIR: ./models
10340
steps:
104-
- name: Download artifacts
41+
- name: Download OpenVINO artifacts
10542
uses: actions/download-artifact@v4
10643
with:
10744
name: ${{ inputs.openvino-install-artifact }}
10845
path: ${{ env.OPENVINO_INSTALL_DIR }}
10946

47+
- name: Download Driver artifacts
48+
if: ${{ inputs.compiler-type == 'DRIVER' }}
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: ${{ inputs.driver-install-artifact }}
52+
path: ${{ env.OPENVINO_INSTALL_DIR }}
53+
11054
- name: Prepare environment
11155
run: |
11256
chmod +x ${OPENVINO_INSTALL_DIR}/setupvars.sh
11357
chmod +x ${OPENVINO_INSTALL_DIR}/tools/compile_tool/compile_tool
114-
echo "NPU_COMPILER_TYPE MLIR" > common_compilation_config.conf
58+
echo "NPU_COMPILER_TYPE ${{ inputs.compiler-type }}" > common_compilation_config.conf
11559
11660
- name: Install huggingface_hub
11761
run: |

0 commit comments

Comments
 (0)