-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
0f25bf0
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.
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.
LGTM for InferSymbolicShapeInterface
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 for ops.yaml & SqueezeOpInferSymbolicShape
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