-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[CINN] Add inplace ops order check in build_cinn_pass #72037
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] Add inplace ops order check in build_cinn_pass #72037
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
for (const auto& shared_value : shared_inplace_values) { | ||
inplace_ops_order_.emplace_back(); | ||
for (size_t i = 0; i < inplace_values_sets.size(); ++i) { | ||
if (inplace_values_sets[i].count(shared_value)) { | ||
inplace_ops_order_.back().push_back(inplace_ops[i]); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里看起来只考虑了input value的情况,如果是 b = op_(a), c = op_(b)
的情况可以处理吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以再加个单测检查下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个目前没办法写出因为 group 合并导致 inplace 顺序改变的 PR,本地测了包含几个 inplace 的 case 测试代码都没问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
paddle/fluid/pir/transforms/sub_graph_detector.cc:597
- [nitpick] The lambda get_inplace_root_value stops iterating upon detecting a cycle by breaking the loop. It may improve clarity and maintainability to add a comment explaining the cycle detection and its intended handling.
while (inplace_map.count(root)) {
PR Category
CINN
PR Types
Bug fixes
Description
Pcard-76996