Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openvino: Add threading option supporting tbb and omp #23068

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Greendogo
Copy link

Specify library name and version: openvino/*

Adds the option to set the threading cmake option to either tbb or omp.

Currently has an issue upon cmake config with projects using this option with openvino.


@CLAassistant
Copy link

CLAassistant commented Mar 12, 2024

CLA assistant check
All committers have signed the CLA.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@valgur
Copy link
Contributor

valgur commented Mar 24, 2024

Thanks!

You will need to add llvm-openmp dependency for OpenMP support, since it's (a) not available for Clang and AppleClang out of the box and (b) you will need to export compiler-specific linker flags for it otherwise.

I see that #pragma omp is being used in public headers (https://github.com/openvinotoolkit/openvino/blob/2024.0.0/src/core/include/openvino/core/parallel.hpp#L186-L190) as well, so you will need to set appropriate cflags and cxxflags for OpenMP regardless.

Somewhat blocked by #22353, though.

@@ -166,7 +170,8 @@ def build_requirements(self):
self.tool_requires("cmake/[>=3.18 <4]")

def requirements(self):
self.requires("onetbb/2021.10.0")
if self.options.threading == "tbb":
self.requires("onetbb/2021.10.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.requires("onetbb/2021.10.0")
# https://github.com/openvinotoolkit/openvino/blob/2024.0.0/src/core/include/openvino/core/parallel.hpp#L186-L190
self.requires("onetbb/2021.10.0", transitive_headers=True, transitive_libs=True)

TBB includes are being used in a public header, if I understand it correctly.

Co-authored-by: Martin Valgur <martin.valgur@gmail.com>
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 4 (ed1860b9f1a386d50c36c19836c483f7294e55d0):

  • openvino/2024.0.0:
    Didn't run or was cancelled before finishing

  • openvino/2023.3.0:
    Didn't run or was cancelled before finishing

  • openvino/2023.2.0:
    Didn't run or was cancelled before finishing

  • openvino/2023.1.0:
    CI failed to create some packages (All logs)

    Logs for packageID aa3b2ab9b2c878ebab4afb04587bb6c76654203f:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=7
    os=Linux
    [options]
    openvino:shared=False
    
    [...]
         catch (const InferenceEngine::ExceptionType&) {   \
                                                    ^
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/common.h:41:5: note: in expansion of macro ‘CATCH_IE_EXCEPTION’
         CATCH_IE_EXCEPTION(NETWORK_NOT_READ, NetworkNotRead)      \
         ^~~~~~~~~~~~~~~~~~
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/ov_tensor.cpp:143:5: note: in expansion of macro ‘CATCH_OV_EXCEPTIONS’
         CATCH_OV_EXCEPTIONS
         ^~~~~~~~~~~~~~~~~~~
    In file included from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:33:0,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/details/ie_exception.hpp:17,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/common.h:13,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/ov_tensor.cpp:6:
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:389:36: note: declared here
     INFERENCE_ENGINE_DECLARE_EXCEPTION(NetworkNotRead, NETWORK_NOT_READ)
                                        ^
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_api.h:25:45: note: in definition of macro ‘INFERENCE_ENGINE_API_CLASS’
     #    define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__
                                                 ^~~~~~~~~~~
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:389:1: note: in expansion of macro ‘INFERENCE_ENGINE_DECLARE_EXCEPTION’
     INFERENCE_ENGINE_DECLARE_EXCEPTION(NetworkNotRead, NETWORK_NOT_READ)
     ^
    In file included from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/ov_tensor.cpp:6:0:
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/common.h:18:48: warning: ‘InferCancelled’ is deprecated: The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html [-Wdeprecated-declarations]
         catch (const InferenceEngine::ExceptionType&) {   \
                                                    ^
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/common.h:42:5: note: in expansion of macro ‘CATCH_IE_EXCEPTION’
         CATCH_IE_EXCEPTION(INFER_CANCELLED, InferCancelled)       \
         ^~~~~~~~~~~~~~~~~~
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/ov_tensor.cpp:143:5: note: in expansion of macro ‘CATCH_OV_EXCEPTIONS’
         CATCH_OV_EXCEPTIONS
         ^~~~~~~~~~~~~~~~~~~
    In file included from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:33:0,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/details/ie_exception.hpp:17,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/common.h:13,
                     from /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/bindings/c/src/ov_tensor.cpp:6:
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:392:36: note: declared here
     INFERENCE_ENGINE_DECLARE_EXCEPTION(InferCancelled, INFER_CANCELLED)
                                        ^
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_api.h:25:45: note: in definition of macro ‘INFERENCE_ENGINE_API_CLASS’
     #    define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__
                                                 ^~~~~~~~~~~
    /home/conan/workspace/prod-v1/bsr/11538/bdbdc/.conan/data/openvino/2023.1.0/_/_/source/src/src/inference/include/ie/ie_common.h:392:1: note: in expansion of macro ‘INFERENCE_ENGINE_DECLARE_EXCEPTION’
     INFERENCE_ENGINE_DECLARE_EXCEPTION(InferCancelled, INFER_CANCELLED)
     ^
    openvino/2023.1.0: WARN: openvino recipe builds GPU plugin without oneDNN (dGPU) support during static build, because CPU plugin compiled with different oneDNN version may cause ODR violation. To enable oneDNN support for GPU plugin, please, either use shared build configuration or disable CPU plugin by setting 'enable_cpu' option to False.
    openvino/2023.1.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    openvino/2023.1.0: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    ERROR: openvino/2023.1.0: Error in package_info() method, line 314
    	openvino_runtime.append("onetbb::libtbb")
    	AttributeError: 'Component' object has no attribute 'append'
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

"enable_pytorch_frontend": [True, False]
"enable_pytorch_frontend": [True, False],
# Threading
"threading": ["tbb", "omp"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • seq is also available to disable the threading
  • can we enable threading since 2024.4 ? because before that version OpenMP support was not enough tested / supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants