From b046fc6aeb2b7bea8ac21d8919d02c0df8fdb4ef Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 3 Mar 2024 21:25:05 +0400 Subject: [PATCH 01/11] Build GPU plugin with CPU's oneDNN --- cmake/features.cmake | 3 +- .../intel_cpu/thirdparty/CMakeLists.txt | 62 +++- .../intel_gpu/thirdparty/CMakeLists.txt | 282 ++++++++++-------- 3 files changed, 198 insertions(+), 149 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index 9e4e507600e1af..add7c988639249 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -34,9 +34,8 @@ endif() ov_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) -if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR (NOT BUILD_SHARED_LIBS AND ENABLE_INTEL_CPU)) +if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN - # also, in case of static build CPU's and GPU's oneDNNs will conflict, so we are disabling GPU's one in this case set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) else() set(ENABLE_ONEDNN_FOR_GPU_DEFAULT ON) diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index bf0294fd76623e..47cb633b4c4a54 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -15,7 +15,11 @@ if(ENABLE_LTO) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON) endif() -function(ov_add_onednn) +function(ov_add_onednn_common) + # + # Common oneDNN options + # + set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp ON) set(DNNL_ENABLE_JIT_PROFILING ${BUILD_SHARED_LIBS} CACHE BOOL "" FORCE) if(BUILD_SHARED_LIBS AND ENABLE_PROFILING_ITT) @@ -30,19 +34,11 @@ function(ov_add_onednn) set(DNNL_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(DNNL_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(DNNL_CPU_RUNTIME "${THREADING}" CACHE STRING "" FORCE) - set(DNNL_GPU_RUNTIME "NONE" CACHE STRING "" FORCE) set(DNNL_BLAS_VENDOR "NONE" CACHE STRING "" FORCE) - # plugin does not use onednn graph set(ONEDNN_BUILD_GRAPH OFF CACHE BOOL "" FORCE) - # select needed primitives - set(DNNL_ENABLE_PRIMITIVE "CONVOLUTION;DECONVOLUTION;CONCAT;LRN;INNER_PRODUCT;MATMUL;POOLING;REDUCTION;REORDER;RNN;SOFTMAX" CACHE STRING "" FORCE) set(DNNL_ENABLE_WORKLOAD "INFERENCE" CACHE STRING "" FORCE) set(DNNL_LIBRARY_NAME "openvino_onednn_cpu" CACHE STRING "" FORCE) - - # Allow to enable oneDNN verbose with CPU_DEBUG_CAPS and rely on oneDNN default configuration otherwise - if(ENABLE_CPU_DEBUG_CAPS) - set(DNNL_VERBOSE ON CACHE STRING "" FORCE) - endif() + set(DNNL_EXPERIMENTAL_PROFILING ON CACHE BOOL "" FORCE) if(X86_64) set(DNNL_TARGET_ARCH "X64" CACHE STRING "" FORCE) @@ -58,6 +54,32 @@ function(ov_add_onednn) message(FATAL_ERROR "Unsupported system processor ${CMAKE_SYSTEM_PROCESSOR}") endif() + # IMPORTANT! when updating this list of supported primitives, align it with oneDNN for GPU list + # https://github.com/openvinotoolkit/openvino/blob/releases/2024/0/src/plugins/intel_gpu/thirdparty/CMakeLists.txt#L15 + # It's required, because in case of static build both CPU and GPU share the same oneDNN library + set(DNNL_ENABLE_PRIMITIVE "CONVOLUTION;DECONVOLUTION;CONCAT;LRN;INNER_PRODUCT;MATMUL;POOLING;REDUCTION;REORDER;RNN;SOFTMAX" CACHE STRING "" FORCE) + + # + # GPU specific options + # + + if(NOT BUILD_SHARED_LIBS AND ENABLE_ONEDNN_FOR_GPU) + # build oneDNN to be compatible with Intel GPU plugin + set(DNNL_ENABLE_PRIMITIVE_GPU_ISA "XEHP;XEHPG;XEHPC" CACHE STRING "" FORCE) + set(DNNL_GPU_RUNTIME "OCL" CACHE STRING "" FORCE) + else() + set(DNNL_GPU_RUNTIME "NONE" CACHE STRING "" FORCE) + endif() + + # + # CPU specific options + # + + # Allow to enable oneDNN verbose with CPU_DEBUG_CAPS and rely on oneDNN default configuration otherwise + if(ENABLE_CPU_DEBUG_CAPS) + set(DNNL_VERBOSE ON CACHE STRING "" FORCE) + endif() + if(AARCH64 OR ARM) set(DNNL_USE_ACL ON CACHE BOOL "Use ARM Conpute Library kernels in oneDNN" FORCE) endif() @@ -78,6 +100,15 @@ function(ov_add_onednn) link_libraries(TBB::tbb) endif() + # to find our FindACL.cmake + if(DNNL_USE_ACL) + list(APPEND CMAKE_MODULE_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") + endif() + + # + # Compilation flags + # + if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) ov_add_compiler_flags(-Wno-undef) ov_add_compiler_flags(-Wno-missing-declarations) @@ -110,10 +141,9 @@ function(ov_add_onednn) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") endif() - # to find our FindACL.cmake - if(DNNL_USE_ACL) - list(APPEND CMAKE_MODULE_PATH "${intel_cpu_thirdparty_SOURCE_DIR}") - endif() + # + # Build and install + # add_subdirectory(onednn EXCLUDE_FROM_ALL) @@ -135,9 +165,9 @@ function(ov_add_onednn) endif() endfunction() +ov_add_onednn_common() + if(ENABLE_MLAS_FOR_CPU) add_subdirectory(mlas) ov_install_static_lib(mlas ${OV_CPACK_COMP_CORE}) endif() - -ov_add_onednn() diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index 4fdbbc39f3d08f..98cd1cb83c88d9 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -6,151 +6,171 @@ # oneDNN for GPU plugin # -if(ENABLE_ONEDNN_FOR_GPU) - function(build_onednn_gpu) - include(ExternalProject) - set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build") - set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install" CACHE PATH "Installation path for oneDNN GPU library") - set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root") - set(ONEDNN_ENABLED_PRIMITIVES "CONCAT;CONVOLUTION;DECONVOLUTION;INNER_PRODUCT;MATMUL;REORDER;POOLING;REDUCTION") - set(ONEDNN_ENABLED_ISA "XEHP;XEHPG;XEHPC") - set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_gpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") - - if(X86_64) - set(ONEDNN_TARGET_ARCH "X64" CACHE STRING "" FORCE) - elseif(X86) - set(ONEDNN_TARGET_ARCH "X86" CACHE STRING "" FORCE) - elseif(RISCV64) - set(ONEDNN_TARGET_ARCH "RV64" CACHE STRING "" FORCE) - elseif(ARM) - set(ONEDNN_TARGET_ARCH "ARM" CACHE STRING "" FORCE) - elseif(AARCH64) - set(ONEDNN_TARGET_ARCH "AARCH64" CACHE STRING "" FORCE) - else() - message(WARNING "Intel GPU plugin unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") - endif() +function(ov_build_onednn_gpu) + include(ExternalProject) + set(ONEDNN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_build") + set(ONEDNN_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_install" CACHE PATH "Installation path for oneDNN GPU library") + set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root") - if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) - ov_add_compiler_flags(-Wno-undef) - ov_add_compiler_flags(-Wno-missing-declarations) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX) - ov_add_compiler_flags(-Wno-array-bounds) - ov_add_compiler_flags(-Wno-stringop-overflow) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) - ov_add_compiler_flags(-Wno-restrict) - endif() - endif() - endif() - if(SUGGEST_OVERRIDE_SUPPORTED) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") - endif() + # IMPORTANT! when updating this list of supported primitives, align it with oneDNN for CPU list + # https://github.com/openvinotoolkit/openvino/blob/releases/2024/0/src/plugins/intel_cpu/thirdparty/CMakeLists.txt#L38 + # It's required, because in case of static build both CPU and GPU share the same oneDNN library + set(ONEDNN_ENABLED_PRIMITIVES "CONCAT;CONVOLUTION;DECONVOLUTION;INNER_PRODUCT;MATMUL;REORDER;POOLING;REDUCTION") + set(ONEDNN_ENABLED_ISA "XEHP;XEHPG;XEHPC") + set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_gpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") - foreach(cmake_var IN ITEMS CMAKE_SYSTEM_NAME CMAKE_SYSTEM_VERSION - CMAKE_SYSTEM_PROCESSOR CMAKE_TOOLCHAIN_FILE) - list(APPEND cmake_extra_args "-D${cmake_var}=${${cmake_var}}") - endforeach() + if(X86_64) + set(ONEDNN_TARGET_ARCH "X64" CACHE STRING "" FORCE) + elseif(X86) + set(ONEDNN_TARGET_ARCH "X86" CACHE STRING "" FORCE) + elseif(RISCV64) + set(ONEDNN_TARGET_ARCH "RV64" CACHE STRING "" FORCE) + elseif(ARM) + set(ONEDNN_TARGET_ARCH "ARM" CACHE STRING "" FORCE) + elseif(AARCH64) + set(ONEDNN_TARGET_ARCH "AARCH64" CACHE STRING "" FORCE) + else() + message(WARNING "Intel GPU plugin unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") + endif() - if(OV_GENERATOR_MULTI_CONFIG) - if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$") - list(APPEND cmake_extra_args "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}") - list(APPEND cmake_extra_args "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}") + if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) + ov_add_compiler_flags(-Wno-undef) + ov_add_compiler_flags(-Wno-missing-declarations) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX) + ov_add_compiler_flags(-Wno-array-bounds) + ov_add_compiler_flags(-Wno-stringop-overflow) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) + ov_add_compiler_flags(-Wno-restrict) endif() - else() - list(APPEND cmake_extra_args "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") endif() + endif() + if(SUGGEST_OVERRIDE_SUPPORTED) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") + endif() - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21) - if(DEFINED CMAKE_CXX_LINKER_LAUNCHER) - list(APPEND cmake_extra_args "-DCMAKE_CXX_LINKER_LAUNCHER=${CMAKE_CXX_LINKER_LAUNCHER}") - endif() - if(DEFINED CMAKE_C_LINKER_LAUNCHER) - list(APPEND cmake_extra_args "-DCMAKE_C_LINKER_LAUNCHER=${CMAKE_C_LINKER_LAUNCHER}") - endif() - endif() + foreach(cmake_var IN ITEMS CMAKE_SYSTEM_NAME CMAKE_SYSTEM_VERSION + CMAKE_SYSTEM_PROCESSOR CMAKE_TOOLCHAIN_FILE) + list(APPEND cmake_extra_args "-D${cmake_var}=${${cmake_var}}") + endforeach() - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15 AND DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) - list(APPEND cmake_extra_args "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}") + if(OV_GENERATOR_MULTI_CONFIG) + if(CMAKE_GENERATOR MATCHES "^Ninja Multi-Config$") + list(APPEND cmake_extra_args "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_DEFAULT_BUILD_TYPE}") + list(APPEND cmake_extra_args "-DCMAKE_DEFAULT_BUILD_TYPE=${CMAKE_DEFAULT_BUILD_TYPE}") endif() + else() + list(APPEND cmake_extra_args "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") + endif() - # propogate OpenCL if explicitly specified - if(OpenCL_LIBRARY) - list(APPEND cmake_extra_args "-DOpenCL_LIBRARY=${OpenCL_LIBRARY}") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21) + if(DEFINED CMAKE_CXX_LINKER_LAUNCHER) + list(APPEND cmake_extra_args "-DCMAKE_CXX_LINKER_LAUNCHER=${CMAKE_CXX_LINKER_LAUNCHER}") endif() - if(OpenCL_INCLUDE_DIR) - list(APPEND cmake_extra_args "-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIR}") + if(DEFINED CMAKE_C_LINKER_LAUNCHER) + list(APPEND cmake_extra_args "-DCMAKE_C_LINKER_LAUNCHER=${CMAKE_C_LINKER_LAUNCHER}") endif() + endif() + + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15 AND DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) + list(APPEND cmake_extra_args "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}") + endif() + + # propogate OpenCL if explicitly specified + if(OpenCL_LIBRARY) + list(APPEND cmake_extra_args "-DOpenCL_LIBRARY=${OpenCL_LIBRARY}") + endif() + if(OpenCL_INCLUDE_DIR) + list(APPEND cmake_extra_args "-DOpenCL_INCLUDE_DIR=${OpenCL_INCLUDE_DIR}") + endif() + + set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ONEDNN_GPU_LIB_PATH ${ONEDNN_INSTALL_DIR}/lib/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") + + ExternalProject_Add(onednn_gpu_build + # Directory Options: + PREFIX "${ONEDNN_PREFIX_DIR}" + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu" + BINARY_DIR "${ONEDNN_BUILD_DIR}" + INSTALL_DIR "${ONEDNN_INSTALL_DIR}" + # Configure Step Options: + CMAKE_ARGS + ${cmake_extra_args} + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}" + "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}" + "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" + "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" + "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=${ENABLE_LTO}" + "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW" + "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" + "-DDNNL_CPU_RUNTIME=NONE" + "-DDNNL_GPU_RUNTIME=OCL" + "-DDNNL_LIBRARY_NAME=${DNNL_GPU_LIBRARY_NAME}" + "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" + "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" + "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" + "-DDNNL_ENABLE_WORKLOAD=INFERENCE" + "-DDNNL_ENABLE_JIT_PROFILING=${BUILD_SHARED_LIBS}" + "-DDNNL_ENABLE_ITT_TASKS=${BUILD_SHARED_LIBS}" + "-DDNNL_BUILD_TESTS=OFF" + "-DDNNL_BUILD_EXAMPLES=OFF" + "-DDNNL_BLAS_VENDOR=NONE" + "-DDNNL_LIBRARY_TYPE=STATIC" + "-DDNNL_EXPERIMENTAL_PROFILING=ON" + "-DONEDNN_BUILD_GRAPH=OFF" + # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored + # Conan's FindOpenCL.cmake module does not set OpenCL_INCLUDE_DIRS, so we need to set it manually + "-DOpenCL_INCLUDE_DIRS=$" + # Conan calls cmake with default value for CMP0091, so we have to bypass it to oneDNN build + # because we bypass conan_toolchain.cmake via CMAKE_TOOLCHAIN_FILE + "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW" + CMAKE_CACHE_ARGS + # The arguments below requires list to be passed as argument + # which doesn't work properly when passed to CMAKE_ARGS. + # Thus we pass it via CMAKE_CACHE_ARGS + "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" + "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" + # Build Step Options: + BUILD_BYPRODUCTS ${ONEDNN_GPU_LIB_PATH} + # Target Options: + EXCLUDE_FROM_ALL ON + ) + + add_library(onednn_gpu_tgt INTERFACE) + set_target_properties(onednn_gpu_tgt PROPERTIES + INTERFACE_LINK_LIBRARIES $ + INTERFACE_INCLUDE_DIRECTORIES $ + INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU) + add_dependencies(onednn_gpu_tgt onednn_gpu_build) + + if(NOT BUILD_SHARED_LIBS) + ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) + + # we need to install library explicitly and set_target_properties in OpenVINOConfig.cmake for 'onednn_gpu_tgt' + # to point to installation location of this file + install(FILES "${ONEDNN_GPU_LIB_PATH}" + DESTINATION ${OV_CPACK_ARCHIVEDIR} + COMPONENT ${OV_CPACK_COMP_CORE}) + endif() +endfunction() + +if(ENABLE_ONEDNN_FOR_GPU) + # if(BUILD_SHARED_LIBS OR NOT ENABLE_INTEL_CPU) + # ov_build_onednn_gpu() + # else() + # in case of static libraries, Intel GPU shares oneDNN with CPU plugin + set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_cpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(ONEDNN_GPU_LIB_PATH ${ONEDNN_INSTALL_DIR}/lib/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") - - ExternalProject_Add(onednn_gpu_build - # Directory Options: - PREFIX "${ONEDNN_PREFIX_DIR}" - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu" - BINARY_DIR "${ONEDNN_BUILD_DIR}" - INSTALL_DIR "${ONEDNN_INSTALL_DIR}" - # Configure Step Options: - CMAKE_ARGS - ${cmake_extra_args} - "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" - "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" - "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}" - "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}" - "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" - "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" - "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=${ENABLE_LTO}" - "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW" - "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" - "-DDNNL_CPU_RUNTIME=NONE" - "-DDNNL_GPU_RUNTIME=OCL" - "-DDNNL_LIBRARY_NAME=${DNNL_GPU_LIBRARY_NAME}" - "-DCMAKE_INSTALL_PREFIX=${ONEDNN_INSTALL_DIR}" - "-DDNNL_ENABLE_CONCURRENT_EXEC=ON" - "-DDNNL_ENABLE_PRIMITIVE_CACHE=OFF" - "-DDNNL_ENABLE_WORKLOAD=INFERENCE" - "-DDNNL_ENABLE_JIT_PROFILING=${BUILD_SHARED_LIBS}" - "-DDNNL_ENABLE_ITT_TASKS=${BUILD_SHARED_LIBS}" - "-DDNNL_BUILD_TESTS=OFF" - "-DDNNL_BUILD_EXAMPLES=OFF" - "-DDNNL_BLAS_VENDOR=NONE" - "-DDNNL_LIBRARY_TYPE=STATIC" - "-DDNNL_EXPERIMENTAL_PROFILING=ON" - "-DONEDNN_BUILD_GRAPH=OFF" - # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored - # Conan's FindOpenCL.cmake module does not set OpenCL_INCLUDE_DIRS, so we need to set it manually - "-DOpenCL_INCLUDE_DIRS=$" - # Conan calls cmake with default value for CMP0091, so we have to bypass it to oneDNN build - # because we bypass conan_toolchain.cmake via CMAKE_TOOLCHAIN_FILE - "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW" - CMAKE_CACHE_ARGS - # The arguments below requires list to be passed as argument - # which doesn't work properly when passed to CMAKE_ARGS. - # Thus we pass it via CMAKE_CACHE_ARGS - "-DDNNL_ENABLE_PRIMITIVE:STRING=${ONEDNN_ENABLED_PRIMITIVES}" - "-DDNNL_ENABLE_PRIMITIVE_GPU_ISA:STRING=${ONEDNN_ENABLED_ISA}" - # Build Step Options: - BUILD_BYPRODUCTS ${ONEDNN_GPU_LIB_PATH} - # Target Options: - EXCLUDE_FROM_ALL ON - ) + set(ONEDNN_GPU_LIB_PATH ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") add_library(onednn_gpu_tgt INTERFACE) set_target_properties(onednn_gpu_tgt PROPERTIES - INTERFACE_LINK_LIBRARIES $ - INTERFACE_INCLUDE_DIRECTORIES $ - INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU - ) - add_dependencies(onednn_gpu_tgt onednn_gpu_build) - - if(NOT BUILD_SHARED_LIBS) - ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) - - # we need to install library explicitly and set_target_properties in OpenVINOConfig.cmake for 'onednn_gpu_tgt' - # to point to installation location of this file - install(FILES "${ONEDNN_GPU_LIB_PATH}" - DESTINATION ${OV_CPACK_ARCHIVEDIR} - COMPONENT ${OV_CPACK_COMP_CORE}) - endif() - endfunction() - build_onednn_gpu() + INTERFACE_LINK_LIBRARIES dnnl + INTERFACE_INCLUDE_DIRECTORIES $> + INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU) + + ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) + # endif() endif() From d294bc1315c5779669b187cc77917e14036cae75 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 3 Mar 2024 21:42:07 +0400 Subject: [PATCH 02/11] Try to enable oneDNN for GPU on Android --- cmake/features.cmake | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index add7c988639249..753bea71b7ebeb 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -33,15 +33,7 @@ else() endif() ov_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) - -if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) - # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN - set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) -else() - set(ENABLE_ONEDNN_FOR_GPU_DEFAULT ON) -endif() - -ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ${ENABLE_ONEDNN_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF) +ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ON "ENABLE_INTEL_GPU" OFF) ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF) ov_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_GPU" OFF) From 031b1fd43ead61542329e0ac31fbef70b33b850f Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 3 Mar 2024 22:00:02 +0400 Subject: [PATCH 03/11] Revert "Try to enable oneDNN for GPU on Android" This reverts commit 9e5cb1e76e76054a5ae8523339e6dc08be45a9cd. --- cmake/features.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index 753bea71b7ebeb..add7c988639249 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -33,7 +33,15 @@ else() endif() ov_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) -ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ON "ENABLE_INTEL_GPU" OFF) + +if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) + # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN + set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) +else() + set(ENABLE_ONEDNN_FOR_GPU_DEFAULT ON) +endif() + +ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ${ENABLE_ONEDNN_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF) ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF) ov_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_GPU" OFF) From 68d089825cd0ce431faca7e7c8d892886ca8b465 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sun, 3 Mar 2024 22:08:58 +0400 Subject: [PATCH 04/11] Added WA for multiple export sets --- cmake/features.cmake | 11 ++++++++ .../intel_cpu/thirdparty/CMakeLists.txt | 24 ++++++++++++++++- src/plugins/intel_cpu/thirdparty/onednn | 2 +- .../intel_gpu/thirdparty/CMakeLists.txt | 26 ++++++++++++++++--- thirdparty/ocl/CMakeLists.txt | 3 +++ 5 files changed, 60 insertions(+), 6 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index add7c988639249..e35641885ab36f 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -43,6 +43,17 @@ endif() ov_dependent_option (ENABLE_ONEDNN_FOR_GPU "Enable oneDNN with GPU support" ${ENABLE_ONEDNN_FOR_GPU_DEFAULT} "ENABLE_INTEL_GPU" OFF) +if(BUILD_SHARED_LIBS OR NOT ENABLE_INTEL_CPU) + set(ENABLE_GPU_USE_CPUS_ONEDNN_DEFAULT OFF) +else() + set(ENABLE_GPU_USE_CPUS_ONEDNN_DEFAULT ON) +endif() + +# TODO: remove +set(ENABLE_GPU_USE_CPUS_ONEDNN_DEFAULT ON) + +ov_dependent_option (ENABLE_GPU_USE_CPUS_ONEDNN "Enable GPU to use oneDNN from CPU" ${ENABLE_GPU_USE_CPUS_ONEDNN_DEFAULT} "ENABLE_ONEDNN_FOR_GPU;ENABLE_INTEL_CPU" OFF) + ov_option (ENABLE_DEBUG_CAPS "enable OpenVINO debug capabilities at runtime" OFF) ov_dependent_option (ENABLE_GPU_DEBUG_CAPS "enable GPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_GPU" OFF) ov_dependent_option (ENABLE_CPU_DEBUG_CAPS "enable CPU debug capabilities at runtime" ON "ENABLE_DEBUG_CAPS;ENABLE_INTEL_CPU" OFF) diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index 47cb633b4c4a54..989975ba7c1fe8 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -63,10 +63,32 @@ function(ov_add_onednn_common) # GPU specific options # - if(NOT BUILD_SHARED_LIBS AND ENABLE_ONEDNN_FOR_GPU) + if(NOT BUILD_SHARED_LIBS AND ENABLE_ONEDNN_FOR_GPU OR ENABLE_GPU_USE_CPUS_ONEDNN) # build oneDNN to be compatible with Intel GPU plugin set(DNNL_ENABLE_PRIMITIVE_GPU_ISA "XEHP;XEHPG;XEHPC" CACHE STRING "" FORCE) set(DNNL_GPU_RUNTIME "OCL" CACHE STRING "" FORCE) + + # Keep in sync with https://github.com/openvinotoolkit/openvino/blob/releases/2024/0/src/plugins/intel_gpu/CMakeLists.txt#L30 + set(INTEL_GPU_TARGET_OCL_VERSION "200" CACHE STRING "Target version of OpenCL which should be used by GPU plugin") + + if(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "300") + set(ONEDNN_CL_VERSION "3_0") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "220") + set(ONEDNN_CL_VERSION "2_2") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "210") + set(ONEDNN_CL_VERSION "2_1") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "200") + set(ONEDNN_CL_VERSION "2_0") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "120") + set(ONEDNN_CL_VERSION "1_2") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "100") + set(ONEDNN_CL_VERSION "1_0") + else() + message(FATAL_ERROR "Unsupported version of OpenCL: ${INTEL_GPU_TARGET_OCL_VERSION}") + endif() + + # override OpenCL version default set by oneDNN (1.2) + set(OPENCL_VERSION_${ONEDNN_CL_VERSION} ON) else() set(DNNL_GPU_RUNTIME "NONE" CACHE STRING "" FORCE) endif() diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 0f94c0e7b94f64..6961af530138d2 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 0f94c0e7b94f64df2b94929279bbeb4f576a6a36 +Subproject commit 6961af530138d2076103fd4ff06eac93c95e59a4 diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index 98cd1cb83c88d9..73a3c001f40df0 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -33,6 +33,22 @@ function(ov_build_onednn_gpu) message(WARNING "Intel GPU plugin unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}") endif() + if(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "300") + set(ONEDNN_CL_VERSION "3_0") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "220") + set(ONEDNN_CL_VERSION "2_2") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "210") + set(ONEDNN_CL_VERSION "2_1") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "200") + set(ONEDNN_CL_VERSION "2_0") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "120") + set(ONEDNN_CL_VERSION "1_2") + elseif(INTEL_GPU_TARGET_OCL_VERSION STREQUAL "100") + set(ONEDNN_CL_VERSION "1_0") + else() + message(FATAL_ERROR "Unsupported version of OpenCL: ${INTEL_GPU_TARGET_OCL_VERSION}") + endif() + if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) ov_add_compiler_flags(-Wno-undef) ov_add_compiler_flags(-Wno-missing-declarations) @@ -119,6 +135,8 @@ function(ov_build_onednn_gpu) "-DDNNL_LIBRARY_TYPE=STATIC" "-DDNNL_EXPERIMENTAL_PROFILING=ON" "-DONEDNN_BUILD_GRAPH=OFF" + # override OpenCL version default set by oneDNN (1.2) + "-DOPENCL_VERSION_${ONEDNN_CL_VERSION}=ON" # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored # Conan's FindOpenCL.cmake module does not set OpenCL_INCLUDE_DIRS, so we need to set it manually "-DOpenCL_INCLUDE_DIRS=$" @@ -156,9 +174,7 @@ function(ov_build_onednn_gpu) endfunction() if(ENABLE_ONEDNN_FOR_GPU) - # if(BUILD_SHARED_LIBS OR NOT ENABLE_INTEL_CPU) - # ov_build_onednn_gpu() - # else() + if(ENABLE_GPU_USE_CPUS_ONEDNN) # in case of static libraries, Intel GPU shares oneDNN with CPU plugin set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_cpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") @@ -172,5 +188,7 @@ if(ENABLE_ONEDNN_FOR_GPU) INTERFACE_COMPILE_DEFINITIONS ENABLE_ONEDNN_FOR_GPU) ov_install_static_lib(onednn_gpu_tgt ${OV_CPACK_COMP_CORE}) - # endif() + else() + ov_build_onednn_gpu() + endif() endif() diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt index 0a402752d3397e..4bc02ecbe41018 100644 --- a/thirdparty/ocl/CMakeLists.txt +++ b/thirdparty/ocl/CMakeLists.txt @@ -59,3 +59,6 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) # installation ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE}) + +install(TARGETS OpenCL EXPORT dnnl-targets + ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}) From d11cd8c0c91ba5e5e260e4de2fda54711f89b359 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 8 Mar 2024 22:13:08 +0400 Subject: [PATCH 05/11] Install opencl for core --- .github/workflows/job_onnx_models_tests.yml | 2 +- .github/workflows/job_pytorch_models_tests.yml | 2 +- .github/workflows/job_tensorflow_models_tests.yml | 2 +- .../install_dependencies/install_openvino_dependencies.sh | 5 +++-- src/cmake/openvino.cmake | 2 +- src/plugins/intel_cpu/thirdparty/CMakeLists.txt | 1 - src/plugins/intel_cpu/thirdparty/onednn | 2 +- src/plugins/intel_gpu/thirdparty/CMakeLists.txt | 7 ++++++- thirdparty/ocl/CMakeLists.txt | 6 ++++-- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/job_onnx_models_tests.yml b/.github/workflows/job_onnx_models_tests.yml index 79c87a3c6e6402..92ac181a4614cf 100644 --- a/.github/workflows/job_onnx_models_tests.yml +++ b/.github/workflows/job_onnx_models_tests.yml @@ -82,7 +82,7 @@ jobs: - name: Install dependencies run: | # install git (required to build pip deps from the sources) - apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs + apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs ocl-icd-libopencl1 - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/.github/workflows/job_pytorch_models_tests.yml b/.github/workflows/job_pytorch_models_tests.yml index 16aa00873bc53b..1b7ea7f69db6a2 100644 --- a/.github/workflows/job_pytorch_models_tests.yml +++ b/.github/workflows/job_pytorch_models_tests.yml @@ -95,7 +95,7 @@ jobs: run: | # install git (required to build pip deps from the sources) # install 'g++' to build 'detectron2' and 'natten' wheels - sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates + sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates ocl-icd-libopencl1 - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/.github/workflows/job_tensorflow_models_tests.yml b/.github/workflows/job_tensorflow_models_tests.yml index c89370851ad24c..e52a00d1a4d2f6 100644 --- a/.github/workflows/job_tensorflow_models_tests.yml +++ b/.github/workflows/job_tensorflow_models_tests.yml @@ -94,7 +94,7 @@ jobs: if: ${{ runner.os == 'Linux' }} run: | # install git (required to build pip deps from the sources) - sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates + sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates ocl-icd-libopencl1 - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/scripts/install_dependencies/install_openvino_dependencies.sh b/scripts/install_dependencies/install_openvino_dependencies.sh index 4c964182f160d4..2a62d7ea5e96ad 100755 --- a/scripts/install_dependencies/install_openvino_dependencies.sh +++ b/scripts/install_dependencies/install_openvino_dependencies.sh @@ -131,7 +131,7 @@ if [ "$os" == "raspbian9" ] || [ "$os" == "debian9" ] ; then elif [ "$os" == "ubuntu18.04" ] ; then - pkgs_core=(libtbb2) + pkgs_core=(ocl-icd-libopencl1 libtbb2) pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3.8 libpython3.8 python3.8-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev make sudo) @@ -140,7 +140,7 @@ elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "debian10" ] || [ "$os" == "raspbi [ "$os" == "ubuntu21.10" ] || [ "$os" == "ubuntu22.04" ] || [ "$os" == "debian11" ] || [ "$os" == "raspbian11" ] || [ "$os" == "ubuntu22.10" ] || [ "$os" == "ubuntu23.04" ] || [ "$os" == "debian12" ] || [ "$os" == "raspbian12" ]; then - pkgs_core=() + pkgs_core=(ocl-icd-libopencl1) pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3 python3-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev make sudo) @@ -223,6 +223,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] pkgs_python+=(python3 python3-pip) extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm") fi + pkgs_core+=("${!pkgs_gpu}") elif [ "$os" == "opensuse-leap15.3" ] ; then pkgs_core=(libtbb2 libtbbmalloc2) pkgs_gpu=(libOpenCL1) diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index 0883b144cdedc1..96ebcebf542756 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -187,7 +187,7 @@ configure_package_config_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOCo list(APPEND INSTALL_PATH_VARS "OPENVINO_LIB_DIR") # remove generator expression at the end, because searching in Release / Debug -# will be done by inside OpenVINOConfig.cmak / ACLConfig.cmake +# will be done by inside OpenVINOConfig.cmake / ACLConfig.cmake string(REPLACE "$" "" OPENVINO_LIB_DIR "${OV_CPACK_LIBRARYDIR}") set(OV_TBB_DIR "${OV_TBB_DIR_INSTALL}") diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index 989975ba7c1fe8..c6da381c7bf83e 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -38,7 +38,6 @@ function(ov_add_onednn_common) set(ONEDNN_BUILD_GRAPH OFF CACHE BOOL "" FORCE) set(DNNL_ENABLE_WORKLOAD "INFERENCE" CACHE STRING "" FORCE) set(DNNL_LIBRARY_NAME "openvino_onednn_cpu" CACHE STRING "" FORCE) - set(DNNL_EXPERIMENTAL_PROFILING ON CACHE BOOL "" FORCE) if(X86_64) set(DNNL_TARGET_ARCH "X64" CACHE STRING "" FORCE) diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 6961af530138d2..52e696784662ef 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 6961af530138d2076103fd4ff06eac93c95e59a4 +Subproject commit 52e696784662ef2a6f9982ea6fae2ec3e442b7b3 diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index 73a3c001f40df0..4c3db33115d030 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -178,8 +178,13 @@ if(ENABLE_ONEDNN_FOR_GPU) # in case of static libraries, Intel GPU shares oneDNN with CPU plugin set(DNNL_GPU_LIBRARY_NAME "openvino_onednn_cpu" CACHE STRING "Name of oneDNN library for Intel GPU Plugin") + set(onednn_output_dir "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}") + if(OV_GENERATOR_MULTI_CONFIG) + # TODO: here we assume Release config is used, but it will not work for debug + set(onednn_output_dir "${onednn_output_dir}/Release") + endif() set(onednn_gpu_lib "${CMAKE_STATIC_LIBRARY_PREFIX}${DNNL_GPU_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") - set(ONEDNN_GPU_LIB_PATH ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") + set(ONEDNN_GPU_LIB_PATH ${onednn_output_dir}/${onednn_gpu_lib} CACHE FILEPATH "Path to oneDNN GPU library") add_library(onednn_gpu_tgt INTERFACE) set_target_properties(onednn_gpu_tgt PROPERTIES diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt index 4bc02ecbe41018..d7b2cc4e408c7a 100644 --- a/thirdparty/ocl/CMakeLists.txt +++ b/thirdparty/ocl/CMakeLists.txt @@ -60,5 +60,7 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE}) -install(TARGETS OpenCL EXPORT dnnl-targets - ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}) +if(NOT BUILD_SHARED_LIBS) + install(TARGETS OpenCL EXPORT dnnl-targets + ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}) +endif() From d5258ac1ddd478d32471a5191b61b33a27f7757a Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Mar 2024 09:38:24 +0400 Subject: [PATCH 06/11] More fixes --- src/plugins/intel_cpu/thirdparty/CMakeLists.txt | 1 + src/plugins/intel_cpu/thirdparty/onednn | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index c6da381c7bf83e..e6516f9559766e 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -66,6 +66,7 @@ function(ov_add_onednn_common) # build oneDNN to be compatible with Intel GPU plugin set(DNNL_ENABLE_PRIMITIVE_GPU_ISA "XEHP;XEHPG;XEHPC" CACHE STRING "" FORCE) set(DNNL_GPU_RUNTIME "OCL" CACHE STRING "" FORCE) + set(DNNL_EXPERIMENTAL_PROFILING ON CACHE BOOL "" FORCE) # Keep in sync with https://github.com/openvinotoolkit/openvino/blob/releases/2024/0/src/plugins/intel_gpu/CMakeLists.txt#L30 set(INTEL_GPU_TARGET_OCL_VERSION "200" CACHE STRING "Target version of OpenCL which should be used by GPU plugin") diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 52e696784662ef..3ab1dd895b5c84 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 52e696784662ef2a6f9982ea6fae2ec3e442b7b3 +Subproject commit 3ab1dd895b5c842b10bd53b5fe6a73fe2dcc3319 From 969b78e101e5ba16f5fd7c55c537d9bc7585199e Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Mar 2024 12:49:30 +0400 Subject: [PATCH 07/11] Fixed compilation of GPU unit tests --- .../reference/scatter_elements_update.hpp | 6 ++--- .../intel_gpu/tests/unit/CMakeLists.txt | 3 +-- .../scatter_elements_update_gpu_test.cpp | 23 ++----------------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/core/reference/include/openvino/reference/scatter_elements_update.hpp b/src/core/reference/include/openvino/reference/scatter_elements_update.hpp index 1cf8cd62a97196..2767a51670dd80 100644 --- a/src/core/reference/include/openvino/reference/scatter_elements_update.hpp +++ b/src/core/reference/include/openvino/reference/scatter_elements_update.hpp @@ -59,7 +59,7 @@ void scatter_elem_update_no_reduction(const size_t data_elem_size, } // namespace template -T reduction_neutral_value(const Reduction reduction_type) { +inline T reduction_neutral_value(const Reduction reduction_type) { switch (reduction_type) { case Reduction::MAX: return std::numeric_limits::lowest(); @@ -76,7 +76,7 @@ T reduction_neutral_value(const Reduction reduction_type) { } template -std::function reduction_functor_for(const Reduction reduction_type) { +inline std::function reduction_functor_for(const Reduction reduction_type) { switch (reduction_type) { case Reduction::MAX: return [](const T a, const T b) { @@ -97,7 +97,7 @@ std::function reduction_functor_for(const Reduction reducti } template <> -std::function reduction_functor_for(const Reduction reduction_type) { +inline std::function reduction_functor_for(const Reduction reduction_type) { switch (reduction_type) { case Reduction::MAX: return [](const char a, const char b) { diff --git a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt b/src/plugins/intel_gpu/tests/unit/CMakeLists.txt index bb1e0cab52bac1..9bb2052141a0df 100644 --- a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt +++ b/src/plugins/intel_gpu/tests/unit/CMakeLists.txt @@ -56,7 +56,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE CI_BUILD_NUMBER="") ov_set_threading_interface_for(${TARGET_NAME}) # Workaround to avoid warnings during LTO build -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if(CMAKE_COMPILER_IS_GNUCXX) set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS_RELEASE "-Wno-error=maybe-uninitialized -Wno-maybe-uninitialized") endif() @@ -75,7 +75,6 @@ target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/test_utils/ $ $ - ${CMAKE_HOME_DIRECTORY}/src/core/reference/include/ ${TEST_COMMON_INCLUDE_DIR}) if(WIN32) diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp index ed6b04c9f75563..6321960359df45 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp @@ -4,6 +4,8 @@ #include "test_utils.h" +#include "openvino/reference/scatter_elements_update.hpp" + #include #include #include @@ -15,27 +17,6 @@ using namespace cldnn; using namespace ::tests; -#ifdef OPENVINO_STATIC_LIBRARY -namespace ov { -namespace reference { -using Reduction = ov::op::v12::ScatterElementsUpdate::Reduction; - -template -void scatter_elem_update(const DataType *input_data, - const IndicesType *indices, - const DataType *updates, - const int64_t axis, - DataType *out_buf, - const Shape &data_shape, - const Shape &indices_shape, - const Reduction reduction_type = Reduction::NONE, - const bool use_init_val = true); -} -} -#else -#include "openvino/reference/scatter_elements_update.hpp" -#endif - template void test_d2411_axisF(bool is_caching_test) { // Dictionary : 2x4x1x1 From f2b6f864d64819e17ec8894cf0fb8f5324ef6056 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Mar 2024 13:14:07 +0400 Subject: [PATCH 08/11] Updated submodule to fix Ubuntu 20.04 LTO build --- src/plugins/intel_cpu/thirdparty/onednn | 2 +- src/plugins/intel_gpu/thirdparty/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 3ab1dd895b5c84..740795e2ec21b1 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 3ab1dd895b5c842b10bd53b5fe6a73fe2dcc3319 +Subproject commit 740795e2ec21b1149e878ecd4424ae03a3544bf3 diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index 4c3db33115d030..bd61952be00dd1 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -117,6 +117,7 @@ function(ov_build_onednn_gpu) "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}" "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}" "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}" + "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=${ENABLE_LTO}" "-DCMAKE_POLICY_DEFAULT_CMP0069=NEW" "-DDNNL_TARGET_ARCH=${ONEDNN_TARGET_ARCH}" From d00090e0f175d8ded6822b076c7d2e26ef49c0c4 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Mar 2024 20:49:10 +0400 Subject: [PATCH 09/11] Temporary install opencl --- thirdparty/ocl/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt index d7b2cc4e408c7a..1b061ab34ad0d6 100644 --- a/thirdparty/ocl/CMakeLists.txt +++ b/thirdparty/ocl/CMakeLists.txt @@ -61,6 +61,12 @@ set(opencl_root_hints "${OpenCL_INCLUDE_DIR}" PARENT_SCOPE) ov_install_static_lib(OpenCL ${OV_CPACK_COMP_CORE}) if(NOT BUILD_SHARED_LIBS) + # dummy export to make cmake happy (this target should be explicitly in dnnl-targets export set + # because oneDNN externals depend on it) install(TARGETS OpenCL EXPORT dnnl-targets ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}) endif() + +# TODO: remove before merge +install(TARGETS OpenCL + LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT ${OV_CPACK_COMP_CORE}) From d99771c47d9cbe0b9ba5cdd47a0cd7edb1590036 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 9 Mar 2024 20:51:06 +0400 Subject: [PATCH 10/11] Revert changes in GHA --- .github/workflows/job_onnx_models_tests.yml | 2 +- .github/workflows/job_pytorch_models_tests.yml | 2 +- .github/workflows/job_tensorflow_models_tests.yml | 2 +- .../install_dependencies/install_openvino_dependencies.sh | 5 ++--- thirdparty/ocl/CMakeLists.txt | 8 ++++---- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/job_onnx_models_tests.yml b/.github/workflows/job_onnx_models_tests.yml index 92ac181a4614cf..79c87a3c6e6402 100644 --- a/.github/workflows/job_onnx_models_tests.yml +++ b/.github/workflows/job_onnx_models_tests.yml @@ -82,7 +82,7 @@ jobs: - name: Install dependencies run: | # install git (required to build pip deps from the sources) - apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs ocl-icd-libopencl1 + apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/.github/workflows/job_pytorch_models_tests.yml b/.github/workflows/job_pytorch_models_tests.yml index 1b7ea7f69db6a2..16aa00873bc53b 100644 --- a/.github/workflows/job_pytorch_models_tests.yml +++ b/.github/workflows/job_pytorch_models_tests.yml @@ -95,7 +95,7 @@ jobs: run: | # install git (required to build pip deps from the sources) # install 'g++' to build 'detectron2' and 'natten' wheels - sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates ocl-icd-libopencl1 + sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/.github/workflows/job_tensorflow_models_tests.yml b/.github/workflows/job_tensorflow_models_tests.yml index e52a00d1a4d2f6..c89370851ad24c 100644 --- a/.github/workflows/job_tensorflow_models_tests.yml +++ b/.github/workflows/job_tensorflow_models_tests.yml @@ -94,7 +94,7 @@ jobs: if: ${{ runner.os == 'Linux' }} run: | # install git (required to build pip deps from the sources) - sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates ocl-icd-libopencl1 + sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates - name: Setup Python 3.11 uses: ./openvino/.github/actions/setup_python diff --git a/scripts/install_dependencies/install_openvino_dependencies.sh b/scripts/install_dependencies/install_openvino_dependencies.sh index 2a62d7ea5e96ad..4c964182f160d4 100755 --- a/scripts/install_dependencies/install_openvino_dependencies.sh +++ b/scripts/install_dependencies/install_openvino_dependencies.sh @@ -131,7 +131,7 @@ if [ "$os" == "raspbian9" ] || [ "$os" == "debian9" ] ; then elif [ "$os" == "ubuntu18.04" ] ; then - pkgs_core=(ocl-icd-libopencl1 libtbb2) + pkgs_core=(libtbb2) pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3.8 libpython3.8 python3.8-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev make sudo) @@ -140,7 +140,7 @@ elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "debian10" ] || [ "$os" == "raspbi [ "$os" == "ubuntu21.10" ] || [ "$os" == "ubuntu22.04" ] || [ "$os" == "debian11" ] || [ "$os" == "raspbian11" ] || [ "$os" == "ubuntu22.10" ] || [ "$os" == "ubuntu23.04" ] || [ "$os" == "debian12" ] || [ "$os" == "raspbian12" ]; then - pkgs_core=(ocl-icd-libopencl1) + pkgs_core=() pkgs_gpu=(ocl-icd-libopencl1) pkgs_python=(python3 python3-venv python3-pip) pkgs_dev=(cmake pkg-config g++ gcc libc6-dev make sudo) @@ -223,7 +223,6 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] pkgs_python+=(python3 python3-pip) extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm") fi - pkgs_core+=("${!pkgs_gpu}") elif [ "$os" == "opensuse-leap15.3" ] ; then pkgs_core=(libtbb2 libtbbmalloc2) pkgs_gpu=(libOpenCL1) diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txt index 1b061ab34ad0d6..0de73ac663edf9 100644 --- a/thirdparty/ocl/CMakeLists.txt +++ b/thirdparty/ocl/CMakeLists.txt @@ -65,8 +65,8 @@ if(NOT BUILD_SHARED_LIBS) # because oneDNN externals depend on it) install(TARGETS OpenCL EXPORT dnnl-targets ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE}) +else() + # TODO: remove before merge + install(TARGETS OpenCL + LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT ${OV_CPACK_COMP_CORE}) endif() - -# TODO: remove before merge -install(TARGETS OpenCL - LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT ${OV_CPACK_COMP_CORE}) From b0efaa5d689e6ef712dd835a9819c3193e365df8 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 14 Mar 2024 17:58:51 +0400 Subject: [PATCH 11/11] Next iteration --- cmake/features.cmake | 5 ++++- .../intel_cpu/thirdparty/CMakeLists.txt | 20 ++++++++++++++----- src/plugins/intel_cpu/thirdparty/onednn | 2 +- .../intel_gpu/thirdparty/CMakeLists.txt | 2 ++ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index e35641885ab36f..6f73ed1ef0d3ab 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -168,13 +168,16 @@ else() set(ENABLE_SYSTEM_TBB_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT}) endif() +# don't use system OpenCL during static build to avoid extra shared libs dependencies +set(ENABLE_SYSTEM_OPENCL_DEFAULT ${BUILD_SHARED_LIBS}) + ov_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" ${ENABLE_SYSTEM_TBB_DEFAULT} "THREADING MATCHES TBB" OFF) ov_option (ENABLE_SYSTEM_PUGIXML "Enables use of system PugiXML" OFF) # the option is on by default, because we use only flatc compiler and don't use any libraries ov_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ${ENABLE_SYSTEM_FLATBUFFERS_DEFAULT} "ENABLE_OV_TF_LITE_FRONTEND" OFF) -ov_dependent_option (ENABLE_SYSTEM_OPENCL "Enables use of system OpenCL" ${ENABLE_SYSTEM_LIBS_DEFAULT} +ov_dependent_option (ENABLE_SYSTEM_OPENCL "Enables use of system OpenCL" ${ENABLE_SYSTEM_OPENCL_DEFAULT} "ENABLE_INTEL_GPU" OFF) # the option is turned off by default, because we compile our own static version of protobuf # with LTO and -fPIC options, while system one does not have such flags diff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt index e6516f9559766e..4bf70fb6d55135 100644 --- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt @@ -20,13 +20,23 @@ function(ov_add_onednn_common) # Common oneDNN options # - set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp ON) - set(DNNL_ENABLE_JIT_PROFILING ${BUILD_SHARED_LIBS} CACHE BOOL "" FORCE) - if(BUILD_SHARED_LIBS AND ENABLE_PROFILING_ITT) - set(DNNL_ENABLE_ITT_TASKS ON CACHE BOOL "" FORCE) + if(ENABLE_GPU_USE_CPUS_ONEDNN AND ENABLE_LTO) + # TODO: for some reason, when CPU's oneDNN is compiled with GPU support, we have + # issues because of LTO; so, let's turn off + set(DNNL_ENABLE_JIT_PROFILING_DEFAULT OFF) + set(DNNL_ENABLE_ITT_TASKS_DEFAULT OFF) else() - set(DNNL_ENABLE_ITT_TASKS OFF CACHE BOOL "" FORCE) + set(DNNL_ENABLE_JIT_PROFILING_DEFAULT ${BUILD_SHARED_LIBS}) + if(BUILD_SHARED_LIBS AND ENABLE_PROFILING_ITT) + set(DNNL_ENABLE_ITT_TASKS_DEFAULT ON) + else() + set(DNNL_ENABLE_ITT_TASKS_DEFAULT OFF) + endif() endif() + + set(CMAKE_DISABLE_FIND_PACKAGE_PythonInterp ON) + set(DNNL_ENABLE_JIT_PROFILING ${DNNL_ENABLE_JIT_PROFILING_DEFAULT} CACHE BOOL "" FORCE) + set(DNNL_ENABLE_ITT_TASKS ${DNNL_ENABLE_ITT_TASKS_DEFAULT} CACHE BOOL "" FORCE) set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE BOOL "" FORCE) set(DNNL_ENABLE_PRIMITIVE_CACHE ON CACHE BOOL "" FORCE) # Enable primitive cache for global sharing set(DNNL_ENABLE_MAX_CPU_ISA ON CACHE BOOL "" FORCE) diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 740795e2ec21b1..48465c1abca47b 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 740795e2ec21b1149e878ecd4424ae03a3544bf3 +Subproject commit 48465c1abca47b82f61656dacdf415f9bd32143d diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt index bd61952be00dd1..d7bb281c48ff55 100644 --- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt +++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt @@ -136,6 +136,8 @@ function(ov_build_onednn_gpu) "-DDNNL_LIBRARY_TYPE=STATIC" "-DDNNL_EXPERIMENTAL_PROFILING=ON" "-DONEDNN_BUILD_GRAPH=OFF" + # avoid searching of PythonInterp in oneDNN docs + "-DCMAKE_DISABLE_FIND_PACKAGE_PythonInterp=ON" # override OpenCL version default set by oneDNN (1.2) "-DOPENCL_VERSION_${ONEDNN_CL_VERSION}=ON" # specifically for Conan, because it overrides CMAKE_PREFIX_PATH and oneDNN's FindOpenCL.cmake is ignored