From 7d0d8f2a925215a132595a25718d944fb9a1b34c Mon Sep 17 00:00:00 2001 From: chendongsheng Date: Fri, 11 Jun 2021 21:04:22 +0800 Subject: [PATCH] fixed ps data_parallel case result is error --- mindspore/ccsrc/backend/session/gpu_session.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/backend/session/gpu_session.cc b/mindspore/ccsrc/backend/session/gpu_session.cc index 965e4852b2..702abb7263 100644 --- a/mindspore/ccsrc/backend/session/gpu_session.cc +++ b/mindspore/ccsrc/backend/session/gpu_session.cc @@ -538,7 +538,7 @@ void GPUSession::UpdateOutputTensors(const VectorRef *outputs, // address, to avoid that the device address context of tensor be rewritten in the next step or next loop. // But one time memory application scenarios need to be skipped, because the memory is not allocated next step: // 1. Non cnode 2. Communication kernel. - if (node->isa() && !AnfAlgo::IsCommunicationOp(node)) { + if (node->isa() && !AnfAlgo::IsCommunicationOp(node) && !ps::PSContext::instance()->is_ps_mode()) { auto new_address = std::make_shared(nullptr, address->GetSize()); AnfAlgo::SetOutputAddr(new_address, output_index, node.get()); if (context::GraphKernelFlags::GetInstance().IsEnableGraphKernel()) {