From bf01c1d1800e337138ea8498cdd5b895e4420046 Mon Sep 17 00:00:00 2001 From: Dennis Krupenik Date: Wed, 1 Jul 2020 02:37:17 +0300 Subject: testing/openvino: new aport Deep Learning Deployment Toolkit https://github.com/openvinotoolkit/openvino Co-authored-by: Leo --- testing/openvino/APKBUILD | 137 +++++++++++++++++++++ testing/openvino/cmake-config.patch | 94 ++++++++++++++ testing/openvino/cmake-dont-force-build-type.patch | 22 ++++ testing/openvino/deprecated-copy.patch | 14 +++ testing/openvino/include-stdexcept.patch | 15 +++ testing/openvino/pessimizing-move.patch | 46 +++++++ 6 files changed, 328 insertions(+) create mode 100644 testing/openvino/APKBUILD create mode 100644 testing/openvino/cmake-config.patch create mode 100644 testing/openvino/cmake-dont-force-build-type.patch create mode 100644 testing/openvino/deprecated-copy.patch create mode 100644 testing/openvino/include-stdexcept.patch create mode 100644 testing/openvino/pessimizing-move.patch (limited to 'testing/openvino') diff --git a/testing/openvino/APKBUILD b/testing/openvino/APKBUILD new file mode 100644 index 00000000000..75e02e73196 --- /dev/null +++ b/testing/openvino/APKBUILD @@ -0,0 +1,137 @@ +# Contributor: Dennis Krupenik +# Maintainer: Dennis Krupenik +pkgname=openvino +pkgver=2020.4 +_gflags=46f73f88b18aee341538c0dfc22b1710a6abedef +_ade=cbe2db61a659c2cc304c3837406f95c39dfa938e +_googletest=9bd163b993459b2ca6ba2dc508577bbc8774c851 +_onednn=2706f56ebab54415be48add2751072065f4b52ab +pkgrel=0 +pkgdesc="Deep Learning Deployment Toolkit" +url="https://github.com/openvinotoolkit/openvino" +arch="x86_64" +license="Apache-2.0" +depends_dev="libtbb-dev opencl-headers opencl-icd-loader-dev opencv-dev" +makedepends="autoconf automake cmake cython gcompat git libtool python3-dev + py3-setuptools $depends_dev" +subpackages="$pkgname-static py3-$pkgname:py3 $pkgname-dev" +source="$pkgname-$pkgver.tar.gz::https://github.com/openvinotoolkit/openvino/archive/$pkgver.tar.gz + gflags-$_gflags.tar.gz::https://github.com/gflags/gflags/archive/$_gflags.tar.gz + ade-$_ade.tar.gz::https://github.com/opencv/ade/archive/$_ade.tar.gz + googletest-$_googletest.tar.gz::https://github.com/openvinotoolkit/googletest/archive/$_googletest.tar.gz + oneDNN-$_onednn.tar.gz::https://github.com/openvinotoolkit/oneDNN/archive/$_onednn.tar.gz + cmake-config.patch + pessimizing-move.patch + deprecated-copy.patch + cmake-dont-force-build-type.patch + include-stdexcept.patch + " + +prepare() { + # FIXME: use system versions + cp -r "$srcdir"/ade-*/* inference-engine/thirdparty/ade/ + cp -r "$srcdir"/gflags-*/* inference-engine/samples/thirdparty/gflags/ + cp -r "$srcdir"/googletest-*/* inference-engine/tests/ie_test_utils/common_test_utils/gtest/ + cp -r "$srcdir"/oneDNN-*/* inference-engine/thirdparty/mkl-dnn/ + + default_prepare + + sed -e 's|-Werror||g' -i cmake/os_flags.cmake +} + +build() { + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cmake -B build \ + -Wno-dev \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr/openvino \ + -DENABLE_ALTERNATIVE_TEMP=OFF \ + -DENABLE_CLANG_FORMAT=OFF \ + -DENABLE_CPPLINT=OFF \ + -DENABLE_GNA=OFF \ + -DENABLE_MYRIAD=OFF \ + -DENABLE_OPENCV=OFF \ + -DENABLE_PROFILING_ITT=OFF \ + -DENABLE_PYTHON=ON \ + -DENABLE_SAMPLES=OFF \ + -DENABLE_SPEECH_DEMO=OFF \ + -DENABLE_VPU=OFF \ + -DNGRAPH_DYNAMIC_COMPONENTS_ENABLE=OFF \ + -DNGRAPH_EXPORT_TARGETS_ENABLE=OFF \ + -DNGRAPH_IE_ENABLE=ON \ + -DNGRAPH_JSON_ENABLE=OFF \ + -DNGRAPH_ONNX_IMPORT_ENABLE=OFF \ + -DNGRAPH_PYTHON_BUILD_ENABLE=OFF \ + -DNGRAPH_TEST_UTIL_ENABLE=OFF \ + -DNGRAPH_UNIT_TEST_ENABLE=OFF \ + -DOpenCV_DIR=/usr/lib/cmake/opencv4 \ + -DTBB_DIR=/usr/lib/cmake/TBB \ + -DNGRAPH_WARNINGS_AS_ERRORS=False \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS -Wno-error" \ + -DTHREADING=TBB \ + $CMAKE_CROSSOPTS . + make -C build +} + +check() { + CTEST_OUTPUT_ON_FAILURE=1 make -C build test +} + +package() { + make -C build DESTDIR="$pkgdir" install + + cd "$pkgdir" + mkdir -p usr/bin usr/include usr/lib usr/share/openvino + + mv usr/openvino/include/* usr/include/ + mv usr/openvino/deployment_tools/inference_engine/include/* usr/include/ + + mv usr/openvino/deployment_tools/inference_engine/lib/intel64/compile_tool usr/bin/ + mv usr/openvino/deployment_tools/inference_engine/lib/intel64/*.so usr/lib/ + mv usr/openvino/deployment_tools/inference_engine/lib/intel64/cache.json usr/share/openvino + mv usr/openvino/deployment_tools/inference_engine/lib/intel64/plugins.xml usr/share/openvino + + mv usr/openvino/lib*/* usr/lib/ + mv usr/openvino/python/* usr/lib/ + + mv usr/openvino/share/* usr/share/ + mv usr/openvino/deployment_tools/inference_engine/share/* usr/share/ + + rm -rf usr/openvino + + # These are part of third-party packages and should not be included + rm -rf usr/include/pugiconfig.hpp usr/include/pugixml.hpp + rm -rf usr/include/clDNN usr/include/cldnn + rm -rf usr/include/ade + rm -rf usr/lib/cmake/ade + rm -rf usr/lib/cmake/pugixml + rm -rf usr/lib/pkgconfig/gflags.pc +} + +dev() { + default_dev + + mkdir -p "$subpkgdir"/usr/lib/cmake/InferenceEngine + mv "$pkgdir"/usr/share/InferenceEngine*.cmake "$subpkgdir"/usr/lib/cmake/InferenceEngine/ + mv "$pkgdir"/usr/share/ie_parallel.cmake "$subpkgdir"/usr/lib/cmake/InferenceEngine/ +} + +py3() { + pkgdesc="$pkgname python bindings" + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/ +} + +sha512sums="67cfe44f587f1b5a96cac3d0dbfbf299e09d47afef626d2a56e0ea8fbe7c24a06bc1ae8fb2c3c3f634637f34826b5a9eb53190697587f966b4140b8400061a6f openvino-2020.4.tar.gz +cf4ba466421959b4be24efa9304f32d831a24e57b6a88d1806b232bf564a67d63a1012c6e6ce7af1ecb1fb70933bc8135b02aa72fdfd10d1bad531ce215e53aa gflags-46f73f88b18aee341538c0dfc22b1710a6abedef.tar.gz +32453e59c3d176bc31b0a55d30667f528bee19979728d8cdeb6fd8fe7143a3b9d0bf15f36ca31b2204570164a0c234702b6f5b4201061760e4edcaed664715f6 ade-cbe2db61a659c2cc304c3837406f95c39dfa938e.tar.gz +130a7a751fb40c55309c5b41ca8d56540e5533d922a811eb01991ac66064c37e52c00bc303d34ccb4eb3847ee8fbcf0e39bd71d05b8c02e8490f31c459c95175 googletest-9bd163b993459b2ca6ba2dc508577bbc8774c851.tar.gz +b099fc26d3ea36ebfe8a8f8c93a7cf2d6c51196a71752c316813dd671936367bbe82aaee0b7cbc761e9d671909d53ff8b77c32f1428cb7ac5087a489f5ff2b8a oneDNN-2706f56ebab54415be48add2751072065f4b52ab.tar.gz +b6347720e08746a4fdbb6e09691644597c900a6c440283baac6b1008399c78c5c34157dbfdb21476a71a7c4fd47c2912c7a7629076761d1bcb26d2a34ba73ba8 cmake-config.patch +9a93c41120189166bfcd5986954de812ebb16e429711b3f637907d2abf79dab75aac55eb1ee04ccbcee06e47709c3dcdd22b56aef89e64bb82b30fa10ca3dfd2 pessimizing-move.patch +d02374561f469f5818a9c76e697d68a84550c191459a2b4f9c7085f5b5e39eb6767a143e281dc0952a950cc7de12e11dd4a4602082f596553e2755c20a7a4867 deprecated-copy.patch +9744e36e5f75d0b39e2862eb2fd6bd5cededda120775e2bd47a039e39f3a9594a6d900d5d060117bdfa1f733ecd08691aa709841f3c89d258b005fd5a9fdfb84 cmake-dont-force-build-type.patch +23b051129678fd790de975f9fdbd0fd7ffdc0dd4de772b7883ffd90bc670eb62292e561b0db72468e8e142701cf3befcefeb2d17020e8eca10ffefcb841b136b include-stdexcept.patch" diff --git a/testing/openvino/cmake-config.patch b/testing/openvino/cmake-config.patch new file mode 100644 index 00000000000..b1c8683787a --- /dev/null +++ b/testing/openvino/cmake-config.patch @@ -0,0 +1,94 @@ +Fix CMake scripts +--- +--- a/docs/template_extension/CMakeLists.txt ++++ b/docs/template_extension/CMakeLists.txt +@@ -5,7 +5,10 @@ + # [cmake:extension] + set(TARGET_NAME "template_extension") + +-find_package(ngraph REQUIRED) ++find_package(ngraph QUIET) ++if(NOT ngraph_FOUND) ++ set(ngraph_DIR ${CMAKE_BINARY_DIR}/ngraph) ++endif() + find_package(InferenceEngine REQUIRED) + + file(GLOB_RECURSE SRC *.cpp) +--- a/inference-engine/thirdparty/clDNN/CMakeLists.txt ++++ b/inference-engine/thirdparty/clDNN/CMakeLists.txt +@@ -465,8 +465,8 @@ + # ====================================================================================================== + + # Check for python 2.7 interpreter (required tool). +-find_package(PythonInterp 2.7) +-if(NOT PYTHONINTERP_FOUND) ++find_package(Python) ++if(NOT Python_FOUND) + message(WARNING "[clDNN] Project requires Python 2.7 interpreter to build (with python loader). CMake could not detect it correctly. + If you have installed this interpreter, please disregard this warning or specify PYTHON_EXECUTABLE in CMake command-line." + ) + +--- a/inference-engine/thirdparty/clDNN/kernel_selector/CMakeLists.txt ++++ b/inference-engine/thirdparty/clDNN/kernel_selector/CMakeLists.txt +@@ -167,7 +167,7 @@ + # =================================== Custom pre- and post-steps ======================================= + add_custom_command(OUTPUT "${__CLDNN_CGDirectory__cg_cache}/${__CLDNN_File__cg_cache__prim_db}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${__CLDNN_CGDirectory__cg_cache}" +- COMMAND "${PYTHON_EXECUTABLE}" "${__CLDNN_Directory__core_common}/primitive_db_gen.py" -out_path "${__CLDNN_CGDirectory__cg_cache}" -out_file_name "${__CLDNN_File__cg_cache__prim_db}" -kernels "${__CLDNN_Directory__cl_kernels}" ++ COMMAND "${Python_EXECUTABLE}" "${__CLDNN_Directory__core_common}/primitive_db_gen.py" -out_path "${__CLDNN_CGDirectory__cg_cache}" -out_file_name "${__CLDNN_File__cg_cache__prim_db}" -kernels "${__CLDNN_Directory__cl_kernels}" + DEPENDS ${__CLDNN_Sources__cl_kernels} "${__CLDNN_Directory__core_common}/primitive_db_gen.py" + COMMENT "Generating ${__CLDNN_File__cg_cache__prim_db} ..." + ) + +--- a/ngraph/CMakeLists.txt ++++ b/ngraph/CMakeLists.txt +@@ -258,13 +258,8 @@ + set(NGRAPH_INSTALL_DOC "${NGRAPH_COMPONENT_PREFIX}${CMAKE_INSTALL_DOCDIR}") + set(NGRAPH_INSTALL_BIN "${NGRAPH_COMPONENT_PREFIX}${CMAKE_INSTALL_BINDIR}") + if (LINUX) +- if (DEFINED NGRAPH_RPATH) +- set(CMAKE_BUILD_RPATH "$ORIGIN:${NGRAPH_RPATH}") +- set(CMAKE_INSTALL_RPATH "$ORIGIN:${NGRAPH_RPATH}") +- else() +- set(CMAKE_BUILD_RPATH "$ORIGIN") +- set(CMAKE_INSTALL_RPATH "$ORIGIN") +- endif() ++ set(CMAKE_BUILD_RPATH "$ORIGIN") ++ set(CMAKE_INSTALL_RPATH "$ORIGIN") + endif() + + #----------------------------------------------------------------------------------------------- + +--- a/inference-engine/src/inference_engine/CMakeLists.txt ++++ b/inference-engine/src/inference_engine/CMakeLists.txt +@@ -230,30 +230,6 @@ + + list(APPEND core_components ngraph) + +-if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO") +- ie_cpack_add_component(tbb REQUIRED) +- list(APPEND core_components tbb) +- +- install(DIRECTORY "${TBB}/include" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- install(DIRECTORY "${TBB}/lib" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- if(EXISTS "${TBB}/bin") +- install(DIRECTORY "${TBB}/bin" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- endif() +- install(FILES "${TBB}/LICENSE" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb +- COMPONENT tbb) +- install(FILES "${TBB}/cmake/TBBConfig.cmake" +- "${TBB}/cmake/TBBConfigVersion.cmake" +- DESTINATION ${IE_CPACK_IE_DIR}/external/tbb/cmake +- COMPONENT tbb) +-endif() +- + ie_cpack_add_component(core REQUIRED DEPENDS ${core_components}) + + install(DIRECTORY "${IE_MAIN_SOURCE_DIR}/include" DESTINATION ${IE_CPACK_IE_DIR} diff --git a/testing/openvino/cmake-dont-force-build-type.patch b/testing/openvino/cmake-dont-force-build-type.patch new file mode 100644 index 00000000000..0b7ca5d590f --- /dev/null +++ b/testing/openvino/cmake-dont-force-build-type.patch @@ -0,0 +1,22 @@ +Upstream: No +Reason: We use BUILD_TYPE=None + +diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt +index 356ce18..1c4984f 100644 +--- a/ngraph/CMakeLists.txt ++++ b/ngraph/CMakeLists.txt +@@ -23,14 +23,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "In-source builds are not allowed.") + endif() + +-if (CMAKE_BUILD_TYPE) +- set(RELEASE_TYPES Debug Release RelWithDebInfo MinSizeRel) +- list(FIND RELEASE_TYPES ${CMAKE_BUILD_TYPE} INDEX_FOUND) +- if (${INDEX_FOUND} EQUAL -1) +- message(FATAL_ERROR "CMAKE_BUILD_TYPE must be one of Debug, Release, RelWithDebInfo, or MinSizeRel") +- endif() +-endif() +- + include(git_tags) + include(var_functions) + diff --git a/testing/openvino/deprecated-copy.patch b/testing/openvino/deprecated-copy.patch new file mode 100644 index 00000000000..a63b0c74e63 --- /dev/null +++ b/testing/openvino/deprecated-copy.patch @@ -0,0 +1,14 @@ +Fix error: implicitly-declared 'constexpr ...' is deprecated [-Werror=deprecated-copy] +--- +--- a/inference-engine/thirdparty/clDNN/src/gpu/memory_gpu.cpp ++++ b/inference-engine/thirdparty/clDNN/src/gpu/memory_gpu.cpp +@@ -127,8 +127,7 @@ + CLDNN_ERROR_MESSAGE("2D image allocation", "unsupported image type!"); + } + +- cl::ImageFormat imageFormat(order, type); +- _buffer = cl::Image2D(_context->context(), CL_MEM_READ_WRITE, imageFormat, _width, _height, 0); ++ _buffer = cl::Image2D(_context->context(), CL_MEM_READ_WRITE, cl::ImageFormat(order, type), _width, _height, 0); + + if (reset) zero_image(); + } diff --git a/testing/openvino/include-stdexcept.patch b/testing/openvino/include-stdexcept.patch new file mode 100644 index 00000000000..b8baf987936 --- /dev/null +++ b/testing/openvino/include-stdexcept.patch @@ -0,0 +1,15 @@ +Upstream: Should be +Reason: Fixes compilation by making std::runtime_error available + +diff --git a/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h b/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h +index 3dbdfd0..2226f1a 100644 +--- a/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h ++++ b/inference-engine/thirdparty/clDNN/kernel_selector/common/tensor_type.h +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + namespace kernel_selector { + #define KERNEL_SELECTOR_TENSOR_DIM_MAX 9 diff --git a/testing/openvino/pessimizing-move.patch b/testing/openvino/pessimizing-move.patch new file mode 100644 index 00000000000..8a078cf59bf --- /dev/null +++ b/testing/openvino/pessimizing-move.patch @@ -0,0 +1,46 @@ +Fix error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] +--- +--- a/inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp ++++ b/inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp +@@ -138,7 +138,7 @@ + } + } + +- return std::move(ret); ++ return ret; + } + + void ExecutionEngine::addExecutableDependency(const std::string& lazyPassName) + +--- a/inference-engine/thirdparty/clDNN/kernel_selector/core/actual_kernels/fully_connected/fully_connected_kernel_fs_byx_fsv32.cpp ++++ b/inference-engine/thirdparty/clDNN/kernel_selector/core/actual_kernels/fully_connected/fully_connected_kernel_fs_byx_fsv32.cpp +@@ -60,7 +60,7 @@ + + runInfo.efficiency = FORCE_PRIORITY_5; + +- return std::move(runInfo); ++ return runInfo; + } + + JitConstants FullyConnected_fs_byx_fsv32::GetJitConstants(const fully_connected_params& params, + +--- a/inference-engine/thirdparty/clDNN/src/gpu/kernels_cache.cpp ++++ b/inference-engine/thirdparty/clDNN/src/gpu/kernels_cache.cpp +@@ -74,7 +74,7 @@ + undefs += "#endif\n"; + } + +- return std::move(undefs); ++ return undefs; + } + + std::string reorder_options(const std::string& org_options) { +@@ -159,7 +159,7 @@ + current_bucket.kernels_counter++; + } + +- return std::move(scode); ++ return scode; + } + + kernels_cache::kernels_cache(gpu_toolkit& context, uint32_t prog_id) : _context(context), _prog_id(prog_id) {} -- cgit v1.2.3