-
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
Support some ops for full quantization #40083
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,42 +47,14 @@ | |
] | ||
|
||
_out_scale_op_list = [ | ||
"conv2d", | ||
"depthwise_conv2d", | ||
"mul", | ||
"matmul", | ||
"matmul_v2", | ||
"relu", | ||
"leaky_relu", | ||
"relu6", | ||
"sigmoid", | ||
"tanh", | ||
"prelu", | ||
"swish", | ||
"softmax", | ||
"batch_norm", | ||
"layer_norm", | ||
"elementwise_add", | ||
"pool2d", | ||
"reshape2", | ||
"transpose2", | ||
"concat", | ||
"elementwise_mul", | ||
"scale", | ||
"slice", | ||
"hard_swish", | ||
"hard_sigmoid", | ||
"conv2d_transpose", | ||
"gru", | ||
"bilinear_interp", | ||
"nearest_interp", | ||
"trilinear_interp", | ||
"flatten", | ||
"flatten2", | ||
"transpose", | ||
"pad2d", | ||
"reshape", | ||
"layer_norm", | ||
"conv2d", "depthwise_conv2d", "mul", "matmul", "matmul_v2", "relu", | ||
"leaky_relu", "relu6", "sigmoid", "tanh", "prelu", "swish", "softmax", | ||
"batch_norm", "layer_norm", "elementwise_add", "pool2d", "reshape2", | ||
"transpose2", "concat", "elementwise_mul", "scale", "slice", "hard_swish", | ||
"hard_sigmoid", "conv2d_transpose", "gru", "bilinear_interp", | ||
"nearest_interp", "trilinear_interp", "flatten", "flatten2", "transpose", | ||
"pad2d", "reshape", "layer_norm", "split", "flatten_contiguous_range", | ||
"squeeze2", "nearest_interp_v2", "fill_constant_batch_size_like" | ||
] | ||
|
||
# list op real input and output names, to avoid processing input such as AxisTensor. | ||
|
@@ -137,6 +109,10 @@ | |
"flatten2": [["X"], ["Out"]], | ||
"unsqueeze2": [["X"], ["Out"]], | ||
"flatten_contiguous_range": [['X'], ["Out"]], | ||
"split": [['X'], ["Out"]], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. split需要特殊处理下么?类似于concat。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. out_threshold只输出一个即可,其余暂不需要特殊处理。 |
||
"squeeze2": [['X'], ["Out"]], | ||
"nearest_interp_v2": [['X'], ["Out"]], | ||
"fill_constant_batch_size_like": [['Input'], ["Out"]], | ||
} | ||
|
||
_conv_ops = ['conv2d', 'depthwise_conv2d', 'conv2d_transpose'] | ||
|
@@ -1804,7 +1780,8 @@ class AddQuantDequantPass(object): | |
"squeeze", "elementwise_sub", "mul", "matmul", "relu", "relu6", | ||
"leaky_relu", "tanh", "swish", "scale", "transpose", "transpose2", | ||
"sigmoid", "pad2d", "flatten", "flatten2", "batch_norm", "layer_norm", | ||
"matmul_v2" | ||
"matmul_v2", "split", "flatten_contiguous_range", "squeeze2", | ||
"nearest_interp_v2", "fill_constant_batch_size_like" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
] | ||
|
||
# To be compatible with PaddleSlim, not remove _activation_type for now | ||
|
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.
list后边加个逗号,修改文件后的diff会更直观。
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.
done