-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for sessions to share a global threadpool. #3177
Conversation
This is ready for review. Debugging the Android CI failure meanwhile.... |
Most of the test_inference/test_environment code is from before including the one that has the cryptic comment :-). |
It looks like all tests exes are run inside the android emulator and hence even the global threadpools test exe shares the same env that was created before which explains the test failure. I don't know much about the emulator, so for now I'll disable these tests for android. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: Add support for sessions to share a global threadpool.
Motivation and Context
The OCR team has a requirement to run multiple sessions (models) in a process. ORT creates an intra and inter thread pool for every session. This is clearly not efficient in this scenario. Hence, we need to design a way to have these 2 thread pools be shared between multiple sessions.
After discussion with the OCR team, option #3 in this design doc seems to be the simplest. They don't have any requirement for this feature to be available in language bindings other than C/C++.
Usage will be as follows. Also see documentation under docs/C_API.md.
Also moved the logger to the Environment class as part of this change to facilitate easier passing of global threadpools to session. We wanted to do this any way.