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

Check version; fail if pre-2024.2 #149

Merged
merged 5 commits into from
Oct 14, 2024
Merged

Check version; fail if pre-2024.2 #149

merged 5 commits into from
Oct 14, 2024

Conversation

abrown
Copy link
Contributor

@abrown abrown commented Oct 10, 2024

In #143, we discovered that upstream OpenVINO had changed the ov_element_type_e enum in a backwards-incompatible way. This means that a mismatch between the Rust bindings (based on the C headers) and the shared library will result in tensors being created with the wrong type (e.g., U64 instead of U8). To avoid this situation, this change reads the OpenVINO library version at runtime (e.g., every time a Core is created) and fails with an error if the version is older than 2024.2, when the breaking change was introduced.

The effect of merging this change is that newer bindings will fail when used with older libraries, which could be problematic for users. Users could always use an older version of the library (e.g., v0.7.*) instead. And the alternative, letting users create tensors of the wrong type, seems like it would open up the door to a slew of bug reports. So this version check seems like an acceptable compromise to handle this upstream breaking change.

In intel#143, we discovered that upstream OpenVINO had changed the
`ov_element_type_e` enum in a backwards-incompatible way. This means
that a mismatch between the Rust bindings (based on the C headers) and
the shared library will result in tensors being created with the wrong
type (e.g., `U64` instead of `U8`). To avoid this situation, this change
reads the OpenVINO library version at runtime (e.g., every time a `Core`
is created) and fails with an error if the version is older than 2024.2,
when the breaking change was introduced.

The effect of merging this change would be that newer bindings will fail
when used with older libraries, which could be problematic for users.
Users could always use an older version of the library (e.g., `v0.7.*`)
instead. And the alternative, letting users create tensors of the wrong
type, seems like it would open up the door to a slew of reported issues.
This updates CI to test only the latest three OpenVINO versions, since
older versions will no longer be accessible due to the new "breaking
change version check." It also updates the OS version of the GitHub
runner for good measure.
OpenVINO has not published packages for `ubuntu-24.04`.
@abrown abrown marked this pull request as ready for review October 10, 2024 22:33
@abrown
Copy link
Contributor Author

abrown commented Oct 10, 2024

cc: @jlb6740, @rahulchaphalkar, @mingqiusun: take a look at the effect this PR will have.

@rahulchaphalkar
Copy link
Contributor

@abrown In a previous comment on the issue, you suggested we can update the major version of openvino-rs (to 0.8.) since ov 2024.2 introduces a breaking change. Will this version check be required for 0.8 and further releases? Since breaking changes are expected for major release.

@abrown
Copy link
Contributor Author

abrown commented Oct 11, 2024

Yes: if merged, the 0.8.0 release will add this check and thus only be usable with 2024.2+ libraries.

Since breaking changes are expected for major release.

I'm not sure I understand what you mean by this.

@rahulchaphalkar
Copy link
Contributor

Since breaking changes are expected for major release.

If openvino-rs updates major version to 0.8.0, what is the need for this check (assuming we update the Readme or something with the supported version). If breaking changes are expected between major releases, why do we need to check if someone uses older ov library.

@abrown
Copy link
Contributor Author

abrown commented Oct 12, 2024

A breaking change is typically understood as an API change of some kind — something that will cause a compile error. This is more insidious: everything looks fine on the outside but then it appears that the bindings end up doing the wrong thing. E.g., a user creates a U8 tensor but actually what is created is a U64 tensor — a hidden change in functionality only detectable at runtime (and even then, a bit difficult to figure out). It's doubtful users will read the release notes and, if they don't, there is no way to programmatically stop them from doing the wrong thing.

There are other options here: we could print a warning or add the ability to turn this off with an environment variable. I would prefer to do something, though: doing nothing (except documenting the breaking change) could lead to bug reports. The approach this PR takes is "better safe than sorry."

@rahulchaphalkar
Copy link
Contributor

Ok, that makes sense. My concern was that if/when there are more silent breaking changes like these, we would need to keep adding checks. But I guess the answer to that would be we worry only about reasonably older versions for openvino.

@abrown
Copy link
Contributor Author

abrown commented Oct 14, 2024

Looks like #150 is the first instance of this confusion.

@abrown abrown merged commit 2af130a into intel:main Oct 14, 2024
17 checks passed
@abrown abrown deleted the force-version branch October 14, 2024 17:26
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

Successfully merging this pull request may close these issues.

2 participants