Skip to content

Commit eca2be5

Browse files
authored
Merge pull request PaddlePaddle#16982 from luotao1/disable_runtime_context_default_1.4
disable runtime_context_cache pass by default
2 parents f2ae7e3 + cb7141c commit eca2be5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

paddle/fluid/inference/api/paddle_pass_builder.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ const std::vector<std::string> kAnakinSubgraphPasses({
8686

8787
GpuPassStrategy::GpuPassStrategy() : PassStrategy({}) {
8888
passes_.assign({
89-
"infer_clean_graph_pass", //
90-
"runtime_context_cache_pass", //
89+
"infer_clean_graph_pass", //
9190
// "identity_scale_op_clean_pass", //
9291
"conv_affine_channel_fuse_pass", //
9392
"conv_eltwiseadd_affine_channel_fuse_pass", //
@@ -116,11 +115,7 @@ CpuPassStrategy::CpuPassStrategy() : PassStrategy({}) {
116115
// NOTE the large fusions should be located in the front, so that they will
117116
// not be damaged by smaller ones.
118117
passes_.assign({
119-
"infer_clean_graph_pass", //
120-
// TODO(luotao): runtime_context_cache_pass should be located in the
121-
// front, see https://github.com/PaddlePaddle/Paddle/issues/16609,
122-
// will enhance this pass later.
123-
"runtime_context_cache_pass", //
118+
"infer_clean_graph_pass", //
124119
"attention_lstm_fuse_pass", //
125120
"seqpool_concat_fuse_pass", //
126121
"seqconv_eltadd_relu_fuse_pass", //

paddle/fluid/inference/tests/api/analyzer_pyramid_dnn_tester.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ void SetConfig(AnalysisConfig *cfg) {
110110
if (FLAGS_zero_copy) {
111111
cfg->SwitchUseFeedFetchOps(false);
112112
}
113+
// Enable runtime_context_cache_pass, disabled by default since it doesn't
114+
// cover all the cases.
115+
// See detail: https://github.com/PaddlePaddle/Paddle/issues/16609
116+
// https://github.com/PaddlePaddle/Paddle/issues/16841
117+
cfg->pass_builder()->AppendPass("runtime_context_cache_pass");
113118
}
114119

115120
void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {

0 commit comments

Comments
 (0)