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
Fix unstable selected_rows_functor_test.cu #13505
Fix unstable selected_rows_functor_test.cu #13505
Conversation
@@ -107,7 +107,7 @@ struct SelectedRowsAddTensor<platform::CUDADeviceContext, T> { | |||
PADDLE_ENFORCE_EQ(in1_height, out_dims[0]); | |||
|
|||
auto& in1_value = input1.value(); | |||
framework::Vector<int64_t> in1_rows(input1.rows()); |
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.
Prevent unnecessary memcpy here.
Not related to this bug.
@@ -206,7 +206,7 @@ struct SelectedRowsAddToTensor<platform::CUDADeviceContext, T> { | |||
PADDLE_ENFORCE_EQ(in1_height, in2_dims[0]); | |||
|
|||
auto& in1_value = input1.value(); | |||
framework::Vector<int64_t> in1_rows(input1.rows()); |
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.
Prevent unnecessary memcpy here.
Not related to this bug.
paddle::platform::CUDADeviceContext ctx(gpu_place); | ||
paddle::platform::CUDADeviceContext& ctx = | ||
*reinterpret_cast<paddle::platform::CUDADeviceContext*>( | ||
paddle::platform::DeviceContextPool::Instance().Get(gpu_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.
Use the computation stream.
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.
Why it must use the DeviceContextPool here?
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.
I see. The copy of lod is async and it is in computation stream.
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.
Cool
paddle::platform::CUDADeviceContext ctx(gpu_place); | ||
paddle::platform::CUDADeviceContext& ctx = | ||
*reinterpret_cast<paddle::platform::CUDADeviceContext*>( | ||
paddle::platform::DeviceContextPool::Instance().Get(gpu_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.
Why it must use the DeviceContextPool here?
No description provided.