-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cache memory in local scope #7058
Conversation
@@ -413,37 +413,51 @@ void OperatorWithKernel::Run(const Scope& scope, | |||
} | |||
|
|||
if (actual_kernel_key == expected_kernel_key) { | |||
kernel_iter->second->Compute(ctx); | |||
PADDLE_ENFORCE_EQ(actual_kernel_key.place_, expected_kernel_key.place_, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual_kernel_key == expected_kernel_key
是不是默认包含了
actual_kernel_key.place_ == expected_kernel_key.place_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是的,kernel key重载的相等操作符是判断是同一种place,并不能分辨CUDAPlace0 和 CUDApLace1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fix #7057
Refer to #6991 (comment)