Add support for sessions to share a global threadpool. - #3177
Merged
Conversation
Contributor
Contributor
Author
|
This is ready for review. Debugging the Android CI failure meanwhile.... |
Pranav Sharma (pranavsharma)
force-pushed
the
global_tp
branch
from
March 17, 2020 02:36
6ed591f to
c0e64c7
Compare
Contributor
Contributor
Author
|
Most of the test_inference/test_environment code is from before including the one that has the cryptic comment :-). |
Contributor
Author
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. |
Pranav Sharma (pranavsharma)
force-pushed
the
global_tp
branch
from
March 18, 2020 02:35
6319b6f to
f4657dc
Compare
Pranav Sharma (pranavsharma)
force-pushed
the
global_tp
branch
from
March 18, 2020 07:50
f4657dc to
754ab24
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.