-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Phi] Migrate tile_op into Phi #40371
Conversation
Thanks for your contribution! |
namespace paddle { | ||
namespace operators { | ||
|
||
inline std::vector<int> get_repeat_times( |
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.
get_repeat_times 要不要改为驼峰命名?
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.
这个函数只在fluid 下的XPU/NPU使用,因此两个设备的Kernel未在此PR迁移,因此此处仅做拆分。
out->set_dims(phi::make_ddim(out_shape)); | ||
if (out_shape[0] == x_dims[0]) { | ||
out->share_lod(x); | ||
} |
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.
out 设置一下dtype
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.
我在adam的PR里改,这个PR是否可以先合入。
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.
好的
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.
if (just_copy) { | ||
dev_ctx.template Alloc<T>(x_grad); | ||
|
||
paddle::framework::TensorCopy( |
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.
可以尝试使用phi下的copy来替代
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.
我在adam的PR改
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,67 @@ | |||
// 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.
这个文件里的内容或许可以迁到funcs下,将传入的context变成,多个参数传入
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.
这个函数只在fluid 下的XPU/NPU使用,因此两个设备的Kernel未在此PR迁移,因此此处仅做拆分。
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.
细节后续按建议再完善下
PR types
Function optimization
PR changes
OPs
Describe
[Phi] Migrate tile_op into Phi.