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

[Python API] add new api #8149

Merged
merged 46 commits into from
Nov 12, 2021

Conversation

akuporos
Copy link
Contributor

@akuporos akuporos commented Oct 21, 2021

Details:

  • bind Core class:
    • available_devices
    • query_model()
    • unload_plugin()
    • register_plugins()
    • register_plugin()
    • get_metric()
    • get_config()
    • import_model()
    • set_config()
    • compile_model()
    • get_versions()
    • read_model()
  • bind ExecutableNetwork class
    • infer_new_request()
    • get_config()
    • get_metric()
    • create_infer_request()
    • get_runtime_function()
    • export_model()
    • output()
    • outputs
    • input()
    • inputs
  • bind InferRequest class
    • input_tensors
    • output_tensors
    • latency
    • profiling_info
    • set_output_tensor()
    • set_input_tensor()
    • set_tensor()
    • get_tensor()
    • set_tensors()
    • set_output_tensors()
    • set_input_tensors()
    • infer()
    • start_async()
    • wait()
    • wait_for()
    • cancel()
    • set_callback()
  • added bindging to Function class
    • reshape()
    • input()
    • inputs
    • output()
    • outputs()
  • bind const Node Outputs class
  • PR for FE: [PYTHON API] move frontend bindings to pyopenvino + move MO to use new Python API #8301

Tickets:

  • ticket-id

@akuporos akuporos requested a review from a team October 21, 2021 14:05
@akuporos akuporos changed the title Bind exec core ov (#50) [Python API] add new api + move FE Oct 21, 2021
@akuporos akuporos added category: Python API OpenVINO Python bindings do not merge labels Oct 21, 2021
@akuporos akuporos added this to the 2022.1 milestone Oct 21, 2021
@akuporos akuporos requested a review from jiwaszki October 21, 2021 14:13
@openvino-pushbot openvino-pushbot added the category: inference OpenVINO Runtime library - Inference label Oct 21, 2021
@akuporos akuporos requested review from AlexeyLebedev1 and a team October 22, 2021 10:40
@akuporos akuporos requested a review from a team as a code owner October 22, 2021 12:51
@akuporos akuporos requested a review from a team October 22, 2021 12:51
@akuporos akuporos requested review from a team as code owners October 22, 2021 12:51
@akuporos akuporos requested review from a team October 22, 2021 12:51
@akuporos akuporos requested a review from a team as a code owner October 22, 2021 12:51
@akuporos akuporos requested review from avladimi and removed request for a team and avladimi October 22, 2021 12:51
@akuporos akuporos force-pushed the develop/new-python-api branch from 0ee198a to d47f7b1 Compare October 22, 2021 12:56
@akuporos akuporos requested a review from a team October 26, 2021 11:11
@akuporos akuporos requested a review from a team November 9, 2021 12:20
@akuporos akuporos force-pushed the develop/new-python-api branch 2 times, most recently from 8e530ba to c7c2636 Compare November 9, 2021 16:59
@akuporos akuporos force-pushed the develop/new-python-api branch from c7c2636 to b5d8303 Compare November 9, 2021 17:00
@akuporos akuporos requested a review from ilyachur November 10, 2021 07:29
akuporos and others added 13 commits November 10, 2021 15:55
* Updated common migration pipeline

* Fixed merge issue

* Added new model and extended example

* Fixed typo

* Added v10-v11 comparison
* del MO_ROOT

* del MO_ROOT from common_utils.py

* add MO_PATH to common_utils.py

* change mo_path
* Use cmake to build samples

* Add the option to set custom build output folder
* [GPU] OneDNN gpu submodule update to version 2.5

* [GPU] Updated onednn submodule and added layout optimizer fix
* Proper cmake install for static libraries case

* Added an ability to skip template plugin

* Added install rules for VPU / GPU

* Install more libraries

* Fixed absolute TBB include paths

* Disable GNA

* Fixed issue with linker

* Some fixes

* Fixed linkage issues in tests

* Disabled some tests

* Updated CI pipelines

* Fixed Windows linkage

* Fixed custom_opset test for static casr

* Fixed CVS-70313

* Continue on error

* Fixed clanf-format

* Try to fix Windows linker

* Fixed compilation

* Disable samples

* Fixed samples build with THREADING=SEQ

* Fixed link error on Windows

* Fixed ieFuncTests

* Added static Azure CI

* Revert "Fixed link error on Windows"

This reverts commit 78cca36.

* Merge static and dynamic linux pipelines

* Fixed Azure
@@ -305,7 +305,7 @@ InferenceEngine::Blob::Ptr MKLDNNPlugin::MKLDNNInferRequest::GetBlob(const std::
desc.getShape().getRank()))
: MemoryDescUtils::convertToTensorDesc(desc);
const auto &tensorDesc = data->getTensorDesc();
if (expectedTensorDesc.getPrecision() != tensorDesc.getPrecision()) {
if (expectedTensorDesc.getPrecision() != normalizeToSupportedPrecision(tensorDesc.getPrecision())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@jiwaszki Could you clarify which tests or use-cases require this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one test fails without this change: tests/test_onnx/test_zoo_models.py::OnnxBackendModelExecutionTest::test_onnx_model_zoo_text_machine_comprehension_bert_squad_model_bertsquad_10_bertsquad_10_bertsquad10_cpu
https://dev.azure.com/openvinoci/dldt/_build/results?buildId=197937&view=logs&j=8e6fb299-7deb-52f1-2f4a-df91230aba00&t=f812e137-0344-51cb-e8b0-0ab752070263&l=6178

@akuporos akuporos enabled auto-merge (squash) November 12, 2021 12:43
@akuporos akuporos merged commit 2c9a4c5 into openvinotoolkit:master Nov 12, 2021
openvino-dev-samples pushed a commit to openvino-dev-samples/openvino that referenced this pull request Nov 23, 2021
* Bind exec core ov (#50)

* Output const node python tests (#52)

* add python bindings tests for Output<const ov::None>

* add proper tests

* add new line

* rename ie_version to version

* Pszmel/bind infer request (#51)

* remove set_batch, get_blob and set_blob

* update InferRequest class

* change InferenceEngine::InferRequest to ov::runtime::InferRequest

* update set_callback body

* update bindings to reflect ov::runtime::InferRequest

* bind set_input_tensor and get_input_tensor

* style fix

* clen ie_infer_queue.cpp

* Bind exec core ov (#50)

* bind core, exec_net classes

* rm unused function

* add new line

* rename ie_infer_request -> infer_request

* update imports

* update __init__.py

* update ie_api.py

* Replace old containers with the new one

* create impl for create_infer_request

* comment out infer_queue to avoid errors with old infer_request

* update infer_request bind to reflect new infer_request api

* comment out inpuit_info from ie_network to avoid errors with old containers

* Register new containers and comment out InferQueue

* update infer request tests

* style fix

* remove unused imports

* remove unused imports and 2 methods

* add tests to cover all new methods from infer_request

* style fix

* add test

* remove registration of InferResults

* update name of exception_ptr parameter

* update the loops that iterate through inputs and outputs

* clean setCustomCallbacks

* style fix

* add Tensor import

* style fix

* update infer and normalize_inputs

* style fix

* rename startTime and endTime

* Create test for mixed keys as infer arguments

* update infer function

* update return type of infer

Co-authored-by: Bartek Szmelczynski <[email protected]>

* fix get_version

* fix opaque issue

* some cosmetic changes

* fix codestyle in tests

* make tests green

* Extend python InferRequest

* Extend python Function

* Change return value of infer call

* Fix missing precisions conversions in CPU plugin

* Rework of runtime for new tests

* Fixed onnx reading in python tests

* Edit compatibility tests

* Edit tests

* Add FLOAT_LIKE xfails

* [Python API] bind ProfilingInfo (#55)

* bind ProfilingInfo

* Add tests

* Fix code style

* Add property

* fix codestyle

* Infer new request method (#56)

* fix conflicts, add infer_new_request function

* remove redundant functions, fix style

* revert the unwanted changes

* revert removal of the Blob

* revert removal of isTblob

* add add_extension from path

* codestyle

* fix win build

* add inputs-outputs to function

* Hot-fix CPU plugin with precision

* fix start_async

* add performance hint to time infer (openvinotoolkit#8480)

* Updated common migration pipeline (openvinotoolkit#8176)

* Updated common migration pipeline

* Fixed merge issue

* Added new model and extended example

* Fixed typo

* Added v10-v11 comparison

* Avoid redundant graph nodes scans (openvinotoolkit#8415)

* Refactor work with env variables (openvinotoolkit#8208)

* del MO_ROOT

* del MO_ROOT from common_utils.py

* add MO_PATH to common_utils.py

* change mo_path

* [IE Sample Scripts] Use cmake to build samples (openvinotoolkit#8442)

* Use cmake to build samples

* Add the option to set custom build output folder

* Remove opset8 from compatibility ngraph python API (openvinotoolkit#8452)

* [GPU] OneDNN gpu submodule update to version 2.5 (openvinotoolkit#8449)

* [GPU] OneDNN gpu submodule update to version 2.5

* [GPU] Updated onednn submodule and added layout optimizer fix

* Install rules for static libraries case (openvinotoolkit#8384)

* Proper cmake install for static libraries case

* Added an ability to skip template plugin

* Added install rules for VPU / GPU

* Install more libraries

* Fixed absolute TBB include paths

* Disable GNA

* Fixed issue with linker

* Some fixes

* Fixed linkage issues in tests

* Disabled some tests

* Updated CI pipelines

* Fixed Windows linkage

* Fixed custom_opset test for static casr

* Fixed CVS-70313

* Continue on error

* Fixed clanf-format

* Try to fix Windows linker

* Fixed compilation

* Disable samples

* Fixed samples build with THREADING=SEQ

* Fixed link error on Windows

* Fixed ieFuncTests

* Added static Azure CI

* Revert "Fixed link error on Windows"

This reverts commit 78cca36.

* Merge static and dynamic linux pipelines

* Fixed Azure

* fix codestyle

Co-authored-by: Bartek Szmelczynski <[email protected]>
Co-authored-by: Piotr Szmelczynski <[email protected]>
Co-authored-by: jiwaszki <[email protected]>
Co-authored-by: Alexey Lebedev <[email protected]>
Co-authored-by: Victor Kuznetsov <[email protected]>
Co-authored-by: Ilya Churaev <[email protected]>
Co-authored-by: Tomasz Jankowski <[email protected]>
Co-authored-by: Dmitry Pigasin <[email protected]>
Co-authored-by: Artur Kulikowski <[email protected]>
Co-authored-by: Ilya Znamenskiy <[email protected]>
Co-authored-by: Ilya Lavrenov <[email protected]>
openvino-dev-samples pushed a commit to openvino-dev-samples/openvino that referenced this pull request Nov 24, 2021
* Bind exec core ov (#50)

* Output const node python tests (#52)

* add python bindings tests for Output<const ov::None>

* add proper tests

* add new line

* rename ie_version to version

* Pszmel/bind infer request (#51)

* remove set_batch, get_blob and set_blob

* update InferRequest class

* change InferenceEngine::InferRequest to ov::runtime::InferRequest

* update set_callback body

* update bindings to reflect ov::runtime::InferRequest

* bind set_input_tensor and get_input_tensor

* style fix

* clen ie_infer_queue.cpp

* Bind exec core ov (#50)

* bind core, exec_net classes

* rm unused function

* add new line

* rename ie_infer_request -> infer_request

* update imports

* update __init__.py

* update ie_api.py

* Replace old containers with the new one

* create impl for create_infer_request

* comment out infer_queue to avoid errors with old infer_request

* update infer_request bind to reflect new infer_request api

* comment out inpuit_info from ie_network to avoid errors with old containers

* Register new containers and comment out InferQueue

* update infer request tests

* style fix

* remove unused imports

* remove unused imports and 2 methods

* add tests to cover all new methods from infer_request

* style fix

* add test

* remove registration of InferResults

* update name of exception_ptr parameter

* update the loops that iterate through inputs and outputs

* clean setCustomCallbacks

* style fix

* add Tensor import

* style fix

* update infer and normalize_inputs

* style fix

* rename startTime and endTime

* Create test for mixed keys as infer arguments

* update infer function

* update return type of infer

Co-authored-by: Bartek Szmelczynski <[email protected]>

* fix get_version

* fix opaque issue

* some cosmetic changes

* fix codestyle in tests

* make tests green

* Extend python InferRequest

* Extend python Function

* Change return value of infer call

* Fix missing precisions conversions in CPU plugin

* Rework of runtime for new tests

* Fixed onnx reading in python tests

* Edit compatibility tests

* Edit tests

* Add FLOAT_LIKE xfails

* [Python API] bind ProfilingInfo (#55)

* bind ProfilingInfo

* Add tests

* Fix code style

* Add property

* fix codestyle

* Infer new request method (#56)

* fix conflicts, add infer_new_request function

* remove redundant functions, fix style

* revert the unwanted changes

* revert removal of the Blob

* revert removal of isTblob

* add add_extension from path

* codestyle

* fix win build

* add inputs-outputs to function

* Hot-fix CPU plugin with precision

* fix start_async

* add performance hint to time infer (openvinotoolkit#8480)

* Updated common migration pipeline (openvinotoolkit#8176)

* Updated common migration pipeline

* Fixed merge issue

* Added new model and extended example

* Fixed typo

* Added v10-v11 comparison

* Avoid redundant graph nodes scans (openvinotoolkit#8415)

* Refactor work with env variables (openvinotoolkit#8208)

* del MO_ROOT

* del MO_ROOT from common_utils.py

* add MO_PATH to common_utils.py

* change mo_path

* [IE Sample Scripts] Use cmake to build samples (openvinotoolkit#8442)

* Use cmake to build samples

* Add the option to set custom build output folder

* Remove opset8 from compatibility ngraph python API (openvinotoolkit#8452)

* [GPU] OneDNN gpu submodule update to version 2.5 (openvinotoolkit#8449)

* [GPU] OneDNN gpu submodule update to version 2.5

* [GPU] Updated onednn submodule and added layout optimizer fix

* Install rules for static libraries case (openvinotoolkit#8384)

* Proper cmake install for static libraries case

* Added an ability to skip template plugin

* Added install rules for VPU / GPU

* Install more libraries

* Fixed absolute TBB include paths

* Disable GNA

* Fixed issue with linker

* Some fixes

* Fixed linkage issues in tests

* Disabled some tests

* Updated CI pipelines

* Fixed Windows linkage

* Fixed custom_opset test for static casr

* Fixed CVS-70313

* Continue on error

* Fixed clanf-format

* Try to fix Windows linker

* Fixed compilation

* Disable samples

* Fixed samples build with THREADING=SEQ

* Fixed link error on Windows

* Fixed ieFuncTests

* Added static Azure CI

* Revert "Fixed link error on Windows"

This reverts commit 78cca36.

* Merge static and dynamic linux pipelines

* Fixed Azure

* fix codestyle

Co-authored-by: Bartek Szmelczynski <[email protected]>
Co-authored-by: Piotr Szmelczynski <[email protected]>
Co-authored-by: jiwaszki <[email protected]>
Co-authored-by: Alexey Lebedev <[email protected]>
Co-authored-by: Victor Kuznetsov <[email protected]>
Co-authored-by: Ilya Churaev <[email protected]>
Co-authored-by: Tomasz Jankowski <[email protected]>
Co-authored-by: Dmitry Pigasin <[email protected]>
Co-authored-by: Artur Kulikowski <[email protected]>
Co-authored-by: Ilya Znamenskiy <[email protected]>
Co-authored-by: Ilya Lavrenov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin category: inference OpenVINO Runtime library - Inference category: Python API OpenVINO Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.