Skip to content

[Auto Parallel]Add spmd_rule for min and min_grad ops. #72269

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

Merged
merged 8 commits into from
Apr 23, 2025

Conversation

Glencsa
Copy link
Contributor

@Glencsa Glencsa commented Apr 15, 2025

PR Category

Auto Parallel

PR Types

New features

Description

Add spmd_rule for min and min_grad ops.

Copy link

paddle-bot bot commented Apr 15, 2025

你的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 Apr 15, 2025
@Glencsa Glencsa changed the title [Auto Parallel]Add spmd_rule for min ops. [Auto Parallel]Add spmd_rule for min and min_grad ops. Apr 17, 2025
phi::distributed::SpmdInfo forward_info =
phi::distributed::ReductionMinInferSpmdDynamic(x, axis, keep_dim);
check_dim_mapping(forward_info.second[0], {-1, -1});
check_partial_dims(forward_info.second[0], {0});
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we test backward?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The spmd_rule function of min_grad reuses ReductionGradInferSpmd, which has already been validated through previous CI tests.

Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

@jeff41404 jeff41404 merged commit d9cec09 into PaddlePaddle:develop Apr 23, 2025
36 of 37 checks passed
@Glencsa Glencsa deleted the add_min_ops_spmd branch April 23, 2025 07:31
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
…72269)

* add unary ops which have spmd_rule but not add in yaml file.

* Add spmd_rule for min operator

* add head file.

* add CI to test min ops.

* add spmd rules for min_grad ops.

* Add cpp unit test for spmd_rule of min and min_grad ops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants