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

Investigate switching to OpenVINO API 2.0 #53

Closed
abrown opened this issue Oct 21, 2022 · 5 comments
Closed

Investigate switching to OpenVINO API 2.0 #53

abrown opened this issue Oct 21, 2022 · 5 comments

Comments

@abrown
Copy link
Contributor

abrown commented Oct 21, 2022

OpenVINO has a new API for accessing its functionality: API 2.0. The C API that these bindings rely on will soon be considered a legacy API. It would be worthwhile to consider switching the implementation to use the C API of API 2.0. A description of how to use some of the top-level structures can be found here.

@x404159
Copy link

x404159 commented Jun 6, 2023

hey, will these bindings support API 2.0 in future, are there any plans?

@abrown
Copy link
Contributor Author

abrown commented Jun 6, 2023

I think so, but it's dependent on a couple of things, mainly getting time to do this. Are you interested in helping out with that?

@x404159
Copy link

x404159 commented Jun 6, 2023

hey, thanks for the quick reply, i really am not very knowledgeable in this area, i needed to inference dynamic model with rust and openvino. so wanted to know the status.

@abrown
Copy link
Contributor Author

abrown commented Dec 21, 2023

I've been informed that the legacy OpenVINO C API will be going away at the end of 2023. This means that switching to OpenVINO's 2.0 API will be necessary to continue binding to future versions of OpenVINO. To help out with this task, here are some steps I might follow:

  • for context: find an installed libopenvino_c.so and list the new ov_* symbols: nm <path> --dynamic --demangle | grep ov_
  • update the OpenVINO submodule (crates/openvino-sys/upstream) to a more recent version (i.e., the most recent release tag)
  • find the new headers from which to generate bindings: src/bindings/c
  • modify the codegen task (crates/xtask/src/codegen.rs) to generate new Rust FFI shims to call these functions; then generate the new code with cargo xtask codegen
  • walk through the openvino crate, mechanically changing as many openvino_sys::ie_* imports to their openvino_sys::ov_* equivalent; unfortunately, some of these changes cannot be mechanical and we will have to tweak certain functions (e.g., inputs and outputs are referenced by name) according to the transition guide
  • some of the examples and tests may need to be updated based on these changes

At this point, it should be possible to run all of the tests and ensure the bindings to the new API still work. At this point we would create a new release, etc.

@abrown
Copy link
Contributor Author

abrown commented Oct 3, 2024

This has been completed since the 0.7.* releases.

@abrown abrown closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants