From c89e00e13be806e50db0dc90cb7f434668eb4f5d Mon Sep 17 00:00:00 2001 From: lizhenyu Date: Tue, 2 Feb 2021 15:51:20 +0800 Subject: [PATCH] add ps cache sparse mode check --- mindspore/ccsrc/runtime/device/kernel_runtime.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mindspore/ccsrc/runtime/device/kernel_runtime.cc b/mindspore/ccsrc/runtime/device/kernel_runtime.cc index 2f1373c7ec..0a83157ea1 100644 --- a/mindspore/ccsrc/runtime/device/kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/kernel_runtime.cc @@ -1151,6 +1151,11 @@ void KernelRuntime::CheckIfSupportPSEmbeddingCache(const session::KernelGraph *g << input_index.first->fullname_with_scope(); MS_LOG(EXCEPTION) << "The embeddingLookup whose input index isn't from dataset doesn't support cache in " "parameter server training mode."; + } else if (input_index.first->isa() && (AnfAlgo::GetCNodeName(input_index.first) == kGetNextOpName)) { + MS_LOG(ERROR) << "The EmbeddingLookup kernel(" << kernel->fullname_with_scope() << ") doesn't enable cache."; + MS_LOG(EXCEPTION) << "All EmbeddingLookup kernels whose input indices are from dataset must enable cache at " + "the same time and parameter 'sparse' must be equal to the value of 'enable_sparse' in " + "context setting in parameter server training mode."; } } }