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

[PyOV] Propagate errors on imports from runtime module #20273

Merged

Conversation

jiwaszki
Copy link

@jiwaszki jiwaszki commented Oct 5, 2023

Details:

  • If there is an error on module imports - propagate them from runtime to main module.
  • When openvino-dev is installed after openvino installation, it overwrites main openvino/__init__.py with try-catch solution. This also allow to use package from PYTHONPATH when only openvino-dev is defined for legacy usage.
  • Now checking of runtime's __init__.py files is decoupled from openvino-dev's ones.
  • Minor refactor of CMake files.

Tickets:

  • 120013

@jiwaszki jiwaszki added the category: Python API OpenVINO Python bindings label Oct 5, 2023
@jiwaszki jiwaszki added this to the 2023.2 milestone Oct 5, 2023
@jiwaszki jiwaszki self-assigned this Oct 5, 2023
@jiwaszki jiwaszki requested review from a team as code owners October 5, 2023 14:29
@github-actions github-actions bot added category: MO Model Optimizer category: build OpenVINO cmake script / infra category: tools OpenVINO C++ / Python tools category: packaging OpenVINO packaging / distribution labels Oct 5, 2023
from openvino.runtime import serialize
from openvino.runtime import shutdown
from openvino.runtime import tensor_from_file
from openvino.runtime import save_model
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have convert_model here?

Copy link
Contributor

Choose a reason for hiding this comment

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

it's below in a separate try / catch block.

This is because if I use only python API from build folder, OVC is not there

"${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py"
"${OpenVINOPython_SOURCE_DIR}/src/compatibility/openvino/__init__.py"
"${OpenVINO_SOURCE_DIR}/tools/ovc/openvino/__init__.py"
"${OpenVINO_SOURCE_DIR}/tools/benchmark_tool/openvino/__init__.py")
Copy link
Contributor

@ilya-lavrenov ilya-lavrenov Oct 6, 2023

Choose a reason for hiding this comment

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

do we need all these runtime copies at all?
maybe we need to keep only "${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py" ? All other runtime modules cannot be used without OpenVINO anyway

@jiwaszki jiwaszki force-pushed the jiwaszki/adjust_init_files branch from 1132192 to f97a42d Compare October 10, 2023 12:26
@ilya-lavrenov ilya-lavrenov merged commit 6a32645 into openvinotoolkit:master Oct 11, 2023
40 of 42 checks passed
alvoron pushed a commit to alvoron/openvino that referenced this pull request Nov 6, 2023
allnes pushed a commit to allnes/openvino that referenced this pull request Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: build OpenVINO cmake script / infra category: MO Model Optimizer category: packaging OpenVINO packaging / distribution category: Python API OpenVINO Python bindings category: tools OpenVINO C++ / Python tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants