diff --git a/.gitignore b/.gitignore index 5e0eb53..ccbcc46 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ /mlas-*.tar.gz /onednn-*.tar.gz /level-zero-npu-extensions-*.tar.gz +/npu_compiler-*.tar.gz +/npu_plugin_elf-*.tar.gz +/npu-plugin-llvm-*.tar.gz +/npu-nn-cost-model-*.tar.gz +/flatbuffers-*.tar.gz diff --git a/28039.patch b/28039.patch deleted file mode 100644 index e702295..0000000 --- a/28039.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 5e23f2a09c530834d4ea41f9901921c61da3381d Mon Sep 17 00:00:00 2001 -From: h6197627 <44726212+h6197627@users.noreply.github.com> -Date: Wed, 11 Dec 2024 17:42:44 +0200 -Subject: [PATCH] [PyOV] update numpy <2.3.0 - ---- - src/bindings/python/constraints.txt | 2 +- - src/bindings/python/requirements.txt | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txt -index cc1d4514b7bbfe..4d65603a5323ab 100644 ---- a/src/bindings/python/constraints.txt -+++ b/src/bindings/python/constraints.txt -@@ -1,5 +1,5 @@ - # used in multiple components --numpy>=1.16.6,<2.2.0 # Python bindings, frontends -+numpy>=1.16.6,<2.3.0 # Python bindings, frontends - - # pytest - pytest>=5.0,<8.4 -diff --git a/src/bindings/python/requirements.txt b/src/bindings/python/requirements.txt -index a2d63161fe764c..febb91d5ecee55 100644 ---- a/src/bindings/python/requirements.txt -+++ b/src/bindings/python/requirements.txt -@@ -1,3 +1,3 @@ --numpy>=1.16.6,<2.2.0 -+numpy>=1.16.6,<2.3.0 - openvino-telemetry>=2023.2.1 - packaging diff --git a/dependencies.cmake b/dependencies.cmake index f4f8831..e550abe 100644 --- a/dependencies.cmake +++ b/dependencies.cmake @@ -213,3 +213,229 @@ if(NOT TARGET openvino::pugixml) ov_build_pugixml() endif() + +# +# Protobuf +# + +if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTEND) + if(ENABLE_SYSTEM_PROTOBUF) + # Note: Debian / Ubuntu / RHEL libprotobuf.a can only be used with -DBUILD_SHARED_LIBS=OFF + # because they are compiled without -fPIC + if(NOT DEFINED Protobuf_USE_STATIC_LIBS) + set(Protobuf_USE_STATIC_LIBS ON) + endif() + if(CMAKE_VERBOSE_MAKEFILE) + set(Protobuf_DEBUG ON) + endif() + # try to find newer version first (major is changed) + # see https://protobuf.dev/support/version-support/ and + # https://github.com/protocolbuffers/protobuf/commit/d61f75ff6db36b4f9c0765f131f8edc2f86310fa + find_package(Protobuf 5.26.0 QUIET CONFIG) + if(NOT Protobuf_FOUND) + find_package(Protobuf 4.22.0 QUIET CONFIG) + endif() + if(Protobuf_FOUND) + # protobuf was found via CONFIG mode, let's save it for later usage in OpenVINOConfig.cmake static build + set(protobuf_config CONFIG) + else() + if(OV_VCPKG_BUILD) + set(protobuf_config CONFIG) + endif() + # otherwise, fallback to existing default + find_package(Protobuf 3.19.6 REQUIRED ${protobuf_config}) + endif() + + # with newer protobuf versions (4.22 and newer), we use CONFIG first + # so, the Protobuf_PROTOC_EXECUTABLE variable must be checked explicitly, + # because it's not used in this case (oppositely to MODULE case) + if(Protobuf_VERSION VERSION_GREATER_EQUAL 22 AND DEFINED Protobuf_PROTOC_EXECUTABLE) + set(PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE}) + else() + set(PROTOC_EXECUTABLE protobuf::protoc) + endif() + else() + add_subdirectory(thirdparty/protobuf EXCLUDE_FROM_ALL) + # protobuf fails to build with -fsanitize=thread by clang + if(ENABLE_THREAD_SANITIZER AND OV_COMPILER_IS_CLANG) + foreach(proto_target protoc libprotobuf libprotobuf-lite) + if(TARGET ${proto_target}) + target_compile_options(${proto_target} PUBLIC -fno-sanitize=thread) + target_link_options(${proto_target} PUBLIC -fno-sanitize=thread) + endif() + endforeach() + endif() + endif() + + # forward additional variables used in the other places + set(Protobuf_IN_FRONTEND ON) + + # set public / interface compile options + function(_ov_fix_protobuf_warnings target_name) + set(link_type PUBLIC) + if(ENABLE_SYSTEM_PROTOBUF) + set(link_type INTERFACE) + endif() + if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX)) + # Protobuf built manually not via CMake in Fedora + if(NOT TARGET protobuf::libprotobuf) + add_library(protobuf::libprotobuf ${link_type} IMPORTED) + set_target_properties(protobuf::libprotobuf PROPERTIES + IMPORTED_LOCATION "${Protobuf_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIRS}") + target_compile_options(${target_name} ${link_type} -Wno-undef) + endif() + endif() + endfunction() + + _ov_fix_protobuf_warnings(protobuf::libprotobuf) + if(TARGET protobuf::libprotobuf-lite) + _ov_fix_protobuf_warnings(protobuf::libprotobuf-lite) + endif() +endif() + +# +# FlatBuffers +# + +if(ENABLE_OV_TF_LITE_FRONTEND) + if(ENABLE_SYSTEM_FLATBUFFERS) + ov_cross_compile_define_debian_arch() + + # on new Ubuntu versions like 23.04 we have config called FlatBuffersConfig.cmake + # so, we need to provide alternative names + find_host_package(Flatbuffers QUIET NAMES Flatbuffers FlatBuffers NO_CMAKE_FIND_ROOT_PATH) + + ov_cross_compile_define_debian_arch_reset() + endif() + + if(Flatbuffers_FOUND) + # we don't actually use library files (.so | .dylib | .a) itself, only headers + if(TARGET flatbuffers::flatbuffers_shared) + set(flatbuffers_LIBRARY flatbuffers::flatbuffers_shared) + elseif(TARGET flatbuffers::flatbuffers) + set(flatbuffers_LIBRARY flatbuffers::flatbuffers) + else() + message(FATAL_ERROR "Internal error: Failed to detect flatbuffers library target") + endif() + set(flatbuffers_COMPILER flatbuffers::flatc) + else() + add_subdirectory(thirdparty/flatbuffers EXCLUDE_FROM_ALL) + + # used by NPU repo + set(flatc_COMMAND flatc) + set(flatc_TARGET flatc) + endif() + + # set additional variables, used in other places of our cmake scripts + set(flatbuffers_INCLUDE_DIRECTORIES $) +endif() + +# +# Snappy Compression +# + +if(ENABLE_SNAPPY_COMPRESSION) + if(ENABLE_SYSTEM_SNAPPY) + find_package(Snappy REQUIRED) + + set(ov_snappy_lib Snappy::snappy) + if(NOT BUILD_SHARED_LIBS AND TARGET Snappy::snappy-static) + # we can use static library only in static build, because in case od dynamic build + # the libsnappy.a should be compiled with -fPIC, while Debian / Ubuntu / RHEL don't do it + set(ov_snappy_lib Snappy::snappy-static) + endif() + + if(OV_PkgConfig_VISIBILITY) + # need to set GLOBAL visibility in order to create ALIAS for this target + set_target_properties(${ov_snappy_lib} PROPERTIES IMPORTED_GLOBAL ON) + endif() + + add_library(openvino::snappy ALIAS ${ov_snappy_lib}) + endif() + + if(NOT TARGET openvino::snappy) + function(ov_build_snappy) + set(BUILD_SHARED_LIBS OFF) + set(SNAPPY_BUILD_BENCHMARKS OFF) + set(SNAPPY_BUILD_TESTS OFF) + set(INSTALL_GTEST OFF) + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # '<': signed/unsigned mismatch + ov_add_compiler_flags(/wd4018) + # conditional expression is constant + ov_add_compiler_flags(/wd4127) + # 'conversion' conversion from 'type1' to 'type2', possible loss of data + ov_add_compiler_flags(/wd4244) + # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch + ov_add_compiler_flags(/wd4245) + # 'var' : conversion from 'size_t' to 'type', possible loss of data + ov_add_compiler_flags(/wd4267) + elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX)) + # we need to pass -Wextra first, then -Wno-sign-compare + # otherwise, snappy's CMakeLists.txt will do it for us + ov_add_compiler_flags(-Wextra) + ov_add_compiler_flags(-Wno-sign-compare) + elseif(OV_COMPILER_IS_INTEL_LLVM AND WIN32) + ov_add_compiler_flags(/WX-) + endif() + + add_subdirectory(thirdparty/snappy EXCLUDE_FROM_ALL) + # need to create alias openvino::snappy + add_library(openvino::snappy ALIAS snappy) + + # WA for emscripten build which currently requires -fexceptions + if(EMSCRIPTEN) + target_compile_options(snappy PRIVATE "-fexceptions") + endif() + endfunction() + + ov_build_snappy() + ov_install_static_lib(snappy ${OV_CPACK_COMP_CORE}) + endif() +endif() + +# +# ONNX +# + +if(ENABLE_OV_ONNX_FRONTEND) + find_package(ONNX 1.16.2 QUIET COMPONENTS onnx onnx_proto NO_MODULE) + + if(ONNX_FOUND) + # conan and vcpkg create imported targets 'onnx' and 'onnx_proto' + # newer versions of ONNX in vcpkg has ONNX:: prefix, let's create aliases + if(TARGET ONNX::onnx) + add_library(onnx ALIAS ONNX::onnx) + endif() + if(TARGET ONNX::onnx_proto) + add_library(onnx_proto ALIAS ONNX::onnx_proto) + endif() + else() + add_subdirectory(thirdparty/onnx) + endif() +endif() + +# +# nlohmann json +# + +# Note: NPU requires 3.9.0 version, because it contains 'nlohmann::ordered_json' +find_package(nlohmann_json 3.9.0 QUIET) +if(nlohmann_json_FOUND) + # conan and vcpkg create imported target nlohmann_json::nlohmann_json +else() + add_subdirectory(thirdparty/json EXCLUDE_FROM_ALL) + + # this is required only because of NPU plugin reused this: export & install + ov_developer_package_export_targets(TARGET nlohmann_json + INSTALL_INCLUDE_DIRECTORIES "${OpenVINO_SOURCE_DIR}/thirdparty/json/nlohmann_json/include") + + # for nlohmann library versions older than v3.0.0 + if(NOT TARGET nlohmann_json::nlohmann_json) + add_library(nlohmann_json::nlohmann_json INTERFACE IMPORTED) + set_target_properties(nlohmann_json::nlohmann_json PROPERTIES + INTERFACE_LINK_LIBRARIES nlohmann_json + INTERFACE_COMPILE_DEFINITIONS JSON_HEADER) + endif() +endif() diff --git a/npu-compiler-disable-git.patch b/npu-compiler-disable-git.patch new file mode 100644 index 0000000..8f7a57d --- /dev/null +++ b/npu-compiler-disable-git.patch @@ -0,0 +1,22 @@ +--- a/cmake/flatbuffers.cmake 2025-04-10 09:12:29.077773814 +0300 ++++ b/cmake/flatbuffers.cmake 2025-04-10 09:12:57.012364853 +0300 +@@ -64,7 +64,7 @@ + + endfunction() + +-find_package(Git REQUIRED) ++#find_package(Git REQUIRED) + function(vpux_gf_version_generate SRC_DIR DST_DIR) + + execute_process( +--- a/src/vpux_compiler/CMakeLists.txt 2025-04-08 21:10:11.545626446 +0300 ++++ b/src/vpux_compiler/CMakeLists.txt 2025-04-08 21:10:52.600509266 +0300 +@@ -51,7 +51,7 @@ + # Embed VPUNN models + # + +-find_package(Git REQUIRED) ++#find_package(Git REQUIRED) + + execute_process( + COMMAND ${GIT_EXECUTABLE} lfs pull diff --git a/npu-compiler-fix-install.patch b/npu-compiler-fix-install.patch new file mode 100644 index 0000000..472393a --- /dev/null +++ b/npu-compiler-fix-install.patch @@ -0,0 +1,47 @@ +--- a/src/vpux_driver_compiler/CMakeLists.txt ++++ b/src/vpux_driver_compiler/CMakeLists.txt +@@ -16,7 +16,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + add_subdirectory(src) + add_subdirectory(test) + +-install( ++#[[install( + FILES + "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/CHANGES.txt" + DESTINATION cid +@@ -26,4 +26,4 @@ install( + FILES + "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/README.md" + DESTINATION cid +- COMPONENT ${CID_COMPONENT}) ++ COMPONENT ${CID_COMPONENT})]] +--- a/src/vpux_driver_compiler/src/loader/CMakeLists.txt ++++ b/src/vpux_driver_compiler/src/loader/CMakeLists.txt +@@ -75,7 +75,7 @@ ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME}) + # loader folder | -> include/ | -> vpux_headers/ -> 1 hpp + # | | -> vpux_loader/ -> 1 hpp + +-install(DIRECTORY "${LOADER_DIR_INC}/vpux_headers" ++#[[install(DIRECTORY "${LOADER_DIR_INC}/vpux_headers" + DESTINATION cid/vpux_elf/loader/include/ + COMPONENT ${CID_COMPONENT}) + +@@ -207,4 +207,4 @@ install(TARGETS npu_elf + CONFIGURATIONS RelWithDebInfo + LIBRARY DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT} + ARCHIVE DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT} +- RUNTIME DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT}) ++ RUNTIME DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT})]] +--- a/src/vpux_compiler/CMakeLists.txt 2025-05-05 19:36:13.333749375 +0300 ++++ b/src/vpux_compiler/CMakeLists.txt 2025-05-05 19:37:04.718216709 +0300 +@@ -241,8 +241,8 @@ + + # Note not included in OpenVINOTargets export! + +-if(BUILD_SHARED_LIBS) ++#[[if(BUILD_SHARED_LIBS) + install(TARGETS ${TARGET_NAME} + ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${VPUX_INTERNAL_COMPONENT} + LIBRARY DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${VPUX_INTERNAL_COMPONENT}) +-endif() ++endif()]] diff --git a/npu-compiler-thirdparty-CMakeLists.txt b/npu-compiler-thirdparty-CMakeLists.txt new file mode 100644 index 0000000..ac751b7 --- /dev/null +++ b/npu-compiler-thirdparty-CMakeLists.txt @@ -0,0 +1,85 @@ +# +# Copyright (C) 2022 Intel Corporation. +# SPDX-License-Identifier: Apache 2.0 +# + +set(BUILD_SHARED_LIBS OFF) + +# +# LLVM/MLIR +# +if(NOT ENABLE_PREBUILT_LLVM_MLIR_LIBS) + set_llvm_flags() + add_subdirectory(llvm-project/llvm EXCLUDE_FROM_ALL) + set(MLIR_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project/mlir/include") + set(MLIR_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm-project/llvm/tools/mlir/include") + include_directories(SYSTEM ${MLIR_SOURCE_DIR} ${MLIR_BINARY_DIR}) +endif() + +# +# flatbuffers +# + +if(CMAKE_SOURCE_DIR STREQUAL OpenVINO_SOURCE_DIR AND + ENABLE_OV_TF_LITE_FRONTEND AND (NOT ENABLE_SYSTEM_FLATBUFFERS OR NOT Flatbuffers_FOUND)) + # we are building NPU plugin via -DOPENVINO_EXTRA_MODULES + # and flatbuffers is already built as part of OpenVINO in case of + # building in a single tree +else() + set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(FLATBUFFERS_INSTALL OFF CACHE BOOL "" FORCE) + set(FLATBUFFERS_BUILD_FLATC ON CACHE BOOL "" FORCE) + + add_subdirectory(flatbuffers EXCLUDE_FROM_ALL) + + # FIXME: this flag is forced while building in a single tree with OV + # but code cannot be compiled with the flag + if(NOT MSVC) + target_compile_options(flatbuffers PRIVATE -Wno-suggest-override) + target_compile_options(flatc PRIVATE -Wno-suggest-override) + if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)) + target_compile_options(flatbuffers PRIVATE -Wno-unused-but-set-variable) + target_compile_options(flatc PRIVATE -Wno-unused-but-set-variable) + endif() + endif() + + vpux_add_native_tool(flatc "${CMAKE_CURRENT_SOURCE_DIR}/flatbuffers" + CMAKE_ARGS + "FLATBUFFERS_BUILD_TESTS:BOOL=OFF" + "FLATBUFFERS_INSTALL:BOOL=OFF" + "FLATBUFFERS_BUILD_FLATC:BOOL=ON" + ) +endif() + +# +# npu_elf +# + +if (ENABLE_NPU_MONO) + if (NOT TARGET npu_elf) + message(FATAL_ERROR "elf/vpux_elf target must exist since ENABLE_NPU_MONO is ON") + endif() + # TODO remove: + # `src/vpux_compiler/include/vpux/compiler/dialect/NPUReg37XX/api` + # `src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/api` + # after integration finishes +else() + # Legacy no-monorepo scenario + add_subdirectory(elf/vpux_elf EXCLUDE_FROM_ALL) + target_include_directories(npu_elf PRIVATE + "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU37XX/dialect/NPUReg37XX/firmware_headers/details" + "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/firmware_headers/details") + + target_include_directories(vpux_elf PRIVATE + "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU37XX/dialect/NPUReg37XX/firmware_headers/details" + "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/firmware_headers/details") +endif() + +# +# nn cost model +# + +set(VPUNN_BUILD_SHARED_LIB OFF CACHE BOOL "" FORCE) +set(VPUNN_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +set(VPUNN_BUILD_TESTS OFF CACHE BOOL "" FORCE) +add_subdirectory(vpucostmodel EXCLUDE_FROM_ALL) diff --git a/npu-compiler-vpux-driver-compiler.patch b/npu-compiler-vpux-driver-compiler.patch new file mode 100644 index 0000000..6781d08 --- /dev/null +++ b/npu-compiler-vpux-driver-compiler.patch @@ -0,0 +1,27 @@ +--- a/src/vpux_driver_compiler/src/vpux_compiler_l0/CMakeLists.txt 2025-04-14 23:36:56.812899341 -0700 ++++ b/src/vpux_driver_compiler/src/vpux_compiler_l0/CMakeLists.txt 2025-04-16 09:58:44.751662645 -0700 +@@ -80,12 +85,12 @@ + COMPONENT ${CID_COMPONENT}) + else() + install(TARGETS ${TARGET_NAME} +- LIBRARY DESTINATION cid/lib ++ LIBRARY DESTINATION lib64 + COMPONENT ${CID_COMPONENT}) + endif() + + install( + FILES + "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/include/npu_driver_compiler.h" +- DESTINATION cid ++ DESTINATION include + COMPONENT ${CID_COMPONENT}) +--- a/src/vpux_driver_compiler/CMakeLists.txt 2025-04-14 21:03:09.221779635 -0700 ++++ b/src/vpux_driver_compiler/CMakeLists.txt 2025-04-14 23:36:46.771479407 -0700 +@@ -12,6 +12,7 @@ + ov_cpack_add_component(${CID_COMPONENT}) + + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) ++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../vpux_compiler/include) + + add_subdirectory(src) + add_subdirectory(test) diff --git a/npu-level-zero.patch b/npu-level-zero.patch index 3f5724c..e7926a9 100644 --- a/npu-level-zero.patch +++ b/npu-level-zero.patch @@ -1,10 +1,9 @@ ---- a/src/plugins/intel_npu/thirdparty/CMakeLists.txt 2024-12-09 20:53:55.103131478 +0200 -+++ b/src/plugins/intel_npu/thirdparty/CMakeLists.txt 2024-12-09 21:43:54.335978284 +0200 -@@ -10,17 +10,5 @@ - add_library(level-zero-ext INTERFACE) +--- a/src/plugins/intel_npu/thirdparty/CMakeLists.txt 2025-04-22 08:56:17.128557002 +0300 ++++ b/src/plugins/intel_npu/thirdparty/CMakeLists.txt 2025-04-22 08:56:27.085760995 +0300 +@@ -11,16 +11,3 @@ set_property(TARGET level-zero-ext APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) add_library(LevelZero::NPUExt ALIAS level-zero-ext) --endif() + endif() - -# -# yaml-cpp @@ -17,184 +16,10 @@ - if(SUGGEST_OVERRIDE_SUPPORTED) - target_compile_options(yaml-cpp PRIVATE -Wno-suggest-override) - endif() -+ install(TARGETS level-zero-ext EXPORT OpenVINODeveloperTargets) - endif() ---- a/src/plugins/intel_npu/src/backend/include/zero_memory.hpp 2025-01-30 16:54:27.550694466 +0000 -+++ b/src/plugins/intel_npu/src/backend/include/zero_memory.hpp 2025-01-30 16:55:08.462018205 +0000 -@@ -5,7 +5,7 @@ - #pragma once - - #include --#include -+#include "ze_graph_ext.h" - - #include - #include ---- a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp 2025-01-30 16:59:40.615523874 +0000 -+++ b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp 2025-01-30 17:00:06.007930172 +0000 -@@ -5,7 +5,7 @@ - #include "zero_pipeline.hpp" - - #include --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/common/itt.hpp" - #include "intel_npu/prefix.hpp" ---- a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp 2025-01-30 17:01:12.269352224 +0000 -+++ b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp 2025-01-30 17:02:55.013658475 +0000 -@@ -4,7 +4,7 @@ - - #include "zero_profiling.hpp" - --#include -+#include "ze_graph_profiling_ext.h" - - #include "intel_npu/config/compiler.hpp" - #include "intel_npu/profiling.hpp" ---- a/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp 2025-01-30 17:07:27.738739813 +0000 -+++ b/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp 2025-01-30 17:07:56.759752802 +0000 -@@ -5,7 +5,7 @@ - #pragma once - - #include --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/common/npu.hpp" - #include "intel_npu/common/sync_infer_request.hpp" ---- a/src/plugins/intel_npu/src/backend/include/zero_device.hpp 2025-01-30 17:09:06.727631829 +0000 -+++ b/src/plugins/intel_npu/src/backend/include/zero_device.hpp 2025-01-30 17:09:28.566273820 +0000 -@@ -5,7 +5,7 @@ - #pragma once - - #include --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/common/icompiled_model.hpp" - #include "intel_npu/common/npu.hpp" ---- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_init.hpp 2025-01-30 17:11:23.387863315 +0000 -+++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_init.hpp 2025-01-30 17:12:15.351004206 +0000 -@@ -5,9 +5,9 @@ - #pragma once - - #include --#include --#include --#include -+#include "ze_command_queue_npu_ext.h" -+#include "ze_graph_ext.h" -+#include "ze_intel_npu_uuid.h" - - #include - ---- a/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp 2025-01-30 17:14:00.292277234 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp 2025-01-30 17:14:25.236311534 +0000 -@@ -7,7 +7,7 @@ - #pragma once - - #include --#include -+#include "ze_graph_ext.h" - - #include - #include ---- a/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp 2025-01-30 17:15:30.489090023 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp 2025-01-30 17:15:49.345658116 +0000 -@@ -5,7 +5,7 @@ - #pragma once - - #include --#include -+#include "ze_graph_ext.h" - - #include - #include ---- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp 2025-01-30 17:17:34.037203346 +0000 -+++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp 2025-01-30 17:18:09.895394136 +0000 -@@ -5,9 +5,9 @@ - #pragma once - - #include --#include --#include --#include -+#include "ze_command_queue_npu_ext.h" -+#include "ze_graph_ext.h" -+#include "ze_graph_profiling_ext.h" - - #include - ---- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_utils.hpp 2025-01-30 17:19:01.314989832 +0000 -+++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_utils.hpp 2025-01-30 17:19:17.921341207 +0000 -@@ -6,7 +6,7 @@ - - #include - #include --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/utils/logger/logger.hpp" - #include "intel_npu/utils/zero/zero_api.hpp" ---- a/src/plugins/intel_npu/src/compiler_adapter/include/plugin_graph.hpp 2025-01-30 17:20:31.103798946 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/include/plugin_graph.hpp 2025-01-30 17:21:08.007054462 +0000 -@@ -6,7 +6,7 @@ - - #pragma once - --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/common/igraph.hpp" - #include "intel_npu/icompiler.hpp" ---- a/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp 2025-01-30 17:22:45.703009508 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp 2025-01-30 17:23:09.819646893 +0000 -@@ -4,7 +4,7 @@ - - #include "driver_compiler_adapter.hpp" - --#include -+#include "ze_graph_ext.h" - - #include - #include ---- a/src/plugins/intel_npu/src/compiler_adapter/include/driver_graph.hpp 2025-01-30 17:24:21.716872348 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/include/driver_graph.hpp 2025-01-30 17:24:43.017813607 +0000 -@@ -6,7 +6,7 @@ - - #pragma once - --#include -+#include "ze_graph_ext.h" - - #include "intel_npu/common/igraph.hpp" - #include "intel_npu/utils/zero/zero_init.hpp" ---- a/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp 2025-01-30 17:26:13.469876624 +0000 -+++ b/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp 2025-01-30 17:26:37.823924892 +0000 -@@ -4,7 +4,7 @@ - - #include "plugin_compiler_adapter.hpp" - --#include -+#include "ze_graph_ext.h" - - #include - #include ---- a/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp 2025-01-30 17:30:07.987984148 +0000 -+++ b/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp 2025-01-30 17:30:24.141709170 +0000 -@@ -4,7 +4,7 @@ - - #include "intel_npu/utils/zero/zero_init.hpp" - --#include -+#include "ze_command_queue_npu_ext.h" - - #include - ---- a/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt 2025-01-30 22:09:54.664509560 +0000 -+++ b/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt 2025-01-30 22:10:59.261604242 +0000 -@@ -41,13 +41,6 @@ +-endif() +--- a/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt 2025-04-22 08:56:52.338766209 +0300 ++++ b/src/plugins/intel_npu/tools/compile_tool/CMakeLists.txt 2025-04-22 08:57:28.380471138 +0300 +@@ -45,13 +45,6 @@ # install(TARGETS ${TARGET_NAME} @@ -209,3 +34,177 @@ - COMPONENT ${NPU_INTERNAL_COMPONENT} - ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) -endif() +--- a/src/plugins/intel_npu/tools/protopipe/CMakeLists.txt 2025-04-22 08:57:42.031656000 +0300 ++++ b/src/plugins/intel_npu/tools/protopipe/CMakeLists.txt 2025-04-22 08:58:18.596665997 +0300 +@@ -64,13 +64,6 @@ + # + + install(TARGETS ${TARGET_NAME} +- RUNTIME DESTINATION "tools/${TARGET_NAME}" ++ RUNTIME DESTINATION "bin/${TARGET_NAME}" + COMPONENT ${NPU_INTERNAL_COMPONENT} + ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) +- +-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md") +- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" +- DESTINATION "tools/${TARGET_NAME}" +- COMPONENT ${NPU_INTERNAL_COMPONENT} +- ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) +-endif() +--- a/src/plugins/intel_npu/tools/single-image-test/CMakeLists.txt 2025-04-22 08:58:29.092032832 +0300 ++++ b/src/plugins/intel_npu/tools/single-image-test/CMakeLists.txt 2025-04-22 08:58:55.051015815 +0300 +@@ -67,13 +67,6 @@ + # + + install(TARGETS ${TARGET_NAME} +- RUNTIME DESTINATION "tools/${TARGET_NAME}" ++ RUNTIME DESTINATION "bin/${TARGET_NAME}" + COMPONENT ${NPU_INTERNAL_COMPONENT} + ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) +- +-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md") +- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md" +- DESTINATION "tools/${TARGET_NAME}" +- COMPONENT ${NPU_INTERNAL_COMPONENT} +- ${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL}) +-endif() +--- a/src/plugins/intel_npu/src/backend/include/zero_memory.hpp 2025-04-22 09:05:56.846233909 +0300 ++++ b/src/plugins/intel_npu/src/backend/include/zero_memory.hpp 2025-04-22 09:06:16.087659601 +0300 +@@ -5,7 +5,7 @@ + #pragma once + + #include +-#include ++#include "ze_graph_ext.h" + + #include + #include +--- a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp 2025-04-22 09:07:43.393381649 +0300 ++++ b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp 2025-04-22 09:07:56.183659457 +0300 +@@ -5,7 +5,7 @@ + #include "zero_pipeline.hpp" + + #include +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/common/itt.hpp" + #include "intel_npu/config/runtime.hpp" +--- a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp 2025-04-22 09:08:57.774124447 +0300 ++++ b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp 2025-04-22 09:09:12.295471482 +0300 +@@ -4,7 +4,7 @@ + + #include "zero_profiling.hpp" + +-#include ++#include "ze_graph_profiling_ext.h" + + #include "intel_npu/config/compiler.hpp" + #include "intel_npu/profiling.hpp" +--- a/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp 2025-04-22 09:10:24.837226950 +0300 ++++ b/src/plugins/intel_npu/src/backend/include/zero_infer_request.hpp 2025-04-22 09:10:41.016084607 +0300 +@@ -5,7 +5,7 @@ + #pragma once + + #include +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/common/npu.hpp" + #include "intel_npu/common/sync_infer_request.hpp" +--- a/src/plugins/intel_npu/src/backend/include/zero_device.hpp 2025-04-22 09:11:34.924583352 +0300 ++++ b/src/plugins/intel_npu/src/backend/include/zero_device.hpp 2025-04-22 09:12:49.755738068 +0300 +@@ -5,7 +5,7 @@ + #pragma once + + #include +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/common/icompiled_model.hpp" + #include "intel_npu/common/npu.hpp" +--- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_init.hpp 2025-04-22 08:54:18.123636777 +0300 ++++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_init.hpp 2025-04-22 08:54:44.392999512 +0300 +@@ -5,9 +5,9 @@ + #pragma once + + #include +-#include +-#include +-#include ++#include "ze_command_queue_npu_ext.h" ++#include "ze_graph_ext.h" ++#include "ze_intel_npu_uuid.h" + + #include + +--- a/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp 2025-04-22 09:15:19.821223694 +0300 ++++ b/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp 2025-04-22 09:15:30.186617303 +0300 +@@ -5,7 +5,7 @@ + #pragma once + + #include +-#include ++#include "ze_graph_ext.h" + + #include + #include +--- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp 2025-04-22 09:16:54.687791603 +0300 ++++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp 2025-04-22 09:17:15.958572870 +0300 +@@ -5,9 +5,9 @@ + #pragma once + + #include +-#include +-#include +-#include ++#include "ze_command_queue_npu_ext.h" ++#include "ze_graph_ext.h" ++#include "ze_graph_profiling_ext.h" + + #include + +--- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_utils.hpp 2025-04-22 09:18:29.594493912 +0300 ++++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_utils.hpp 2025-04-22 09:18:42.216166698 +0300 +@@ -6,7 +6,7 @@ + + #include + #include +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/utils/logger/logger.hpp" + #include "intel_npu/utils/zero/zero_api.hpp" +--- a/src/plugins/intel_npu/src/compiler_adapter/include/plugin_graph.hpp 2025-04-22 09:23:42.150544550 +0300 ++++ b/src/plugins/intel_npu/src/compiler_adapter/include/plugin_graph.hpp 2025-04-22 09:24:26.961320914 +0300 +@@ -6,7 +6,7 @@ + + #pragma once + +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/common/igraph.hpp" + #include "intel_npu/icompiler.hpp" +--- a/src/plugins/intel_npu/src/compiler_adapter/include/driver_graph.hpp 2025-04-22 09:26:36.769713083 +0300 ++++ b/src/plugins/intel_npu/src/compiler_adapter/include/driver_graph.hpp 2025-04-22 09:27:38.382076030 +0300 +@@ -6,7 +6,7 @@ + + #pragma once + +-#include ++#include "ze_graph_ext.h" + + #include "intel_npu/common/igraph.hpp" + #include "intel_npu/utils/zero/zero_init.hpp" +--- a/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp 2025-04-22 09:28:33.202081565 +0300 ++++ b/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp 2025-04-22 09:31:04.864198534 +0300 +@@ -4,7 +4,7 @@ + + #include "intel_npu/utils/zero/zero_init.hpp" + +-#include ++#include "ze_command_queue_npu_ext.h" + + #include + diff --git a/openvino-fedora.patch b/openvino-fedora.patch index b913d70..642cb34 100644 --- a/openvino-fedora.patch +++ b/openvino-fedora.patch @@ -1,5 +1,5 @@ ---- a/CMakeLists.txt 2024-11-21 09:30:10.773366672 +0200 -+++ b/CMakeLists.txt 2024-11-21 09:38:39.166535850 +0200 +--- a/CMakeLists.txt 2025-03-04 11:03:17.565212068 +0200 ++++ b/CMakeLists.txt 2025-03-04 11:04:19.363015019 +0200 @@ -168,10 +168,10 @@ endif() @@ -15,13 +15,6 @@ if(ENABLE_TESTS) # layers and other more high-level / e2e tests -@@ -185,4 +185,4 @@ - # provides a callback function to describe each component in repo - include(cmake/packaging/packaging.cmake) - --ov_cpack(${OV_CPACK_COMPONENTS_ALL}) -\ No newline at end of file -+ov_cpack(${OV_CPACK_COMPONENTS_ALL}) --- a/cmake/developer_package/packaging/archive.cmake 2024-11-21 09:41:13.107605950 +0200 +++ b/cmake/developer_package/packaging/archive.cmake 2024-11-21 11:00:50.406807366 +0200 @@ -25,14 +25,17 @@ @@ -97,3 +90,18 @@ includedir=${include_prefix} Name: OpenVINO +--- a/src/plugins/intel_gpu/CMakeLists.txt 2025-03-17 18:30:04.844696856 +0200 ++++ b/src/plugins/intel_gpu/CMakeLists.txt 2025-03-17 18:30:35.623976711 +0200 +@@ -63,9 +63,9 @@ + add_subdirectory(thirdparty) + include(thirdparty/cmake/rapidjson.cmake) + +-if(CMAKE_COMPILER_IS_GNUCXX) +- ov_add_compiler_flags(-Werror) +-endif() ++#if(CMAKE_COMPILER_IS_GNUCXX) ++# ov_add_compiler_flags(-Werror) ++#endif() + + add_subdirectory(src/runtime) + add_subdirectory(src/kernel_selector) diff --git a/openvino.spec b/openvino.spec index b3ff85c..96ebcd3 100644 --- a/openvino.spec +++ b/openvino.spec @@ -1,4 +1,4 @@ -%define so_ver 2450 +%global so_ver 2510 %global desc %{expand: \ OpenVINO is an open-source toolkit for optimizing and deploying deep learning models from cloud to edge. It accelerates deep learning inference across @@ -6,7 +6,7 @@ various use cases, such as generative AI, video, audio, and language with models from popular frameworks like PyTorch, TensorFlow, ONNX, and more.} Name: openvino -Version: 2024.5.0 +Version: 2025.1.0 Release: %autorelease Summary: Toolkit for optimizing and deploying AI inference @@ -40,43 +40,69 @@ Summary: Toolkit for optimizing and deploying AI inference License: Apache-2.0 AND MIT AND BSL-1.0 AND HPND AND BSD-3-Clause AND (GPL-2.0-only OR BSD-3-Clause) URL: https://github.com/openvinotoolkit/openvino Source0: %url/archive/%{version}/%{name}-%{version}.tar.gz -Source1: https://github.com/openvinotoolkit/oneDNN/archive/c60a9946aa2386890e5c9f5587974facb7624227/onednn-c60a994.tar.gz -Source2: https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94/mlas-d1bc25e.tar.gz -Source3: https://github.com/intel/level-zero-npu-extensions/archive/110f48ee8eda22d8b40daeeecdbbed0fc3b08f8b/level-zero-npu-extensions-110f48e.tar.gz -Source4: dependencies.cmake -Source5: pyproject.toml +Source1: dependencies.cmake +Source2: pyproject.toml +Source3: https://github.com/openvinotoolkit/oneDNN/archive/5baba714e16e11309774a62783f363cad30e97c7/onednn-5baba71.tar.gz +Source4: https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94/mlas-d1bc25e.tar.gz +Source5: https://github.com/intel/level-zero-npu-extensions/archive/c0156a3390ae39671ff8f2a6f5471f04bb65bb12/level-zero-npu-extensions-c0156a3.tar.gz +Source6: https://github.com/openvinotoolkit/npu_compiler/archive/npu_ud_2025_12_rc2/npu_compiler-npu_ud_2025_12_rc2.tar.gz +Source7: npu-compiler-thirdparty-CMakeLists.txt +Source8: https://github.com/openvinotoolkit/npu_plugin_elf/archive/ce501d3059c81fd6bd0ad7165ab823838fa5d851/npu_plugin_elf-ce501d3.tar.gz +Source9: https://github.com/intel/npu-nn-cost-model/archive/a965531d3d3a37748cc5ab7feac342b35baaf7b4/npu-nn-cost-model-a965531.tar.gz +Source10: https://github.com/intel/npu-plugin-llvm/arhcive/0d1145010d6d2ba48a945c824ed0ca03254b94ed/npu-plugin-llvm-0d11450.tar.gz +Source11: https://github.com/google/flatbuffers/archive/6df40a2471737b27271bdd9b900ab5f3aec746c7/flatbuffers-6df40a2.tar.gz Patch0: openvino-fedora.patch -# Support numpy 2.2.0 -Patch1: https://github.com/openvinotoolkit/openvino/pull/28039.patch -Patch2: npu-level-zero.patch +Patch1: npu-level-zero.patch +Patch2: npu-compiler-disable-git.patch +Patch3: npu-compiler-fix-install.patch +Patch4: npu-compiler-vpux-driver-compiler.patch ExclusiveArch: x86_64 BuildRequires: cmake +%if 0%{?fedora} >= 42 || 0%{?rhel} > 10 +BuildRequires: gcc14 +BuildRequires: gcc14-c++ +%else +BuildRequires: gcc BuildRequires: gcc-c++ +%endif BuildRequires: gflags-devel +BuildRequires: glibc-devel +BuildRequires: flatbuffers-compiler +BuildRequires: flatbuffers-devel +BuildRequires: json-devel +BuildRequires: libedit-devel +BuildRequires: libffi-devel +BuildRequires: libxml2-devel BuildRequires: oneapi-level-zero-devel BuildRequires: patchelf BuildRequires: pugixml-devel BuildRequires: pybind11-devel BuildRequires: python3-devel +BuildRequires: python3-onnx BuildRequires: python3-pip +BuildRequires: python3-numpy BuildRequires: python3-setuptools +BuildRequires: python3-pytest BuildRequires: python3-wheel -BuildRequires: numpy -BuildRequires: ShellCheck +BuildRequires: snappy-devel BuildRequires: zlib-ng-compat-devel BuildRequires: xbyak-devel BuildRequires: yaml-cpp-devel BuildRequires: tbb-devel -# forked version of OpenVINO oneDNN does not have a proper version -Provides: bundled(onednn) -# MLAS upstream does not have any release -Provides: bundled(mlas) +BuildRequires: onnx-devel +BuildRequires: protobuf-devel +BuildRequires: opencv-devel +BuildRequires: pkgconfig(OpenCL) +BuildRequires: opencl-headers Requires: lib%{name}-ir-frontend = %{version} Requires: lib%{name}-pytorch-frontend = %{version} -Requires: numpy +Requires: lib%{name}-onnx-frontend = %{version} +Requires: lib%{name}-paddle-frontend = %{version} +Requires: lib%{name}-tensorflow-frontend = %{version} +Requires: lib%{name}-tensorflow-lite-frontend = %{version} Recommends: %{name}-plugins = %{version} %description @@ -92,11 +118,19 @@ applications that use %{name}. %package plugins Summary: OpenVINO Plugins +# forked version of OpenVINO oneDNN does not have a proper version +Provides: bundled(onednn) +# Intel MLAS +Provides: bundled(mlas) +# Intel level-zero-npu-extensions +Provides: bundled(level-zero-npu-extensions) Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-opencv %description plugins The OpenVINO plugins package provides support for various hardware devices. -It includes plugins for auto, auto_batch, hetero, intel_cpu and template. +It includes auto, auto_batch, hetero, intel_cpu, intel_npu, intel_gpu and +template plugins. %package -n lib%{name}-ir-frontend Summary: OpenVINO IR Frontend @@ -109,15 +143,74 @@ into memory. %package -n lib%{name}-pytorch-frontend Summary: OpenVINO PyTorch Frontend Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-torch %description -n lib%{name}-pytorch-frontend The PyTorch Frontend is a C++ based OpenVINO Frontend component that is responsible for reading and converting a PyTorch model to an ov::Model object that can be further serialized into the Intermediate Representation (IR) format +%package -n lib%{name}-onnx-frontend +Summary: OpenVINO ONNX Frontend +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n lib%{name}-onnx-frontend +The main responsibility of the ONNX Frontend is to import ONNX models and +convert them into the ov::Model representation. + +%package -n lib%{name}-paddle-frontend +Summary: OpenVINO Paddle Frontend +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n lib%{name}-paddle-frontend +OpenVINO Paddle Frontend is responsible for reading and converting +a PaddlePaddle model and operators and maps them semantically to +the OpenVINO opset. + +%package -n lib%{name}-tensorflow-frontend +Summary: OpenVINO Tensorflow Frontend +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n lib%{name}-tensorflow-frontend +OpenVINO TensorFlow Frontend is responsible for reading and converting +a TensorFlow model to an ov::Model object that further can be serialized into +the Intermediate Representation (IR) format. + +%package -n lib%{name}-tensorflow-lite-frontend +Summary: OpenVINO Tensorflow-lite Frontend +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description -n lib%{name}-tensorflow-lite-frontend +OpenVINO TensorFlow Lite Frontend is responsible for reading and converting +a TensorFlow model to an ov::Model object that further can be serialized into +the Intermediate Representation (IR) format with lower latency and smaller +binary size on mobile and edge devices. + +%package -n intel-npu-compiler +Summary: OpenVINO NPU Compiler +# Intel npu-compiler +Provides: bundled(npu_compiler) +# intel VPUNN cost model +Provides: bundled(npu-nn-cost-model) +# Intel npu-plugin-elf +Provides: bundled(npu_plugin_elf) +# Intel npu-plugin-llvm +Provides: bundled(npu-plugin-llvm) +# Flatbuffer for npu_compiler +Provides: bundled(flatbuffers) +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: intel-npu-driver + +%description -n intel-npu-compiler +Intel NPU device is an AI inference accelerator integrated with Intel client +CPUs, starting from Intel Core Ultra generation of CPUs (formerly known as +Meteor Lake). It enables energy-efficient execution of artificial neural +network tasks.} + %package -n python3-%{name} Summary: OpenVINO Python API Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: python3-numpy %description -n python3-%{name} OpenVINO Python API allowing users to use the OpenVINO library in their Python @@ -125,26 +218,32 @@ code. Python API provides bindings to basic and advanced APIs from OpenVINO runtime. %prep -%autosetup -p1 +%autosetup -N +%patch -P 0 -p1 # Remove the thirdparty deps rm -rf thirdparty/* -cp %{SOURCE4} thirdparty/ +cp %{SOURCE1} thirdparty/ + +# python:prep +sed -i '/openvino-telemetry/d' src/bindings/python/requirements.txt +sed -i 's/numpy>=1.16.6,<2.3.0/numpy>=1.16.6/' src/bindings/python/requirements.txt +cp %{SOURCE2} src/bindings/python # Intel-cpu-plugin thirdparty deps -tar xf %{SOURCE1} +tar xf %{SOURCE3} cp -r oneDNN-*/* src/plugins/intel_cpu/thirdparty/onednn -tar xf %{SOURCE2} +tar xf %{SOURCE4} cp -r mlas-*/* src/plugins/intel_cpu/thirdparty/mlas # Intel-npu-plugin thirdparty deps rm -rf src/plugins/intel_npu/thirdparty/yaml-cpp -tar xf %{SOURCE3} +tar xf %{SOURCE5} cp -r level-*/* src/plugins/intel_npu/thirdparty/level-zero-ext +%patch -P 1 -p1 -# python:prep -sed -i '/openvino-telemetry/d' src/bindings/python/requirements.txt -cp %{SOURCE5} src/bindings/python +# intel-gpu-plugin cache.json +sed -i -e 's|CACHE_JSON_INSTALL_DIR ${OV_CPACK_PLUGINSDIR}|CACHE_JSON_INSTALL_DIR %{_datadir}/%{name}|g' src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt # gcc 15 include cstdint sed -i '/#include .*/a#include ' src/core/include/openvino/core/type/bfloat16.hpp @@ -157,13 +256,52 @@ sed -i '/#include .*/a#include ' src/core/dev_api/openvino/core sed -i '/#include .*/a#include ' src/common/snippets/include/snippets/utils/debug_caps_config.hpp sed -i '/#include .*/a#include ' src/plugins/intel_cpu/src/utils/debug_caps_config.h sed -i '/#include .*/a#include ' src/plugins/intel_npu/src/plugin/npuw/partitioning/online/graph.hpp +sed -i '/#include .*/a#include ' src/plugins/intel_npu/src/plugin/npuw/serialization.hpp +sed -i '/#include .*/a#include ' src/plugins/intel_cpu/src/utils/enum_class_hash.hpp +sed -i '/#include .*/a#include ' src/plugins/intel_npu/tools/protopipe/src/graph.hpp +sed -i '/#include .*/a#include ' src/plugins/intel_npu/tools/protopipe/src/scenario/criterion.hpp + +# Intel-npu-compiler +tar xf %{SOURCE6} -C thirdparty +rm -rf thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/* +cp %{SOURCE7} thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/CMakeLists.txt +%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 2 -p1 +%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 3 -p1 +%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 4 -p1 +# ov::pass::KeepConstPrecision fix +sed -i -e 's|ov::pass::KeepConstsPrecision|ov::pass::KeepConstPrecision|g' thirdparty/npu_compiler-npu_ud_2025_12_rc2/src/vpux_compiler/src/frontend/IE.cpp +# disable test +sed -i '/^add_subdirectory(test)/s/^/#/' thirdparty/npu_compiler-npu_ud_2025_12_rc2/src/vpux_driver_compiler/CMakeLists.txt + +# Intel-npu-compiler thirdparty deps +tar xf %{SOURCE8} +mv npu_plugin_elf-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/elf +tar xf %{SOURCE9} +mv npu-nn-cost-model-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/vpucostmodel +tar xf %{SOURCE10} +mv npu-plugin-llvm-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/llvm-project +# disable atomic builtins +sed -i '/^include(CheckAtomic)/s/^/#/' thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/llvm-project/llvm/cmake/config-ix.cmake +# extract flatbuffers +tar xf %{SOURCE11} +mv flatbuffers-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/flatbuffers %build +export NPU_PLUGIN_HOME="$PWD/thirdparty/npu_compiler-npu_ud_2025_12_rc2" +export CFLAGS="${CFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor" +export CXXFLAGS="${CXXFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor" + %cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="%{optflags} -Wformat -Wformat-security" \ - -DENABLE_CLANG_FORMAT=OFF \ + -DCMAKE_POLICY_VERSION_MINIMUM="3.5.0" \ +%if 0%{?fedora} >= 42 || 0%{?rhel} > 10 + -DCMAKE_C_COMPILER=gcc-14 \ + -DCMAKE_CXX_COMPILER=g++-14 \ +%endif -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ + -DENABLE_CLANG_FORMAT=OFF \ + -DENABLE_PRECOMPILED_HEADERS=OFF \ + -DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON \ -DENABLE_QSPECTRE=OFF \ -DENABLE_INTEGRITYCHECK=OFF \ -DENABLE_SANITIZER=OFF \ @@ -188,28 +326,36 @@ sed -i '/#include .*/a#include ' src/plugins/intel_npu/src/plug -DENABLE_MLAS_FOR_CPU=ON \ -DENABLE_MLAS_FOR_CPU_DEFAULT=ON \ -DENABLE_INTEL_GNA=OFF \ - -DENABLE_INTEL_GPU=OFF \ + -DENABLE_INTEL_GPU=ON \ -DENABLE_SYSTEM_LEVEL_ZERO=ON \ -DENABLE_INTEL_NPU=ON \ -DENABLE_NPU_PLUGIN_ENGINE=ON \ + -DENABLE_ZEROAPI_BACKEND=ON \ + -DENABLE_INTEL_NPU_INTERNAL=ON \ + -DENABLE_INTEL_NPU_PROTOPIPE=ON \ -DENABLE_ONEDNN_FOR_GPU=OFF \ -DENABLE_MULTI=ON \ -DENABLE_PROXY=ON \ -DENABLE_TEMPLATE=ON \ - -DENABLE_OV_ONNX_FRONTEND=OFF \ - -DENABLE_OV_PADDLE_FRONTEND=OFF \ + -DENABLE_OV_ONNX_FRONTEND=ON \ + -DENABLE_OV_PADDLE_FRONTEND=ON \ + -DENABLE_OV_JAX_FRONTEND=OFF \ -DENABLE_OV_IR_FRONTEND=ON \ -DENABLE_OV_PYTORCH_FRONTEND=ON \ - -DENABLE_OV_TF_FRONTEND=OFF \ - -DENABLE_OV_TF_LITE_FRONTEND=OFF \ + -DENABLE_OV_TF_FRONTEND=ON \ + -DENABLE_OV_TF_LITE_FRONTEND=ON \ -DENABLE_PYTHON=ON \ -DPython3_EXECUTABLE=%{python3} \ -DENABLE_WHEEL=OFF \ -DENABLE_JS=OFF \ -DENABLE_SYSTEM_LIBS_DEFAULT=ON \ - -DENABLE_SYSTEM_OPENCL=OFF \ + -DENABLE_SYSTEM_OPENCL=ON \ -DENABLE_SYSTEM_PUGIXML=ON \ - -DENABLE_SYSTEM_PROTOBUF=OFF \ + -DENABLE_SYSTEM_SNAPPY=ON \ + -DENABLE_SYSTEM_PROTOBUF=ON \ + -DProtobuf_LIBRARIES=%{_libdir} \ + -DProtobuf_INCLUDE_DIRS=%{_includedir} \ + -DProtobuf_USE_STATIC_LIBS=OFF \ -DTHREADING=TBB \ -DENABLE_SYSTEM_TBB=ON \ -DTBB_LIB_INSTALL_DIR=%{_libdir} \ @@ -217,7 +363,19 @@ sed -i '/#include .*/a#include ' src/plugins/intel_npu/src/plug -DENABLE_TBB_RELEASE_ONLY=ON \ -DENABLE_SAMPLES=OFF \ -DENABLE_TESTS=OFF \ - -DBUILD_SHARED_LIBS=ON + -DBUILD_SHARED_LIBS=ON \ + -DBLAS_LIBRARIES=%{_libdir} \ + -DOPENVINO_EXTRA_MODULES=$NPU_PLUGIN_HOME \ + -DDENABLE_PRIVATE_TESTS=OFF \ + -DENABLE_NPU_LSP_SERVER=OFF \ + -DENABLE_PREBUILT_LLVM_MLIR_LIBS=OFF \ + -DDENABLE_DEVELOPER_BUILD=OFF \ + -DENABLE_MLIR_COMPILER=ON \ + -DBUILD_COMPILER_FOR_DRIVER=ON \ + -DENABLE_DRIVER_COMPILER_ADAPTER=OFF \ + -DENABLE_SOURCE_PACKAGE=OFF \ + -DLibEdit_LIBRARIES=%{_libdir}/libedit.so \ + -DLibEdit_INCLUDE_DIRS=%{_includedir}/histedit.h \ %cmake_build %install @@ -227,10 +385,13 @@ export WHEEL_VERSION=%{version} %{python3} src/bindings/python/wheel/setup.py dist_info -o %{buildroot}/%{python3_sitearch} rm -v %{buildroot}/%{python3_sitearch}/requirements.txt rm -v %{buildroot}/%{python3_sitearch}/%{name}/preprocess/torchvision/requirements.txt +mkdir -p -m 755 %{buildroot}%{_datadir}/%{name} %check LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} samples/python/hello_query_device/hello_query_device.py LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} samples/python/model_creation_sample/model_creation_sample.py samples/python/model_creation_sample/lenet.bin CPU +# onnx-tests +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%{python3_sitearch}:src/frontends/onnx %pytest -v src/frontends/onnx/tests/tests_python/test_frontend_onnx* %files %license LICENSE @@ -242,9 +403,14 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}% %files devel %{_includedir}/%{name} +%{_includedir}/npu_driver_compiler.h %{_libdir}/lib%{name}.so %{_libdir}/lib%{name}_c.so %{_libdir}/lib%{name}_pytorch_frontend.so +%{_libdir}/lib%{name}_onnx_frontend.so +%{_libdir}/lib%{name}_paddle_frontend.so +%{_libdir}/lib%{name}_tensorflow_frontend.so +%{_libdir}/lib%{name}_tensorflow_lite_frontend.so %{_libdir}/cmake/openvino-%{version} %{_libdir}/pkgconfig/%{name}.pc @@ -254,8 +420,12 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}% %{_libdir}/%{name}-%{version}/lib%{name}_auto_batch_plugin.so %{_libdir}/%{name}-%{version}/lib%{name}_hetero_plugin.so %{_libdir}/%{name}-%{version}/lib%{name}_intel_cpu_plugin.so +%{_libdir}/%{name}-%{version}/lib%{name}_intel_gpu_plugin.so %{_libdir}/%{name}-%{version}/lib%{name}_intel_npu_plugin.so %{_bindir}/compile_tool +%{_bindir}/protopipe +%{_bindir}/single-image-test +%{_datadir}/%{name} %files -n lib%{name}-ir-frontend %{_libdir}/lib%{name}_ir_frontend.so.%{version} @@ -265,6 +435,25 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}% %{_libdir}/lib%{name}_pytorch_frontend.so.%{version} %{_libdir}/lib%{name}_pytorch_frontend.so.%{so_ver} +%files -n lib%{name}-onnx-frontend +%{_libdir}/lib%{name}_onnx_frontend.so.%{version} +%{_libdir}/lib%{name}_onnx_frontend.so.%{so_ver} + +%files -n lib%{name}-paddle-frontend +%{_libdir}/lib%{name}_paddle_frontend.so.%{version} +%{_libdir}/lib%{name}_paddle_frontend.so.%{so_ver} + +%files -n lib%{name}-tensorflow-frontend +%{_libdir}/lib%{name}_tensorflow_frontend.so.%{version} +%{_libdir}/lib%{name}_tensorflow_frontend.so.%{so_ver} + +%files -n lib%{name}-tensorflow-lite-frontend +%{_libdir}/lib%{name}_tensorflow_lite_frontend.so.%{version} +%{_libdir}/lib%{name}_tensorflow_lite_frontend.so.%{so_ver} + +%files -n intel-npu-compiler +%{_libdir}/libnpu_driver_compiler.so + %files -n python3-%{name} %{python3_sitearch}/%{name} %{python3_sitearch}/%{name}-%{version}.dist-info diff --git a/pyproject.toml b/pyproject.toml index 5be2e69..7e18195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openvino" -version = "2024.5.0" +version = "2025.1.0" dependencies = [ "numpy>1.16.6", "packaging", diff --git a/sources b/sources index 4895a44..a4e1a3c 100644 --- a/sources +++ b/sources @@ -1,4 +1,9 @@ -SHA512 (openvino-2024.5.0.tar.gz) = b003647de3de49e605943488ca9b2e5196b20d95b3152f0c2331c283d4cb253d1bbbb9cde04fa82733d3871d7128c6db6210957660bd89f26462798f782eca47 -SHA512 (onednn-c60a994.tar.gz) = cc91f5b2ece1c3f14af308e3da436447d07964fa5ffa848c571fe67197a367673bf7bf9cd979fab0c9b216f92c611bd8df7018ec8e080f10759582629c10cb9d +SHA512 (openvino-2025.1.0.tar.gz) = ae3432e9caf5df1ec292a029c3708a294447070fa02ef1be084264cdc1f21711d0ced8fdb198ea2597bb75f9742efcb4a978517e7bb4baa1bcd67d2c05395501 +SHA512 (onednn-5baba71.tar.gz) = 72f1a11623f8cabb2605eb734b891f36b16876ac7c940947807c4d574c7e6031dd064de5ebc7d2042c02989c1f38b55499d8c16d70a52d35dfbe74047d0ea3ce SHA512 (mlas-d1bc25e.tar.gz) = 8d6dd319924135b7b22940d623305bf200b812ae64cde79000709de4fad429fbd43794301ef16e6f10ed7132777b7a73e9f30ecae7c030aea80d57d7c0ce4500 -SHA512 (level-zero-npu-extensions-110f48e.tar.gz) = aaaeecad6c00489b652cd94d63ed0c1e59eb0eaed8b463198b40f1af3944004b072808ccc3074b71d825e9f0f37bf76fedf296961bb18959ef66a699b71fec41 +SHA512 (level-zero-npu-extensions-c0156a3.tar.gz) = 33ebdaec13dd05d6cf51e79f0e91a3c68621c428061423e243eb998c9ebe123ee90f6b4edc749d7fa2206c729058afff945177e8c90a05d36220f076e067c22c +SHA512 (npu_compiler-npu_ud_2025_12_rc2.tar.gz) = ab8999ecc63b7a17a52b7e07008b8e0396a97d58130908de039cca628c57a3bacc76ef9aac5e1060702b641130fe5340d44eed9c7deeb254a3ce52eb0151e4df +SHA512 (npu_plugin_elf-ce501d3.tar.gz) = acb168762c0660deaeb7214a4dc931317725005ec5533173fb96b3addc80f9a8ff5894e2349897f9d99a22c8852c9e93f2faf08ebda3f07d1f8a25a73c3c41f6 +SHA512 (npu-plugin-llvm-0d11450.tar.gz) = 538fdf3a1832391bf83dbe8bd20caa26b22246a4a298d908abed5dbb3d7b113ae761836ed5e4ffcf9eeca6758c1b4fc9d7e9602fd2f1fb57b855be804079df2c +SHA512 (npu-nn-cost-model-a965531.tar.gz) = 86c01715de65686fd4761fa0f96e6c83fda94d46bae4b61361e926e5445f27bebf974eae36cbdd0c65fdc92ab903dc58ea9b116e35ccca24ba9b425fbcefc0c2 +SHA512 (flatbuffers-6df40a2.tar.gz) = 895f56fa4730b8505b553f62f8293929f26982f147be6d44fab73064862d3a20a498b4fc18bab979a2421909e501d70d987eccc5e0924e98be676add508da95a