From 5ecdc49c6b234b3709e7466dd3e3b30c6326368d Mon Sep 17 00:00:00 2001 From: luotao1 Date: Fri, 15 Mar 2019 16:14:12 +0800 Subject: [PATCH] set enable_runtime_context_cache_ default false test=develop --- paddle/fluid/inference/api/analysis_config.cc | 2 -- paddle/fluid/inference/api/paddle_analysis_config.h | 2 +- paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/inference/api/analysis_config.cc b/paddle/fluid/inference/api/analysis_config.cc index 2189b8738..a9e477f88 100644 --- a/paddle/fluid/inference/api/analysis_config.cc +++ b/paddle/fluid/inference/api/analysis_config.cc @@ -205,8 +205,6 @@ void AnalysisConfig::Update() { // Append after the Affine_channel_conv_fuse pass. pass_builder()->InsertPass(3, "tensorrt_subgraph_pass"); } - // runtime_context_cache isn't fit for tensorrt. - enable_runtime_context_cache_ = false; } if (use_mkldnn_) { diff --git a/paddle/fluid/inference/api/paddle_analysis_config.h b/paddle/fluid/inference/api/paddle_analysis_config.h index 85639eebe..3b7faa540 100644 --- a/paddle/fluid/inference/api/paddle_analysis_config.h +++ b/paddle/fluid/inference/api/paddle_analysis_config.h @@ -278,7 +278,7 @@ struct AnalysisConfig { // since the input/output names of this Op do not change in the execution, // RuntimeContext could be created only at the first iteration of this Op's // execution to save the elapsed time. - bool enable_runtime_context_cache_{true}; + bool enable_runtime_context_cache_{false}; // A runtime cache, shouldn't be transferred to others. std::string serialized_info_cache_; diff --git a/paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc b/paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc index 5157bd280..e1787a717 100644 --- a/paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc +++ b/paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc @@ -107,6 +107,7 @@ void SetConfig(AnalysisConfig *cfg) { cfg->DisableGpu(); cfg->SwitchSpecifyInputNames(); cfg->SwitchIrOptim(); + cfg->SwitchRuntimeContextCache(); if (FLAGS_zero_copy) { cfg->SwitchUseFeedFetchOps(false); } -- GitLab