Skip to content

Commit

Permalink
Add depthwise_conv2d to supported quantization list
Browse files Browse the repository at this point in the history
  • Loading branch information
wozna committed Dec 31, 2021
1 parent f0ee53c commit e2467db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Expand Up @@ -26,10 +26,10 @@ void CPUQuantizePlacementPass::ApplyImpl(ir::Graph* graph) const {
VLOG(3) << "Marks operators which are to be quantized.";
std::unordered_set<std::string> supported_op_types =
std::unordered_set<std::string>(
{"concat", "conv2d", "elementwise_add", "fc", "matmul",
"nearest_interp", "nearest_interp_v2", "pool2d", "prior_box",
"reshape2", "transpose2", "fusion_gru", "fusion_lstm", "multi_gru",
"slice"});
{"concat", "conv2d", "depthwise_conv2d", "elementwise_add", "fc",
"matmul", "nearest_interp", "nearest_interp_v2", "pool2d",
"prior_box", "reshape2", "transpose2", "fusion_gru", "fusion_lstm",
"multi_gru", "slice"});
const auto& excluded_ids_list =
Get<std::unordered_set<int>>("quantize_excluded_op_ids");
const auto& op_types_list =
Expand Down
Expand Up @@ -216,9 +216,6 @@ def test_quant_update_activation(self):
graph = quant2_int8_mkldnn_pass._update_activations(graph)
self.check_graph_after_pass(graph)


if core.avx_supported():

class TestQuant2Int8MkldnnPassNearestInterp(unittest.TestCase):
def op_name(self):
return "nearest_interp"
Expand Down Expand Up @@ -344,11 +341,11 @@ def test_quant_update_activation(self):
"filter": (False, input_scale_tensor),
"conv_output": (False, output_scale_tensor),
}

quant2_int8_mkldnn_pass._var_quant_scales = var_scale
graph = quant2_int8_mkldnn_pass._propagate_scales(graph)
graph = quant2_int8_mkldnn_pass._quantize_fp32_graph(graph)
self.check_graph_after_pass(graph)
if core.avx_supported():
quant2_int8_mkldnn_pass._var_quant_scales = var_scale
graph = quant2_int8_mkldnn_pass._propagate_scales(graph)
graph = quant2_int8_mkldnn_pass._quantize_fp32_graph(graph)
self.check_graph_after_pass(graph)

class TestQuant2Int8MkldnnPassNearestInterpV2(unittest.TestCase):
def op_name(self):
Expand Down

1 comment on commit e2467db

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

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

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.