openvino/src/bindings/python
Anastasiia Pnevskaia 432ea63e0c
[TF FE] Fixed memory sharing for HF models. (#23318)
### Details:
 There were two problems with memory sharing, which affected HF models. 
`value()` method of class `ResourceVariable` copies value of variable in
some cases. This results in sharing of memory with a copied value, which
is deallocated when `GraphIterator` finishes its work.
Replaced `value()` with `read_value_no_copy()` which should not copy
value in any case.

Another problem is that original model inference moves weights to new
location which leads to corruption of shared memory in OV model.
So the original model should be inferred after the OV inference to
prevent any changes in original model.

### Tickets:
 - 134787, 134408

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2024-03-15 08:46:20 +00:00
..
docs Update year in src/bindings/python folder (#22186) 2024-01-16 18:58:06 +01:00
src [TF FE] Fixed memory sharing for HF models. (#23318) 2024-03-15 08:46:20 +00:00
tests [PyOV] convert ExecutionMode enum to any (#23284) 2024-03-06 09:25:32 +00:00
thirdparty Added a WA for running Python API in debug mode (#18848) 2023-07-28 17:29:09 +04:00
wheel Avoid stripping of debug info in wheels (#23345) 2024-03-13 23:07:40 +00:00
.clang-format Rename runtime to src (#8842) 2021-11-27 11:28:25 +03:00
.gitignore [PyOV] Making offline_transformations a private module (#13213) 2022-09-28 18:38:52 +02:00
CMakeLists.txt Additional cleaning of `InferenceEngine` (#22959) 2024-02-20 13:26:53 +00:00
README.md [DOCS] Update of hyperlinks to 2024 + new ov homepage diagram image for master (#23091) 2024-02-28 07:54:04 +00:00
constraints.txt Update pytest requirement in /src/bindings/python (#22492) 2024-02-01 09:06:42 +00:00
pyproject.toml [PYTHON API] Check new config (#11402) 2022-06-13 10:21:04 +02:00
requirements.txt Get rid of distutils (#22281) 2024-01-24 21:22:57 +01:00
requirements_test.txt Don't use complex dependencies in Python API tests (#23104) 2024-02-28 08:21:57 +00:00
setup.cfg [PyOV] Legacy IE Python API removal (#20908) 2024-01-11 13:46:49 +01:00

README.md

OpenVINO Python API

OpenVINO Python API is a part of the OpenVINO library. The component is responsible for:

  • Bindings of OpenVINO - allowing users to use the OpenVINO library in their Python code. Python API provides bindings to basic and advanced APIs from OpenVINO Runtime.
  • Extending OpenVINO with pythonic features - on top of direct translations from C++, Python API component:
    • Adds specific extensions to support numpy-based data.
    • Provides support for external frameworks inputs.
    • Provides shortcuts and helpers with more pythonic design.
    • Allows to apply advanced concepts, like shared memory, to take full advantage of OpenVINO.

OpenVINO Python API uses the common codestyle checks which are adjusted to project needs.

Key contacts

If you have any questions, feature requests or want us to review your PRs, send us a message or ping us on GitHub via openvino-ie-python-api-maintainers. You can always directly contact everyone from this group.

Components

OpenVINO PYTHON API has the following structure:

  • docs - folder that contains developer documentation and code examples.
  • src - folder with all source files for Python API.
  • tests - tests directory for OpenVINO Python API.
  • thirdparty - folder that contains third-party modules like pybind11.
  • wheel - wheel-specific directory that contains all specific requirements and files used during wheel creation.

Tutorials

If you want to contribute to OpenVINO Python API, here is the list of learning materials and project guidelines:

See also