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 / Fusion] Support fusion of Pattern with multi downstream #66034

Merged
merged 130 commits into from
Aug 5, 2024

Conversation

huangjiyi
Copy link
Member

@huangjiyi huangjiyi commented Jul 15, 2024

PR Category

CINN

PR Types

Improvements

Description

Pcard-76996

Done in this PR

  • AnchorFusion 多下游融合方案实现(目前只支持只有 ElementWiseOp 的子图)
  • 实现 FusionTracker 记录前端算子融合的过程,用于指导后端 IR 融合以保证前后端 Fusion 过程的一致性
  • 优化算子融合代码

Todo

  • 完善多下游融合实现,待支持包含 Transpose、BroadCast、Slice、Reduce 等 Op 的子图的多下游融合

Copy link

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

@paddle-bot paddle-bot bot added the contributor External developers label Jul 15, 2024
@huangjiyi huangjiyi force-pushed the fix-anchor-fusion branch from 8a29727 to 486d511 Compare July 16, 2024 08:32
@huangjiyi huangjiyi force-pushed the fix-anchor-fusion branch 2 times, most recently from b38e004 to 49bc25a Compare August 4, 2024 14:32
@huangjiyi huangjiyi changed the title [CINN / Fusion] Fix anchor fusion [CINN / Fusion] Support fusion of Pattern with multi downstream Aug 5, 2024
Copy link
Contributor

@2742195759 2742195759 left a comment

Choose a reason for hiding this comment

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

LGTM

count += is_elementwise;
}
}
return (count <= 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里应该是 T -> (T, T, T, B) 的场景还是会因为后端不支持报错。所以判断应该是 count < len(downstreams)

Copy link
Member Author

Choose a reason for hiding this comment

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

下个 PR 修复

Copy link
Contributor

@2742195759 2742195759 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾 for print usage

x = paddle.rand((32, 32, 128))
return (x,)

print("feifeifei")
Copy link
Member

Choose a reason for hiding this comment

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

之后 PR 删一下~

Copy link
Member Author

Choose a reason for hiding this comment

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

Get

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Aurelius84 Aurelius84 left a comment

Choose a reason for hiding this comment

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

LGTM

@2742195759 2742195759 merged commit 55629f8 into PaddlePaddle:develop Aug 5, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants