-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[Paddle-Inference] support preln-ernie: add preln_emb_eltwise_layernorm_op, preln_skip_layernorm_op #39570
Conversation
Thanks for your contribution! |
#if IS_TRT_VERSION_GE(7000) | ||
VLOG(4) << "convert fluid PrelnEmbEltwiseLayerNorm op to tensorrt layer"; | ||
|
||
if (!(engine_->use_oss() && engine_->with_interleaved())) { |
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部分,这样即便跑不了trt plugin,也不会挂掉。
const framework::Scope& scope, bool test_mode) override { | ||
#if IS_TRT_VERSION_GE(7000) | ||
VLOG(4) << "convert fused preln_skip_layernorm op to tensorrt layer"; | ||
if (!(engine_->use_oss() && engine_->with_interleaved())) { |
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.
同上
@@ -1007,6 +1009,24 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8, | |||
} | |||
} | |||
|
|||
if (op_type == "fused_preln_embedding_eltwise_layernorm") { |
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.
如果没有进入trt,该融合pass没有原生kernel实现,运行时会报错。所以判断是否可以提前到pass阶段?如果不可以,这里可以直接报错了,信息会更明确
@@ -1316,6 +1336,17 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8, | |||
} | |||
} | |||
|
|||
if (op_type == "preln_skip_layernorm") { |
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.
同上
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.
以上几个问题请提pr修复
好的~ |
PR types
Others
PR changes
Others
Describe
支持 preln 结构的ernie模型,增加 preln_emb_eltwise_layernorm_op, preln_skip_layernorm_op 两个op