Skip to content

[Auto Parallel] Add spmd rule No.9 for group_norm and group_norm_grad ops. #72946

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 27 commits into from
Jun 13, 2025

Conversation

Glencsa
Copy link
Contributor

@Glencsa Glencsa commented May 26, 2025

PR Category

Auto Parallel

PR Types

New features

Description

Copy link

paddle-bot bot commented May 26, 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.

Comment on lines 120 to 145
VLOG(4) << "shape size of x: 3~5";
VLOG(4) << "Einsum Notation: " << x_axes << "," << scale_axes << ","
<< bias_axes << "-->" << out_axes << "," << mean_axes << ","
<< variance_axes;
VLOG(4) << "X"
<< " shape: [" << str_join(x_shape) << "] "
<< "src_dims_mapping: [" << str_join(x_dist_attr_src.dims_mapping())
<< "] "
<< "dst_dims_mapping: [" << str_join(x_dims_mapping) << "]";
VLOG(4) << "Scale"
<< " shape: [" << str_join(scale_shape) << "] "
<< "src_dims_mapping: [" << str_join(scale_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(scale_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Bias"
<< " shape: [" << str_join(bias_shape) << "] "
<< "src_dims_mapping: [" << str_join(bias_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(bias_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Out dims mapping: [" << str_join(out_dist_attr.dims_mapping())
<< "]";
VLOG(4) << "Mean dims mapping: [" << str_join(mean_dist_attr.dims_mapping())
<< "]";
VLOG(4) << "Variance dims mapping: ["
<< str_join(variance_dist_attr.dims_mapping()) << "]";
VLOG(4) << std::endl;
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 use macro LOG_SPMD_INPUT or LOG_SPMD_OUTPUT to simplify log code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I will use it to simplify log code in next commit.

Comment on lines 330 to 367
VLOG(4) << "Scale"
<< " shape: [" << str_join(scale_shape) << "] "
<< "src_dims_mapping: [" << str_join(scale_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(scale_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Bias"
<< " shape: [" << str_join(bias_shape) << "] "
<< "src_dims_mapping: [" << str_join(bias_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(bias_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Y"
<< " shape: [" << str_join(y_shape) << "] "
<< "src_dims_mapping: [" << str_join(y_dims_mapping) << "] "
<< "dst_dims_mapping: [" << str_join(y_dist_attr_dst.dims_mapping())
<< "]";
VLOG(4) << "Mean"
<< " shape: [" << str_join(mean_shape) << "] "
<< "src_dims_mapping: [" << str_join(mean_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(mean_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Variance"
<< " shape: [" << str_join(variance_shape) << "] "
<< "src_dims_mapping: [" << str_join(variance_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(variance_dist_attr_dst.dims_mapping()) << "]";
VLOG(4) << "Y_grad"
<< " shape: [" << str_join(y_grad_shape) << "] "
<< "src_dims_mapping: [" << str_join(y_grad_dims_mapping) << "] "
<< "dst_dims_mapping: ["
<< str_join(y_grad_dist_attr_dst.dims_mapping()) << "]";

VLOG(4) << "X_grad dims mapping: ["
<< str_join(x_grad_dist_attr.dims_mapping()) << "]";
VLOG(4) << "Scale_grad dims mapping: ["
<< str_join(scale_grad_dist_attr.dims_mapping()) << "]";
VLOG(4) << "Bias_grad dims mapping: ["
<< str_join(bias_grad_dist_attr.dims_mapping()) << "]";
VLOG(4) << std::endl;
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 use macro LOG_SPMD_INPUT or LOG_SPMD_OUTPUT to simplify log code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shall we use macro LOG_SPMD_INPUT or LOG_SPMD_OUTPUT to simplify log code

Thanks, I will use it to simplify log code in next commit.

Copy link

paddle-ci-bot bot commented Jun 11, 2025

Sorry to inform you that f82d50d's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1
Copy link
Contributor

luotao1 commented Jun 12, 2025

@Glencsa 每条评审意见需要都回复

@Glencsa
Copy link
Contributor Author

Glencsa commented Jun 13, 2025

/re-run all-failed

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

@luotao1 luotao1 merged commit dcdd774 into PaddlePaddle:develop Jun 13, 2025
75 of 81 checks passed
@Glencsa Glencsa deleted the group_norm branch June 14, 2025 01:22
DrRyanHuang pushed a commit to DrRyanHuang/Paddle that referenced this pull request Jun 14, 2025
… ops. (PaddlePaddle#72946)

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

* Add spmd_rule for group_norm ops.

* Add spmd_rule for group_norm ops.

* add CI test for group_norm.

* add CI test for group_norm.

* fix bug.

* fix bug(PD_REGISTER_SPMD_RULE not surport string)

* PD_REGISTER_SPMD_RULE  need less than 5?

* fix bug.

* fix bug.

* fix bug.

* fix bug.

* fix bug.

* fix bug.

* add partial status.

* fix bug.

* fix bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants