diff --git a/mindspore/ccsrc/profiler/device/ascend/parallel_strategy_profiling.cc b/mindspore/ccsrc/profiler/device/ascend/parallel_strategy_profiling.cc index 681ba721593..1822635d672 100644 --- a/mindspore/ccsrc/profiler/device/ascend/parallel_strategy_profiling.cc +++ b/mindspore/ccsrc/profiler/device/ascend/parallel_strategy_profiling.cc @@ -38,12 +38,13 @@ namespace profiler { namespace ascend { bool has_save_parallel_strategy = false; bool has_got_parallel_strategy_data = false; +bool profiling_parallel_strategy_enabled = false; irpb::ProfilingParallel cache_profiling_parallel_pb; bool IsProfilingParallelStrategyEnabled() { auto ascend_profiler = AscendProfiler::GetInstance(); MS_EXCEPTION_IF_NULL(ascend_profiler); - if (!ascend_profiler->IsInitialized()) { + if (!profiling_parallel_strategy_enabled || !ascend_profiler->IsInitialized()) { MS_LOG(INFO) << "Profiling parallel strategy is disabled."; return false; }