Skip to content

Commit 7c111a0

Browse files
author
Pei Yang
authored
add trt int8 support for elementwise_mul and scale (#25785)
1 parent 5246f5d commit 7c111a0

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

paddle/fluid/inference/tensorrt/op_teller.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ struct SimpleOpTypeSetTeller : public Teller {
5454
"leaky_relu",
5555
"fc",
5656
"relu6",
57-
"concat"};
57+
"concat",
58+
"scale",
59+
"elementwise_mul",
60+
"conv2d_transpose"};
5861
std::unordered_set<std::string> teller_set{
5962
"mul",
6063
"conv2d",

python/paddle/fluid/contrib/slim/quantization/quantization_pass.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,26 @@
4646
]
4747

4848
_out_scale_op_list = [
49-
"conv2d", "depthwise_conv2d", "mul", "matmul", "relu", "leaky_relu",
50-
"relu6", "sigmoid", "tanh", "prelu", "swish", "softmax", "batch_norm",
51-
"elementwise_add", "pool2d", "reshape2", "transpose2", "concat"
49+
"conv2d",
50+
"depthwise_conv2d",
51+
"mul",
52+
"matmul",
53+
"relu",
54+
"leaky_relu",
55+
"relu6",
56+
"sigmoid",
57+
"tanh",
58+
"prelu",
59+
"swish",
60+
"softmax",
61+
"batch_norm",
62+
"elementwise_add",
63+
"pool2d",
64+
"reshape2",
65+
"transpose2",
66+
"concat",
67+
"elementwise_mul",
68+
"scale",
5269
]
5370

5471
# list op real input and output names, to avoid processing input such as AxisTensor.
@@ -89,6 +106,8 @@
89106
"dropout": [["X"], ["Out"]],
90107
"batch_norm": [["X"], ["Y"]],
91108
"sigmoid": [["X"], ["Out"]],
109+
"elementwise_mul": [["X", "Y"], ["Out"]],
110+
"scale": [["X"], ["Out"]],
92111
}
93112

94113

0 commit comments

Comments
 (0)