From 81644a95dfa25cd5eebf5ac2b2478aaaf67a180a Mon Sep 17 00:00:00 2001 From: caifubi Date: Tue, 21 Apr 2020 10:11:20 +0800 Subject: [PATCH] change enable_loop_sink default value to True --- mindspore/ccsrc/utils/context/ms_context.cc | 3 ++- mindspore/context.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/utils/context/ms_context.cc b/mindspore/ccsrc/utils/context/ms_context.cc index 3a2de9ba0c7..5e8fc48216d 100644 --- a/mindspore/ccsrc/utils/context/ms_context.cc +++ b/mindspore/ccsrc/utils/context/ms_context.cc @@ -69,7 +69,6 @@ MsContext::MsContext(const std::string &policy, const std::string &target) { enable_task_sink_ = true; ir_fusion_flag_ = true; enable_hccl_ = false; - enable_loop_sink_ = false; enable_mem_reuse_ = true; enable_gpu_summary_ = true; precompile_only_ = false; @@ -78,6 +77,7 @@ MsContext::MsContext(const std::string &policy, const std::string &target) { enable_dynamic_mem_pool_ = true; graph_memory_max_size_ = "0"; variable_memory_max_size_ = "0"; + enable_loop_sink_ = target == kAscendDevice || target == kDavinciDevice; MS_LOG(DEBUG) << "Create context with backend policy:" << policy << ", device target:" << target << "."; } @@ -134,6 +134,7 @@ bool MsContext::set_device_target(const std::string &target) { } else { device_target_ = target; } + enable_loop_sink_ = device_target_ == kAscendDevice; MS_LOG(INFO) << "ms set context device target:" << target; return true; } diff --git a/mindspore/context.py b/mindspore/context.py index 311937fb9b4..237b2143ed3 100644 --- a/mindspore/context.py +++ b/mindspore/context.py @@ -516,7 +516,7 @@ def set_context(**kwargs): enable_ir_fusion (bool): Whether to enable ir fusion. Default: True. save_graphs (bool): Whether to save graphs. Default: False. enable_hccl (bool): Whether to enable hccl. Default: False. - enable_loop_sink (bool): Whether to enable loop sink. Default: False. + enable_loop_sink (bool): Whether to enable loop sink. Default: True. enable_task_sink (bool): Whether to enable task sink. Default: True. enable_mem_reuse (bool): Whether to enable memory reuse. Default: True. save_ms_model (bool): Whether to save lite model converted by graph. Default: False.