-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【Inference PIR】add fused_rotary_position_embedding_pass #65265
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -623,6 +623,7 @@ const std::vector<std::string> kPirGpuPasses{ | |||
"transpose_flatten_concat_fuse_pass", | |||
"remove_redundant_transpose_pass", | |||
"transfer_layout_pass", | |||
"fused_rotary_position_embedding_pass", |
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.
这个pass放在embedding_eltwise_layernorm_fuse_pass前一个
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.
好的
|
||
auto axis = match_ctx.Attr<std::vector<int64_t>>("full_13_value"); | ||
auto axis_2 = match_ctx.Attr<std::vector<int64_t>>("full_12_value"); | ||
return check_axes(axis) && check_axes(axis_2); |
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.
这个地方return了,后面的check就不会执行了吧
return check_unsqueeze_axes(unsqueeze_axis) && | ||
check_unsqueeze_axes(unsqueeze_axis_1) && | ||
check_unsqueeze_axes(unsqueeze_axis_2) && | ||
check_unsqueeze_axes(unsqueeze_axis_3); |
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.
同理
…#65265) * fused * 前面retrun true后面就不检查了 * 修改return true的后面无法检查 * 删除多余的注释
PR Category
Inference
PR Types
New features
Description
Pcard-71500
增加fused_rotary_position_embedding_pass
A30测试结果:
Llama-7b batch-size:1 no fused_rotary_position_embedding_pass:32857.339ms
Llama-7b batch-size:1 have fused_rotary_position_embedding_pass:31191.201ms
Llama-7b batch-size:4 no fused_rotary_position_embedding_pass:52057.086ms
Llama-7b batch-size:4 have fused_rotary_position_embedding_pass:50541.888ms
在pir 下,llama-7b 模型在 batch_size=1 与batch_size=4 的平均时延方面分别有 5.071% 与 2.911% 的性能提升,其余模型无明显影响;显存方面基本持平