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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/actions/compile-models/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Compile models for NPU'

inputs:
compiler-type:
description: 'MLIR|DRIVER'
description: 'PLUGIN|DRIVER'
type: string
required: true
npu-platform:
Expand Down Expand Up @@ -46,7 +46,7 @@ runs:
python3 -m pip install --require-hashes -r ${{ github.action_path }}/requirements.txt
- name: Prepare OpenVINO environment
if: ${{ inputs.compiler-type == 'MLIR' }}
if: ${{ inputs.compiler-type == 'PLUGIN' }}
shell: bash
run: |
cat <<'EOF' > prepare_env.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/compile-models/common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def parse_arguments():
"--compiler-type",
type=str,
required=True,
choices=["MLIR", "DRIVER"],
help="MLIR|DRIVER",
choices=["PLUGIN", "DRIVER"],
help="PLUGIN|DRIVER",
)
parser.add_argument(
"--compile-tool",
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/compile-models/compile_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"repository_path": "path/to/model/in.repo",
"framework": "onnx|pytorch",
"model_type": "transormer",
"category": "MLIR/VPU4000/SILICON",
"category": "PLUGIN/VPU4000/SILICON",
"extra_config": {
"NPU_COMPILER_TYPE": "MLIR",
"NPU_COMPILER_TYPE": "PLUGIN",
"NPU_PLATFORM": "VPU4000",
"DEVICE_ID": "4000",
"PERFORMANCE_HINT": "LATENCY"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/download-models/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Download models from different sources'

inputs:
compiler-type:
description: 'MLIR|DRIVER'
description: 'PLUGIN|DRIVER'
type: string
required: true
models-config:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/download-models/common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def parse_arguments():
"--compiler-type",
type=str,
required=True,
choices=["MLIR", "DRIVER"],
help="MLIR|DRIVER",
choices=["PLUGIN", "DRIVER"],
help="PLUGIN|DRIVER",
)
parser.add_argument(
"--models-config",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/download-models/download_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"repository_path": "path/to/model/in/repo",
"framework": "pytorch|onnx",
"extra_config": {
"NPU_COMPILER_TYPE": "MLIR|DRIVER"
"NPU_COMPILER_TYPE": "PLUGIN|DRIVER"
}
}
]
Expand Down
25 changes: 24 additions & 1 deletion .github/actions/versions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ outputs:
description: 'NPU Linux Driver commit SHA'
value: ${{ steps.read-linux-npu-driver-sha.outputs.drv-sha }}
omz-repository:
description: 'Open Model Zoo Repository full name: for/open_model_zoo'
description: 'Open Model Zoo Repository full name: fork/open_model_zoo'
value: ${{ steps.read-omz-sha.outputs.omz-repository }}
omz-sha:
description: 'Open Model Zoo commit SHA'
value: ${{ steps.read-omz-sha.outputs.omz-sha }}
opencv-repository:
description: 'OpenCV Repository full name: fork/opencv'
value: ${{ steps.read-ocv-sha.outputs.ocv-repository }}
opencv-sha:
description: 'OpenCV commit SHA'
value: ${{ steps.read-ocv-sha.outputs.ocv-sha }}

runs:
using: 'composite'
Expand Down Expand Up @@ -156,3 +162,20 @@ runs:
echo "Open Model Zoo commit sha = $OMZ_SHA"
echo "omz-repository=$OMZ_ORG/open_model_zoo" >> $GITHUB_OUTPUT
echo "omz-sha=$OMZ_SHA" >> $GITHUB_OUTPUT

- name: Fetch and parse OpenCV config from OpenVINO
id: read-ocv-sha
shell: bash
run: |
OV_REPO=${{ steps.read-openvino-sha.outputs.openvino-repository }}
OV_SHA=${{ steps.read-openvino-sha.outputs.openvino-sha }}
JSON=$(curl -sS --fail --retry 5 --retry-delay 2 \
-H "Accept: application/vnd.github.v3.raw" \
https://api.github.com/repos/${OV_REPO}/contents/src/plugins/intel_npu/tools/opencv_version.json?ref=${OV_SHA} \
)
OCV_ORG=$(echo "$JSON" | jq -r 'to_entries[0].key')
OCV_SHA=$(echo "$JSON" | jq -r 'to_entries[0].value')
echo "OpenCV orgranization = $OCV_ORG"
echo "OpenCV commit sha = $OCV_SHA"
echo "ocv-repository=$OCV_ORG/opencv" >> $GITHUB_OUTPUT
echo "ocv-sha=$OCV_SHA" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ jobs:
with:
os: ubuntu_24_04
build-runner: ubuntu-latest-32-cores
build-mlir: true
build-plugin: true
build-driver: false
with-codeql: true
1 change: 1 addition & 0 deletions .github/workflows/job_build_drv_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
run: |
sed -i "s|^set(OPENVINO_REPOSITORY .*|set(OPENVINO_REPOSITORY https://github.com/${{ steps.versions.outputs.openvino-repository }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
sed -i "s|^set(OPENVINO_REVISION .*|set(OPENVINO_REVISION ${{ steps.versions.outputs.openvino-sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
sed -i "s|^set(OPENCV_REVISION .*|set(OPENCV_REVISION ${{ steps.versions.outputs.opencv-sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
sed -i '/GIT_REPOSITORY/{n;s|https://github.com/openvinotoolkit/npu_compiler.git|https://github.com/${{ steps.versions.outputs.npu-compiler-repository }}.git|}' ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
sed -i "s|^set(NPU_COMPILER_TAG .*|set(NPU_COMPILER_TAG ${{ steps.versions.outputs.npu-compiler-tag }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
sed -i "s|^set(NPU_COMPILER_REVISION .*|set(NPU_COMPILER_REVISION ${{ steps.versions.outputs.npu-compiler-sha }})|" ${NPU_DRIVER_REPO}/compiler/compiler_source.cmake
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux MLIR Build
name: Linux Plugin Build
on:
workflow_call:
inputs:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/job_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ on:
description: 'A string of options passed to NPU Driver CMake'
type: string
required: false
build-mlir:
description: 'Whether to build MLIR NPU Compiler'
build-plugin:
description: 'Whether to build Plugin NPU Compiler'
type: boolean
required: false
default: true
Expand Down Expand Up @@ -85,10 +85,10 @@ env:
OPENVINO_INSTALL_DIR: ./openvino_install

jobs:
BuildMLIR:
name: MLIR / Build
if: ${{ inputs.build-mlir }}
uses: ./.github/workflows/job_build_mlir_linux.yml
BuildPlugin:
name: Plugin / Build
if: ${{ inputs.build-plugin }}
uses: ./.github/workflows/job_build_plugin_linux.yml
permissions:
actions: read
contents: read
Expand Down Expand Up @@ -134,27 +134,27 @@ jobs:
build-cache: ${{ inputs.build-cache }}
build-cache-key-suffix: ${{ inputs.build-cache-key-suffix }}

MLIRUnitTests:
name: MLIR / Unit Tests
needs: BuildMLIR
PluginUnitTests:
name: Plugin / Unit Tests
needs: BuildPlugin
if: ${{ inputs.run-unit-tests || inputs.run-lit-tests }}
uses: ./.github/workflows/job_tests_unit_mlir_linux.yml
uses: ./.github/workflows/job_tests_unit_plugin_linux.yml
with:
test-runner: ${{ inputs.test-runner }}
install-package: ${{ needs.BuildMLIR.outputs.build-package }}
install-package: ${{ needs.BuildPlugin.outputs.build-package }}
run-unit-tests: ${{ inputs.run-unit-tests }}
run-lit-tests: ${{ inputs.run-lit-tests }}

MLIRCompilationTests:
name: MLIR / Compilation Tests
needs: BuildMLIR
PluginCompilationTests:
name: Plugin / Compilation Tests
needs: BuildPlugin
if: ${{ inputs.run-compilation-tests }}
uses: ./.github/workflows/job_tests_compilation_linux.yml
with:
os: ${{ inputs.os }}
test-runner: ${{ inputs.test-runner }}
install-package: ${{ needs.BuildMLIR.outputs.build-package }}
compiler-type: MLIR
install-package: ${{ needs.BuildPlugin.outputs.build-package }}
compiler-type: PLUGIN

DriverCompilationTests:
name: Driver / Compilation Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/job_tests_compilation_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
type: string
required: true
compiler-type:
description: 'MLIR or DRIVER'
description: 'PLUGIN or DRIVER'
type: string
required: true
export-blobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
test-runner: ubuntu-22.04-8-cores
build-cache: true
build-cache-key-suffix: ${{ github.sha }}
build-mlir: true
build-plugin: true
build-driver: true
build-cid: true
run-unit-tests: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
test-runner: ubuntu-latest-8-cores
build-cache: true
build-cache-key-suffix: ${{ github.sha }}
build-mlir: true
build-plugin: true
build-driver: true
build-cid: true
run-unit-tests: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.*project
*.orig
.settings
.clangd

# Build results
[Bb]uild*/
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/openvinotoolkit/npu_plugin_elf.git
[submodule "thirdparty/llvm-project"]
path = thirdparty/llvm-project
url = https://github.com/intel/npu-plugin-llvm.git
url = https://github.com/intel-staging/npu-compiler-llvm.git
[submodule "thirdparty/vpucostmodel"]
path = thirdparty/vpucostmodel
url = https://github.com/intel/npu-nn-cost-model.git
Expand Down
24 changes: 17 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2022-2025 Intel Corporation.
# Copyright (C) 2022-2026 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0
#

Expand Down Expand Up @@ -117,9 +117,15 @@ if (ENABLE_SPLIT_DWARF)
endif()

if(ENABLE_DEVELOPER_BUILD OR uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
enable_asserts()
# align this to LLVM_ENABLE_ASSERTIONS
# if it's undefined, consider it's ON (== developer build || debug)
if(NOT DEFINED LLVM_ENABLE_ASSERTIONS OR LLVM_ENABLE_ASSERTIONS)
enable_asserts()
endif()
endif()

enable_color_diagnostics()

#
# Sub-directories
#
Expand Down Expand Up @@ -150,17 +156,21 @@ else()
endif()
endif()

add_subdirectory(thirdparty EXCLUDE_FROM_ALL)

if (ENABLE_CLANG_TIDY_PLUGIN)
# to enable clang-tidy plugin for a target T call `enable_clang_tidy_plugin(T)`
# make sure `add_clang_tidy_plugin` has been called first just once
# with a path to the plugin source directory
include(cmake/clang_tidy_plugin.cmake)
add_clang_tidy_plugin("${CMAKE_CURRENT_SOURCE_DIR}/tools/clang_tidy_plugin")
endif()

add_subdirectory(thirdparty EXCLUDE_FROM_ALL)

if(ENABLE_DEVELOPER_BUILD)
add_compile_definitions(VPUX_DEVELOPER_BUILD)
endif()

if(ENABLE_MLIR_COMPILER)
add_subdirectory(sw_runtime_kernels/kernels)
endif()
add_subdirectory(sw_runtime_kernels/kernels)

add_subdirectory(src)

Expand Down
Loading
Loading