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

[AutoParallel] Add reduce_all spmd rule #59411

Merged
merged 5 commits into from
Nov 29, 2023

Conversation

deepllz
Copy link
Contributor

@deepllz deepllz commented Nov 27, 2023

PR types

New features

PR changes

Others

Description

添加对reduce_all算子切分推导规则的支持、添加相关的单元测试
Pcard-73145

Copy link

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

// NOTE(zhonghui): There is no reduce_all type of ncclRedOp_t, just use
// min to replace
red_type = ncclMin;
break;
}
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.

对的,从partial转换到replicate状态的时候,需要调用allReduce算子,无论是nccl还是gloo,都没有reduce_all这个type,只有sum、mean、max、min、prod这几种。这里用min来模拟bool类型的reduce_all操作,得到的结果是相同的。

opts->setReduceFunction(
static_cast<void (*)(void*, const void*, const void*, size_t)>(
&gloo::min<T>));
break;
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.

同上

Copy link
Contributor

@liuzhenhai93 liuzhenhai93 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

@GhostScreaming GhostScreaming left a comment

Choose a reason for hiding this comment

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

LGTM

@GhostScreaming GhostScreaming merged commit 87bf502 into PaddlePaddle:develop Nov 29, 2023
29 checks passed
@deepllz deepllz deleted the reduce_all branch December 7, 2023 13:29
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.

None yet

3 participants