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

[CINN]delete redundant SetShapeOrDataForValue #64470

Merged
merged 4 commits into from
May 23, 2024

Conversation

Hongqing-work
Copy link
Contributor

PR Category

CINN

PR Types

Others

Description

Pcard-67164
This PR delete redundant SetShapeOrDataForValue.

Copy link

paddle-bot bot commented May 20, 2024

你的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.

}

if (VLOG_IS_ON(4)) {
::std::cerr << ">>>>>>>>>>>>>>>>>>>> cinn_op.fusion(op_id: op_"
Copy link
Contributor

Choose a reason for hiding this comment

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

这个不像是error信息,对调试如果没有作用的话就去掉吧

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

return Pattern2Placement{{rhs, lhs}};
}
if (lhs.isa<std::string>()) {
if (GetSymbolSet(rhs).count(ToString(lhs)) != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这样对于 S0*S1*S2 <----> S0*S2 的情况是不是处理不了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里我们只用保证uniform的符号不被替换就可以了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已更新替换机制

@@ -120,6 +120,12 @@ using Pattern2Placement = std::unordered_map<symbol::DimExpr, symbol::DimExpr>;
Pattern2Placement ConstructCstrLhsEqRhsReplacement(
const symbol::Broadcastable<symbol::DimExpr>& broadcastable_condition) {
auto [lhs, rhs] = *broadcastable_condition;
if (SubstituteDimExpr(rhs, Pattern2Placement{{rhs, lhs}}) != rhs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

rhs != lhs的情况下,这个条件分支一定是true吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修复,上一个commit里发生了粘贴错误

@zyfncg zyfncg merged commit 306f2d2 into PaddlePaddle:develop May 23, 2024
32 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 23, 2024
* [CINN]delete redundant SetShapeOrDataForValue

* update broadcast_tree Substitute policy

* fix

* fix
chen2016013 pushed a commit to chen2016013/Paddle that referenced this pull request May 26, 2024
* [CINN]delete redundant SetShapeOrDataForValue

* update broadcast_tree Substitute policy

* fix

* fix
@Hongqing-work Hongqing-work deleted the delete-redundant-shape-set branch May 31, 2024 02:21
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.

2 participants