From b76fa31cc51ae7518f475f22a70f87922f2c11b2 Mon Sep 17 00:00:00 2001 From: laiyongqiang Date: Mon, 19 Oct 2020 11:12:08 +0800 Subject: [PATCH] no need to add atomic for communication op's output --- .../ccsrc/runtime/device/ascend/kernel_build_ascend.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc b/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc index 5f6b198c792..01b0114909b 100644 --- a/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc +++ b/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc @@ -234,7 +234,13 @@ std::map> GetCommunicationOpInputInfo( for (size_t i = 0; i < input_num; i++) { auto input_node = kernel->input(i + 1); auto kernel_input = AnfAlgo::VisitKernelWithReturnType(input_node, 0, true); - MS_LOG(INFO) << " Add atomic clean for single communication op input, comm:" << kernel->fullname_with_scope() + if (AnfAlgo::IsCommunicationOp(kernel_input.first)) { + // no need to add atomic for communication op's output + MS_LOG(INFO) << "No need to add atomic clean for communication op " + << kernel_input.first->fullname_with_scope() << "'s output"; + continue; + } + MS_LOG(INFO) << "Add atomic clean for single communication op input, comm:" << kernel->fullname_with_scope() << " input_node: " << kernel_input.first->fullname_with_scope() << " index: " << kernel_input.second; auto iter = comm_input_info_map.find(kernel_input.first);