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

【Infer Symbolic Shape No.208】[BUAA] Add masked_multihead_attention_ op #67861

Merged
merged 12 commits into from
Sep 6, 2024

Conversation

Luohongzhige
Copy link
Contributor

PR Category

CINN

PR Types

Improvements

Description

#66444
添加masked_multihead_attention_ 算子符号推导接口
仅有Unittest,Optest暂不实现

Copy link

paddle-bot bot commented Aug 30, 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.

@luotao1 luotao1 added contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 labels Aug 30, 2024
@@ -75,7 +75,8 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(Linspace)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(LinearInterp)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Logspace)
// OP_DECLARE_INFER_SYMBOLIC_SHAPE(Lstm)
// OP_DECLARE_INFER_SYMBOLIC_SHAPE(MaskedMultiheadAttention_)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(MaskedMultiheadAttention)
Copy link
Contributor

Choose a reason for hiding this comment

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

只需要保留inplace声明就行,可以删掉这个declare

symbol::ShapeOrDataDimExprs{
symbol::TensorShapeOrDataDimExprs(cache_kv_shape)});

if (!beam_cache_offset_shape_or_data.isa<symbol::NullShapeOrDataDimExpr>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里直接判断operand传没传吧

// // pass
// return true;
// }
bool MaskedMultiheadAttentionOpInferSymbolicShape(
Copy link
Contributor

Choose a reason for hiding this comment

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

没有不带下划线版本的op了,yaml中的op名是masked_multihead_attention_

Copy link
Contributor

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 918ee36 into PaddlePaddle:develop Sep 6, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants