-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[AP] Implement pcc compile engine frontend of trivial fusion. #72640
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
Conversation
…interpret_cast to avoid strict-aliasing.
…atement added by previous commit.
Fix the mismatched output numerical order issue
你的PR提交成功,感谢你对开源项目的贡献! |
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.
LGTM
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.
paddle.base.libpaddle.pir.bind_symbolic_constraints( | ||
forward_program, self._constraints | ||
) | ||
paddle.base.libpaddle.pir.apply_cinn_pass(forward_program) | ||
|
||
elif self._backend.is_pcc(): |
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.
pcc backend 没有调用 apply_general_passes
是因为 CSE 有问题是么?如果是这样的话我后面可以看看
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.
多谢啦。pcc backend还需要通过实验验证需要加哪些Pass,目前功能尚不完整。CSE暂时没发现问题。
…Paddle#72640) * 1) add PCC compile engine; 2) add pcc.fuse.by_register() with-block api * Fix compiling error when cinn is not enabled. * Polish copyright and error messages. --------- Co-authored-by: Liu Yiqun <liuyiqun01@baidu.com>
PR Category
CINN
PR Types
New features
Description
pcard-76996
动机
当前pcc受制于组合算子拆解和CINN融合前端,用户不能直接操控融合算子范围。
本次pr为pcc.compile切换了新的编译引擎,该引擎直接按用户意图融合代码(相信程序员),不依赖组合算子拆解和CINN融合前端,然后直接进行apass处理。
示例用法
pcc.fuse.by_register
示例日志
PCC
编译引擎总共分如下几个步骤:ApplyApFacadePass
.将pd_op.ap_facade
替换成ap_op.facade
ApplyFuseApTrivialPass
. 将介于pd_op.ap_trivial_fusion_begin
和pd_op.ap_trivial_fusion_end
之间的op融合成cinn_op.fusion
ApplyGenerateShapePass
. 将用于处理动态形状的算子聚合成cinn_op.generate_shape
算子ApplyApGenericDrrPass
. 应用ap_path
参数指定的系统的apass。上述日志此步骤报错,因为本示例程序没有配apass。ApplyFallbackToPhiPass
. 将未成功编译的cinn_op.fusion
子图降级到phi