From 5ac4dff5007d95f59025a06060527de6f8bcb23d Mon Sep 17 00:00:00 2001 From: fangzehua Date: Mon, 29 Mar 2021 11:00:21 +0800 Subject: [PATCH] fix loss scale for cache embedding --- .../frontend/parallel/cache_embedding/cache_embedding.cc | 5 +++++ mindspore/core/base/core_ops.h | 1 + 2 files changed, 6 insertions(+) diff --git a/mindspore/ccsrc/frontend/parallel/cache_embedding/cache_embedding.cc b/mindspore/ccsrc/frontend/parallel/cache_embedding/cache_embedding.cc index e6d00e7620..7f92698555 100644 --- a/mindspore/ccsrc/frontend/parallel/cache_embedding/cache_embedding.cc +++ b/mindspore/ccsrc/frontend/parallel/cache_embedding/cache_embedding.cc @@ -714,6 +714,11 @@ void AddCacheEmbedding(const FuncGraphPtr &graph, bool is_pipe) { if (!CheckHostCacheParamSize(param_cache_enable_set)) { return; } + for (auto &node : cnodes) { + if (IsPrimitiveCNode(node, prim::kPrimNPUAllocFloatStatus)) { + MS_LOG(EXCEPTION) << "Cache embedding haven't support loss scale yet."; + } + } auto unique_cache_enable = FindUniqueCacheEnable(cnodes); if (unique_cache_enable.empty()) { MS_LOG(WARNING) << "Parameters have cache enable, but not find Unique op cache enable."; diff --git a/mindspore/core/base/core_ops.h b/mindspore/core/base/core_ops.h index 903e1e0091..3e275a5d68 100644 --- a/mindspore/core/base/core_ops.h +++ b/mindspore/core/base/core_ops.h @@ -465,6 +465,7 @@ inline const PrimitivePtr kPrimPriorBox = std::make_shared("PriorBox" inline const PrimitivePtr kPrimQuantDTypeCast = std::make_shared("QuantDTypeCast"); inline const PrimitivePtr kPrimWhile = std::make_shared("While"); inline const PrimitivePtr kPrimPull = std::make_shared("Pull"); +inline const PrimitivePtr kPrimNPUAllocFloatStatus = std::make_shared("NPUAllocFloatStatus"); // Structures inline const PrimitivePtr kPrimMakeList = std::make_shared("make_list");