From b4b169467ba27d04e6d4bd5c6bc3f7abbba04c65 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Wed, 29 May 2019 16:46:20 +0800 Subject: [PATCH] add fc_mkldnn_pass in compare_mkldnn (#17712) test=develop --- paddle/fluid/inference/tests/api/analyzer_bert_tester.cc | 1 + paddle/fluid/inference/tests/api/analyzer_dam_tester.cc | 1 + paddle/fluid/inference/tests/api/analyzer_mm_dnn_tester.cc | 1 + paddle/fluid/inference/tests/api/analyzer_transformer_tester.cc | 1 + paddle/fluid/inference/tests/api/analyzer_vis_tester.cc | 1 + 5 files changed, 5 insertions(+) diff --git a/paddle/fluid/inference/tests/api/analyzer_bert_tester.cc b/paddle/fluid/inference/tests/api/analyzer_bert_tester.cc index fda6cf358d3..54b74a537c7 100644 --- a/paddle/fluid/inference/tests/api/analyzer_bert_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_bert_tester.cc @@ -184,6 +184,7 @@ void compare(bool use_mkldnn = false) { SetConfig(&cfg); if (use_mkldnn) { cfg.EnableMKLDNN(); + cfg.pass_builder()->AppendPass("fc_mkldnn_pass"); } std::vector> inputs; diff --git a/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc b/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc index 3efe17c8108..83bf99ec8aa 100644 --- a/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_dam_tester.cc @@ -252,6 +252,7 @@ void compare(bool use_mkldnn = false) { std::unordered_set op_list = {"softmax", "elementwise_add", "relu"}; cfg.SetMKLDNNOp(op_list); + cfg.pass_builder()->AppendPass("fc_mkldnn_pass"); } std::vector> input_slots_all; diff --git a/paddle/fluid/inference/tests/api/analyzer_mm_dnn_tester.cc b/paddle/fluid/inference/tests/api/analyzer_mm_dnn_tester.cc index 245357bfff8..17c670a68cc 100644 --- a/paddle/fluid/inference/tests/api/analyzer_mm_dnn_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_mm_dnn_tester.cc @@ -147,6 +147,7 @@ void compare(bool use_mkldnn = false) { if (use_mkldnn) { cfg.EnableMKLDNN(); + cfg.pass_builder()->AppendPass("fc_mkldnn_pass"); } std::vector> input_slots_all; diff --git a/paddle/fluid/inference/tests/api/analyzer_transformer_tester.cc b/paddle/fluid/inference/tests/api/analyzer_transformer_tester.cc index 147c7712fb8..f2195966add 100644 --- a/paddle/fluid/inference/tests/api/analyzer_transformer_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_transformer_tester.cc @@ -220,6 +220,7 @@ void compare(bool use_mkldnn = false) { SetConfig(&cfg); if (use_mkldnn) { cfg.EnableMKLDNN(); + cfg.pass_builder()->AppendPass("fc_mkldnn_pass"); } std::vector> input_slots_all; diff --git a/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc b/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc index 3f020f3cbb6..5f65229ecd5 100644 --- a/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_vis_tester.cc @@ -133,6 +133,7 @@ void compare(bool use_mkldnn = false) { SetConfig(&cfg); if (use_mkldnn) { cfg.EnableMKLDNN(); + cfg.pass_builder()->AppendPass("fc_mkldnn_pass"); } std::vector> input_slots_all; -- GitLab