-
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
Move conv to pten #39354
Move conv to pten #39354
Conversation
Thanks for your contribution! |
323ccd4
to
e4ee16b
Compare
67aa9ae
to
2a44c23
Compare
907d2a5
to
097dcaf
Compare
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
… move_conv_to_pten
// #ifndef PADDLE_WITH_ASCEND_CL | ||
// if (input_data_type == framework::proto::VarType::FP16) { | ||
// PADDLE_ENFORCE_EQ( | ||
// library, framework::LibraryType::kCUDNN, | ||
// platform::errors::InvalidArgument( | ||
// "float16 can only be used when CUDNN or NPU is used")); | ||
// } | ||
// #endif |
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.
这里注释如果不需要的话后面可以删掉
@@ -0,0 +1,61 @@ | |||
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
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.
double_grad的kernel可以和一阶grad放同一个文件里
} // namespace phi | ||
|
||
PD_REGISTER_KERNEL( | ||
conv2d_grad_grad, CPU, ALL_LAYOUT, phi::ConvGradGradKernel, float, double) { |
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.
xxx_grad_grad
可以后面统一为xxx_double_grad
inline void TransToChannelFirst(const DeviceContext& context, | ||
const Tensor* input, | ||
Tensor* transformed_input) { | ||
VLOG(5) << "Why am I called?"; |
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.
??
@@ -0,0 +1,13 @@ | |||
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
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.
这个文件是不可以删掉?
auto filter_dims = filter.dims(); | ||
|
||
DDim in_data_dims; | ||
const paddle::framework::DataLayout data_layout = |
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.
paddle::framework::->phi::?
|
||
#include "paddle/fluid/operators/math/padding.h" | ||
#include "paddle/fluid/platform/cudnn_workspace_helper.h" | ||
#include "paddle/fluid/platform/float16.h" |
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.
include "paddle/fluid/platform/float16.h" 可以去掉
|
||
#include "paddle/fluid/operators/math/padding.h" | ||
#include "paddle/fluid/platform/cudnn_workspace_helper.h" | ||
#include "paddle/fluid/platform/float16.h" |
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.
include "paddle/fluid/platform/float16.h" 可去掉
auto blas = phi::funcs::GetBlas<Context, T>(dev_ctx); | ||
|
||
if (input_grad) { | ||
input_grad->mutable_data<T>(dev_ctx.GetPlace()); |
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.
dev_ctx.Alloc
} | ||
|
||
if (filter_grad) { | ||
filter_grad->mutable_data<T>(dev_ctx.GetPlace()); |
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.
同上
… move_conv_to_pten
… move_conv_to_pten
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
PR types
Breaking changes
PR changes
OPs
Describe
move conv to pten