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

[Arm]Add fused_attention #9878

Merged
merged 14 commits into from
Feb 22, 2023
Merged

Conversation

sprouteer
Copy link
Collaborator

@sprouteer sprouteer commented Dec 27, 2022

PR devices
ARM

PR types
New features

PR changes
PASS, OP

Description

  1. 修改gemm实现,之前只支持m方向bias,新添加n方向bias,支持v7和v8实现。
  2. 添加matmul_v2 + elementwise_add int8精度融合成fc。
  3. 添加了针对ernie模型的pass -> lite_ernie_attention_fuse_pass, 目前支持arm cpu int8精度
  4. 添加fused_attention_op,添加arm cpu实现
  5. 部分测试数据如下

image

@paddle-bot
Copy link

paddle-bot bot commented Dec 27, 2022

Thanks for your contribution!

@@ -111,3 +111,4 @@ USE_MIR_PASS(reshape_calc_offline_pass);
USE_MIR_PASS(keepdims_convert_pass);
USE_MIR_PASS(op_fusion_minimal_set_pass);
USE_MIR_PASS(lite_sigmoid_elementmul_fuse_pass);
USE_MIR_PASS(lite_transformer_attention_fuse_pass);
Copy link
Collaborator

Choose a reason for hiding this comment

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

我感觉不用加 lite_ 前缀了吧?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@zhupengyang zhupengyang left a comment

Choose a reason for hiding this comment

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

LGTM,剩下的可以后面改

Comment on lines +37 to +39
} else {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

不需要else

Comment on lines +48 to +50
.BindTargets({TARGET(kARM)})
.ExcludeTargets(
{TARGET(kXPU), TARGET(kOpenCL), TARGET(kMetal), TARGET(kNNAdapter)})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.BindTargets({TARGET(kARM)})
.ExcludeTargets(
{TARGET(kXPU), TARGET(kOpenCL), TARGET(kMetal), TARGET(kNNAdapter)})
.ExcludeTargets({TARGET(kAny))
.BindTargets({TARGET(kARM)})

@sprouteer sprouteer merged commit b6f0a9f into PaddlePaddle:develop Feb 22, 2023
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