-
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
【Infer Symbolic Shape No.208】[BUAA] Add masked_multihead_attention_ op #67861
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -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) |
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.
只需要保留inplace声明就行,可以删掉这个declare
symbol::ShapeOrDataDimExprs{ | ||
symbol::TensorShapeOrDataDimExprs(cache_kv_shape)}); | ||
|
||
if (!beam_cache_offset_shape_or_data.isa<symbol::NullShapeOrDataDimExpr>()) { |
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.
这里直接判断operand传没传吧
// // pass | ||
// return true; | ||
// } | ||
bool MaskedMultiheadAttentionOpInferSymbolicShape( |
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.
没有不带下划线版本的op了,yaml中的op名是masked_multihead_attention_
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.
LGTM
PR Category
CINN
PR Types
Improvements
Description
#66444
添加masked_multihead_attention_ 算子符号推导接口
仅有Unittest,Optest暂不实现