From f507e5c1f2683e6564db794890231ece2b04fa7d Mon Sep 17 00:00:00 2001 From: luotao1 Date: Mon, 3 Sep 2018 13:43:23 +0800 Subject: [PATCH] update multi-threads UT --- paddle/fluid/inference/analysis/analyzer.cc | 6 +++--- paddle/fluid/inference/analysis/analyzer_tester.cc | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/paddle/fluid/inference/analysis/analyzer.cc b/paddle/fluid/inference/analysis/analyzer.cc index 192ac2daa..c95bf3597 100644 --- a/paddle/fluid/inference/analysis/analyzer.cc +++ b/paddle/fluid/inference/analysis/analyzer.cc @@ -14,6 +14,7 @@ #include "paddle/fluid/inference/analysis/analyzer.h" #include +#include #include "paddle/fluid/inference/analysis/data_flow_graph_to_fluid_pass.h" #include "paddle/fluid/inference/analysis/dfg_graphviz_draw_pass.h" #include "paddle/fluid/inference/analysis/fluid_to_data_flow_graph_pass.h" @@ -41,7 +42,7 @@ class DfgPassManagerImpl final : public DfgPassManager { public: DfgPassManagerImpl() { // TODO(Superjomn) set the key with pass reprs. - LOG(INFO) + VLOG(3) << "-----------------------------------------------------------------"; if (FLAGS_IA_enable_ir) { AddPass("fluid-to-ir-pass", new FluidToIrPass); @@ -53,7 +54,7 @@ class DfgPassManagerImpl final : public DfgPassManager { if (!FLAGS_IA_output_storage_path.empty()) { AddPass("model-store-pass", new ModelStorePass); } - LOG(INFO) + VLOG(3) << "-----------------------------------------------------------------"; } @@ -112,7 +113,6 @@ void Analyzer::Run(Argument* argument) { "mul_lstm_fuse_pass", "graph_viz_pass", // "seq_concat_fc_fuse_pass", "graph_viz_pass", // "fc_fuse_pass", "graph_viz_pass" // - })); for (auto& x : data_) { diff --git a/paddle/fluid/inference/analysis/analyzer_tester.cc b/paddle/fluid/inference/analysis/analyzer_tester.cc index 6482752e0..0dd6f4402 100644 --- a/paddle/fluid/inference/analysis/analyzer_tester.cc +++ b/paddle/fluid/inference/analysis/analyzer_tester.cc @@ -335,18 +335,14 @@ void TestDituRNNPrediction(bool use_analysis_and_activate_ir = false, } } -// Directly infer with the original model. -TEST(Analyzer, DituRNN_without_analysis) { - LOG(INFO) << "ditu rnn without analysis"; +TEST(Analyzer, DituRNN) { TestDituRNNPrediction(false, 1); - TestDituRNNPrediction(false, 4); // multi-threads + TestDituRNNPrediction(true, 1); } -// Inference with analysis and IR. The IR module will fuse some large kernels. -TEST(Analyzer, DituRNN_with_analysis_with_IR) { - LOG(INFO) << "ditu rnn with analysis and IR fuse"; - TestDituRNNPrediction(true, 1); - TestDituRNNPrediction(true, 4); // multi-threads +TEST(Analyzer, DituRNN_multi_thread) { + TestDituRNNPrediction(false, 4); + TestDituRNNPrediction(true, 4); } } // namespace analysis -- GitLab