From 20f86e636bf71170b6dea71c8665f18177427616 Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Fri, 7 Aug 2020 21:31:52 +0800 Subject: [PATCH] Revert "Op debug feature" This reverts commit 8a23b57101c72622a50f9ddae97da91ecc957a79. --- inc/framework/ge_runtime/model_runner.h | 5 ----- src/ge/ge_runtime/model_runner.cc | 19 ------------------- src/ge/ge_runtime/runtime_model.cc | 10 ++++------ src/ge/ge_runtime/runtime_model.h | 2 -- 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/inc/framework/ge_runtime/model_runner.h b/inc/framework/ge_runtime/model_runner.h index e495dfdf..8e312b09 100644 --- a/inc/framework/ge_runtime/model_runner.h +++ b/inc/framework/ge_runtime/model_runner.h @@ -35,9 +35,6 @@ class ModelRunner { bool LoadDavinciModel(uint32_t device_id, uint64_t session_id, uint32_t model_id, std::shared_ptr davinci_model, std::shared_ptr listener); - - bool DistributeTask(uint32_t model_id); - bool LoadModelComplete(uint32_t model_id); const std::vector &GetTaskIdList(uint32_t model_id) const; @@ -46,8 +43,6 @@ class ModelRunner { const std::map> &GetRuntimeInfoMap(uint32_t model_id) const; - void *GetModelHandle(uint32_t model_id) const; - bool UnloadModel(uint32_t model_id); bool RunModel(uint32_t model_id, const InputData &input_data, OutputData *output_data); diff --git a/src/ge/ge_runtime/model_runner.cc b/src/ge/ge_runtime/model_runner.cc index 9961ab4e..b6e43dd5 100644 --- a/src/ge/ge_runtime/model_runner.cc +++ b/src/ge/ge_runtime/model_runner.cc @@ -49,15 +49,6 @@ bool ModelRunner::LoadDavinciModel(uint32_t device_id, uint64_t session_id, uint return true; } -bool ModelRunner::DistributeTask(uint32_t model_id) { - auto model_iter = runtime_models_.find(model_id); - if (model_iter == runtime_models_.end()) { - GELOGE(PARAM_INVALID, "Model id %u not found.", model_id); - return false; - } - return model_iter->second->DistributeTask(); -} - bool ModelRunner::LoadModelComplete(uint32_t model_id) { auto model_iter = runtime_models_.find(model_id); if (model_iter == runtime_models_.end()) { @@ -100,16 +91,6 @@ const std::map> &ModelRunner::GetRunti return model_iter->second->GetRuntimeInfoMap(); } -void *ModelRunner::GetModelHandle(uint32_t model_id) const { - auto model_iter = runtime_models_.find(model_id); - if (model_iter == runtime_models_.end()) { - GELOGW("Model id %u not found.", model_id); - return nullptr; - } - - return model_iter->second->GetModelHandle(); -} - bool ModelRunner::UnloadModel(uint32_t model_id) { auto iter = runtime_models_.find(model_id); if (iter != runtime_models_.end()) { diff --git a/src/ge/ge_runtime/runtime_model.cc b/src/ge/ge_runtime/runtime_model.cc index f0405056..bdf8f2a6 100644 --- a/src/ge/ge_runtime/runtime_model.cc +++ b/src/ge/ge_runtime/runtime_model.cc @@ -283,16 +283,14 @@ bool RuntimeModel::Load(uint32_t device_id, uint64_t session_id, std::shared_ptr } GenerateTask(device_id, session_id, davinci_model); - return status; -} -bool RuntimeModel::DistributeTask() { - bool status = LoadTask(); + status = LoadTask(); if (!status) { GELOGE(FAILED, "DistributeTask failed"); - return false; + return status; } - return true; + + return status; } bool RuntimeModel::Run() { diff --git a/src/ge/ge_runtime/runtime_model.h b/src/ge/ge_runtime/runtime_model.h index d0c466d4..67535296 100644 --- a/src/ge/ge_runtime/runtime_model.h +++ b/src/ge/ge_runtime/runtime_model.h @@ -35,12 +35,10 @@ class RuntimeModel { ~RuntimeModel(); bool Load(uint32_t device_id, uint64_t session_id, std::shared_ptr &davinci_model); - bool DistributeTask(); bool LoadComplete(); const std::vector &GetTaskIdList() const; const std::vector &GetStreamIdList() const; const std::map> &GetRuntimeInfoMap() const { return runtime_info_map_; } - rtModel_t GetModelHandle() const { return rt_model_handle_; } bool Run(); bool CopyInputData(const InputData &input_data); bool GetInputOutputDescInfo(bool zero_copy, std::vector *input_desc,