Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions .github/workflows/job_build_mlir_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
143 changes: 143 additions & 0 deletions .github/workflows/job_mlir_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Linux MLIR
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
test-runner:
description: 'Machine on which the tests will run'
type: string
required: false
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
run-unit-tests:
description: 'Whether to run NPU Compiler unit tests'
type: boolean
required: false
default: false
run-lit-tests:
description: 'Whether to run NPU Compiler LIT tests'
type: boolean
required: false
default: false
run-compilation-tests:
description: 'Whether to run NPU Compiler compile_tool tests suites'
type: boolean
required: false
default: false

defaults:
run:
shell: bash

permissions: read-all

env:
OPENVINO_INSTALL_DIR: ./openvino_install

jobs:
Dependencies:
name: Dependencies
runs-on: ubuntu-latest
outputs:
openvino_org: ${{ steps.read_openvino_sha.outputs.ov_org }}
openvino_sha: ${{ steps.read_openvino_sha.outputs.ov_sha }}
omz_org: ${{ steps.read_omz_sha.outputs.omz_org }}
omz_sha: ${{ steps.read_omz_sha.outputs.omz_sha }}
artifact-name: ${{ steps.artifacts.outputs.name }}
env:
OPENVINO_REPO: ./openvino
NPU_COMPILER_REPO: ./npu_compiler
steps:
- name: Get OpenVINO config
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
validation/openvino_config.json
sparse-checkout-cone-mode: false
path: ${{ env.NPU_COMPILER_REPO }}

- name: Get integrated OpenVINO version
id: read_openvino_sha
run: |
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')
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')
echo "OpenVINO orgranization = $GITHUB_ORG"
echo "OpenVINO commit sha = $COMMIT_SHA"
echo "ov_org=$GITHUB_ORG" >> $GITHUB_OUTPUT
echo "ov_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT

- name: Clone OpenVINO
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
src/plugins/intel_npu/tools/omz_version.json
sparse-checkout-cone-mode: false
repository: ${{ steps.read_openvino_sha.outputs.ov_org }}/openvino
path: ${{ env.OPENVINO_REPO }}
ref: ${{ steps.read_openvino_sha.outputs.ov_sha }}

- name: Get integrated Open Model Zoo version
id: read_omz_sha
run: |
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')
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')
echo "Open Model Zoo orgranization = $GITHUB_ORG"
echo "Open Model Zoo commit sha = $COMMIT_SHA"
echo "omz_org=$GITHUB_ORG" >> $GITHUB_OUTPUT
echo "omz_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT

- name: Configure artifacts
id: artifacts
run: echo "name=l_ov_dyn_${{ inputs.os }}_npu_${{ github.sha }}" >> $GITHUB_OUTPUT

Build:
name: Build
needs: Dependencies
uses: ./.github/workflows/job_build_mlir_linux.yml
with:
os: ${{ inputs.os }}
build-runner: ${{ inputs.build-runner }}
openvino-organization: ${{ needs.Dependencies.outputs.openvino_org }}
openvino-commit: ${{ needs.Dependencies.outputs.openvino_sha }}
openvino-cmake-options: ${{ inputs.openvino-cmake-options }}
npu-cmake-options: ${{ inputs.npu-cmake-options }}
build-cache: ${{ inputs.build-cache }}
build-cache-key-suffix: ${{ inputs.build-cache-key-suffix }}
with-tests: ${{ inputs.run-unit-tests || inputs.run-lit-tests }}
openvino-install-artifact: ${{ needs.Dependencies.outputs.artifact-name }}

Test:
name: Test
needs: [Dependencies, Build]
if: ${{ inputs.run-unit-tests || inputs.run-lit-tests || inputs.run-compilation-tests }}
uses: ./.github/workflows/job_test_mlir_linux.yml
with:
test-runner: ${{ inputs.test-runner }}
openvino-install-artifact: ${{ needs.Dependencies.outputs.artifact-name }}
run-unit-tests: ${{ inputs.run-unit-tests }}
run-lit-tests: ${{ inputs.run-lit-tests }}
run-compilation-tests: ${{ inputs.run-compilation-tests }}
Loading