Skip to content

Commit

Permalink
filter unsupported inputs for elementwise op in op teller
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxinxin08 committed Apr 1, 2022
1 parent e6a19ae commit 2b332c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions paddle/fluid/inference/tensorrt/op_teller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,21 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
VLOG(3) << "Now trt may not support two 1d tensor elementwise op.";
return false;
}
if (op_type == "elementwise_add" || op_type == "elementwise_mul") {
if (x_var_desc->Persistable()) {
VLOG(3) << "Input X is a parameter which is not supported for "
"elementwise_add/elementwise_mul in tensorrt, swap x and "
"y will work";
return false;
}
}
if (op_type == "elementwise_sub" || op_type == "elementwise_div") {
if (x_var_desc->Persistable() || y_var_desc->Persistable()) {
VLOG(3) << "Input X or Input Y is a parameter which is not supported "
"for elementwise_sub/elementwise_div in tensorrt";
return false;
}
}
}

if (op_type == "stack") {
Expand Down

1 comment on commit 2b332c8

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 2b332c8 Apr 1, 2022

Choose a reason for hiding this comment

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

🕵️ CI failures summary

🔍 PR: #41253 Commit ID: 2b332c8 contains failed CI.

🔹 Failed: PR-CI-Coverage

Unknown Failed
Unknown Failed

Please sign in to comment.