forked from mindspore-Ecosystem/mindspore
!16515 Delete the invalid cache
From: @zhangzhaoju Reviewed-by: @kisnwang,@hwhewei,@zh_qh Signed-off-by: @zh_qh
This commit is contained in:
commit
659fb1dbbb
|
@ -1172,7 +1172,6 @@ void ClearResAtexit() {
|
|||
PrimBpropOptimizer::GetPrimBpropOptimizerInst().Clear();
|
||||
|
||||
abstract::ClearPrimEvaluatorMap();
|
||||
compile::ClearConvertCache();
|
||||
pipeline::GetMethodMap().clear();
|
||||
pipeline::GetAttrMap().clear();
|
||||
pipeline::ExecutorPy::ClearRes();
|
||||
|
|
|
@ -50,10 +50,6 @@ LinConvertResult MsBackend::MsConvert(const GraphSegmentPtr &segment, const std:
|
|||
MS_LOG(DEBUG) << "MsConvert";
|
||||
MS_EXCEPTION_IF_NULL(segment);
|
||||
MS_EXCEPTION_IF_NULL(MsContext::GetInstance());
|
||||
auto cached = g_ConvertCache.find(segment);
|
||||
if (cached != g_ConvertCache.end()) {
|
||||
return cached->second;
|
||||
}
|
||||
LinConvertResult result;
|
||||
FuncGraphPtr fg;
|
||||
AnfNodePtrList inputs;
|
||||
|
@ -107,9 +103,6 @@ LinConvertResult MsBackend::MsConvert(const GraphSegmentPtr &segment, const std:
|
|||
result.graph_id = graph_id;
|
||||
|
||||
graph_id_map_[graph_id] = result;
|
||||
if (!pynative_mode) {
|
||||
(void)g_ConvertCache.emplace(segment, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,6 @@
|
|||
|
||||
namespace mindspore {
|
||||
namespace compile {
|
||||
// cached conversion
|
||||
ConvertCache g_ConvertCache;
|
||||
void ClearConvertCache() { g_ConvertCache.clear(); }
|
||||
|
||||
namespace {
|
||||
// Return the list of nodes whose values are required beyond this segment.
|
||||
|
@ -178,11 +175,6 @@ std::tuple<FuncGraphPtr, AnfNodePtrList, AnfNodePtrList> TransformSegmentToAnfGr
|
|||
template <typename T>
|
||||
LinConvertResult Convert(const GraphSegmentPtr &segment, const std::string &) {
|
||||
MS_EXCEPTION_IF_NULL(segment);
|
||||
auto cached = g_ConvertCache.find(segment);
|
||||
if (cached != g_ConvertCache.end()) {
|
||||
return cached->second;
|
||||
}
|
||||
|
||||
LinConvertResult result;
|
||||
|
||||
FuncGraphPtr fg = nullptr;
|
||||
|
@ -202,7 +194,6 @@ LinConvertResult Convert(const GraphSegmentPtr &segment, const std::string &) {
|
|||
result.outputs = outputs;
|
||||
result.graph_id = UINT32_MAX;
|
||||
|
||||
(void)g_ConvertCache.emplace(segment, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,13 +40,8 @@ struct LinConvertResult {
|
|||
};
|
||||
|
||||
using LinkFuncType = std::function<LinConvertResult(const GraphSegmentPtr &, const std::string &)>;
|
||||
using ConvertCache = std::unordered_map<GraphSegmentPtr, LinConvertResult>;
|
||||
extern LinkFuncType MsVmConvert;
|
||||
extern ConvertCache g_ConvertCache;
|
||||
extern std::set<std::string> backend_list;
|
||||
|
||||
void ClearConvertCache();
|
||||
|
||||
std::tuple<FuncGraphPtr, AnfNodePtrList, AnfNodePtrList> TransformSegmentToAnfGraph(const AnfNodePtrList &lst);
|
||||
} // namespace compile
|
||||
} // namespace mindspore
|
||||
|
|
Loading…
Reference in New Issue