Skip to content

Conversation

@geekbeast
Copy link
Contributor

This adds the necessary compiler promises to allow use of openvino backend in Viceroy and other wasmtime derived platforms.

@geekbeast
Copy link
Contributor Author

Most of the classes seem Send as there isn't any thread local magic going on. CNNNetwork seems Sync unless binding to a session somehow mutates the network.

@abrown
Copy link
Contributor

abrown commented Oct 4, 2022

The CI failure you observed is not due to your changes; I opened and merged #49 to avoid that and if you rebase on main then CI should pass. On the changes themselves, the review is in progress: I'm checking internally with the OpenVINO team about this just to make sure this will be a safe change.

@geekbeast geekbeast force-pushed the feature/send-and-sync branch from 773fb26 to fb95288 Compare October 19, 2022 19:09
Copy link
Contributor

@abrown abrown left a comment

Choose a reason for hiding this comment

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

After some discussion with the OpenVINO team, I think this change is fine to merge:

  • the structures marked Send are safe to send to other threads because these structures have exclusive ownership of OpenVINO's raw pointer, which can be sent to any thread. This is usage similar to the the Send and Sync example.
  • the structures can indeed be marked Sync, indicating that they can be shared between threads, since Rust will enforce exclusive mutable access and the underlying C++ methods which use &self are thread-safe (e.g., as tested here, here, and here). More could probably be marked Sync but this should be fine for now.

@abrown abrown merged commit 3eefe76 into intel:main Oct 21, 2022
@geekbeast geekbeast deleted the feature/send-and-sync branch October 21, 2022 18: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