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

[Semi-Auto] Replace the pointers in reshape-like spmd rule with smart pointers. #59101

Merged
merged 4 commits into from
Nov 23, 2023

Conversation

pkuzyc
Copy link
Contributor

@pkuzyc pkuzyc commented Nov 17, 2023

PR types

Others

PR changes

Others

Description

Pcard-76459
Replace the pointers in reshape-like spmd rule with smart pointers.

Copy link

paddle-bot bot commented Nov 17, 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.


void Split::set_input(DimTrans* dim) { input_dim_trans_ = dim; }
void Split::set_input(const std::shared_ptr<DimTrans>& dim) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shared_ptr类型的参数,是否有必要使用引用,一般建议使用值传参即可。

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

const std::set<int64_t>& sharded_input_dims) {
std::shared_ptr<DimTrans> GetDimTrans(
const std::shared_ptr<DimTrans>& dim_trans,
std::vector<std::vector<bool>>* shardable,
Copy link
Contributor

Choose a reason for hiding this comment

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

参数顺序:这里是否考虑把输出参数放到输入参数的后面?

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

@pkuzyc pkuzyc closed this Nov 21, 2023
@pkuzyc pkuzyc reopened this Nov 21, 2023
Copy link
Contributor

@deepllz deepllz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@zhiqiu zhiqiu merged commit 4499bdd into PaddlePaddle:develop Nov 23, 2023
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 2023
… pointers. (PaddlePaddle#59101)

* use smart pointer in reshape-like spmd rules

* remove ununsed code and comments

* replace the reference of shared_ptr in function arg list

* modify the arg order in GetDimTrans function
@pkuzyc pkuzyc deleted the fix_reshape_rule branch February 6, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants