call SetNumThreads everytime to avoid missing omp thread setting#17224
Merged
luotao1 merged 2 commits intoPaddlePaddle:developfrom May 7, 2019
Merged
call SetNumThreads everytime to avoid missing omp thread setting#17224luotao1 merged 2 commits intoPaddlePaddle:developfrom
luotao1 merged 2 commits intoPaddlePaddle:developfrom
Conversation
resolve PaddlePaddle#17153 test=develop
resolve PaddlePaddle#17153 test=develop
luotao1
reviewed
May 6, 2019
| if (UNLIKELY(config_.cpu_math_library_num_threads() > 1)) { | ||
| paddle::platform::SetNumThreads(config_.cpu_math_library_num_threads()); | ||
| } | ||
| paddle::platform::SetNumThreads(config_.cpu_math_library_num_threads()); |
Contributor
There was a problem hiding this comment.
Here the reason of remove UNLIKELY(config_.cpu_math_library_num_threads() > 1) is: #17153 (comment)
I test this PR in pyramid_dnn, it doesn't impact the inference speedup in small model. @Superjomn
Contributor
Author
There was a problem hiding this comment.
omp_set_num_threads() just does nothing but set var, so the cost should be less.
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.
resolve #17153
test=develop