Delete the invalid cache

This commit is contained in:
zhangzhaoju 2021-05-17 17:33:16 +08:00
parent 75a1fe3579
commit 78d3c3318b
4 changed files with 0 additions and 22 deletions

View File

@ -1171,7 +1171,6 @@ void ClearResAtexit() {
PrimBpropOptimizer::GetPrimBpropOptimizerInst().Clear();
abstract::ClearPrimEvaluatorMap();
compile::ClearConvertCache();
pipeline::GetMethodMap().clear();
pipeline::GetAttrMap().clear();
pipeline::ExecutorPy::ClearRes();

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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