Skip to content

Commit

Permalink
Port fixes from master to 2022.3 LTS (#20125)
Browse files Browse the repository at this point in the history
* Backport Robust detection of Cython version (#19537) (#19547)

* Robust detection of Cython version (#19537)

* Aligned protobuf version in conanfile.txt with onnx recipe (#19525)

---------

Co-authored-by: Ilya Lavrenov <[email protected]>

* Fixed order of dependent cmake options (#19551)

* Fixed order of dependent cmake options

* Update .ci/azure/linux_cuda.yml

fixed typo in option name

* resolve gil (#19631)

* Fixed NCC style check (#20121)

---------

Co-authored-by: Przemyslaw Wysocki <[email protected]>
Co-authored-by: Anastasia Kuporosova <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent 3881079 commit 5004f55
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions .ci/azure/linux_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ jobs:
-DENABLE_PYTHON=OFF
-DENABLE_NVIDIA=ON
-DENABLE_TESTS=ON
-DENABLE_DATA=OFF
/root/repos/openvino &&
/root/w/ninja -v CudaFuncTests CudaUnitTests"
workingDirectory: $(WORK_DIR)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ jobs:
- name: Install Clang dependency
run: |
sudo apt update
sudo apt --assume-yes remove clang-7 clang-8 clang-9 clang-10 clang-11 clang-12 clang-13
sudo apt --assume-yes install libclang-14-dev
sudo apt --assume-yes remove clang-7 clang-8 clang-9 clang-10 clang-11 clang-12 clang-13 clang-15
sudo apt --assume-yes install clang-14 libclang-14-dev
- name: Install Python-based dependencies
run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt
Expand Down
4 changes: 2 additions & 2 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ ie_dependent_option (GAPI_TEST_PERF "if GAPI unit tests should examine performan

ie_dependent_option (ENABLE_MYRIAD_MVNC_TESTS "functional and behavior tests for mvnc api" OFF "ENABLE_TESTS;ENABLE_INTEL_MYRIAD" OFF)

ie_dependent_option (ENABLE_DATA "fetch models from testdata repo" ON "ENABLE_FUNCTIONAL_TESTS;NOT ANDROID" OFF)

ie_dependent_option (ENABLE_BEH_TESTS "tests oriented to check OpenVINO Runtime API correctness" ON "ENABLE_TESTS" OFF)

ie_dependent_option (ENABLE_FUNCTIONAL_TESTS "functional tests" ON "ENABLE_TESTS" OFF)

ie_dependent_option (ENABLE_DATA "fetch models from testdata repo" ON "ENABLE_FUNCTIONAL_TESTS;NOT ANDROID" OFF)

ie_option (ENABLE_SAMPLES "console samples are part of OpenVINO Runtime package" ON)

ie_option (ENABLE_OPENCV "enables custom OpenCV download" OFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endif()
include (cmake/UseCython.cmake)

# Check Cython version
if(CYTHON_VERSION VERSION_LESS "0.29")
if(CYTHON_VERSION VERSION_LESS 0.29)
message(FATAL_ERROR "OpenVINO Python API needs at least Cython version 0.29, found version ${CYTHON_VERSION}")
else()
message(STATUS "Found Cython version ${CYTHON_VERSION}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,30 @@ include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )

# Find Cython version
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V ERROR_VARIABLE CYTHON_OUTPUT OUTPUT_QUIET)
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")
execute_process(COMMAND ${CYTHON_EXECUTABLE} -V
ERROR_VARIABLE CYTHON_OUTPUT
OUTPUT_VARIABLE CYTHON_ERROR_MESSAGE
RESULT_VARIABLE CYTHON_EXIT_CODE
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(CYTHON_EXIT_CODE EQUAL 0)
if(NOT CYTHON_OUTPUT)
set(CYTHON_OUTPUT "${CYTHON_ERROR_MESSAGE}")
endif()
string(REGEX REPLACE "^Cython version ([0-9]+\\.[0-9]+(\\.[0-9]+)?).*" "\\1" CYTHON_VERSION "${CYTHON_OUTPUT}")
else()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(CYTHON_MESSAGE_MODE TRACE)
endif()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
set(CYTHON_MESSAGE_MODE FATAL_ERROR)
endif()
message(${CYTHON_MESSAGE_MODE} "Failed to detect cython version: ${CYTHON_ERROR_MESSAGE}")
unset(CYTHON_MESSAGE_MODE)
endif()

unset(CYTHON_OUTPUT)
unset(CYTHON_EXIT_CODE)
unset(CYTHON_ERROR_MESSAGE)

mark_as_advanced( CYTHON_EXECUTABLE CYTHON_VERSION )
8 changes: 6 additions & 2 deletions src/bindings/python/src/pyopenvino/core/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ void regclass_CompiledModel(py::module m) {
"create_infer_request",
[](ov::CompiledModel& self) {
// Create temporary ov::InferRequest and move it to actual wrapper class.
return std::make_shared<InferRequestWrapper>(self.create_infer_request(), self.inputs(), self.outputs());
ov::InferRequest request;
{
py::gil_scoped_release release;
request = self.create_infer_request();
}
return std::make_shared<InferRequestWrapper>(std::move(request), self.inputs(), self.outputs());
},
py::call_guard<py::gil_scoped_release>(),
R"(
Creates an inference request object used to infer the compiled model.
The created request has allocated input and output tensors.
Expand Down

0 comments on commit 5004f55

Please sign in to comment.