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

[PIR][Inference] pir support multihead_matmul_fuse_pass to fuse a multihead_matmul op and other Important works #60892

Merged

Conversation

yuanlehome
Copy link
Contributor

@yuanlehome yuanlehome commented Jan 17, 2024

PR types

Others

PR changes

Others

Description

本PR主要做了如下工作:

  1. 升级了常量折叠pass,支持builtin.combine op的折叠,思路是将其与下一个op一起打包去执行;

  2. 添加了multihead_matmul_fuse_pass,支持两种pattern的fuse;
    实现中,关于weights和biases都是通过算子组合的形式(这里是reshape+combine+concat)的形式模拟计算,之后再借助常量折叠pass将插入的用于模拟计算的op给折叠起来。

  3. 为DRR的ResultPattern添加了一些简单常用的属性,书写简洁清晰;

  4. 相关修改已在多个关键模型上验证过,均没有问题。

TOOD:

  1. 未来可能要支持builtin.slice等其他内建op的折叠

Others

Pcard-71500

Copy link

paddle-bot bot commented Jan 17, 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.

@yuanlehome yuanlehome force-pushed the pir_support_attention_fuse_pass branch from f6703d6 to f4a62d1 Compare January 17, 2024 08:13
@yuanlehome yuanlehome force-pushed the pir_support_attention_fuse_pass branch from eccc5de to 7cc52c2 Compare January 17, 2024 10:38
@yuanlehome yuanlehome force-pushed the pir_support_attention_fuse_pass branch from ea846ed to aad8b40 Compare January 17, 2024 13:38
@yuanlehome yuanlehome changed the title [PIR][Inference] pir support attention_fuse_pass to fuse a multihead_matmul op [PIR][Inference] pir support multihead_matmul_fuse_pass to fuse a multihead_matmul op and other Important works Jan 17, 2024
zyfncg
zyfncg previously approved these changes Jan 18, 2024
@yuanlehome yuanlehome merged commit 81f0b07 into PaddlePaddle:develop Jan 19, 2024
29 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.

None yet

4 participants