Skip to content

[Operator]Delete XShape for squeeze output #67355

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
merged 7 commits into from
Aug 14, 2024

Conversation

Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Aug 12, 2024

PR Category

Operator Mechanism

PR Types

Deprecations

Description

Pcard-67164

What's New?

退场了动态图和新IR下 squeeze 算子中的XShape字段,实现动静统一,具体改动:

1. 在legacy里隔离旧静态图的定义

动态图和新IR的算子体系使用了 phi/ops.yaml,实现理想态的动静统一。为了保证旧IR下的算子表示层面的兼容,因此在legacy目录下static_ops.yaml和static_backward.yaml单独定义了squeeeze的前反向算子,Kernel使用 squeeze_with_xshape,并在Kernel定义中标记FIXME

2. 需要对squeeze2_grad的转换规则做添加

test_seq2seq 和 test_bmn 两个单测依赖squeeze2_grad的转换规则,并在单测体系下单独添加了test_squeeze_grad_translator.py 单测

3. 修改了pd_to_cinn pass 逻辑

移除了 pd_to_cinn_pass 中 SqueezeOpPattern 中的 ReplaceWithCinnReshape 逻辑,无需再处理XShape

4. 部分融合Pass需要移除XShape的DRR定义

目前框架里主要涉及squeeze_transpose_onednn_fuse_pass和fused_rotary_position_embedding_pass两个Pass

Copy link

paddle-bot bot commented Aug 12, 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.

winter-wang
winter-wang previously approved these changes Aug 13, 2024
zhangbo9674
zhangbo9674 previously approved these changes Aug 13, 2024
zyfncg
zyfncg previously approved these changes Aug 13, 2024
XiaoguangHu01
XiaoguangHu01 previously approved these changes Aug 14, 2024
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

@chen2016013 chen2016013 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

@Hongqing-work Hongqing-work 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 InferSymbolicShapeInterface

Copy link
Contributor

@gongshaotian gongshaotian 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 ops.yaml & SqueezeOpInferSymbolicShape

@Aurelius84 Aurelius84 merged commit 413d127 into PaddlePaddle:develop Aug 14, 2024
27 of 28 checks passed
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.

8 participants