|
|
|
@@ -337,18 +337,6 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptr<ge::Ge |
|
|
|
GE_IF_BOOL_EXEC(SUCCESS != (ret = davinci_model->Assign(ge_model)), GELOGW("assign model to modeldef failed."); |
|
|
|
break;); |
|
|
|
GE_TIMESTAMP_END(Assign, "GraphLoader::ModelAssign"); |
|
|
|
/// In multi-threaded inference, using the same session_id among multiple threads may cause some threads to fail. |
|
|
|
/// These session_ids come from the same model, so the values of session_id are the same. |
|
|
|
/// Update session_id for infer in load model to avoid the same session_id. |
|
|
|
if (!ge_root_model->GetTrainFlag()) { |
|
|
|
uint64_t new_session_id; |
|
|
|
ret = GenSessionId(new_session_id); |
|
|
|
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ret != SUCCESS, return ret, "Generate session_id for infer failed."); |
|
|
|
ret = davinci_model->UpdateSessionId(new_session_id); |
|
|
|
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ret != SUCCESS, return ret, "Update session_id for infer failed."); |
|
|
|
ge_model->InsertSessionMap(model_id, new_session_id); |
|
|
|
GELOGD("Update new session id: %lu.", new_session_id); |
|
|
|
} |
|
|
|
GE_TIMESTAMP_START(Init); |
|
|
|
GE_IF_BOOL_EXEC(SUCCESS != (ret = davinci_model->Init()), GELOGW("DavinciInit failed."); break;); |
|
|
|
GE_TIMESTAMP_END(Init, "GraphLoader::ModelInit"); |
|
|
|
|