add transfer_scope_cache unit-test#18467
Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom Jul 3, 2019
luotao1:add_transfer_scope_cache_ut
Merged
add transfer_scope_cache unit-test#18467luotao1 merged 1 commit intoPaddlePaddle:developfrom luotao1:add_transfer_scope_cache_ut
luotao1 merged 1 commit intoPaddlePaddle:developfrom
luotao1:add_transfer_scope_cache_ut
Conversation
test=develop
Contributor
Author
|
@LeoZhao-Intel Please take a review for the unit-test. |
luotao1
commented
Jul 2, 2019
| // paddle::framework::global_transfer_data_cache() are thread_local, | ||
| // their pointer should be different among different thread id. | ||
| PADDLE_ENFORCE(global_transfer_scope_cache.size(), threads_num); | ||
| PADDLE_ENFORCE(global_transfer_data_cache.size(), threads_num); |
Contributor
Author
There was a problem hiding this comment.
The size should be 1 in #18428 specific mkldnn tid setting mode.
Contributor
There was a problem hiding this comment.
is the cpu_num set -1 for MKLDNN tested?
Contributor
Author
There was a problem hiding this comment.
Since #18453 refine api and const variable name to make it sense. Then
- use static variable to do cache instead of thread local in thread frequent switching case #18428 will follow the new api
platform:: set_cur_mkldnn_session_id(-1)(not cpu_num) for MKLDNN tested. See:
https://github.com/PaddlePaddle/Paddle/compare/develop...luotao1:LeoZhao-Intel-mt_memoryleak_test?expand=1#diff-db5799d22e4420bb8cdacdad8d5e2b67R255
if (enable_mkldnn_cache_clear_mode) platform:: set_cur_mkldnn_session_id(-1);
...
if (enable_mkldnn_cache_clear_mode) {
PADDLE_ENFORCE(global_transfer_scope_cache.size(), 1);
} else {
PADDLE_ENFORCE(global_transfer_scope_cache.size(), threads_num);
}
- After use static variable to do cache instead of thread local in thread frequent switching case #18428 merged, we will enhance the
config.EnableMKLDNN()interface, and remove
platform::set_cur_mkldnn_session_id(-1)in the inference codes.
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.
global_transfer_scope_cacheandglobal_transfer_data_cache. Since these two variable are thread_local now, thus, their size should be equal to thread_num.RemoveKidsFromTransferScopeCache