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

[Py OV] Add utils to openvino module #28062

Merged
merged 10 commits into from
Dec 16, 2024

Conversation

almilosz
Copy link
Contributor

@almilosz almilosz commented Dec 13, 2024

Details:

  • Move runtime/utils/ to openvino
  • Add proxy locations in openvino/runtime/utils/
  • create proxy for openvino/runtime/opset_utils.py. It contained one internal function => _get_node_factory. Move its location to openvino/utils/node_factory.py.
  • Rename utils.py to package_utils.py. Import its functionality in openvino/utils/__init__.py so it's accessible for a user in the same way (except internal _add_openvino_libs_to_search_path and _ClassPropertyDescriptor)
    NOTE: on Windows _add_openvino_libs_to_search_path has to be called (and initialized) on top of openvino.__init__, especially before _pyopenvino imports.

Part of openvino.runtime deprecation

Tickets:

CVS-129450

@github-actions github-actions bot added the category: Python API OpenVINO Python bindings label Dec 13, 2024
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
@github-actions github-actions bot added category: tools OpenVINO C++ / Python tools category: OVC OVC tool labels Dec 13, 2024
@almilosz almilosz marked this pull request as ready for review December 13, 2024 21:30
@almilosz almilosz requested review from a team as code owners December 13, 2024 21:30
Signed-off-by: Alicja Miloszewska <[email protected]>
@almilosz almilosz requested a review from a team as a code owner December 14, 2024 09:50
from openvino.utils import _add_openvino_libs_to_search_path
from openvino.package_utils import _add_openvino_libs_to_search_path
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not touch it please because we are removing it this release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately there are still some samples that depend on it.
I had to touch it because wheels_windows_vs2019_release CI failed.

# -*- coding: utf-8 -*-
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should raise a warning about its deprecation since 2025 and our intention to remove in 2026 release.
It relates all runtime modules

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a task to raise a warning about runtime deprecation. You can track the progress here in jira

Co-authored-by: Anastasia Kuporosova <[email protected]>
@almilosz almilosz changed the title PR5 [Py OV] Add utils to openvino module [Py OV] Add utils to openvino module Dec 16, 2024
@almilosz almilosz added this pull request to the merge queue Dec 16, 2024
Merged via the queue into openvinotoolkit:master with commit 1dd6492 Dec 16, 2024
181 checks passed
@almilosz almilosz deleted the almilosz/move-utils branch December 16, 2024 18:37
11happy pushed a commit to 11happy/openvino that referenced this pull request Dec 23, 2024
### Details:
- Move `runtime/utils/` to openvino
- Add proxy locations in `openvino/runtime/utils/`
- create proxy for `openvino/runtime/opset_utils.py`. It contained one
internal function => `_get_node_factory`. Move its location to
`openvino/utils/node_factory.py`.
- Rename `utils.py` to `package_utils.py`. Import its functionality in
`openvino/utils/__init__.py` so it's accessible for a user in the same
way (except internal `_add_openvino_libs_to_search_path` and
`_ClassPropertyDescriptor`)
NOTE: on Windows `_add_openvino_libs_to_search_path` has to be called
(and initialized) on top of `openvino.__init__`, especially before
`_pyopenvino` imports.

Part of `openvino.runtime` deprecation

### Tickets:
 [CVS-129450](https://jira.devtools.intel.com/browse/CVS-129450)

---------

Signed-off-by: Alicja Miloszewska <[email protected]>
Co-authored-by: Anastasia Kuporosova <[email protected]>
ilya-lavrenov added a commit to ilya-lavrenov/openvino that referenced this pull request Dec 24, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 24, 2024
### Reverted:
- #28062 (Guilty one)
- #28085 (Relies on
Guilty one)
- #28166 (Relies on
Guilty one)
github-merge-queue bot pushed a commit that referenced this pull request Jan 8, 2025
### Details:
- An [Issue](https://jira.devtools.intel.com/browse/CVS-159892) appeared
after moving `openvino.runtime.utils` ([PR28062](
#28062)). On `openvino`
import, `op` was initialized
[here](https://github.com/openvinotoolkit/openvino/blob/26e5fe9a5961502eb3086424ce68496c9a4d7a30/src/bindings/python/src/openvino/runtime/utils/types.py#L14)
alongside utils. I propose to initialize `op` explicitly in
`openvino/runtime/__init__.py` and `openvino/__init__.py`
- Initialize ops.py in `runtime/opset*/` as they are present in the
`sys.modules` for `2024.6-openvino` and some users may access operators
directly from there.

### Tickets:
 - https://jira.devtools.intel.com/browse/CVS-159892

---------

Signed-off-by: Alicja Miloszewska <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Jan 16, 2025
### Details:
Add deprecation warning for `openvino.runtime` that will be shown
**ONCE** when sb will access runtime functionality for the first time.
Examples:
![Screenshot 2025-01-10
114701](https://github.com/user-attachments/assets/4229ede3-3b86-418a-8dbf-f230ff91983b)

![warn_updated](https://github.com/user-attachments/assets/4b4a7c56-c5ca-4b7b-8b34-f89f3a4bc627)

`openvino.runtime` funtionality was added to openvino namespace in these
PRs:
- #27785
- #27902
- #28007
- #28062
- #28085

Internal calls in `openvino` module also triggered warning, so they were
updated:
 - #28166 
 - #28356

### Tickets:
 - [CVS-129451](https://jira.devtools.intel.com/browse/CVS-129451)

---------

Signed-off-by: Alicja Miloszewska <[email protected]>
Co-authored-by: Anastasia Kuporosova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: OVC OVC tool 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.

3 participants