diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index f06e53ca..d7da8916 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -7,7 +7,6 @@ set(SRC_LIST "../common/dump/exception_dumper.cc" "../common/dump/dump_manager.cc" "../common/dump/dump_op.cc" - "../common/dump/dump_server.cc" "../common/dump/opdebug_register.cc" "../common/profiling/ge_profiling.cc" "../graph/load/graph_loader.cc" @@ -247,7 +246,6 @@ target_include_directories(ge_executor_shared PRIVATE ${GE_CODE_DIR}/../inc/cce #### blue zone #### ${GE_CODE_DIR}/third_party/fwkacllib/inc - ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ) target_link_options(ge_executor_shared PRIVATE diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 770fdb08..d7a6ca25 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -27,7 +27,6 @@ #include "graph/load/model_manager/davinci_model.h" #include "model/ge_root_model.h" #include "common/formats/utils/formats_trans_utils.h" -#include "toolchain/adx_datadump_server.h" namespace ge { thread_local uint32_t device_count = 0; @@ -49,7 +48,6 @@ const int kTimeSpecNano = 1000000000; const int kTimeSpecMiro = 1000000; const int kOpNameMaxSize = 100; const uint64_t kInferSessionId = 0; -const int32_t kDumpStatus = 0; #pragma pack(push, 1) struct CustAicpuSoBuf { uint64_t kernelSoBuf; @@ -320,59 +318,6 @@ bool ModelManager::IsNeedHybridLoad(ge::GeRootModel &ge_root_model) { return is_shape_unknown || is_dsp_partitioned_graph || GetContext().GetHostExecFlag(); } -bool ModelManager::IsDumpSeverInited(uint64_t session_id) { - auto it = session_id_to_dump_server_init_flag_.find(session_id); - return it != session_id_to_dump_server_init_flag_.end() && it->second; -} - -Status ModelManager::AddDumpProperties(uint64_t session_id, const DumpProperties &dump_properties) { - if (!IsDumpSeverInited(session_id)) { - if (dump_properties.IsDumpOpen() || dump_properties.IsOpDebugOpen()) { - GE_IF_BOOL_EXEC(AdxDataDumpServerInit() != kDumpStatus, - GELOGE(PARAM_INVALID, "[Init][AdxDataDumpServer] failed, session_id:%lu.", session_id); - return PARAM_INVALID) - GELOGI("Init adx data dump server success"); - session_id_to_dump_server_init_flag_[session_id] = true; - } - } - DumpManager::GetInstance().AddDumpProperties(session_id, dump_properties); - return SUCCESS; -} - -Status ModelManager::InitDumPropertiesWithNewSessionId(uint64_t session_id) { - DumpProperties dump_properties; - dump_properties.InitByOptions(); - GE_CHK_STATUS_RET(AddDumpProperties(session_id, dump_properties), "[Add][DumpProperties] failed."); - return SUCCESS; -} - -Status ModelManager::UpdateSessionId(uint32_t model_id, GeModelPtr ge_model, - std::shared_ptr &davinci_model, uint64_t &session_id) { - uint64_t new_session_id; - Status ret = GenSessionId(new_session_id); - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ret != SUCCESS, return ret, - "[Generate][SessionId] for infer failed, model_id:%u.", model_id); - ret = davinci_model->UpdateSessionId(new_session_id); - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(ret != SUCCESS, return ret, - "[Update][SessionId] for infer failed, model_id:%u.", model_id); - ge_model->InsertSessionMap(model_id, new_session_id); - GELOGD("Update new session id: %lu.", new_session_id); - session_id = new_session_id; - return SUCCESS; -} - -bool ModelManager::HasVarNode(ComputeGraphPtr &compute_graph) const { - for (ge::NodePtr &node : compute_graph->GetAllNodes()) { - if (node == nullptr) { - continue; - } - if (node->GetType() == VARIABLE) { - return true; - } - } - return false; -} - /// /// @ingroup domi_ome /// @brief load model online @@ -409,21 +354,7 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptrAssign(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. uint64_t session_id = GetContext().SessionId(); - // Inference graph with variable node is not support for multi-threads scenario - if (!ge_root_model->GetTrainFlag() && !HasVarNode(root_graph)) { - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(UpdateSessionId(model_id, ge_model, davinci_model, session_id) != SUCCESS, - return ret, - "UpdateSessionId failed."); - GE_CHK_RT_RET(rtSetDevice(GetContext().DeviceId())); - GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(InitDumPropertiesWithNewSessionId(session_id) != SUCCESS, - GE_CHK_RT(rtDeviceReset(static_cast(GetContext().DeviceId()))); - return ret, - "Init DumProperties with new session_id failed."); - } const DumpProperties &dump_properties = DumpManager::GetInstance().GetDumpProperties(session_id); davinci_model->SetDumpProperties(dump_properties); diff --git a/ge/graph/load/model_manager/model_manager.h b/ge/graph/load/model_manager/model_manager.h index efba54ec..e35bb7aa 100755 --- a/ge/graph/load/model_manager/model_manager.h +++ b/ge/graph/load/model_manager/model_manager.h @@ -345,17 +345,6 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelManager { void GenModelId(uint32_t *id); - Status InitDumPropertiesWithNewSessionId(uint64_t session_id); - - bool IsDumpSeverInited(uint64_t session_id); - - Status AddDumpProperties(uint64_t session_id, const DumpProperties &dump_properties); - - Status UpdateSessionId(uint32_t model_id, GeModelPtr ge_model, - std::shared_ptr &davinci_model, uint64_t &session_id); - - bool HasVarNode(ComputeGraphPtr &compute_graph) const; - std::map> model_map_; std::map> hybrid_model_map_; std::map> model_aicpu_kernel_; diff --git a/tests/ut/ge/graph/load/model_manager_unittest.cc b/tests/ut/ge/graph/load/model_manager_unittest.cc index de891072..a3545b33 100644 --- a/tests/ut/ge/graph/load/model_manager_unittest.cc +++ b/tests/ut/ge/graph/load/model_manager_unittest.cc @@ -438,28 +438,4 @@ TEST_F(UtestModelManagerModelManager, test_data_input_tensor) { auto ret = mm.DataInputTensor(model_id,inputs); EXPECT_EQ(PARAM_INVALID, ret); // HybridDavinciModel::impl_ is null. } - -TEST_F(UtestModelManagerModelManager, test_init_dump_properties_with_new_session_id) { - ModelManager model_manager; - uint64_t session_id = 1; - model_manager.InitDumPropertiesWithNewSessionId(session_id); -} - -TEST_F(UtestModelManagerModelManager, test_update_session_id) { - ModelManager model_manager; - uint32_t model_id = 0; - uint64_t session_id = 0; - GeModelPtr ge_model = MakeShared(); - std::shared_ptr davinci_model = MakeShared(0, nullptr); - model_manager.UpdateSessionId(model_id, ge_model, davinci_model, session_id); -} - -TEST_F(UtestModelManagerModelManager, test_has_var_node) { - ModelManager model_manager; - uint64_t session_id = 1; - Graph graph("test"); - CreateGraph(graph); - auto compute_graph = ge::GraphUtils::GetComputeGraph(graph); - model_manager.HasVarNode(compute_graph); -} } // namespace ge