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

[CINN]Add qkv unpack attn #64439

Merged
merged 10 commits into from
May 23, 2024
Merged

Conversation

phlrain
Copy link
Collaborator

@phlrain phlrain commented May 20, 2024

PR Category

CINN

PR Types

Others

Description

pcard-76996

添加q k v unpack的attention
q = [1, 1, head * head_dim]
k = [1, seq_len, head * head_dim]
v = [1, seq_len, head * head_dim]
当前仅支持bs = 1的情况,后续会逐步完善

Copy link

paddle-bot bot commented May 20, 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.

@phlrain phlrain changed the title Add qkv unpack attn [CINN]Add qkv unpack attn May 23, 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

@@ -2514,6 +2514,16 @@
backward : put_along_axis_grad
interfaces : paddle::dialect::InferSymbolicShapeInterface

- op : qkv_unpack_mha
Copy link
Contributor

Choose a reason for hiding this comment

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

看起来这个是一个fusion op,应该放到fused_ops.yaml里?

Copy link
Contributor

@zyfncg zyfncg left a comment

Choose a reason for hiding this comment

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

TODO:该算子移到fusion_ops.yaml中

@phlrain phlrain merged commit 6e7449c into PaddlePaddle:develop May 23, 2024
31 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 23, 2024
* add fast infer attention

* remove usless code

* fix rocm compile bug

* polish code

* fix conflict

* remove depulicate
chen2016013 pushed a commit to chen2016013/Paddle that referenced this pull request May 26, 2024
* add fast infer attention

* remove usless code

* fix rocm compile bug

* polish code

* fix conflict

* remove depulicate
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.

5 participants