diff --git a/ge/common/profiling/ge_profiling.cc b/ge/common/profiling/ge_profiling.cc index 67e6b619..640f77a1 100644 --- a/ge/common/profiling/ge_profiling.cc +++ b/ge/common/profiling/ge_profiling.cc @@ -22,7 +22,6 @@ #include "graph/load/graph_loader.h" #include "init/gelib.h" #include "framework/common/ge_inner_error_codes.h" -#include "opskernel_manager/ops_kernel_builder_manager.h" namespace { const uint32_t kDeviceListIndex = 3; @@ -150,12 +149,7 @@ ge::Status RegProfReporterCallback(MsprofReporterCallback func) { GELOGE(rt_ret, "Pass MsprofReporterCallback to runtime failed!!"); return rt_ret; } - // Pass MsprofReporterCallback to hccl in opskernel so initialize - rt_ret = ge::OpsKernelBuilderManager::Instance().RegProfReporterCallBack(reinterpret_cast(func)); - if (rt_ret != ge::SUCCESS) { - GELOGE(rt_ret, "Pass MsprofReporterCallback to hccl failed."); - return rt_ret; - } + // Pass MsprofReporterCallback to hccl } return ge::SUCCESS; } diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index c8f728c2..456cb0a4 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -22,7 +22,6 @@ #include "graph/ge_context.h" #include "runtime/base.h" #include "graph/load/new_model_manager/davinci_model.h" -#include "opskernel_manager/ops_kernel_builder_manager.h" namespace { const char *const kTrainingTrace = "training_trace"; @@ -496,11 +495,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfIn GELOGE(FAILED, "Runtime profiler start failed."); return FAILED; } - Status hccl_ret = OpsKernelBuilderManager::Instance().ProfStart(model_load_mask); - if (hccl_ret != SUCCESS) { - GELOGE(FAILED, "Hccl profiler start failed."); - return FAILED; - } is_load_profiling_ = true; GELOGI("Prof init: model load profiling on."); } @@ -530,12 +524,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfFi GELOGE(FAILED, "Runtime profiler stop failed."); return FAILED; } - - Status hccl_ret = OpsKernelBuilderManager::Instance().ProfStop(PROF_MODEL_LOAD_MASK); - if (hccl_ret != SUCCESS) { - GELOGE(FAILED, "Hccl profiler stop failed."); - return FAILED; - } for (auto device_id_module : device_id_module_map_) { if (device_id_module.second != 0) { uint32_t device_id = static_cast(device_id_module.first); @@ -661,12 +649,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfSt GELOGE(FAILED, "Runtime profiler config proc failed."); return FAILED; } - - Status hccl_ret = OpsKernelBuilderManager::Instance().ProfStart(module); - if (hccl_ret != SUCCESS) { - GELOGE(FAILED, "Hccl profiler start failed."); - return FAILED; - } if ((module & PROF_MODEL_EXECUTE_MASK) == PROF_MODEL_EXECUTE_MASK) { for (int32_t i = 0; i < device_num; i++) { if (std::find(device_id_.begin(), device_id_.end(), device_list[i]) == device_id_.end()) { @@ -708,11 +690,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfSt GELOGE(FAILED, "Prof stop: runtime profiler config proc failed."); return FAILED; } - Status hccl_ret = OpsKernelBuilderManager::Instance().ProfStop(module); - if (hccl_ret != SUCCESS) { - GELOGE(FAILED, "Hccl profiler stop failed."); - return FAILED; - } uint64_t execute_model_mask = module & PROF_MODEL_EXECUTE_MASK; if (execute_model_mask == PROF_MODEL_EXECUTE_MASK) { for (int32_t i = 0; i < device_num; i++) { diff --git a/ge/init/gelib.cc b/ge/init/gelib.cc index 03028e53..92700179 100755 --- a/ge/init/gelib.cc +++ b/ge/init/gelib.cc @@ -145,10 +145,6 @@ Status GELib::InnerInitialize(const map &options) { return initOpsBuilderStatus; } - if (is_train_mode_ || (options_.device_id != kDefaultDeviceIdForInfer)) { - GE_CHK_RT_RET(rtSetDevice(options_.device_id)); - } - GELOGI("sessionManager initial."); GE_TIMESTAMP_START(SessionManagerInitialize); Status initSmStatus = sessionManager_.Initialize(options); @@ -342,7 +338,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status GELib::InitSystemWithOpt // set device id GELOGI("set logical device id:%u", options.device_id); GetContext().SetCtxDeviceId(static_cast(options.device_id)); - // GE_CHK_RT_RET(rtSetDevice(options.device_id)); + GE_CHK_RT_RET(rtSetDevice(options.device_id)); // In the scenario that the automatic add fusion is set, but there is no cleanaddr operator, // maybe need to check it diff --git a/ge/opskernel_manager/ops_kernel_builder_manager.cc b/ge/opskernel_manager/ops_kernel_builder_manager.cc index 4361df44..37bdcf7a 100644 --- a/ge/opskernel_manager/ops_kernel_builder_manager.cc +++ b/ge/opskernel_manager/ops_kernel_builder_manager.cc @@ -168,31 +168,4 @@ Status OpsKernelBuilderManager::GenerateTask(const Node &node, return SUCCESS; } -Status OpsKernelBuilderManager::RegProfReporterCallBack(void *func) const { - GE_CHECK_NOTNULL(func); - for (auto it = ops_kernel_builders_.begin(); it != ops_kernel_builders_.end(); it++) { - GE_CHK_STATUS_RET(it->second->RegProfReporterCallBack(func), - "Failed to invoke RegProfReporterCallBack."); - } - GELOGD("Done invoking RegProfReporterCallBack successfully"); - return SUCCESS; -} - -Status OpsKernelBuilderManager::ProfStart(uint64_t prof_config) const { - for (auto it = ops_kernel_builders_.begin(); it != ops_kernel_builders_.end(); it++) { - GE_CHK_STATUS_RET(it->second->ProfStart(prof_config), - "Failed to invoke ProfStart."); - } - GELOGD("Done invoking ProfStart successfully"); - return SUCCESS; -} - -Status OpsKernelBuilderManager::ProfStop(uint64_t prof_config) const { - for (auto it = ops_kernel_builders_.begin(); it != ops_kernel_builders_.end(); it++) { - GE_CHK_STATUS_RET(it->second->ProfStop(prof_config), - "Failed to invoke ProfStop."); - } - GELOGD("Done invoking ProfStop successfully"); - return SUCCESS; -} -} // namespace ge \ No newline at end of file +} // namespace ge diff --git a/ge/opskernel_manager/ops_kernel_builder_manager.h b/ge/opskernel_manager/ops_kernel_builder_manager.h index a2d3e565..7a95ddfa 100644 --- a/ge/opskernel_manager/ops_kernel_builder_manager.h +++ b/ge/opskernel_manager/ops_kernel_builder_manager.h @@ -46,12 +46,6 @@ class OpsKernelBuilderManager { Status GenerateTask(const Node &node, RunContext &context, std::vector &tasks) const; - Status RegProfReporterCallBack(void *func) const; - - Status ProfStart(uint64_t prof_config) const; - - Status ProfStop(uint64_t prof_config) const; - private: OpsKernelBuilderManager() = default; static Status GetLibPaths(const std::map &options, std::string &lib_paths);