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

[Pass] Support transpose_Y in matmul_elt_add_fuse_pass #7162

Conversation

zhaoyang-star
Copy link
Collaborator

@zhaoyang-star zhaoyang-star commented Oct 10, 2021

【问题】
matmul中的transpose_Y参数为true时,无法通过 matmul_elt_add_fuse_pass 融合为FC,也无法通过 matmul_fuse_pass 将matmul转换为mul
比如如下模型结构中,matmul中的transpose_Y参数为true,经 opt 图优化前后结构一样,无法转为FC进行计算。
image

【本PR工作】
在 matmul_elt_add_fuse_pass 中实现支持这一 case:transpose_YtrueYpersistable()
如上提到的子结构经该 pass 后,可以转为FC

【效果】
使用 cls_blur_model_fp32 模型验证,arm cpu/opencl 精度保持不变。

@paddle-bot-old
Copy link

Thanks for your contribution!

Copy link
Collaborator

@DannyIsFunny DannyIsFunny 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
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

LGTM

@zhaoyang-star zhaoyang-star merged commit e24060b into PaddlePaddle:develop Oct 11, 2021
@zhaoyang-star zhaoyang-star deleted the matmul_elt_add_fuse_pass_support_transpose_Y branch October 11, 2021 10:01
zhaoyang-star added a commit to zhaoyang-star/Paddle-Lite that referenced this pull request Oct 11, 2021
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.

3 participants