Skip to content

add transfer_scope_cache unit-test#18467

Merged
luotao1 merged 1 commit intoPaddlePaddle:developfrom
luotao1:add_transfer_scope_cache_ut
Jul 3, 2019
Merged

add transfer_scope_cache unit-test#18467
luotao1 merged 1 commit intoPaddlePaddle:developfrom
luotao1:add_transfer_scope_cache_ut

Conversation

@luotao1
Copy link
Contributor

@luotao1 luotao1 commented Jul 2, 2019

@luotao1
Copy link
Contributor Author

luotao1 commented Jul 2, 2019

@LeoZhao-Intel Please take a review for the unit-test.

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

@luotao1 luotao1 Jul 2, 2019

Choose a reason for hiding this comment

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

The size should be 1 in #18428 specific mkldnn tid setting mode.

Copy link
Contributor

Choose a reason for hiding this comment

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

is the cpu_num set -1 for MKLDNN tested?

Copy link
Contributor Author

@luotao1 luotao1 Jul 3, 2019

Choose a reason for hiding this comment

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

Since #18453 refine api and const variable name to make it sense. Then

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);
  }

@luotao1 luotao1 requested a review from Superjomn July 2, 2019 15:23
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 d234aa0 into PaddlePaddle:develop Jul 3, 2019
@luotao1 luotao1 deleted the add_transfer_scope_cache_ut branch July 3, 2019 04:42
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.

2 participants