Skip to content

Commit

Permalink
Introduce protopipe (#27087)
Browse files Browse the repository at this point in the history
### Details:
 - Publishing protopipe to open-source 

### Tickets:
 - E-143100
  • Loading branch information
Maxim-Doronin authored Oct 18, 2024
1 parent 923909f commit 1fea20e
Show file tree
Hide file tree
Showing 59 changed files with 6,327 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
[submodule "src/plugins/intel_npu/thirdparty/level-zero-ext"]
path = src/plugins/intel_npu/thirdparty/level-zero-ext
url = https://github.com/intel/level-zero-npu-extensions.git
[submodule "src/plugins/intel_npu/thirdparty/yaml-cpp"]
path = src/plugins/intel_npu/thirdparty/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
[submodule "thirdparty/telemetry"]
path = thirdparty/telemetry
url = https://github.com/openvinotoolkit/telemetry.git
Expand Down
1 change: 1 addition & 0 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(shellcheck_skip_list
"${OpenVINO_SOURCE_DIR}/thirdparty"
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_cpu/thirdparty"
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_gpu/thirdparty"
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_npu/thirdparty"
"${OpenVINO_SOURCE_DIR}/src/bindings/python/thirdparty/pybind11"
"${TEMP}")

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/intel_npu/cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ if(NOT BUILD_SHARED_LIBS AND NOT ENABLE_MLIR_COMPILER AND NOT ENABLE_DRIVER_COMP
endif()

ov_dependent_option(ENABLE_IMD_BACKEND "Enable InferenceManagerDemo based NPU AL backend" OFF "NOT WIN32;NOT CMAKE_CROSSCOMPILING" OFF)

ov_dependent_option(ENABLE_INTEL_NPU_PROTOPIPE "Enable Intel NPU Protopipe tool" ON "ENABLE_INTEL_NPU_INTERNAL" OFF)
12 changes: 12 additions & 0 deletions src/plugins/intel_npu/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@ if(ENABLE_ZEROAPI_BACKEND)
add_library(LevelZero::NPUExt ALIAS level-zero-ext)
install(TARGETS level-zero-ext EXPORT "${PROJECT_NAME}Targets")
endif()

#
# yaml-cpp
#

if(ENABLE_INTEL_NPU_PROTOPIPE)
add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
# NB: Suppress warnings in yaml-cpp
if(SUGGEST_OVERRIDE_SUPPORTED)
target_compile_options(yaml-cpp PRIVATE -Wno-suggest-override)
endif()
endif()
1 change: 1 addition & 0 deletions src/plugins/intel_npu/thirdparty/yaml-cpp
Submodule yaml-cpp added at da82fd
4 changes: 4 additions & 0 deletions src/plugins/intel_npu/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
add_subdirectory(common)
add_subdirectory(compile_tool)
add_subdirectory(single-image-test)

if (ENABLE_INTEL_NPU_PROTOPIPE)
add_subdirectory(protopipe)
endif()
72 changes: 72 additions & 0 deletions src/plugins/intel_npu/tools/protopipe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Copyright (C) 2023-2024 Intel Corporation.
# SPDX-License-Identifier: Apache 2.0
#

set(TARGET_NAME protopipe)

if (NOT DEFINED PROJECT_NAME)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
project(protopipe_standalone)
include("cmake/standalone.cmake")
return()
endif()

#
# Dependencies
#

find_package(OpenCV QUIET COMPONENTS gapi)
if(OpenCV_VERSION VERSION_LESS 4.9)
message(STATUS "NPU ${TARGET_NAME} tool is disabled due to missing dependencies: gapi from OpenCV >= 4.9.")
return()
endif()

if (WIN32)
# WA: add_tool_target expects to have all dependencies as cmake targets.
add_library(winmm INTERFACE)
target_link_libraries(winmm INTERFACE "winmm.lib")
endif()

#
# Define the target
#

set(PROTOPIPE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)

ov_add_target(ADD_CPPLINT
TYPE EXECUTABLE
NAME ${TARGET_NAME}
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
ADDITIONAL_SOURCE_DIRS ${PROTOPIPE_SOURCE_DIR}
INCLUDES ${PROTOPIPE_SOURCE_DIR}
LINK_LIBRARIES
PRIVATE
Threads::Threads
gflags
yaml-cpp
openvino::runtime
opencv_gapi
winmm)



set_target_properties(${TARGET_NAME} PROPERTIES
FOLDER ${CMAKE_CURRENT_SOURCE_DIR}
CXX_STANDARD 17)

#
# Install
#

install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION "tools/${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()
Loading

0 comments on commit 1fea20e

Please sign in to comment.