Skip to content

[CINN]Apply broadcast device lowering for too many broadcast tree bugs #66207

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

Conversation

Hongqing-work
Copy link
Contributor

PR Category

CINN

PR Types

Improvements

Description

Pcard-67164
This PR applys broadcast device lowering for too many broadcast tree bugs.

Copy link

paddle-bot bot commented Jul 18, 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.

Comment on lines +488 to +495
std::optional<std::shared_ptr<BroadcastTree>> GetBroadcastTreeForOptimize(
const OpLoweringGroupPtr& group) {
if (!FLAGS_cinn_bc_branch_optimize) return std::nullopt;

const common::BroadcastLeaf leaves = [&]() {
// NOTE(dev): Need UpdateShapeOrDataExprs firstly and the logic
// will be migated into BucketLower later.
UpdateGroupShapeOrDataExprs(const_cast<OpLoweringGroupPtr&>(group));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: broadcast tree完全接入之后此函数将仅用于pre_compiler判断,将不需要const_cast,这里只生效保底机制故将原来逻辑直接迁移至此保留const_cast

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM for const_cast

@Hongqing-work Hongqing-work merged commit 985b7eb into PaddlePaddle:develop Jul 22, 2024
31 checks passed
@Hongqing-work Hongqing-work deleted the apply-bc-device-lower branch September 5, 2024 08:25
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.

4 participants