!789 fix question that release all loaded model memory when memory is not enough

From: @wan_xuelei
Reviewed-by: @xchu42,@ji_chen
Signed-off-by: @startzgf168,@ji_chen
pull/789/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 69e7d5bf64

@ -2439,6 +2439,13 @@ Status GraphManager::CheckAndReleaseMemory(const GeModelPtr &ge_model, const Gra
continue;
}
auto model_id = model->GetModelId();
// unknown model not release
bool is_unknown_shape = false;
GE_CHK_STATUS_RET(model->CheckIsUnknownShape(is_unknown_shape));
if (is_unknown_shape) {
GELOGD("model_id[%u] graph_id[%u] is unknown model, not release memory", model_id, graph_id);
continue;
}
// not loaded,no need unload
if (!it.second->GetLoadFlag()) {
GELOGI("CheckAndReleaseMemory graph[%u] has not been loaded.", graph_id);

Loading…
Cancel
Save