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

Adding execution providers as shared library? #2818

Closed
tensorbuffer opened this issue Jan 11, 2020 · 10 comments
Closed

Adding execution providers as shared library? #2818

tensorbuffer opened this issue Jan 11, 2020 · 10 comments
Labels
feature request request for unsupported feature or enhancement stale issues that have not been addressed in a while; categorized by a bot

Comments

@tensorbuffer
Copy link

tensorbuffer commented Jan 11, 2020

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Hello, from this link it says "Build it as a static lib."
https://github.com/microsoft/onnxruntime/blob/master/docs/AddingExecutionProvider.md

I added my own execution provider ("X"), and I see libonnxruntime_providers_x.a is built.
However I would like it to be a shared .so, just like libonnxruntime.so

For test I compile and link CXXapi_sample.cc with libonnxruntime.so and currently the new provider is not there (e.g. the number of providers is 1).

Would like to know why it needs to be static and if possible to be shared so?

System information

  • ONNX Runtime version (you are using): Mainline
    building on ubuntu for cpu and also my customized execution provider.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@pranavsharma
Copy link
Contributor

As of now execution providers can be linked only statically. We're working on dynamic linking as we speak. fyi @RyanUnderhill

@pranavsharma pranavsharma added the feature request request for unsupported feature or enhancement label Jan 11, 2020
@tensorbuffer
Copy link
Author

ok thanks. How to use the added provider? Do I need to copy the libonnxruntime_providers.a and libonnxruntime_providers_x.a to the release folder? Do I need to modify the app code (CXXapi_sample.cc)? How to build the app (since there's dynamic link with libonnxruntime.so and static link with providers)?

@snnn
Copy link
Member

snnn commented Jan 11, 2020

@tensorbuffer
Copy link
Author

Ok I see, the 'Using the execution provider' section. Looks like I need to modify the CXXapi_sample.cc. This looks weird to me, which execution provider to use should be decided by onnxruntime, not by application.

@vigsterkr
Copy link

vigsterkr commented Feb 4, 2020

@pranavsharma any roadmap/project or possibly branch publicly available of this... i.e. potentially help out with the effort?

basically it would be nice to be able to use onnxruntime API (c/c++) to check whether a backend is available and then use it. since now if the library has not been compiled with a given backend, one cannot even check via API which backend is available (runtime)

@pranavsharma
Copy link
Contributor

This feature is being worked on in a private branch and not at a stage where it can be opened up for community contributions due to multiple conflicting internal pieces. Once we've achieved this for one execution provider, we can open it up to the community. Stay tuned!

@stale
Copy link

stale bot commented Jul 18, 2020

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@stale stale bot added the wontfix label Jul 18, 2020
@snnn
Copy link
Member

snnn commented Jul 19, 2020

@RyanUnderhill is working on this.
Now he has made the DNNL EP as a shared library.

@stale stale bot removed the wontfix label Jul 19, 2020
@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@stale stale bot added the stale issues that have not been addressed in a while; categorized by a bot label Sep 20, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

This issue has been automatically closed due to inactivity. Please reactivate if further support is needed.

@stale stale bot closed this as completed Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

4 participants