Skip to content

Commit

Permalink
Merge branch 'master' into feature/deprecation-function
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianboguszewski authored Aug 16, 2022
2 parents ccfab41 + 2e7284c commit d5c4c99
Show file tree
Hide file tree
Showing 276 changed files with 5,745 additions and 3,629 deletions.
2 changes: 1 addition & 1 deletion .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements.txt
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/wheel/requirements-dev.txt
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/requirements.txt
# For running Python API tests
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
# For running Paddle frontend unit tests
Expand Down Expand Up @@ -164,7 +165,6 @@ jobs:
-DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS)
-DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS)
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
-DENABLE_WHEEL=ON
-DENABLE_TESTS=ON
-DENABLE_OV_ONNX_FRONTEND=ON
-DENABLE_FASTER_BUILD=ON
Expand Down
4 changes: 2 additions & 2 deletions .ci/azure/linux_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements.txt
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/wheel/requirements-dev.txt
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/requirements.txt
# For running Python API tests
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
# For running Paddle frontend unit tests
Expand Down Expand Up @@ -142,7 +143,6 @@ jobs:
-DENABLE_PYTHON=ON
-DENABLE_OPENCV=OFF
-DPYTHON_EXECUTABLE=/usr/bin/python3.8
-DENABLE_WHEEL=ON
-DENABLE_TESTS=ON
-DENABLE_FASTER_BUILD=ON
-DENABLE_STRICT_DEPENDENCIES=OFF
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
sudo apt-get install --no-install-recommends gnupg -y
echo "deb https://apt.repos.intel.com/openvino/2022 focal main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2022.list
sudo apt-get update -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/intel-openvino-2022.list
# sudo apt-get install openvino -y
sudo apt-get install openvino -y
# install our local one and make sure the conflicts are resolved
sudo apt-get install --no-install-recommends dpkg-dev -y
rm -r _CPack_Packages
Expand Down
1 change: 0 additions & 1 deletion .ci/azure/linux_lohika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
# -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
# -DENABLE_PYTHON=ON
# -DPYTHON_EXECUTABLE=/usr/bin/python3.8
# -DENABLE_WHEEL=ON
# -DENABLE_TESTS=ON
# -DENABLE_OV_ONNX_FRONTEND=ON
# -DENABLE_FASTER_BUILD=ON
Expand Down
4 changes: 2 additions & 2 deletions .ci/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ jobs:
rem For running Python API tests
python -m pip install -r $(REPO_DIR)\src\bindings\python\src\compatibility\openvino\requirements-dev.txt
python -m pip install -r $(REPO_DIR)\src\bindings\python\wheel\requirements-dev.txt
python -m pip install -r $(REPO_DIR)\src\bindings\python\requirements.txt
rem For running Paddle frontend unit tests
python -m pip install -r $(REPO_DIR)\src\core\tests\frontend\paddle\requirements_dev.txt
rem For running ONNX frontend unit tests
Expand All @@ -136,7 +137,6 @@ jobs:
- script: |
set PATH=$(WORK_DIR)\ninja-win;%PATH%
call "$(MSVS_VARS_PATH)" && $(CMAKE_CMD) -G "Ninja Multi-Config" ^
-DENABLE_WHEEL=ON ^
-DENABLE_ONEDNN_FOR_GPU=$(CMAKE_BUILD_SHARED_LIBS) ^
-DBUILD_SHARED_LIBS=$(CMAKE_BUILD_SHARED_LIBS) ^
-DENABLE_REQUIREMENTS_INSTALL=OFF ^
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
-DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" ^
-S $(REPO_DIR)\tests\samples_tests ^
-B $(BUILD_SAMPLES_TESTS_DIR)
displayName: 'CMake'
displayName: 'CMake Samples Tests'
- script: $(CMAKE_CMD) -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_SAMPLES_TESTS_DIR)\cmake_install.cmake
displayName: 'Install Samples Tests'
Expand Down
3 changes: 0 additions & 3 deletions .ci/openvino-onnx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ RUN cmake .. \
-DENABLE_INTEL_GPU=OFF \
-DENABLE_PROFILING_ITT=OFF \
-DENABLE_SAMPLES=OFF \
-DENABLE_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DENABLE_OV_ONNX_FRONTEND=ON \
-DENABLE_OV_PADDLE_FRONTEND=OFF \
-DENABLE_OV_TF_FRONTEND=OFF \
-DENABLE_OPENVINO_DEBUG=OFF \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/py_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'samples/python/**'
jobs:
linters:
runs-on: ubuntu-22.04
runs-on: ubuntu-18.04
steps:
- name: Code checkout
uses: actions/checkout@v2
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
python-version: '3.6'
- name: Install dependencies
run: python -m pip install -r src/bindings/python/requirements_test.txt
# samples code-style
Expand Down
41 changes: 1 addition & 40 deletions cmake/developer_package/IEDevScriptsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,46 +275,7 @@ function(ov_mark_target_as_cc)
ie_mark_target_as_cc(${ARGN})
endfunction()

# check python package

function(ie_check_pip_package full_name message_type)
find_package(PythonInterp 3 REQUIRED)

get_filename_component(PYTHON_EXEC_DIR ${PYTHON_EXECUTABLE} DIRECTORY)

# extract version if any
if(full_name MATCHES "^([a-z_]+)[~=<>!]*(.*)$")
set(name ${CMAKE_MATCH_1})
set(req_version ${CMAKE_MATCH_2})
else()
set(name ${full_name})
endif()

execute_process(
COMMAND ${PYTHON_EXECUTABLE} -m pip show ${name}
WORKING_DIRECTORY ${PYTHON_EXEC_DIR}
RESULT_VARIABLE PIP_EXIT_CODE
OUTPUT_VARIABLE output)

if(NOT PIP_EXIT_CODE EQUAL 0)
set(${name}_FOUND OFF PARENT_SCOPE)
message(${message_type} "${name} package is not installed. Please use \"${PYTHON_EXECUTABLE} -m pip install ${full_name}\".")
else()
if(req_version)
string(REGEX MATCH "Version: ([0-9]+\.?[0-9]*\.?[0-9]*)\n" installed_version "${output}")
if(installed_version)
set(installed_version "${CMAKE_MATCH_1}")
endif()

if(NOT req_version STREQUAL installed_version)
message(${message_type} "${name} package is installed, but may have different version (${installed_version}). "
"Please use \"${PYTHON_EXECUTABLE} -m pip install ${full_name}\".")
endif()
else()
set(${name}_FOUND ON PARENT_SCOPE)
endif()
endif()
endfunction()
include(python_requirements)

# Code style utils

Expand Down
18 changes: 10 additions & 8 deletions cmake/developer_package/ncc_naming_style/ncc_naming_style.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0
#

if(NOT COMMAND ie_check_pip_package)
message(FATAL_ERROR "ncc_naming_style.cmake must be included after ie_check_pip_package")
if(NOT COMMAND ov_check_pip_packages)
message(FATAL_ERROR "Internal error: ncc_naming_style.cmake must be included after ov_check_pip_packages")
endif()

set(ncc_style_dir "${IEDevScripts_DIR}/ncc_naming_style")
Expand Down Expand Up @@ -72,12 +72,14 @@ if(NOT EXISTS ${ncc_script_py})
endif()

if(ENABLE_NCC_STYLE)
set(req_file "${ncc_style_dir}/requirements_dev.txt")
file(STRINGS ${req_file} req_lines)

foreach(req IN LISTS req_lines)
ie_check_pip_package(${req} STATUS)
endforeach()
ov_check_pip_packages(REQUIREMENTS_FILE "${ncc_style_dir}/requirements_dev.txt"
RESULT_VAR python_clang_FOUND
WARNING_MESSAGE "NCC style check will be unavailable"
MESSAGE_MODE WARNING)
if(NOT python_clang_FOUND)
# Note: warnings is already thrown by `ov_check_pip_packages`
set(ENABLE_NCC_STYLE OFF)
endif()
endif()

# create high-level target
Expand Down
112 changes: 112 additions & 0 deletions cmake/developer_package/python_requirements.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

#
# ov_check_pip_package(REQUIREMENT <single requirement>
# RESULT_VAR <result var name>
# [WARNING_MESSAGE <message>]
# [MESSAGE_MODE <WARNING | FATAL_ERROR | TRACE>])
#
function(ov_check_pip_package)
find_package(PythonInterp 3 QUIET)

set(oneValueOptionalArgs
MESSAGE_MODE # Set the type of message: { FATAL_ERROR | WARNING | ... }
WARNING_MESSAGE # callback message
)
set(oneValueRequiredArgs
REQUIREMENT # Requirement-specifier to check
RESULT_VAR # Result varibale to set return code {ON | OFF}
)
set(multiValueArgs)

cmake_parse_arguments(ARG "" "${oneValueRequiredArgs};${oneValueOptionalArgs}" "${multiValueArgs}" ${ARGN})

foreach(argName ${oneValueRequiredArgs})
if (NOT ARG_${argName})
message(SEND_ERROR "Argument '${argName}' is required.")
endif()
endforeach()

if(NOT ARG_MESSAGE_MODE)
set(ARG_MESSAGE_MODE WARNING)
elseif(CMAKE_VERSION VERSION_LESS 3.15 AND ARG_MESSAGE_MODE STREQUAL "TRACE")
set(ARG_MESSAGE_MODE WARNING)
endif()

if(ARG_UNPARSED_ARGUMENTS)
message(SEND_ERROR "Unexpected parameters have passed to the function: ${ARG_UNPARSED_ARGUMENTS}")
endif()

# quote '3.x' with \'3.x\'
string(REPLACE "'" "\\'" REQ "${ARG_REQUIREMENT}")

if(PYTHONINTERP_FOUND)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import pkg_resources ; pkg_resources.require('${REQ}')"
RESULT_VARIABLE EXIT_CODE
OUTPUT_VARIABLE OUTPUT_TEXT
ERROR_VARIABLE ERROR_TEXT)
endif()

if(NOT EXIT_CODE EQUAL 0)
set(${ARG_RESULT_VAR} OFF PARENT_SCOPE)
message(${ARG_MESSAGE_MODE} "Python module '${REQ}' is missed, ${ARG_WARNING_MESSAGE}")
else()
set(${ARG_RESULT_VAR} ON PARENT_SCOPE)
endif()
endfunction()

#
# ov_check_pip_packages(REQUIREMENTS_FILE <requirements.txt file>
# RESULT_VAR <result var name>
# [WARNING_MESSAGE <message>]
# [MESSAGE_MODE <WARNING | FATAL_ERROR | TRACE>])
#
function(ov_check_pip_packages)
find_package(PythonInterp 3 QUIET)

set(oneValueOptionalArgs
MESSAGE_MODE # Set the type of message: { FATAL_ERROR | WARNING | ... }
WARNING_MESSAGE # callback message
)
set(oneValueRequiredArgs
REQUIREMENTS_FILE # File with requirement-specifiers to check
RESULT_VAR # Result varibale to set return code {ON | OFF}
)
set(multiValueArgs)

cmake_parse_arguments(ARG "" "${oneValueOptionalArgs};${oneValueRequiredArgs}" "${multiValueArgs}" ${ARGN})

foreach(argName ${oneValueRequiredArgs})
if (NOT ARG_${argName})
message(SEND_ERROR "Argument '${argName}' is required.")
endif()
endforeach()

if(NOT ARG_MESSAGE_MODE)
set(ARG_MESSAGE_MODE WARNING)
elseif(CMAKE_VERSION VERSION_LESS 3.15 AND ARG_MESSAGE_MODE STREQUAL "TRACE")
set(ARG_MESSAGE_MODE WARNING)
endif()

if(ARG_UNPARSED_ARGUMENTS)
message(SEND_ERROR "Unexpected parameters have passed to the function: ${ARG_UNPARSED_ARGUMENTS}")
endif()

if(PYTHONINTERP_FOUND)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import pkg_resources ; pkg_resources.require(open('${ARG_REQUIREMENTS_FILE}', mode='r'))"
RESULT_VARIABLE EXIT_CODE
OUTPUT_VARIABLE OUTPUT_TEXT
ERROR_VARIABLE ERROR_TEXT)
endif()

if(NOT EXIT_CODE EQUAL 0)
set(${ARG_RESULT_VAR} OFF PARENT_SCOPE)
message(${ARG_MESSAGE_MODE} "Python requirement file ${ARG_REQUIREMENTS_FILE} is not installed, ${ARG_WARNING_MESSAGE}")
else()
set(${ARG_RESULT_VAR} ON PARENT_SCOPE)
endif()
endfunction()
9 changes: 0 additions & 9 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,9 @@ Usage: -DSELECTIVE_BUILD=ON -DSELECTIVE_BUILD_STAT=/path/*.csv" OFF

ie_option(ENABLE_ERROR_HIGHLIGHT "Highlight errors and warnings during compile time" OFF)

# Try to find python3
find_package(PythonLibs 3 QUIET)
ie_dependent_option (ENABLE_PYTHON "enables ie python bridge build" OFF "PYTHONLIBS_FOUND" OFF)

find_package(PythonInterp 3 QUIET)
ie_dependent_option (ENABLE_DOCS "Build docs using Doxygen" OFF "PYTHONINTERP_FOUND" OFF)

# this option should not be a part of InferenceEngineDeveloperPackage
# since wheels can be built only together with main OV build
cmake_dependent_option (ENABLE_WHEEL "Build wheel packages for PyPi" OFF
"PYTHONINTERP_FOUND;CMAKE_SOURCE_DIR STREQUAL OpenVINO_SOURCE_DIR" OFF)

#
# Inference Engine specific options
#
Expand Down
3 changes: 2 additions & 1 deletion cmake/packaging/debian.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ macro(ov_cpack_settings)
set(CPACK_COMPONENT_LIBRARIES_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_LIBRARIES_DEV_DEPENDS "core_dev;libraries")
set(CPACK_DEBIAN_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-dev-${cpack_name_ver}")
# ov_debian_generate_conflicts(libraries_dev ${conflicting_versions})
ov_debian_generate_conflicts(libraries_dev ${conflicting_versions})
ov_debian_add_lintian_suppression(libraries_dev
# it's umbrella package
"empty-binary-package")
Expand All @@ -272,6 +272,7 @@ macro(ov_cpack_settings)
set(CPACK_COMPONENT_OPENVINO_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_OPENVINO_DEPENDS "libraries_dev;samples;python_samples")
set(CPACK_DEBIAN_OPENVINO_PACKAGE_NAME "openvino-${cpack_name_ver}")
ov_debian_generate_conflicts(openvino ${conflicting_versions})
ov_debian_add_lintian_suppression(openvino
# it's umbrella package
"empty-binary-package")
Expand Down
1 change: 1 addition & 0 deletions docs/OV_Runtime_UG/supported_plugins/GPU.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ All parameters must be set before calling `ov::Core::compile_model()` in order t
- ov::hint::model_priority
- ov::hint::performance_mode
- ov::hint::num_requests
- ov::hint::inference_precision
- ov::num_streams
- ov::compilation_num_threads
- ov::device::id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST_P(OVInferRequestBatchedTests, SetInputTensors_Batch_Non_0) {
auto batch_shape = Shape{batch, 3, 3, 3};
auto model = OVInferRequestBatchedTests::create_n_inputs(1, element::f32, batch_shape, "CNHW");
const std::string tensor_name = "tensor_input0";
auto execNet = ie->compile_model(model, targetDevice);
auto execNet = ie->compile_model(model, target_device);
ov::InferRequest req;
req = execNet.create_infer_request();
std::vector<ov::Tensor> tensors(batch, ov::Tensor(element::f32, one_shape));
Expand All @@ -31,7 +31,7 @@ TEST_P(OVInferRequestBatchedTests, SetInputTensors_remote_tensor_default) {
auto batch_shape = Shape{batch, 4, 4, 4};
auto model = OVInferRequestBatchedTests::create_n_inputs(1, element::f32, batch_shape, "NCHW");
const std::string tensor_name = "tensor_input0";
auto execNet = ie->compile_model(model, targetDevice);
auto execNet = ie->compile_model(model, target_device);
ov::InferRequest req;
req = execNet.create_infer_request();
std::vector<ov::Tensor> tensors(batch - 1, ov::Tensor(element::f32, one_shape));
Expand All @@ -49,7 +49,7 @@ TEST_P(OVInferRequestBatchedTests, SetInputTensors_Strides) {
auto model = OVInferRequestBatchedTests::create_n_inputs(2, element::f32, batch_shape, "NCHW");
std::vector<float> buffer1(one_shape_size_stride, 10);
std::vector<float> buffer2(one_shape_size_stride, 20);
auto execNet = ie->compile_model(model, targetDevice);
auto execNet = ie->compile_model(model, target_device);
// Create InferRequest
ov::InferRequest req;
req = execNet.create_infer_request();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ INSTANTIATE_TEST_SUITE_P(
// IE Class SetConfig
//

using IEClassSetConfigTestHETERO = BehaviorTestsUtils::IEClassNetworkTest;
class IEClassSetConfigTestHETERO : public BehaviorTestsUtils::IEClassNetworkTest,
public BehaviorTestsUtils::IEPluginTestBase {
void SetUp() override {
IEClassNetworkTest::SetUp();
IEPluginTestBase::SetUp();
}
};

TEST_F(IEClassSetConfigTestHETERO, smoke_SetConfigNoThrow) {
{
Expand Down Expand Up @@ -115,7 +121,13 @@ INSTANTIATE_TEST_SUITE_P(
smoke_IEClassGetConfigTest, IEClassGetConfigTest,
::testing::Values(CommonTestUtils::DEVICE_TEMPLATE));

using IEClassGetConfigTestTEMPLATE = BehaviorTestsUtils::IEClassNetworkTest;
class IEClassGetConfigTestTEMPLATE : public BehaviorTestsUtils::IEClassNetworkTest,
public BehaviorTestsUtils::IEPluginTestBase {
void SetUp() override {
IEClassNetworkTest::SetUp();
IEPluginTestBase::SetUp();
}
};

TEST_F(IEClassGetConfigTestTEMPLATE, smoke_GetConfigNoThrow) {
InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate();
Expand Down
Loading

0 comments on commit d5c4c99

Please sign in to comment.