-
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
【Hackathon 5th No.52】 为 Paddle 新增 unsqueeze 的 spmd 切分推导规则 -part #58296
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@pkuzyc 老师您好,CI已过,可以review了 |
Sorry to inform you that c33990f's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
// Step1: Build the transformation from | ||
// the original shape to the target shape | ||
|
||
std::vector<int64_t> out_shape(x_shape); |
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_shape 应该不需要拷贝。
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.
Done
|
||
std::vector<DimTrans*> MakeUnsqueezeDimTransReverse( | ||
const std::vector<int64_t>& out_shape, const std::vector<int64_t>& axis) { | ||
int64_t n = static_cast<int64_t>(out_shape.size() - axis.size()); |
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.
reverse 里输入的 rank 应该是知道的 (x_ndim),不用计算。
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.
Done
@pkuzyc 修改完毕,可以再次review了 |
const std::vector<int64_t>& out_shape, | ||
const std::vector<int64_t>& axis, | ||
const int& x_ndim, | ||
const int& out_ndim) { |
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.
整型参数直接传 int 就可以,不用传 const 引用,可以在下个 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.
LGTM
…lePaddle#58296) * add unsqueeze spmd rules * fix bugs * fix bugs * modify the code based on the first review * fix bugs
…lePaddle#58296) * add unsqueeze spmd rules * fix bugs * fix bugs * modify the code based on the first review * fix bugs
…lePaddle#58296) * add unsqueeze spmd rules * fix bugs * fix bugs * modify the code based on the first review * fix bugs
PR types
Others
PR changes
Others
Description
为 Paddle 新增 squeeze 和 unsqueeze 的 spmd 切分推导规则
#57262
https://github.com/PaddlePaddle/community/blob/master/pfcc/paddle-code-reading/auto_parallel/spmd_rules.md
【Hackathon 5th No.52】 为 Paddle 新增 squeeze 和 unsqueeze 的 spmd 切分推导规则 #57877