Skip to content

Conversation

@NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Jul 2, 2025

PR Category

Auto Parallel

PR Types

New features

Description

einsum 算子增加 spmd rule

@paddle-bot
Copy link

paddle-bot bot commented Jul 2, 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 Jul 2, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 99.05213% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@2255259). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/infermeta/spmd_rules/einsum.cc 99.05% 2 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## develop #73753 +/- ## ========================================== Coverage ? 99.05% ========================================== Files ? 1 Lines ? 211 Branches ? 0 ========================================== Hits ? 209 Misses ? 2 Partials ? 0 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@NKNaN
Copy link
Contributor Author

NKNaN commented Jul 3, 2025

/re-run all-failed

std::string* output) {
// For fwd spmd rule, only those diagonal labels in output should not be
// sharded. But for bwd spmd rule, input and output are switched. So we simply
// set the spmd rule here to replace all diagonal labels as 1.
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.

已添加

}
}

bool IsEinsumOuter(const std::string& equation) {
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.

已添加

bool IsEinsumOuter(const std::string& equation) {
std::vector<std::string> inputs;
std::string output;
ParseEinsumEquation(equation, &inputs, &output);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里在调用之前有 ParseEinsumEquation 了,是不是不用调用了,直接把参数传进来?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

嗯嗯,我改了一下

@NKNaN
Copy link
Contributor Author

NKNaN commented Jul 13, 2025

/re-run all-failed

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

@pkuzyc pkuzyc merged commit b3bdf7e into PaddlePaddle:develop Jul 17, 2025
127 of 137 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

3 participants