Skip to content

call SetNumThreads everytime to avoid missing omp thread setting#17224

Merged
luotao1 merged 2 commits intoPaddlePaddle:developfrom
LeoZhao-Intel:omp_thread
May 7, 2019
Merged

call SetNumThreads everytime to avoid missing omp thread setting#17224
luotao1 merged 2 commits intoPaddlePaddle:developfrom
LeoZhao-Intel:omp_thread

Conversation

@LeoZhao-Intel
Copy link
Contributor

resolve #17153
test=develop

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks very much!

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());
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

omp_set_num_threads() just does nothing but set var, so the cost should be less.

@luotao1 luotao1 requested a review from Superjomn May 6, 2019 08:25
Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 54636a1 into PaddlePaddle:develop May 7, 2019
@ghost ghost added this to the v1.5 for Intel milestone May 7, 2019
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.

fc_op slows on multi-instance inference

3 participants