Skip to content
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

Merged
merged 9 commits into from
Nov 6, 2023

Conversation

WintersMontagne10335
Copy link
Contributor

@paddle-bot
Copy link

paddle-bot bot commented Oct 21, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Oct 21, 2023
@WintersMontagne10335
Copy link
Contributor Author

@pkuzyc 老师您好,CI已过,可以review了

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Oct 29, 2023

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out_shape 应该不需要拷贝。

Copy link
Contributor Author

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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverse 里输入的 rank 应该是知道的 (x_ndim),不用计算。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@WintersMontagne10335
Copy link
Contributor Author

@pkuzyc 修改完毕,可以再次review了

@luotao1 luotao1 changed the title 【Hackathon 5th No.52】 为 Paddle 新增 unsqueeze 的 spmd 切分推导规则 【Hackathon 5th No.52】 为 Paddle 新增 unsqueeze 的 spmd 切分推导规则 -part Nov 3, 2023
const std::vector<int64_t>& out_shape,
const std::vector<int64_t>& axis,
const int& x_ndim,
const int& out_ndim) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整型参数直接传 int 就可以,不用传 const 引用,可以在下个 pr 修复

Copy link
Contributor

@pkuzyc pkuzyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit 67a6a31 into PaddlePaddle:develop Nov 6, 2023
28 checks passed
zeroRains pushed a commit to zeroRains/Paddle that referenced this pull request Nov 8, 2023
…lePaddle#58296)

* add unsqueeze spmd rules

* fix bugs

* fix bugs

* modify the code based on the first review

* fix bugs
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
…lePaddle#58296)

* add unsqueeze spmd rules

* fix bugs

* fix bugs

* modify the code based on the first review

* fix bugs
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
…lePaddle#58296)

* add unsqueeze spmd rules

* fix bugs

* fix bugs

* modify the code based on the first review

* fix bugs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants