From c7f3b08445e1e45fde7f9a1483dfa2ab23940356 Mon Sep 17 00:00:00 2001 From: wjm Date: Wed, 9 Jun 2021 06:28:07 +0800 Subject: [PATCH 01/43] mark original input --- ge/generator/ge_generator.cc | 1 + metadef | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ge/generator/ge_generator.cc b/ge/generator/ge_generator.cc index 24b35bca..505b1908 100644 --- a/ge/generator/ge_generator.cc +++ b/ge/generator/ge_generator.cc @@ -205,6 +205,7 @@ static Status AddInputs(const ComputeGraphPtr &graph, const NodePtr &node, const } (void)AttrUtils::SetBool(data_op, "_is_single_op", true); + (void)AttrUtils::SetBool(data_op, ATTR_NAME_IS_ORIGINAL_INPUT, true); GE_CHK_BOOL_EXEC(data_op->AddInputDesc(tensor) == GRAPH_SUCCESS, REPORT_CALL_ERROR("E19999", "AddInputDesc failed for node:%s", data_op->GetName().c_str()); diff --git a/metadef b/metadef index 310610e5..2ad00e17 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 310610e5392e01659d214ad380e9ed2c39f9f5a3 +Subproject commit 2ad00e17886fd06c0d00f8a8cf370783a3d31818 From f840399fc3fe240952a00ed567210db7d779135e Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Thu, 17 Jun 2021 20:49:25 +0800 Subject: [PATCH 02/43] Aicpu single_op always dynamic execute. --- ge/single_op/task/op_task.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index 66d70e7e..1bee6634 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -450,7 +450,6 @@ Status AiCpuBaseTask::SetExtInfoAndType(const std::string &kernel_ext_info, uint GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateSessionInfo(ULLONG_MAX, kernel_id, false), "[Update][SessionInfo] failed."); - GE_CHK_STATUS_RET(aicpu_ext_handle_->UpdateExecuteMode(true), "[Update][ExecuteMode] failed."); GE_CHK_RT_RET(rtMalloc(&ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), RT_MEMORY_HBM)); GE_CHK_RT_RET(rtMemcpy(ext_info_addr_dev_, aicpu_ext_handle_->GetExtInfoLen(), From 6f130e22904dec2413815135520ce95f44d49f80 Mon Sep 17 00:00:00 2001 From: wangkai Date: Fri, 18 Jun 2021 10:37:55 +0800 Subject: [PATCH 03/43] add link header targets Signed-off-by: wangkai --- ge/common/CMakeLists.txt | 24 ++++++++++++++---------- ge/executor/CMakeLists.txt | 20 +++++++++++++------- 2 files changed, 27 insertions(+), 17 deletions(-) mode change 100644 => 100755 ge/executor/CMakeLists.txt diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 7974a46d..f55ff427 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -84,12 +84,11 @@ target_include_directories(ge_common PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### - ${GE_DEPEND_DIR}/inc - ${GE_DEPEND_DIR}/inc/cce + $<$>:${GE_DEPEND_DIR}/inc> + $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### - #${GE_DEPEND_DIR}/include - ${GE_CODE_DIR}/third_party/fwkacllib/inc - ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> ) target_link_options(ge_common PRIVATE @@ -98,6 +97,9 @@ target_link_options(ge_common PRIVATE target_link_libraries(ge_common PRIVATE $ + $<$>:$> + $<$>:$> + $<$>:$> static_mmpa -Wl,--no-as-needed graph @@ -151,16 +153,18 @@ target_include_directories(ge_common_static PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### - ${GE_DEPEND_DIR}/inc - ${GE_DEPEND_DIR}/inc/cce + $<$>:${GE_DEPEND_DIR}/inc> + $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### - #${GE_DEPEND_DIR}/include - ${GE_CODE_DIR}/third_party/fwkacllib/inc - ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> ) target_link_libraries(ge_common_static PRIVATE $ + $<$>:$> + $<$>:$> + $<$>:$> ascend_protobuf_static json c_sec diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt old mode 100644 new mode 100755 index b04216b8..b6342973 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -187,15 +187,18 @@ target_include_directories(ge_executor SYSTEM PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### - ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/cce + $<$>:${GE_DEPEND_DIR}/inc> + $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### - ${GE_CODE_DIR}/third_party/fwkacllib/inc - ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> ) target_link_libraries(ge_executor PRIVATE $ + $<$>:$> + $<$>:$> + $<$>:$> json ascend_protobuf_static c_sec @@ -238,10 +241,10 @@ target_include_directories(ge_executor_shared PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### - ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/cce + $<$>:${GE_DEPEND_DIR}/inc> + $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### - ${GE_CODE_DIR}/third_party/fwkacllib/inc + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> ) target_link_options(ge_executor_shared PRIVATE @@ -251,6 +254,9 @@ target_link_options(ge_executor_shared PRIVATE target_link_libraries(ge_executor_shared PRIVATE $ + $<$>:$> + $<$>:$> + $<$>:$> -Wl,--no-as-needed ge_common runtime From 676ce23b556e20d8f49eabccc25e3ab51bf8803a Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Fri, 18 Jun 2021 11:03:51 +0800 Subject: [PATCH 04/43] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20ls?= =?UTF-8?q?=20:=20Adaptation=20rectification=20of=20op=5Ftiling.'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../node_executor/aicore/aicore_op_task.cc | 24 +++++++++---------- .../node_executor/aicore/aicore_op_task.h | 4 ++-- ge/single_op/task/op_task.cc | 13 +++++----- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.cc b/ge/hybrid/node_executor/aicore/aicore_op_task.cc index 76082cb3..8cd24bd1 100644 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.cc +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.cc @@ -25,7 +25,7 @@ #include "single_op/task/build_task_utils.h" #include "single_op/task/tbe_task_builder.h" -using optiling::utils::OpRunInfo; +using optiling::OpRunInfo; namespace ge { namespace hybrid { @@ -359,7 +359,9 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { GE_CHECK_NOTNULL(op_desc); GELOGD("[%s] Start to update tiling info for task: [%s]", node->GetName().c_str(), stub_name_.c_str()); - OpRunInfo tiling_info(-1, true, 0); + OpRunInfo tiling_info; + tiling_info.block_dim = -1; // codex: Using uninitialized value + tiling_info.clear_atomic = true; auto execution_context = context.GetExecutionContext(); @@ -368,14 +370,12 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { RECORD_EXECUTION_EVENT(execution_context, context.GetNodeName(), "[CalcTilingInfo] End"); // update op args by tiling info - block_dim_ = tiling_info.GetBlockDim(); - clear_atomic_ = tiling_info.GetClearAtomic(); - std::vector workspaces; - tiling_info.GetAllWorkspaces(workspaces); - op_desc->SetWorkspaceBytes(workspaces); - - tiling_data_ = tiling_info.GetAllTilingData().str(); - tiling_key_ = tiling_info.GetTilingKey(); + block_dim_ = static_cast(tiling_info.block_dim); + op_desc->SetWorkspaceBytes(tiling_info.workspaces); + clear_atomic_ = tiling_info.clear_atomic; + + tiling_data_ = tiling_info.tiling_data.str(); + tiling_key_ = tiling_info.tiling_key; GELOGD("Successfully getting [tiling_key] : %u", tiling_key_); if (tiling_data_.empty()) { GELOGD("[%s] Tiling data is empty.", op_desc->GetName().c_str()); @@ -412,7 +412,7 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { Status AiCoreOpTask::CalcTilingInfo(const NodePtr &node, OpRunInfo &tiling_info) { GELOGD("[%s] Start to invoke OpParaCalculate.", node->GetName().c_str()); - GE_CHK_STATUS_RET(optiling::OpParaCalculateV2(*node, tiling_info), + GE_CHK_STATUS_RET(OpParaCalculate(*node, tiling_info), "[Invoke][OpParaCalculate]Failed calc tiling data of node %s.", node->GetName().c_str()); GELOGD("[%s] Done invoking OpParaCalculate successfully.", node->GetName().c_str()); @@ -633,7 +633,7 @@ std::string AtomicAddrCleanOpTask::GetKeyForKernelName(const OpDesc &op_desc) co Status AtomicAddrCleanOpTask::CalcTilingInfo(const NodePtr &node, OpRunInfo &tiling_info) { GELOGD("[%s] Start to invoke OpAtomicCalculate.", node->GetName().c_str()); - GE_CHK_STATUS_RET(optiling::OpAtomicCalculateV2(*node, tiling_info), + GE_CHK_STATUS_RET(OpAtomicCalculate(*node, tiling_info), "[Invoke][OpAtomicCalculate]Failed calc tiling data of node %s.", node->GetName().c_str()); GELOGD("[%s] Done invoking OpAtomicCalculate successfully.", node->GetName().c_str()); diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.h b/ge/hybrid/node_executor/aicore/aicore_op_task.h index 3c8db8c9..8d7b7f1e 100755 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.h +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.h @@ -85,7 +85,7 @@ class AiCoreOpTask { virtual std::string GetKeyForTvmMagic() const; virtual std::string GetKeyForTvmMetaData() const; virtual std::string GetKeyForKernelName(const OpDesc &op_desc) const; - virtual Status CalcTilingInfo(const NodePtr &node, optiling::utils::OpRunInfo &tiling_info); + virtual Status CalcTilingInfo(const NodePtr &node, optiling::OpRunInfo &tiling_info); std::unique_ptr tiling_buffer_ = nullptr; std::string tiling_data_; @@ -130,7 +130,7 @@ class AtomicAddrCleanOpTask : public AiCoreOpTask { std::string GetKeyForTvmMagic() const override; std::string GetKeyForTvmMetaData() const override; std::string GetKeyForKernelName(const OpDesc &op_desc) const override; - Status CalcTilingInfo(const NodePtr &node, optiling::utils::OpRunInfo &tiling_info) override; + Status CalcTilingInfo(const NodePtr &node, optiling::OpRunInfo &tiling_info) override; private: Status InitAtomicAddrCleanIndices(const OpDesc &op_desc); diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index 66d70e7e..e48677f8 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -224,17 +224,18 @@ Status TbeOpTask::LaunchKernel(rtStream_t stream) { Status TbeOpTask::UpdateRunInfo() { // invoke OpParaCalculate GELOGD("Start to invoke OpParaCalculate."); - optiling::utils::OpRunInfo run_info(0, true, 0); - auto ret = optiling::OpParaCalculateV2(*node_, run_info); + optiling::OpRunInfo run_info; + run_info.block_dim = 0; + auto ret = optiling::OpParaCalculate(*node_, run_info); if (ret != GRAPH_SUCCESS) { GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Invoke][OpParaCalculate] failed, ret = %u.", ret); REPORT_INNER_ERROR("E19999", "invoke OpParaCalculate failed, ret = %u.", ret); return ACL_ERROR_GE_INTERNAL_ERROR; } - block_dim_ = run_info.GetBlockDim(); - tiling_data_ = run_info.GetAllTilingData().str(); - tiling_key_ = run_info.GetTilingKey(); - run_info.GetAllWorkspaces(run_info_workspaces_); + block_dim_ = run_info.block_dim; + tiling_data_ = run_info.tiling_data.str(); + tiling_key_ = run_info.tiling_key; + run_info_workspaces_ = run_info.workspaces; GELOGD("Done invoking OpParaCalculate successfully. block_dim = %u, tiling size = %zu, tiling_key = %u", block_dim_, tiling_data_.size(), tiling_key_); return SUCCESS; From e2741096ad309785b713f9613a1a2266b4d2faf6 Mon Sep 17 00:00:00 2001 From: zhou_chao1993 Date: Fri, 18 Jun 2021 16:39:55 +0800 Subject: [PATCH 05/43] delete repeat code --- ge/hybrid/executor/hybrid_model_async_executor.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/ge/hybrid/executor/hybrid_model_async_executor.cc b/ge/hybrid/executor/hybrid_model_async_executor.cc index 930412e3..63e48c92 100644 --- a/ge/hybrid/executor/hybrid_model_async_executor.cc +++ b/ge/hybrid/executor/hybrid_model_async_executor.cc @@ -78,8 +78,6 @@ Status HybridModelAsyncExecutor::Start(const std::shared_ptr &lis GetThreadLocalContext() = *executor_->GetContext()->ge_context; GetContext().SetSessionId(executor_->GetContext()->session_id); GetContext().SetContextId(executor_->GetContext()->context_id); - GE_CHECK_NOTNULL(executor_->GetContext()->ge_context); - GetThreadLocalContext() = *executor_->GetContext()->ge_context; return RunInternal(); }); From c2a1076a8734a5dbb80f5336ee9bcd8b21bec817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=A8=E6=98=9F?= Date: Sat, 19 Jun 2021 15:15:51 +0800 Subject: [PATCH 06/43] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!1?= =?UTF-8?q?784=20:=20Create=20NodeExecute=20on-demand'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ge/hybrid/node_executor/node_executor.cc | 75 +++++++------ ge/hybrid/node_executor/node_executor.h | 7 +- tests/ut/ge/CMakeLists.txt | 2 - .../node_executor/node_executor_unittest.cc | 103 ------------------ 4 files changed, 44 insertions(+), 143 deletions(-) delete mode 100644 tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc diff --git a/ge/hybrid/node_executor/node_executor.cc b/ge/hybrid/node_executor/node_executor.cc index 04225557..5f3d6e45 100755 --- a/ge/hybrid/node_executor/node_executor.cc +++ b/ge/hybrid/node_executor/node_executor.cc @@ -58,8 +58,8 @@ Status NodeExecutor::CompileTask(const HybridModel &model, const NodePtr &node, } Status NodeExecutorManager::EnsureInitialized() { + GE_CHK_STATUS_RET(InitializeExecutors()); std::lock_guard lk(mu_); - ++ref_count_; if (initialized_) { return SUCCESS; } @@ -115,14 +115,17 @@ NodeExecutorManager::ExecutorType NodeExecutorManager::ResolveExecutorType(Node return it->second; } -Status NodeExecutorManager::GetExecutor(Node &node, const NodeExecutor **executor) { +Status NodeExecutorManager::GetExecutor(Node &node, const NodeExecutor **executor) const { auto executor_type = ResolveExecutorType(node); - GELOGD("[%s] Set node executor by type: %d.", node.GetName().c_str(), static_cast(executor_type)); const auto it = executors_.find(executor_type); if (it == executors_.end()) { - return GetOrCreateExecutor(executor_type, executor); + REPORT_INNER_ERROR("E19999", "Failed to get executor by type: %d.", static_cast(executor_type)); + GELOGE(INTERNAL_ERROR, "[Check][ExecutorType]Failed to get executor by type: %d.", + static_cast(executor_type)); + return INTERNAL_ERROR; } + GELOGD("[%s] Set node executor by type: %d.", node.GetName().c_str(), static_cast(executor_type)); *executor = it->second.get(); return SUCCESS; } @@ -175,50 +178,51 @@ Status NodeExecutorManager::CalcOpRunningParam(Node &node) const { return OpsKernelBuilderManager::Instance().CalcOpRunningParam(node); } -Status NodeExecutorManager::GetOrCreateExecutor(ExecutorType executor_type, const NodeExecutor **out_executor) { +Status NodeExecutorManager::InitializeExecutors() { std::lock_guard lk(mu_); - const auto executor_it = executors_.find(executor_type); - if (executor_it != executors_.end()) { - *out_executor = executor_it->second.get(); + if (executor_initialized_) { + ++ref_count_; + GELOGI("Executor is already initialized. add ref count to [%d]", ref_count_); return SUCCESS; } - GELOGI("Start to Initialize NodeExecutor, type = %d", static_cast(executor_type)); - auto it = builders_.find(executor_type); - if (it == builders_.end()) { - REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for executor type = %d", - static_cast(executor_type)); - GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for executor type = %d", static_cast(executor_type)); - return INTERNAL_ERROR; - } + GELOGI("Start to Initialize NodeExecutors"); + for (auto &it : builders_) { + auto engine_type = it.first; + auto build_fn = it.second; + GE_CHECK_NOTNULL(build_fn); + auto executor = std::unique_ptr(build_fn()); + if (executor == nullptr) { + REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for engine type = %d", + static_cast(engine_type)); + GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for engine type = %d", static_cast(engine_type)); + return INTERNAL_ERROR; + } - auto build_fn = it->second; - GE_CHECK_NOTNULL(build_fn); - auto executor = std::unique_ptr(build_fn()); - if (executor == nullptr) { - REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for executor type = %d", - static_cast(executor_type)); - GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for engine type = %d", static_cast(executor_type)); - return INTERNAL_ERROR; - } + GELOGD("Executor of engine type = %d was created successfully", static_cast(engine_type)); + auto ret = executor->Initialize(); + if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Initialize NodeExecutor failed for type = %d", static_cast(engine_type)); + GELOGE(ret, "[Initialize][NodeExecutor] failed for type = %d", static_cast(engine_type)); + for (auto &executor_it : executors_) { + executor_it.second->Finalize(); + } + executors_.clear(); + return ret; + } - GELOGD("Executor of engine type = %d was created successfully", static_cast(executor_type)); - auto ret = executor->Initialize(); - if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Initialize NodeExecutor failed for type = %d", static_cast(executor_type)); - GELOGE(ret, "[Initialize][NodeExecutor] failed for type = %d", static_cast(executor_type)); - return ret; + executors_.emplace(engine_type, std::move(executor)); } - *out_executor = executor.get(); - executors_.emplace(executor_type, std::move(executor)); - GELOGI("Initializing NodeExecutor successfully, type = %d", static_cast(executor_type)); + ++ref_count_; + executor_initialized_ = true; + GELOGI("Initializing NodeExecutors successfully."); return SUCCESS; } void NodeExecutorManager::FinalizeExecutors() { std::lock_guard lk(mu_); - if (ref_count_ <= 0) { + if (!executor_initialized_) { GELOGD("No need for finalizing for not initialized."); return; } @@ -233,6 +237,7 @@ void NodeExecutorManager::FinalizeExecutors() { it.second->Finalize(); } executors_.clear(); + executor_initialized_ = false; GELOGD("Done invoking Finalize successfully."); } diff --git a/ge/hybrid/node_executor/node_executor.h b/ge/hybrid/node_executor/node_executor.h index 97c9cee9..fffd4e7d 100644 --- a/ge/hybrid/node_executor/node_executor.h +++ b/ge/hybrid/node_executor/node_executor.h @@ -179,6 +179,8 @@ class NodeExecutorManager { */ Status EnsureInitialized(); + Status InitializeExecutors(); + void FinalizeExecutors(); /** @@ -194,7 +196,7 @@ class NodeExecutorManager { * @param executor executor * @return SUCCESS on success, error code otherwise */ - Status GetExecutor(Node &node, const NodeExecutor **executor); + Status GetExecutor(Node &node, const NodeExecutor **executor) const; /** * Resolve executor type by node @@ -204,13 +206,12 @@ class NodeExecutorManager { ExecutorType ResolveExecutorType(Node &node) const; private: - Status GetOrCreateExecutor(ExecutorType executor_type, const NodeExecutor **executor); - std::map> executors_; std::map> builders_; std::map engine_mapping_; std::mutex mu_; bool initialized_ = false; + bool executor_initialized_ = false; int ref_count_ = 0; }; diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 631e18f8..8b024820 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -839,7 +839,6 @@ set(HYBRID_TEST_FILES "hybrid/executor/subgraph_executor_unittest.cc" "hybrid/executor/worker/execution_engine_unittest.cc" "hybrid/model/hybrid_model_builder_unittest.cc" - "hybrid/node_executor/node_executor_unittest.cc" "hybrid/node_executor/rts/rts_node_task_unittest.cc" "hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc" "hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc" @@ -847,7 +846,6 @@ set(HYBRID_TEST_FILES "hybrid/executor/hybrid_model_async_executor_unittest.cc" "hybrid/executor/hybrid_model_pipeline_executor_unittest.cc" "hybrid/node_executor/aicore/aicore_task_compiler_unittest.cc" - ) set(OTHERS_TEST_FILES diff --git a/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc b/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc deleted file mode 100644 index 8a1240d3..00000000 --- a/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#define private public -#define protected public -#include "hybrid/node_executor/node_executor.h" -#undef protected -#undef private - -using namespace std; -using namespace testing; - -namespace ge { -using namespace hybrid; - -namespace { - bool finalized = false; -} - -class NodeExecutorTest : public testing::Test { - protected: - void SetUp() {} - void TearDown() { } -}; - -class FailureNodeExecutor : public NodeExecutor { - public: - Status Initialize() override { - return INTERNAL_ERROR; - } -}; - -class SuccessNodeExecutor : public NodeExecutor { - public: - Status Initialize() override { - initialized = true; - finalized = false; - return SUCCESS; - } - - Status Finalize() override { - finalized = true; - } - - bool initialized = false; -}; - -REGISTER_NODE_EXECUTOR_BUILDER(NodeExecutorManager::ExecutorType::AICORE, FailureNodeExecutor); -REGISTER_NODE_EXECUTOR_BUILDER(NodeExecutorManager::ExecutorType::AICPU_TF, SuccessNodeExecutor); - -TEST_F(NodeExecutorTest, TestGetOrCreateExecutor) { - auto &manager = NodeExecutorManager::GetInstance(); - const NodeExecutor *executor = nullptr; - Status ret = SUCCESS; - // no builder - ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::RESERVED, &executor); - ASSERT_EQ(ret, INTERNAL_ERROR); - // initialize failure - ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICORE, &executor); - ASSERT_EQ(ret, INTERNAL_ERROR); - ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); - ASSERT_EQ(ret, SUCCESS); - ASSERT_TRUE(executor != nullptr); - ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); - ASSERT_EQ(ret, SUCCESS); - ASSERT_TRUE(executor != nullptr); - ASSERT_TRUE(((SuccessNodeExecutor*)executor)->initialized); -} - -TEST_F(NodeExecutorTest, TestInitAndFinalize) { - auto &manager = NodeExecutorManager::GetInstance(); - manager.FinalizeExecutors(); - manager.EnsureInitialized(); - manager.EnsureInitialized(); - const NodeExecutor *executor = nullptr; - auto ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); - ASSERT_EQ(ret, SUCCESS); - ASSERT_TRUE(executor != nullptr); - ASSERT_TRUE(((SuccessNodeExecutor*)executor)->initialized); - manager.FinalizeExecutors(); - ASSERT_FALSE(manager.executors_.empty()); - manager.FinalizeExecutors(); - ASSERT_TRUE(manager.executors_.empty()); - ASSERT_TRUE(finalized); -} -} // namespace ge From 0b04317d23e4405c93a1eb2f5e80925fae758523 Mon Sep 17 00:00:00 2001 From: wangxiaotian22 Date: Tue, 15 Jun 2021 21:08:33 +0800 Subject: [PATCH 07/43] fix cmetric --- ge/common/util.cc | 82 ++++++------------- ge/graph/load/model_manager/davinci_model.cc | 4 +- ge/graph/preprocess/insert_op/ge_aipp_op.cc | 2 +- .../node_executor/hccl/hccl_node_executor.cc | 3 +- ge/ir_build/option_utils.cc | 2 +- ge/offline/main.cc | 3 +- tests/depends/mmpa/src/mmpa_stub.cc | 7 ++ tests/ut/ge/CMakeLists.txt | 1 + tests/ut/ge/common/util_unittest.cc | 63 ++++++++++++++ .../ge/graph/load/davinci_model_unittest.cc | 3 + tests/ut/ge/graph_ir/ge_ir_build_unittest.cc | 9 +- 11 files changed, 115 insertions(+), 64 deletions(-) create mode 100644 tests/ut/ge/common/util_unittest.cc diff --git a/ge/common/util.cc b/ge/common/util.cc index 448efc0f..dfb5bac4 100644 --- a/ge/common/util.cc +++ b/ge/common/util.cc @@ -340,15 +340,24 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string RealPath(const char return res; } +void PathValidErrReport(const std::string &file_path, const std::string &atc_param, const std::string &reason) { + if (!atc_param.empty()) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({atc_param, file_path, reason})); + } else { + REPORT_INNER_ERROR("E19999", "Path[%s] invalid, reason:%s", file_path.c_str(), reason.c_str()); + } +} + FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInputPathValid(const std::string &file_path, const std::string &atc_param) { // The specified path is empty std::map args_map; if (file_path.empty()) { - if (atc_param != "") { - ErrorManager::GetInstance().ATCReportErrMessage("E10004", {"parameter"}, {atc_param}); + if (!atc_param.empty()) { + REPORT_INPUT_ERROR("E10004", std::vector({"parameter"}), std::vector({atc_param})); } else { - REPORT_INNER_ERROR("E19999", "Param file_path is empty, check invalid"); + REPORT_INNER_ERROR("E19999", "Param file_path is empty, check invalid."); } GELOGW("Input parameter %s is empty.", file_path.c_str()); return false; @@ -356,13 +365,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInputPathValid(const std::string real_path = RealPath(file_path.c_str()); // Unable to get absolute path (does not exist or does not have permission to access) if (real_path.empty()) { - if (atc_param != "") { - std::string reason = "realpath error, errmsg:" + std::string(strerror(errno)); - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, reason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s]'s realpath is empty, errmsg[%s]", file_path.c_str(), strerror(errno)); - } + std::string reason = "realpath error, errmsg:" + std::string(strerror(errno)); + PathValidErrReport(file_path, atc_param, reason); GELOGW("Path[%s]'s realpath is empty, errmsg[%s]", file_path.c_str(), strerror(errno)); return false; } @@ -378,23 +382,12 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInputPathValid(const GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( !ValidateStr(real_path, mode), - if (atc_param != "") { - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, real_path, kPathValidReason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] has invalid char, %s", file_path.c_str(), kPathValidReason); - } + PathValidErrReport(file_path, atc_param, kPathValidReason); return false, "Invalid value for %s[%s], %s.", atc_param.c_str(), real_path.c_str(), kPathValidReason); // The absolute path points to a file that is not readable if (mmAccess2(real_path.c_str(), M_R_OK) != EN_OK) { - if (atc_param != "") { - std::string reason = "cat not access, errmsg:" + std::string(strerror(errno)); - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, reason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] can't acccess, errmsg:%s", file_path.c_str(), strerror(errno)); - } + PathValidErrReport(file_path, atc_param, "cat not access, errmsg:" + std::string(strerror(errno))); GELOGW("Read file[%s] failed, errmsg[%s]", file_path.c_str(), strerror(errno)); return false; } @@ -406,10 +399,10 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const const std::string &atc_param) { // The specified path is empty if (file_path.empty()) { - if (atc_param != "") { - ErrorManager::GetInstance().ATCReportErrMessage("E10004", {"parameter"}, {atc_param}); + if (!atc_param.empty()) { + REPORT_INPUT_ERROR("E10004", std::vector({"parameter"}), std::vector({atc_param})); } else { - REPORT_INNER_ERROR("E19999", "Param file_path is empty, check invalid"); + REPORT_INNER_ERROR("E19999", "Param file_path is empty, check invalid."); } ErrorManager::GetInstance().ATCReportErrMessage("E10004", {"parameter"}, {atc_param}); GELOGW("Input parameter's value is empty."); @@ -417,17 +410,10 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const } GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(strlen(file_path.c_str()) >= MMPA_MAX_PATH, - if (atc_param != "") { - std::string reason = "len is too long, it must be less than " + - std::to_string(MMPA_MAX_PATH); - ErrorManager::GetInstance().ATCReportErrMessage( - "E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, reason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] len is too long, it must be less than %d", - file_path.c_str(), MMPA_MAX_PATH); - } - return "", "Path[%s] len is too long, it must be less than %d", file_path.c_str(), + std::string reason = "len is too long, it must be less than " + + std::to_string(MMPA_MAX_PATH); + PathValidErrReport(file_path, atc_param, reason); + return false, "Path[%s] len is too long, it must be less than %d", file_path.c_str(), MMPA_MAX_PATH); // A regular matching expression to verify the validity of the input file path @@ -441,12 +427,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( !ValidateStr(file_path, mode), - if (atc_param != "") { - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, kPathValidReason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] has invalid char, %s", file_path.c_str(), kPathValidReason); - } + PathValidErrReport(file_path, atc_param, kPathValidReason); return false, "Invalid value for %s[%s], %s.", atc_param.c_str(), file_path.c_str(), kPathValidReason); std::string real_path = RealPath(file_path.c_str()); @@ -454,13 +435,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const if (!real_path.empty()) { // File is not readable or writable if (mmAccess2(real_path.c_str(), M_W_OK | M_F_OK) != EN_OK) { - if (atc_param != "") { - std::string reason = "cat not access, errmsg:" + std::string(strerror(errno)); - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, reason}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] can't acccess, errmsg:%s", file_path.c_str(), strerror(errno)); - } + PathValidErrReport(file_path, atc_param, "cat not access, errmsg:" + std::string(strerror(errno))); GELOGW("Write file[%s] failed, errmsg[%s]", real_path.c_str(), strerror(errno)); return false; } @@ -479,12 +454,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const std::string prefix_path = std::string(file_path).substr(0, static_cast(path_split_pos)); // Determine whether the specified path is valid by creating the path if (CreateDirectory(prefix_path) != 0) { - if (atc_param != "") { - ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, - {atc_param, file_path, "Can not create directory"}); - } else { - REPORT_INNER_ERROR("E19999", "Path[%s] Can not create directory", file_path.c_str()); - } + PathValidErrReport(file_path, atc_param, "Can not create directory"); GELOGW("Can not create directory[%s].", file_path.c_str()); return false; } diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 5b67c205..929ae158 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -3463,11 +3463,11 @@ bool DavinciModel::CheckUserAndModelSize(const int64_t &size, const int64_t &op_ } // The input and model input size can not be exactly equal because user input is not definite. if ((size + kDataMemAlignSizeCompare) < op_size) { - REPORT_INNER_ERROR("E19999", "%s size:%ld from user add align:%u < input_op_size:%ld in model, model_id:%u, " + REPORT_INNER_ERROR("E19999", "%s size:%ld from user add align:%u < op_size:%ld in model, model_id:%u, " "check invalid", input_or_output.c_str(), size, kDataMemAlignSizeCompare, op_size, model_id_); GELOGE(ACL_ERROR_GE_PARAM_INVALID, - "[Check][Param] %s size:%ld from user add align:%u < input_op_size:%ld in model, model_id:%u", + "[Check][Param] %s size:%ld from user add align:%u < op_size:%ld in model, model_id:%u", input_or_output.c_str(), size, kDataMemAlignSizeCompare, op_size, model_id_); return false; } diff --git a/ge/graph/preprocess/insert_op/ge_aipp_op.cc b/ge/graph/preprocess/insert_op/ge_aipp_op.cc index 5c191af7..2ea41b01 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.cc @@ -114,7 +114,7 @@ Status GetDataDimN(const ge::NodePtr &data_node, ge::Format format, int64_t &bat std::vector({ data_node->GetName() + " format", TypeUtils::FormatToSerialString(format), - "only format " + TypeUtils::FormatToSerialString(FORMAT_NCHW) + " and "+ + "only format " + TypeUtils::FormatToSerialString(FORMAT_NCHW) + " and " + TypeUtils::FormatToSerialString(FORMAT_NHWC) + " supported which dynamic aipp is linked"})); GELOGE(PARAM_INVALID, "[Check][Param] Not support data format:%s, node:%s", diff --git a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc index 72092cd8..d942695e 100644 --- a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc +++ b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc @@ -24,6 +24,7 @@ #include "graph/types.h" #include "hybrid/executor/hybrid_execution_context.h" #include "hccl/hcom.h" +#include "runtime/event.h" namespace ge { namespace { @@ -325,7 +326,7 @@ Status RdmaNodeTask::ExecuteAsync(TaskContext &context, std::function do rtEvent_t evt = nullptr; if (context.GetExecutionContext()->hccl_stream != nullptr) { - GE_CHK_RT_RET(rtEventCreateWithFlag(&evt, 0x01)); + GE_CHK_RT_RET(rtEventCreateWithFlag(&evt, RT_EVENT_WITH_FLAG)); GE_CHK_RT_RET(rtStreamWaitEvent(context.GetExecutionContext()->hccl_stream, evt)); } TaskContext *p_ctx = &context; diff --git a/ge/ir_build/option_utils.cc b/ge/ir_build/option_utils.cc index cecc2588..e2b08495 100755 --- a/ge/ir_build/option_utils.cc +++ b/ge/ir_build/option_utils.cc @@ -204,7 +204,7 @@ bool CheckDynamicImagesizeInputShapeValid(map> shape_map if (!input_format.empty() && !ge::TypeUtils::IsFormatValid(input_format.c_str())) { GELOGE(ge::PARAM_INVALID, "[Check][DynamicImagesizeInputShape] input_format [%s] invalid, can not support now.", input_format.c_str()); - REPORT_INPUT_ERROR("E10003", std::vector({"parameter","value","reason"}), + REPORT_INPUT_ERROR("E10003", std::vector({"parameter", "value", "reason"}), std::vector({"input_format", input_format, "this format is not support"})); return false; } diff --git a/ge/offline/main.cc b/ge/offline/main.cc index a1ae476b..14db1ded 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -953,8 +953,7 @@ domi::Status GenerateModel(std::map &options, std::string output ge::Model load_model = ge::Model("loadmodel", "version2"); auto ret1 = load_model.LoadFromFile(FLAGS_model); if (ret1 != ge::GRAPH_SUCCESS) { - REPORT_INPUT_ERROR("E10041", std::vector({"file"}), std::vector({FLAGS_model})); - REPORT_CALL_ERROR("E19999", "load from model file:%s failed", FLAGS_model.c_str()); + REPORT_INPUT_ERROR("E10041", std::vector({"parameter"}), std::vector({FLAGS_model})); DOMI_LOGE("Load model from %s failed, please check model file or " "input parameter[--framework] is correct", FLAGS_model.c_str()); (void)ge_generator.Finalize(); diff --git a/tests/depends/mmpa/src/mmpa_stub.cc b/tests/depends/mmpa/src/mmpa_stub.cc index a82621ef..aae8de9f 100644 --- a/tests/depends/mmpa/src/mmpa_stub.cc +++ b/tests/depends/mmpa/src/mmpa_stub.cc @@ -220,6 +220,13 @@ VOID mmScandirFree(mmDirent **entryList, INT32 count) INT32 mmAccess2(const CHAR *pathName, INT32 mode) { + if (pathName == NULL) { + return EN_INVALID_PARAM; + } + INT32 ret = access(pathName, mode); + if (ret != EN_OK) { + return EN_ERROR; + } return 0; } diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 63579109..b820e465 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -761,6 +761,7 @@ set(MULTI_PARTS_TEST_FILES "graph_ir/ge_ir_build_unittest.cc" "graph/transop_util_unittest.cc" "common/datatype_transfer_unittest.cc" + "common/util_unittest.cc" "common/dump_manager_unittest.cc" "common/dump_op_unittest.cc" "common/dump_exception_unittest.cc" diff --git a/tests/ut/ge/common/util_unittest.cc b/tests/ut/ge/common/util_unittest.cc new file mode 100644 index 00000000..6df3db96 --- /dev/null +++ b/tests/ut/ge/common/util_unittest.cc @@ -0,0 +1,63 @@ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "common/util.h" + +namespace ge { +namespace formats { +class UtestUtilTransfer : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + + +INT32 mmAccess2(const CHAR *pathName, INT32 mode) +{ + return -1; +} + +TEST_F(UtestUtilTransfer, CheckOutputPathValid) { + EXPECT_EQ(CheckOutputPathValid("", ""), false); + EXPECT_EQ(CheckOutputPathValid("", "model"), false); + + char max_file_path[14097] = {0}; + memset(max_file_path, 1, 14097); + EXPECT_EQ(CheckOutputPathValid(max_file_path, "model"), false); + + EXPECT_EQ(CheckOutputPathValid("$#%", ""), false); + + // system("touch test_util"); + // system("chmod 555 test_util"); + // EXPECT_EQ(CheckOutputPathValid("./test_util", ""), false); + // system("rm -r test_util"); +} + +TEST_F(UtestUtilTransfer, CheckInputPathValid) { + EXPECT_EQ(CheckInputPathValid("", ""), false); + EXPECT_EQ(CheckInputPathValid("", "model"), false); + + EXPECT_EQ(CheckInputPathValid("$#%", ""), false); + + EXPECT_EQ(CheckInputPathValid("./test_util", ""), false); + +} + +} +} + diff --git a/tests/ut/ge/graph/load/davinci_model_unittest.cc b/tests/ut/ge/graph/load/davinci_model_unittest.cc index 3f9cc850..378f2f07 100644 --- a/tests/ut/ge/graph/load/davinci_model_unittest.cc +++ b/tests/ut/ge/graph/load/davinci_model_unittest.cc @@ -1035,6 +1035,9 @@ TEST_F(UtestDavinciModel, NnExecute) { ProfilingManager::Instance().device_id_.emplace_back(0); model.task_list_.resize(1); EXPECT_EQ(model.NnExecute(stream, false, input_data, output_data), SUCCESS); + + input_data.blobs[0].length = 128; + EXPECT_NE(model.NnExecute(stream, false, input_data, output_data), SUCCESS); } TEST_F(UtestDavinciModel, update_io_addr_success) { DavinciModel model(0, nullptr); diff --git a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc index e14178d8..047c9e1d 100644 --- a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc +++ b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc @@ -368,7 +368,14 @@ TEST(UtestIrBuild, check_modify_mixlist_param) { {"ge.exec.modify_mixlist", "/modify.json"} }; ModelBufferData model; - + auto ret = aclgrphBuildModel(graph, build_options, model); EXPECT_EQ(ret, GRAPH_PARAM_INVALID); +} + +TEST(UtestIrCommon, check_dynamic_imagesize_input_shape_valid_format_empty) { + std::map> shape_map; + std::string dynamic_image_size = ""; + bool ret = CheckDynamicImagesizeInputShapeValid(shape_map, "123", dynamic_image_size); + EXPECT_EQ(ret, false); } \ No newline at end of file From 1942c5e74e506f6da8e119186cc4ef7921b3761f Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Mon, 21 Jun 2021 11:37:17 +0800 Subject: [PATCH 08/43] Fix bug of single_op kernel bin register. --- ge/hybrid/node_executor/aicore/aicore_op_task.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.cc b/ge/hybrid/node_executor/aicore/aicore_op_task.cc index 76082cb3..95877181 100644 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.cc +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.cc @@ -81,7 +81,7 @@ Status AiCoreOpTask::Init(const OpDesc &op_desc, const domi::TaskDef &task_def) Status AiCoreOpTask::RegisterTbeHandle(const OpDesc &op_desc) { rtError_t rt_ret = rtQueryFunctionRegistered(stub_name_.c_str()); - if (rt_ret != RT_ERROR_NONE || is_single_op_) { + if (rt_ret != RT_ERROR_NONE) { auto op_desc_ptr = MakeShared(op_desc); GE_CHECK_NOTNULL(op_desc_ptr); auto tbe_kernel = op_desc_ptr->TryGetExtAttr(GetKeyForTbeKernel(), TBEKernelPtr()); @@ -194,7 +194,7 @@ Status AiCoreOpTask::RegisterKernelHandle(const OpDesc &op_desc) { Status AiCoreOpTask::InitWithKernelDef(const OpDesc &op_desc, const domi::TaskDef &task_def) { const domi::KernelDef &kernel_def = task_def.kernel(); const domi::KernelContext &context = kernel_def.context(); - stub_name_ = kernel_def.stub_func(); + stub_name_ = is_single_op_ ? to_string(log_id_) + kernel_def.stub_func() : kernel_def.stub_func(); GE_CHK_STATUS_RET(RegisterTbeHandle(op_desc)); GE_CHK_RT_RET(rtGetFunctionByName(stub_name_.c_str(), &stub_func_)); args_size_ = kernel_def.args_size(); From 7337be63533554bb571a2d56a73b5b6d37c78eba Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Mon, 21 Jun 2021 14:56:16 +0800 Subject: [PATCH 09/43] Refersh arg addr in aicpu node executor. --- ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc index c2ebf654..c83a76d1 100755 --- a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc +++ b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.cc @@ -64,10 +64,6 @@ Status AicpuNodeTaskBase::InitExtInfo(const std::string &kernel_ext_info, int64_ GE_CHK_STATUS_RET(aicpu_ext_handle_.UpdateSessionInfoSessionId(session_id), "[Update][SessionInfoSessionId] failed, session_id:%ld.", session_id); - bool execute_mode = !aicpu_ext_handle_.IsNeedRefreshIOAddr() && !node_item_->is_dynamic; - GE_CHK_STATUS_RET(aicpu_ext_handle_.UpdateExecuteMode(execute_mode), - "[Update][ExecuteMode] failed, node:%s.", node_name_.c_str()); - // copy task args buf GE_CHK_STATUS_RET(AllocTensorBuffer(aicpu_ext_handle_.GetExtInfoLen(), ext_info_addr_dev_), "[Invoke][AllocTensorBuffer]Node[%s] alloc kernel_ext_info buf failed, size=%zu", From b01ce212e745795f6b8ba52df549bc905c5c6376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8D=8E?= Date: Sat, 19 Jun 2021 11:08:02 +0800 Subject: [PATCH 10/43] opt info --- CMakeLists.txt | 1 + ge/common/CMakeLists.txt | 8 ++ ge/common/ge_opt_info.cc | 58 +++++++++ ge/common/ge_opt_info.h | 31 +++++ ge/graph/manager/graph_manager.cc | 9 +- tests/CMakeLists.txt | 1 + tests/depends/opt_info/CMakeLists.txt | 37 ++++++ tests/depends/opt_info/src/opt_info_stub.cc | 46 +++++++ tests/framework/cmake/graphengine.cmake | 2 + tests/st/testcase/test_ge_opt_info.cc | 123 ++++++++++++++++++ tests/ut/ge/CMakeLists.txt | 4 + tests/ut/ge/common/ge_opt_info_unittest.cc | 82 ++++++++++++ third_party/fwkacllib/inc/opt_info/opt_info.h | 34 +++++ 13 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 ge/common/ge_opt_info.cc create mode 100644 ge/common/ge_opt_info.h create mode 100644 tests/depends/opt_info/CMakeLists.txt create mode 100644 tests/depends/opt_info/src/opt_info_stub.cc create mode 100644 tests/st/testcase/test_ge_opt_info.cc create mode 100644 tests/ut/ge/common/ge_opt_info_unittest.cc create mode 100644 third_party/fwkacllib/inc/opt_info/opt_info.h diff --git a/CMakeLists.txt b/CMakeLists.txt index bed5b995..77a759ba 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ else () #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) else() find_module(slog libalog.so ${ASCEND_ATC_DIR}) + find_module(opt_feature libopt_feature.so ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) if(PLATFORM STREQUAL "train") find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index f55ff427..91f3b27d 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -43,6 +43,7 @@ set(SRC_LIST "op/ge_op_utils.cc" "thread_pool.cc" "ge/tbe_plugin_manager.cc" + "ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL) @@ -86,9 +87,11 @@ target_include_directories(ge_common PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> + $<$>:${GE_DEPEND_DIR}../abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info> ) target_link_options(ge_common PRIVATE @@ -108,6 +111,7 @@ target_link_libraries(ge_common PRIVATE c_sec error_manager slog + opt_feature -Wl,--as-needed json $<$>:-lrt> @@ -155,9 +159,11 @@ target_include_directories(ge_common_static PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> + $<$>:${GE_DEPEND_DIR}/../abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> + $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info> ) target_link_libraries(ge_common_static PRIVATE @@ -213,6 +219,7 @@ target_include_directories(ge_common PRIVATE ${CMAKE_BINARY_DIR}/proto/graphengine_protos ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_common PRIVATE @@ -228,6 +235,7 @@ target_link_libraries(ge_common PRIVATE c_sec error_manager slog + opt_feature static_mmpa -Wl,--as-needed json diff --git a/ge/common/ge_opt_info.cc b/ge/common/ge_opt_info.cc new file mode 100644 index 00000000..c6bac480 --- /dev/null +++ b/ge/common/ge_opt_info.cc @@ -0,0 +1,58 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "common/ge_opt_info.h" + +#include +#include +#include "graph/ge_local_context.h" +#include "ge/ge_api_types.h" +#include "common/debug/ge_log.h" +#include "opt_info.h" + +namespace ge { +Status GeOptInfo::SetOptInfo() { + std::string soc_ver; + graphStatus ret = GetThreadLocalContext().GetOption(SOC_VERSION, soc_ver); + if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get soc version failed."); + GELOGE(FAILED, "[Get][SocVersion]Get soc version failed."); + return FAILED; + } + GELOGD("Soc version:%s.", soc_ver.c_str()); + std::map opt_info; + // the first arg does not work at present. + if (gelc::GetOptInfo(gelc::kOffline, soc_ver, opt_info) != gelc::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get optional information failed, is_offline:%d, soc version:%s", + gelc::kOffline, soc_ver.c_str()); + GELOGE(FAILED, "[Get][OptInfo]Get optional information failed, is_offline:%d, soc version:%s", + gelc::kOffline, soc_ver.c_str()); + return FAILED; + } + // do nothing if get empty information + if (opt_info.empty()) { + GELOGI("Optional information is empty."); + return SUCCESS; + } + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + for (const auto &itr : opt_info) { + graph_options.emplace(itr.first, itr.second); + GELOGI("Get optional information success, key:%s, value:%s.", itr.first.c_str(), itr.second.c_str()); + } + GetThreadLocalContext().SetGraphOption(graph_options); + return SUCCESS; +} +} // namespace ge diff --git a/ge/common/ge_opt_info.h b/ge/common/ge_opt_info.h new file mode 100644 index 00000000..4ec9a59f --- /dev/null +++ b/ge/common/ge_opt_info.h @@ -0,0 +1,31 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef GE_COMMON_GE_OPT_INFO_H_ +#define GE_COMMON_GE_OPT_INFO_H_ + +#include "ge/ge_api_error_codes.h" +#include "register/register_types.h" + +namespace ge { +class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeOptInfo { + public: + GeOptInfo() = default; + static Status SetOptInfo(); +}; +} // namespace ge + +#endif // GE_COMMON_GE_OPT_INFO_H_ diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index bf04ed58..3861e6ac 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -27,6 +27,7 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/dump/dump_manager.h" +#include "common/ge_opt_info.h" #include "analyzer/analyzer.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" @@ -949,7 +950,7 @@ Status GraphManager::SetRtContext(rtContext_t rt_context, rtCtxMode_t mode, uint rtError_t rt_ret = rtCtxCreate(&rt_context, mode, ge::GetContext().DeviceId()); if (rt_ret != RT_ERROR_NONE) { - REPORT_CALL_ERROR("E19999", "Call rtCtxCreate faileded, session_id:%lu, graph_id:%u, mode:%d", + REPORT_CALL_ERROR("E19999", "Call rtCtxCreate failed, session_id:%lu, graph_id:%u, mode:%d", session_id, graph_id, mode); GELOGE(FAILED, "[Call][RtCtxCreate] faileded, session_id:%lu, graph_id:%u, mode:%d", session_id, graph_id, mode); return FAILED; @@ -1001,6 +1002,12 @@ Status GraphManager::PreRun(const GraphNodePtr &graph_node, const std::vector + c_sec +) + +target_include_directories(opt_feature_stub INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src) diff --git a/tests/depends/opt_info/src/opt_info_stub.cc b/tests/depends/opt_info/src/opt_info_stub.cc new file mode 100644 index 00000000..df518c4b --- /dev/null +++ b/tests/depends/opt_info/src/opt_info_stub.cc @@ -0,0 +1,46 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "opt_info.h" +#include +#include +#include +#include + +namespace gelc { +namespace { +const std::vector kSocVersions = {"Ascend910"}; +} + +void SetAllOptInfo(std::map &opt_infos) { + opt_infos.emplace("opt_module.fe", "all"); + opt_infos.emplace("opt_module.pass", "all"); + opt_infos.emplace("opt_module.op_tune", "all"); + opt_infos.emplace("opt_module.rl_tune", "all"); + opt_infos.emplace("opt_module.aoe", "all"); +} + +Status GetOptInfo(WorkMode mode, const std::string &soc_ver, + std::map &opt_infos) { + if (std::find(kSocVersions.begin(), kSocVersions.end(), soc_ver)== kSocVersions.end()) { + SetAllOptInfo(opt_infos); + return SUCCESS; + } + opt_infos.emplace("opt_module.fe", "all"); + opt_infos.emplace("opt_module.pass", "all"); + opt_infos.emplace("opt_module.op_tune", "all"); + return SUCCESS; +} +} // namespace gelc diff --git a/tests/framework/cmake/graphengine.cmake b/tests/framework/cmake/graphengine.cmake index 81aa00cc..c4380016 100644 --- a/tests/framework/cmake/graphengine.cmake +++ b/tests/framework/cmake/graphengine.cmake @@ -103,6 +103,7 @@ list(APPEND INCLUDE_DIRECTORIES "${GE_CODE_DIR}/third_party/fwkacllib/inc/cce" "${GE_CODE_DIR}/third_party/fwkacllib/inc/ops" "${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain" + "${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info" "${GE_CODE_DIR}/tests/ut/ge" "${GE_CODE_DIR}/tests/ut/common" "${CMAKE_BINARY_DIR}" @@ -117,6 +118,7 @@ list(APPEND STUB_LIBS runtime_stub profiler_stub hccl_stub + opt_feature_stub error_manager_stub ascend_protobuf json diff --git a/tests/st/testcase/test_ge_opt_info.cc b/tests/st/testcase/test_ge_opt_info.cc new file mode 100644 index 00000000..8fc47a9b --- /dev/null +++ b/tests/st/testcase/test_ge_opt_info.cc @@ -0,0 +1,123 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "easy_graph/graph/box.h" +#include "easy_graph/graph/node.h" +#include "easy_graph/builder/graph_dsl.h" +#include "easy_graph/builder/box_builder.h" +#include "easy_graph/layout/graph_layout.h" +#include "easy_graph/layout/engines/graph_easy/graph_easy_option.h" +#include "easy_graph/layout/engines/graph_easy/graph_easy_executor.h" +#include "graph/graph.h" +#include "graph/compute_graph.h" +#include "framework/common/types.h" +#include "graph/debug/ge_attr_define.h" +#include "ge_graph_dsl/graph_dsl.h" +#include "ge_graph_dsl/op_desc/op_desc_cfg_box.h" +#define protected public +#define private public +#include "common/ge_opt_info.h" +#undef private +#undef protected + +namespace ge { +class STEST_opt_info : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(STEST_opt_info, get_opt_info_all) { + std::map options = {{ge::SOC_VERSION, "Ascend310"}}; + GetThreadLocalContext().SetGlobalOption(options); + + /// data1 data2 + /// \ / + /// add + // build graph + DEF_GRAPH(g1) { + CHAIN(NODE("data1", DATA)->NODE("add", ADD)); + CHAIN(NODE("data2", DATA)->NODE("add")); + }); + + auto graph = ToGeGraph(g1); + + // new session & add graph + Session session(options); + auto ret = session.AddGraph(1, graph, options); + EXPECT_EQ(ret, SUCCESS); + // build input tensor + std::vector inputs; + // build_graph through session + ret = session.BuildGraph(1, inputs); + EXPECT_EQ(ret, SUCCESS); + + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.rl_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.aoe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(STEST_opt_info, get_opt_info_success) { + std::map options = {{ge::SOC_VERSION, "Ascend910"}}; + GetThreadLocalContext().SetGlobalOption(options); + + /// data1 data2 + /// \ / + /// add + // build graph + DEF_GRAPH(g1) { + CHAIN(NODE("data1", DATA)->NODE("add", ADD)); + CHAIN(NODE("data2", DATA)->NODE("add")); + }); + + auto graph = ToGeGraph(g1); + + // new session & add graph + Session session(options); + auto ret = session.AddGraph(1, graph, options); + EXPECT_EQ(ret, SUCCESS); + // build input tensor + std::vector inputs; + // build_graph through session + ret = session.BuildGraph(1, inputs); + EXPECT_EQ(ret, SUCCESS); + + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} +} // namespace ge diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 631e18f8..ea9e2360 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -62,6 +62,7 @@ include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/cce) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/ops) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain) +include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info) include_directories(${GE_CODE_DIR}/tests/ut/ge) include_directories(${GE_CODE_DIR}/tests/ut/common) include_directories(${CMAKE_BINARY_DIR}) @@ -172,6 +173,7 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/dump/exception_dumper.cc" "${GE_CODE_DIR}/ge/common/dump/opdebug_register.cc" "${GE_CODE_DIR}/ge/common/dump/dump_op.cc" + "${GE_CODE_DIR}/ge/common/ge_opt_info.cc" "${GE_CODE_DIR}/ge/common/helper/om_file_helper.cc" "${GE_CODE_DIR}/ge/model/ge_root_model.cc" "${GE_CODE_DIR}/ge/common/model_parser/model_parser.cc" @@ -768,6 +770,7 @@ set(MULTI_PARTS_TEST_FILES "common/dump_op_unittest.cc" "common/dump_exception_unittest.cc" "common/opdebug_register_unittest.cc" + "common/ge_opt_info_unittest.cc" "common/format_transfer_unittest.cc" "common/format_transfer_transpose_unittest.cc" "common/format_transfer_nchw_5d_unittest.cc" @@ -863,6 +866,7 @@ list(APPEND COMMON_SHARED_LIBRARIES mmpa_stub hccl_stub error_manager_stub + opt_feature_stub ascend_protobuf json ) diff --git a/tests/ut/ge/common/ge_opt_info_unittest.cc b/tests/ut/ge/common/ge_opt_info_unittest.cc new file mode 100644 index 00000000..3ac51615 --- /dev/null +++ b/tests/ut/ge/common/ge_opt_info_unittest.cc @@ -0,0 +1,82 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#define protected public +#define private public +#include "common/ge_opt_info.h" +#include "graph/ge_local_context.h" +#include "external/ge/ge_api_types.h" +#undef private +#undef protected + +namespace ge { +class UTEST_opt_info : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(UTEST_opt_info, get_opt_info_success) { + std::map options = {{ge::SOC_VERSION, "Ascend910"}}; + GetThreadLocalContext().SetGlobalOption(options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::SUCCESS); + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(UTEST_opt_info, get_opt_info_all) { + std::map global_options = {{ge::SOC_VERSION, "Ascend310"}}; + GetThreadLocalContext().SetGlobalOption(global_options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::SUCCESS); + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.rl_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.aoe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(UTEST_opt_info, get_opt_info_failed) { + std::map options; + GetThreadLocalContext().SetGlobalOption(options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::FAILED); +} + +} // namespace ge diff --git a/third_party/fwkacllib/inc/opt_info/opt_info.h b/third_party/fwkacllib/inc/opt_info/opt_info.h new file mode 100644 index 00000000..ea9bb529 --- /dev/null +++ b/third_party/fwkacllib/inc/opt_info/opt_info.h @@ -0,0 +1,34 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +namespace gelc { +using Status = uint32_t; +using WorkMode = uint32_t; +const Status SUCCESS = 0x0; +const Status FAILED = 0xFFFFFFFF; +const WorkMode kOffline = 0x0; +const WorkMode kInline = 0x01; + +extern "C" { +__attribute__((visibility ("default"))) +Status GetOptInfo(WorkMode mode, const std::string &soc_ver, + std::map &opt_info_map); +} +} // namespace gelc + From e0939a797a9c413ce37a17131ed7132f1664fb4c Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Mon, 21 Jun 2021 15:36:19 +0800 Subject: [PATCH 11/43] Adaptation rectification of op_tiling. --- .../node_executor/aicore/aicore_op_task.cc | 24 +++++++++---------- .../node_executor/aicore/aicore_op_task.h | 4 ++-- ge/single_op/task/op_task.cc | 13 +++++----- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.cc b/ge/hybrid/node_executor/aicore/aicore_op_task.cc index 8cd24bd1..76082cb3 100644 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.cc +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.cc @@ -25,7 +25,7 @@ #include "single_op/task/build_task_utils.h" #include "single_op/task/tbe_task_builder.h" -using optiling::OpRunInfo; +using optiling::utils::OpRunInfo; namespace ge { namespace hybrid { @@ -359,9 +359,7 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { GE_CHECK_NOTNULL(op_desc); GELOGD("[%s] Start to update tiling info for task: [%s]", node->GetName().c_str(), stub_name_.c_str()); - OpRunInfo tiling_info; - tiling_info.block_dim = -1; // codex: Using uninitialized value - tiling_info.clear_atomic = true; + OpRunInfo tiling_info(-1, true, 0); auto execution_context = context.GetExecutionContext(); @@ -370,12 +368,14 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { RECORD_EXECUTION_EVENT(execution_context, context.GetNodeName(), "[CalcTilingInfo] End"); // update op args by tiling info - block_dim_ = static_cast(tiling_info.block_dim); - op_desc->SetWorkspaceBytes(tiling_info.workspaces); - clear_atomic_ = tiling_info.clear_atomic; - - tiling_data_ = tiling_info.tiling_data.str(); - tiling_key_ = tiling_info.tiling_key; + block_dim_ = tiling_info.GetBlockDim(); + clear_atomic_ = tiling_info.GetClearAtomic(); + std::vector workspaces; + tiling_info.GetAllWorkspaces(workspaces); + op_desc->SetWorkspaceBytes(workspaces); + + tiling_data_ = tiling_info.GetAllTilingData().str(); + tiling_key_ = tiling_info.GetTilingKey(); GELOGD("Successfully getting [tiling_key] : %u", tiling_key_); if (tiling_data_.empty()) { GELOGD("[%s] Tiling data is empty.", op_desc->GetName().c_str()); @@ -412,7 +412,7 @@ Status AiCoreOpTask::UpdateTilingInfo(TaskContext &context) { Status AiCoreOpTask::CalcTilingInfo(const NodePtr &node, OpRunInfo &tiling_info) { GELOGD("[%s] Start to invoke OpParaCalculate.", node->GetName().c_str()); - GE_CHK_STATUS_RET(OpParaCalculate(*node, tiling_info), + GE_CHK_STATUS_RET(optiling::OpParaCalculateV2(*node, tiling_info), "[Invoke][OpParaCalculate]Failed calc tiling data of node %s.", node->GetName().c_str()); GELOGD("[%s] Done invoking OpParaCalculate successfully.", node->GetName().c_str()); @@ -633,7 +633,7 @@ std::string AtomicAddrCleanOpTask::GetKeyForKernelName(const OpDesc &op_desc) co Status AtomicAddrCleanOpTask::CalcTilingInfo(const NodePtr &node, OpRunInfo &tiling_info) { GELOGD("[%s] Start to invoke OpAtomicCalculate.", node->GetName().c_str()); - GE_CHK_STATUS_RET(OpAtomicCalculate(*node, tiling_info), + GE_CHK_STATUS_RET(optiling::OpAtomicCalculateV2(*node, tiling_info), "[Invoke][OpAtomicCalculate]Failed calc tiling data of node %s.", node->GetName().c_str()); GELOGD("[%s] Done invoking OpAtomicCalculate successfully.", node->GetName().c_str()); diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.h b/ge/hybrid/node_executor/aicore/aicore_op_task.h index 8d7b7f1e..3c8db8c9 100755 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.h +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.h @@ -85,7 +85,7 @@ class AiCoreOpTask { virtual std::string GetKeyForTvmMagic() const; virtual std::string GetKeyForTvmMetaData() const; virtual std::string GetKeyForKernelName(const OpDesc &op_desc) const; - virtual Status CalcTilingInfo(const NodePtr &node, optiling::OpRunInfo &tiling_info); + virtual Status CalcTilingInfo(const NodePtr &node, optiling::utils::OpRunInfo &tiling_info); std::unique_ptr tiling_buffer_ = nullptr; std::string tiling_data_; @@ -130,7 +130,7 @@ class AtomicAddrCleanOpTask : public AiCoreOpTask { std::string GetKeyForTvmMagic() const override; std::string GetKeyForTvmMetaData() const override; std::string GetKeyForKernelName(const OpDesc &op_desc) const override; - Status CalcTilingInfo(const NodePtr &node, optiling::OpRunInfo &tiling_info) override; + Status CalcTilingInfo(const NodePtr &node, optiling::utils::OpRunInfo &tiling_info) override; private: Status InitAtomicAddrCleanIndices(const OpDesc &op_desc); diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index e48677f8..66d70e7e 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -224,18 +224,17 @@ Status TbeOpTask::LaunchKernel(rtStream_t stream) { Status TbeOpTask::UpdateRunInfo() { // invoke OpParaCalculate GELOGD("Start to invoke OpParaCalculate."); - optiling::OpRunInfo run_info; - run_info.block_dim = 0; - auto ret = optiling::OpParaCalculate(*node_, run_info); + optiling::utils::OpRunInfo run_info(0, true, 0); + auto ret = optiling::OpParaCalculateV2(*node_, run_info); if (ret != GRAPH_SUCCESS) { GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Invoke][OpParaCalculate] failed, ret = %u.", ret); REPORT_INNER_ERROR("E19999", "invoke OpParaCalculate failed, ret = %u.", ret); return ACL_ERROR_GE_INTERNAL_ERROR; } - block_dim_ = run_info.block_dim; - tiling_data_ = run_info.tiling_data.str(); - tiling_key_ = run_info.tiling_key; - run_info_workspaces_ = run_info.workspaces; + block_dim_ = run_info.GetBlockDim(); + tiling_data_ = run_info.GetAllTilingData().str(); + tiling_key_ = run_info.GetTilingKey(); + run_info.GetAllWorkspaces(run_info_workspaces_); GELOGD("Done invoking OpParaCalculate successfully. block_dim = %u, tiling size = %zu, tiling_key = %u", block_dim_, tiling_data_.size(), tiling_key_); return SUCCESS; From df52801ea551999be69e9d42285aa9b06008ff92 Mon Sep 17 00:00:00 2001 From: wuweikang Date: Thu, 13 May 2021 16:14:41 +0800 Subject: [PATCH 12/43] remove updation of session_id --- ge/graph/manager/graph_manager.cc | 2 +- ge/hybrid/model/hybrid_model_builder.cc | 46 +++++++++++++++---- ge/hybrid/model/hybrid_model_builder.h | 1 + ge/model/ge_root_model.h | 5 ++ .../executor/subgraph_executor_unittest.cc | 3 ++ .../model/hybrid_model_builder_unittest.cc | 26 +++++++++-- 6 files changed, 67 insertions(+), 16 deletions(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index bf04ed58..329db797 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -3132,10 +3132,10 @@ void GraphManager::PreRunThread(GraphManager *graph_manager) { } // Avoid repeatively prerun for graphs owns same graph_id in online inference concurrency if (count > 1 && graph_node->GetBuildFlag()) { - graph_node->Lock(); GELOGD("Avoid repeatively prerun, graph_id:%u.", args.graph_id); // In online inference concurrency senario, graph_node is allowed to be locked for 'count' times graph_node->SetSemSize(count); + graph_node->Lock(); graph_manager->run_args_q_.Push(RunArgs( { graph_node, args.graph_id, args.session_id, args.error_context, args.input_tensor, graph_node->GetGeRootModel(), GetThreadLocalContext(), args.callback })); GELOGI("[PreRunThread] Loop end. Start to run with cached build model."); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index 5337a0cf..01e189d3 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -147,6 +147,7 @@ Status HybridModelBuilder::Build() { GE_CHK_STATUS_RET(ValidateParams(), "[Invoke][ValidateParams] failed, model_name_:[%s]", GetGraphName()); hybrid_model_.model_name_ = ge_root_model_->GetModelName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); + GE_CHK_STATUS_RET(CopyGraph(), "[Invoke][CopyGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitRuntimeParams(), "[Invoke][InitRuntimeParams] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(RecoverGraphUnknownFlag(), "[Invoke][RecoverGraphUnknownFlag] failed, model_name_:[%s]", GetGraphName()); @@ -174,8 +175,8 @@ Status HybridModelBuilder::BuildForSingleOp() { hybrid_model_.model_name_ = ge_root_model_->GetRootGraph()->GetName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); auto ret = ge_root_model_->GetSubgraphInstanceNameToModel(); - const GeModelPtr ge_model = ret[ge_root_model_->GetRootGraph()->GetName()]; - GE_CHK_STATUS_RET(IndexTaskDefs(ge_root_model_->GetRootGraph(), ge_model), + const GeModelPtr ge_model = ret[hybrid_model_.root_graph_->GetName()]; + GE_CHK_STATUS_RET(IndexTaskDefs(hybrid_model_.root_graph_, ge_model), "[Invoke][IndexTaskDefs] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(LoadGraph(), "[Invoke][LoadGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitWeights(), "[Invoke][InitWeights] failed, model_name_:[%s]", GetGraphName()); @@ -190,6 +191,29 @@ Status HybridModelBuilder::ValidateParams() { return SUCCESS; } +Status HybridModelBuilder::CopyGraph() { + GELOGD("Copy compute graph begin."); + auto root_graph = ge_root_model_->GetRootGraph(); + + ge_root_model_->IncreaseBuildTimes(); + std::string new_graph_name = ge_root_model_->GetRootGraph()->GetName() + "_" + + std::to_string(ge_root_model_->GetBuildTimes()); + ComputeGraphPtr new_root_graph = MakeShared(new_graph_name); + GE_CHECK_NOTNULL(new_root_graph); + int32_t depth = 0; + std::map node_old_2_new; + std::map op_desc_old_2_new; + graphStatus ret = GraphUtils::CopyComputeGraph(root_graph, new_root_graph, node_old_2_new, op_desc_old_2_new, depth); + if (ret != GRAPH_SUCCESS) { + GELOGE(GRAPH_FAILED, "Copy compute graph failed."); + return GRAPH_FAILED; + } + hybrid_model_.root_graph_ = new_root_graph; + + GELOGD("Copy compute graph[%s] success.", new_graph_name.c_str()); + return SUCCESS; +} + Status HybridModelBuilder::BuildNodeItem(const NodePtr &node, NodeItem &node_item) { auto op_desc = node->GetOpDesc(); GE_CHK_STATUS_RET(ParseForceInfershapeNodes(node, node_item), @@ -814,7 +838,7 @@ Status HybridModelBuilder::BuildOutputMapping(GraphItem &graph_item, } Status HybridModelBuilder::LoadGraph() { - auto root_graph = ge_root_model_->GetRootGraph(); + auto root_graph = hybrid_model_.root_graph_; if (!GetContext().GetHostExecFlag()) { std::shared_ptr merged_graph; GELOGI("Before merging subgraphs DirectNodesSize = %zu, GetAllNodesSize = %zu", @@ -828,7 +852,6 @@ Status HybridModelBuilder::LoadGraph() { root_graph->GetAllNodesSize()); } - hybrid_model_.root_graph_ = root_graph; GE_CHK_STATUS_RET(RelinkNextIteration(), "[%s] Relink NextIteration failed", GetGraphName()); // Reset node id by topological order across all subgraphs int64_t index = 0; @@ -877,6 +900,7 @@ Status HybridModelBuilder::LoadGraph() { } for (auto &it : hybrid_model_.known_shape_sub_models_) { auto node_item = MutableNodeItem(it.first); + GE_CHECK_NOTNULL(node_item); AscendString graph_name; GE_CHK_GRAPH_STATUS_RET(it.second->GetGraph().GetName(graph_name), "Failed to get subgraph name"); auto subgraph = hybrid_model_.GetRootGraph()->GetSubgraph(graph_name.GetString()); @@ -1125,7 +1149,9 @@ Status HybridModelBuilder::InitWeights() { sub_weight_buffer->GetSize()); auto subgraph = GraphUtils::GetComputeGraph(subgraph_model.second->GetGraph()); if (subgraph != ge_root_model_->GetRootGraph()) { - subgraph = ge_root_model_->GetRootGraph()->GetSubgraph(subgraph_model.first); + subgraph = hybrid_model_.root_graph_->GetSubgraph(subgraph_model.first); + } else { + subgraph = hybrid_model_.root_graph_; } GE_CHECK_NOTNULL(subgraph); hybrid_model_.weight_buffer_map_.emplace(subgraph->GetName(), std::move(sub_weight_buffer)); @@ -1282,7 +1308,7 @@ Status HybridModelBuilder::IndexTaskDefs(const ComputeGraphPtr &sub_graph, const } Status HybridModelBuilder::IndexTaskDefs() { - const auto root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; const auto &root_graph_name = root_graph->GetName(); if (SetOutputNameAttr(*root_graph) != SUCCESS) { GELOGW("Set output name attr failed."); @@ -1316,7 +1342,7 @@ Status HybridModelBuilder::IndexTaskDefs() { Status HybridModelBuilder::IndexSpecialNodes() { GELOGD("Start to index special nodes"); - const auto &root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; for (auto &node : root_graph->GetAllNodes()) { GE_CHECK_NOTNULL(node); GE_CHECK_NOTNULL(node->GetOpDesc()); @@ -1471,7 +1497,7 @@ Status HybridModelBuilder::InitRuntimeParams() { runtime_param_.session_id = ret ? static_cast(value) : 0; ret = ge::AttrUtils::GetInt(first_model, ATTR_MODEL_TASK_GEN_VAR_ADDR, value); runtime_param_.logic_var_base = ret ? static_cast(value) : 0; - runtime_param_.graph_id = ge_root_model_->GetRootGraph()->GetGraphID(); + runtime_param_.graph_id = hybrid_model_.root_graph_->GetGraphID(); value = 0; for (auto &it : ge_root_model_->GetSubgraphInstanceNameToModel()) { (void) ge::AttrUtils::GetInt(it.second, ATTR_MODEL_VAR_SIZE, value); @@ -1608,7 +1634,7 @@ Status HybridModelBuilder::TransAllVarData() { } Status HybridModelBuilder::CopyVarData() { - GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(ge_root_model_->GetRootGraph(), + GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(hybrid_model_.root_graph_, runtime_param_.session_id, hybrid_model_.device_id_), "[Invoke][CopyVarData] failed."); @@ -1691,7 +1717,7 @@ Status HybridModelBuilder::LoadKnownShapedSubgraph(ComputeGraph &graph, NodeItem } Status HybridModelBuilder::RecoverGraphUnknownFlag() { - const auto &root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; for (auto &sub_graph : root_graph->GetAllSubgraphs()) { GE_CHECK_NOTNULL(sub_graph); for (const auto &node : sub_graph->GetDirectNode()) { diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index 92974441..3ab43b7f 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -56,6 +56,7 @@ class HybridModelBuilder { Status BuildOutputMapping(GraphItem &partitioned_call, const NodeItem &node_item, bool is_root_graph); Status ValidateParams(); Status LoadGraph(); + Status CopyGraph(); Status LoadGeModel(ComputeGraph &graph, const GeModelPtr &ge_model); Status LoadTask(NodeItem &node_item); Status LoadTasks(); diff --git a/ge/model/ge_root_model.h b/ge/model/ge_root_model.h index 9e8e116e..b6e3d081 100755 --- a/ge/model/ge_root_model.h +++ b/ge/model/ge_root_model.h @@ -60,6 +60,10 @@ class GeRootModel { bool GetTrainFlag() const { return train_flag_; } + int32_t GetBuildTimes() const { return hybrid_build_times_; } + + void IncreaseBuildTimes() { hybrid_build_times_++; } + private: ComputeGraphPtr root_graph_ = nullptr; std::map subgraph_instance_name_to_model_; @@ -69,6 +73,7 @@ class GeRootModel { bool train_flag_ = false; std::string model_name_; bool is_specific_stream_ = false; + int32_t hybrid_build_times_ = 0; }; } // namespace ge using GeRootModelPtr = std::shared_ptr; diff --git a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc index 2dc3b639..827705ae 100644 --- a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc +++ b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc @@ -249,6 +249,9 @@ TEST_F(UtestSubgraphExecutor, cond_graph_schedule_tasks) { graph_context.callback_manager = std::unique_ptr(new CallbackManager()); ASSERT_EQ(graph_context.callback_manager->Init(), SUCCESS); + auto root_graph = hybrid_model.root_graph_; + switch_t = root_graph->FindNode("switch_t"); + switch_f = root_graph->FindNode("switch_f"); const auto node_it_t = hybrid_model.node_items_.find(switch_t); const auto node_it_f = hybrid_model.node_items_.find(switch_f); ASSERT_NE(hybrid_model.node_items_.end(), node_it_t); diff --git a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc index 2ab82350..95669b73 100644 --- a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc +++ b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc @@ -214,11 +214,17 @@ TEST_F(UtestHybridModelBuilder, normal_hybrid_model_build) { ASSERT_EQ(it->second->frame_index_, index); ASSERT_EQ(it->second->parent_frame_, -1); }; - TestFrameGroup(enter1, control_group_index); - TestFrameGroup(active1, control_group_index); - TestFrameGroup(active2, control_group_index); - TestFrameGroup(active3, control_group_index); - TestFrameGroup(output1, -1); + auto root_graph = hybrid_model.root_graph_; + auto enter1_node = root_graph->FindNode("enter"); + auto active1_node = root_graph->FindNode("active1"); + auto active2_node = root_graph->FindNode("active2"); + auto active3_node = root_graph->FindNode("active3"); + auto output1_node = root_graph->FindNode("net_output"); + TestFrameGroup(enter1_node, control_group_index); + TestFrameGroup(active1_node, control_group_index); + TestFrameGroup(active2_node, control_group_index); + TestFrameGroup(active3_node, control_group_index); + TestFrameGroup(output1_node, -1); engine_mapping.clear(); task_executor.clear(); @@ -346,4 +352,14 @@ EXPECT_EQ(hybrid_model_builder.InitVariableTensors(), SUCCESS); EXPECT_EQ(hybrid_model_builder.hybrid_model_.variable_tensors_.size(), 1); HostMemManager::Instance().var_memory_base_map_.clear(); } + +TEST_F(UtestHybridModelBuilder, copy_graph_success) { +ComputeGraphPtr graph = std::make_shared("test"); +GeRootModelPtr ge_root_model = make_shared(graph); +HybridModel hybrid_model(ge_root_model); +HybridModelBuilder hybrid_model_builder(hybrid_model); + +Status st = hybrid_model_builder.CopyGraph(); +EXPECT_EQ(st, SUCCESS); +} } // namespace ge From f8154fbef674da3320cdbc325c5957678be3133a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8D=8E?= Date: Mon, 21 Jun 2021 17:39:14 +0800 Subject: [PATCH 13/43] opt info --- ge/common/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 91f3b27d..d81bb00a 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -87,7 +87,7 @@ target_include_directories(ge_common PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> - $<$>:${GE_DEPEND_DIR}../abl/licctrl> + $<$>:${GE_DEPEND_DIR}/abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> @@ -159,7 +159,7 @@ target_include_directories(ge_common_static PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> - $<$>:${GE_DEPEND_DIR}/../abl/licctrl> + $<$>:${GE_DEPEND_DIR}/abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> From 096981679abff4bc050f69aa6736ea45ae77db09 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Mon, 21 Jun 2021 18:35:43 +0800 Subject: [PATCH 14/43] Update submodule. --- metadef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadef b/metadef index e189fc7f..f75dbad2 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit e189fc7f4da9f7714f009d70da4db627de17955d +Subproject commit f75dbad2f2249608080e482acc6d723e04fec3da From 64b22f8c98452144804528b69d453fd22ab61474 Mon Sep 17 00:00:00 2001 From: wangzhengjun Date: Mon, 21 Jun 2021 19:32:53 +0800 Subject: [PATCH 15/43] skip control flow op when replace node with empty tensor --- .../passes/replace_with_empty_const_pass.cc | 20 +++++++++ .../replace_with_empty_const_pass_unittest.cc | 45 +++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/ge/graph/passes/replace_with_empty_const_pass.cc b/ge/graph/passes/replace_with_empty_const_pass.cc index 9459c852..3176d1ee 100644 --- a/ge/graph/passes/replace_with_empty_const_pass.cc +++ b/ge/graph/passes/replace_with_empty_const_pass.cc @@ -21,7 +21,23 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/utils/graph_utils.h" +#include "graph/utils/node_utils.h" +namespace { +const std::unordered_set kControlFlowOps = { + ge::SWITCH, + ge::REFSWITCH, + ge::MERGE, + ge::REFMERGE, + ge::ENTER, + ge::REFENTER, + ge::NEXTITERATION, + ge::REFNEXTITERATION, + ge::EXIT, + ge::REFEXIT, + ge::LOOPCOND +}; +} namespace ge { Status ReplaceWithEmptyConstPass::Run(NodePtr &node) { GELOGD("ReplaceWithEmptyConstPass in."); @@ -39,6 +55,10 @@ Status ReplaceWithEmptyConstPass::Run(NodePtr &node) { GELOGI("Node %s is const. Ignore current pass.", node->GetName().c_str()); return SUCCESS; } + if (kControlFlowOps.count(NodeUtils::GetNodeType(node)) != 0) { + GELOGI("Node %s is control flow op. Ignore current pass.", node->GetName().c_str()); + return SUCCESS; + } // Node like no op, it has no output if (node->GetOpDesc()->GetAllOutputsDescPtr().empty()) { GELOGI("Node %s has no output desc. Ignore current pass.", node->GetName().c_str()); diff --git a/tests/ut/ge/graph/passes/replace_with_empty_const_pass_unittest.cc b/tests/ut/ge/graph/passes/replace_with_empty_const_pass_unittest.cc index 6711b0d3..d353498c 100644 --- a/tests/ut/ge/graph/passes/replace_with_empty_const_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/replace_with_empty_const_pass_unittest.cc @@ -57,6 +57,36 @@ ut::GraphBuilder Graph1Builder() { builder.AddDataEdge(cast1, 0, conv2d, 0); return builder; } + +/// data1 const1 +/// \ / +/// add1 +/// | +/// data2 -> switch1 (empty) +/// | +/// conv2d +ut::GraphBuilder Graph2Builder() { + ut::GraphBuilder builder = ut::GraphBuilder("graph2"); + auto data1 = builder.AddNode("data1", "Data", 0, 1); + auto data2 = builder.AddNode("data2", "Data", 0, 1); + auto const1 = builder.AddNode("const1", "Const", 0, 1); + auto add1 = builder.AddNode("add1", "Add", 2, 1); + auto switch1 = builder.AddNode("switch1", "Switch", 2, 1); + auto conv2d = builder.AddNode("conv2d", "Conv2D", 1, 0); + + add1->GetOpDesc()->AddInputDesc(GeTensorDesc(GeShape({1, 1, 8, 8}),FORMAT_NCHW)); + add1->GetOpDesc()->AddInputDesc(GeTensorDesc(GeShape({1, 1, 8, 8}),FORMAT_NCHW)); + add1->GetOpDesc()->AddOutputDesc(GeTensorDesc(GeShape({1, 1, 8, 8}),FORMAT_NCHW)); + GeTensorDesc empty_tensor(GeShape({1, 0, 8, 8}),FORMAT_NCHW); + switch1->GetOpDesc()->UpdateOutputDesc(0, empty_tensor); + + builder.AddDataEdge(data1, 0, add1, 0); + builder.AddDataEdge(const1, 0, add1, 1); + builder.AddDataEdge(add1, 0, switch1, 0); + builder.AddDataEdge(data2, 0, switch1, 1); + builder.AddDataEdge(switch1, 0, conv2d, 0); + return builder; +} } // namespace @@ -85,4 +115,19 @@ TEST_F(UtestReplaceWithEmptyConstPass, replace_whith_empty_const_success) { auto conv2d = graph->FindNode("conv2d"); EXPECT_EQ(conv2d->GetInDataNodes().at(0)->GetType(),"Const"); } + +TEST_F(UtestReplaceWithEmptyConstPass, replace_whith_empty_switch_skip) { + auto builder = Graph2Builder(); + auto graph = builder.GetGraph(); + graph->SetSessionID(0); + ReplaceWithEmptyConstPass replace_with_empty_const_pass; + + EXPECT_EQ(graph->GetDirectNodesSize(), 6); + // run pass on switch1, graph still has 6 nodes + auto switch1 = graph->FindNode("switch1"); + EXPECT_NE(switch1, nullptr); + Status ret = replace_with_empty_const_pass.Run(switch1); + EXPECT_EQ(ret, SUCCESS); + EXPECT_EQ(graph->GetDirectNodesSize(), 6); +} } // namespace ge From 0b31eb4bda4f73b54d6f23ce064a240a4cbf5fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8D=8E?= Date: Tue, 22 Jun 2021 09:33:39 +0800 Subject: [PATCH 16/43] =?UTF-8?q?=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 +- ge/common/CMakeLists.txt | 8 -- ge/common/ge_opt_info.cc | 58 --------- ge/common/ge_opt_info.h | 31 ----- ge/graph/manager/graph_manager.cc | 7 - tests/CMakeLists.txt | 1 - tests/depends/opt_info/CMakeLists.txt | 37 ------ tests/depends/opt_info/src/opt_info_stub.cc | 46 ------- tests/framework/cmake/graphengine.cmake | 2 - tests/st/testcase/test_ge_opt_info.cc | 123 ------------------ tests/ut/ge/CMakeLists.txt | 4 - tests/ut/ge/common/ge_opt_info_unittest.cc | 82 ------------ third_party/fwkacllib/inc/opt_info/opt_info.h | 34 ----- 13 files changed, 1 insertion(+), 435 deletions(-) delete mode 100644 ge/common/ge_opt_info.cc delete mode 100644 ge/common/ge_opt_info.h delete mode 100644 tests/depends/opt_info/CMakeLists.txt delete mode 100644 tests/depends/opt_info/src/opt_info_stub.cc delete mode 100644 tests/st/testcase/test_ge_opt_info.cc delete mode 100644 tests/ut/ge/common/ge_opt_info_unittest.cc delete mode 100644 third_party/fwkacllib/inc/opt_info/opt_info.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 77a759ba..e3cc1e32 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,6 @@ else () #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) else() find_module(slog libalog.so ${ASCEND_ATC_DIR}) - find_module(opt_feature libopt_feature.so ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) if(PLATFORM STREQUAL "train") find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) @@ -180,4 +179,4 @@ else () add_subdirectory(ge) -endif () \ No newline at end of file +endif () diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index d81bb00a..f55ff427 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -43,7 +43,6 @@ set(SRC_LIST "op/ge_op_utils.cc" "thread_pool.cc" "ge/tbe_plugin_manager.cc" - "ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL) @@ -87,11 +86,9 @@ target_include_directories(ge_common PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> - $<$>:${GE_DEPEND_DIR}/abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> - $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info> ) target_link_options(ge_common PRIVATE @@ -111,7 +108,6 @@ target_link_libraries(ge_common PRIVATE c_sec error_manager slog - opt_feature -Wl,--as-needed json $<$>:-lrt> @@ -159,11 +155,9 @@ target_include_directories(ge_common_static PRIVATE #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> $<$>:${GE_DEPEND_DIR}/inc/cce> - $<$>:${GE_DEPEND_DIR}/abl/licctrl> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> - $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info> ) target_link_libraries(ge_common_static PRIVATE @@ -219,7 +213,6 @@ target_include_directories(ge_common PRIVATE ${CMAKE_BINARY_DIR}/proto/graphengine_protos ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_common PRIVATE @@ -235,7 +228,6 @@ target_link_libraries(ge_common PRIVATE c_sec error_manager slog - opt_feature static_mmpa -Wl,--as-needed json diff --git a/ge/common/ge_opt_info.cc b/ge/common/ge_opt_info.cc deleted file mode 100644 index c6bac480..00000000 --- a/ge/common/ge_opt_info.cc +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "common/ge_opt_info.h" - -#include -#include -#include "graph/ge_local_context.h" -#include "ge/ge_api_types.h" -#include "common/debug/ge_log.h" -#include "opt_info.h" - -namespace ge { -Status GeOptInfo::SetOptInfo() { - std::string soc_ver; - graphStatus ret = GetThreadLocalContext().GetOption(SOC_VERSION, soc_ver); - if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get soc version failed."); - GELOGE(FAILED, "[Get][SocVersion]Get soc version failed."); - return FAILED; - } - GELOGD("Soc version:%s.", soc_ver.c_str()); - std::map opt_info; - // the first arg does not work at present. - if (gelc::GetOptInfo(gelc::kOffline, soc_ver, opt_info) != gelc::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get optional information failed, is_offline:%d, soc version:%s", - gelc::kOffline, soc_ver.c_str()); - GELOGE(FAILED, "[Get][OptInfo]Get optional information failed, is_offline:%d, soc version:%s", - gelc::kOffline, soc_ver.c_str()); - return FAILED; - } - // do nothing if get empty information - if (opt_info.empty()) { - GELOGI("Optional information is empty."); - return SUCCESS; - } - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - for (const auto &itr : opt_info) { - graph_options.emplace(itr.first, itr.second); - GELOGI("Get optional information success, key:%s, value:%s.", itr.first.c_str(), itr.second.c_str()); - } - GetThreadLocalContext().SetGraphOption(graph_options); - return SUCCESS; -} -} // namespace ge diff --git a/ge/common/ge_opt_info.h b/ge/common/ge_opt_info.h deleted file mode 100644 index 4ec9a59f..00000000 --- a/ge/common/ge_opt_info.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef GE_COMMON_GE_OPT_INFO_H_ -#define GE_COMMON_GE_OPT_INFO_H_ - -#include "ge/ge_api_error_codes.h" -#include "register/register_types.h" - -namespace ge { -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeOptInfo { - public: - GeOptInfo() = default; - static Status SetOptInfo(); -}; -} // namespace ge - -#endif // GE_COMMON_GE_OPT_INFO_H_ diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 3861e6ac..b862a7d6 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -27,7 +27,6 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/dump/dump_manager.h" -#include "common/ge_opt_info.h" #include "analyzer/analyzer.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" @@ -1002,12 +1001,6 @@ Status GraphManager::PreRun(const GraphNodePtr &graph_node, const std::vector - c_sec -) - -target_include_directories(opt_feature_stub INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src) diff --git a/tests/depends/opt_info/src/opt_info_stub.cc b/tests/depends/opt_info/src/opt_info_stub.cc deleted file mode 100644 index df518c4b..00000000 --- a/tests/depends/opt_info/src/opt_info_stub.cc +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "opt_info.h" -#include -#include -#include -#include - -namespace gelc { -namespace { -const std::vector kSocVersions = {"Ascend910"}; -} - -void SetAllOptInfo(std::map &opt_infos) { - opt_infos.emplace("opt_module.fe", "all"); - opt_infos.emplace("opt_module.pass", "all"); - opt_infos.emplace("opt_module.op_tune", "all"); - opt_infos.emplace("opt_module.rl_tune", "all"); - opt_infos.emplace("opt_module.aoe", "all"); -} - -Status GetOptInfo(WorkMode mode, const std::string &soc_ver, - std::map &opt_infos) { - if (std::find(kSocVersions.begin(), kSocVersions.end(), soc_ver)== kSocVersions.end()) { - SetAllOptInfo(opt_infos); - return SUCCESS; - } - opt_infos.emplace("opt_module.fe", "all"); - opt_infos.emplace("opt_module.pass", "all"); - opt_infos.emplace("opt_module.op_tune", "all"); - return SUCCESS; -} -} // namespace gelc diff --git a/tests/framework/cmake/graphengine.cmake b/tests/framework/cmake/graphengine.cmake index c4380016..81aa00cc 100644 --- a/tests/framework/cmake/graphengine.cmake +++ b/tests/framework/cmake/graphengine.cmake @@ -103,7 +103,6 @@ list(APPEND INCLUDE_DIRECTORIES "${GE_CODE_DIR}/third_party/fwkacllib/inc/cce" "${GE_CODE_DIR}/third_party/fwkacllib/inc/ops" "${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain" - "${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info" "${GE_CODE_DIR}/tests/ut/ge" "${GE_CODE_DIR}/tests/ut/common" "${CMAKE_BINARY_DIR}" @@ -118,7 +117,6 @@ list(APPEND STUB_LIBS runtime_stub profiler_stub hccl_stub - opt_feature_stub error_manager_stub ascend_protobuf json diff --git a/tests/st/testcase/test_ge_opt_info.cc b/tests/st/testcase/test_ge_opt_info.cc deleted file mode 100644 index 8fc47a9b..00000000 --- a/tests/st/testcase/test_ge_opt_info.cc +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "easy_graph/graph/box.h" -#include "easy_graph/graph/node.h" -#include "easy_graph/builder/graph_dsl.h" -#include "easy_graph/builder/box_builder.h" -#include "easy_graph/layout/graph_layout.h" -#include "easy_graph/layout/engines/graph_easy/graph_easy_option.h" -#include "easy_graph/layout/engines/graph_easy/graph_easy_executor.h" -#include "graph/graph.h" -#include "graph/compute_graph.h" -#include "framework/common/types.h" -#include "graph/debug/ge_attr_define.h" -#include "ge_graph_dsl/graph_dsl.h" -#include "ge_graph_dsl/op_desc/op_desc_cfg_box.h" -#define protected public -#define private public -#include "common/ge_opt_info.h" -#undef private -#undef protected - -namespace ge { -class STEST_opt_info : public testing::Test { - protected: - void SetUp() {} - void TearDown() {} -}; - -TEST_F(STEST_opt_info, get_opt_info_all) { - std::map options = {{ge::SOC_VERSION, "Ascend310"}}; - GetThreadLocalContext().SetGlobalOption(options); - - /// data1 data2 - /// \ / - /// add - // build graph - DEF_GRAPH(g1) { - CHAIN(NODE("data1", DATA)->NODE("add", ADD)); - CHAIN(NODE("data2", DATA)->NODE("add")); - }); - - auto graph = ToGeGraph(g1); - - // new session & add graph - Session session(options); - auto ret = session.AddGraph(1, graph, options); - EXPECT_EQ(ret, SUCCESS); - // build input tensor - std::vector inputs; - // build_graph through session - ret = session.BuildGraph(1, inputs); - EXPECT_EQ(ret, SUCCESS); - - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.rl_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.aoe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(STEST_opt_info, get_opt_info_success) { - std::map options = {{ge::SOC_VERSION, "Ascend910"}}; - GetThreadLocalContext().SetGlobalOption(options); - - /// data1 data2 - /// \ / - /// add - // build graph - DEF_GRAPH(g1) { - CHAIN(NODE("data1", DATA)->NODE("add", ADD)); - CHAIN(NODE("data2", DATA)->NODE("add")); - }); - - auto graph = ToGeGraph(g1); - - // new session & add graph - Session session(options); - auto ret = session.AddGraph(1, graph, options); - EXPECT_EQ(ret, SUCCESS); - // build input tensor - std::vector inputs; - // build_graph through session - ret = session.BuildGraph(1, inputs); - EXPECT_EQ(ret, SUCCESS); - - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} -} // namespace ge diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 3ea4d1a7..8b024820 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -62,7 +62,6 @@ include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/cce) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/ops) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain) -include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info) include_directories(${GE_CODE_DIR}/tests/ut/ge) include_directories(${GE_CODE_DIR}/tests/ut/common) include_directories(${CMAKE_BINARY_DIR}) @@ -173,7 +172,6 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/dump/exception_dumper.cc" "${GE_CODE_DIR}/ge/common/dump/opdebug_register.cc" "${GE_CODE_DIR}/ge/common/dump/dump_op.cc" - "${GE_CODE_DIR}/ge/common/ge_opt_info.cc" "${GE_CODE_DIR}/ge/common/helper/om_file_helper.cc" "${GE_CODE_DIR}/ge/model/ge_root_model.cc" "${GE_CODE_DIR}/ge/common/model_parser/model_parser.cc" @@ -770,7 +768,6 @@ set(MULTI_PARTS_TEST_FILES "common/dump_op_unittest.cc" "common/dump_exception_unittest.cc" "common/opdebug_register_unittest.cc" - "common/ge_opt_info_unittest.cc" "common/format_transfer_unittest.cc" "common/format_transfer_transpose_unittest.cc" "common/format_transfer_nchw_5d_unittest.cc" @@ -864,7 +861,6 @@ list(APPEND COMMON_SHARED_LIBRARIES mmpa_stub hccl_stub error_manager_stub - opt_feature_stub ascend_protobuf json ) diff --git a/tests/ut/ge/common/ge_opt_info_unittest.cc b/tests/ut/ge/common/ge_opt_info_unittest.cc deleted file mode 100644 index 3ac51615..00000000 --- a/tests/ut/ge/common/ge_opt_info_unittest.cc +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#define protected public -#define private public -#include "common/ge_opt_info.h" -#include "graph/ge_local_context.h" -#include "external/ge/ge_api_types.h" -#undef private -#undef protected - -namespace ge { -class UTEST_opt_info : public testing::Test { - protected: - void SetUp() {} - void TearDown() {} -}; - -TEST_F(UTEST_opt_info, get_opt_info_success) { - std::map options = {{ge::SOC_VERSION, "Ascend910"}}; - GetThreadLocalContext().SetGlobalOption(options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::SUCCESS); - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(UTEST_opt_info, get_opt_info_all) { - std::map global_options = {{ge::SOC_VERSION, "Ascend310"}}; - GetThreadLocalContext().SetGlobalOption(global_options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::SUCCESS); - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.rl_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.aoe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(UTEST_opt_info, get_opt_info_failed) { - std::map options; - GetThreadLocalContext().SetGlobalOption(options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::FAILED); -} - -} // namespace ge diff --git a/third_party/fwkacllib/inc/opt_info/opt_info.h b/third_party/fwkacllib/inc/opt_info/opt_info.h deleted file mode 100644 index ea9bb529..00000000 --- a/third_party/fwkacllib/inc/opt_info/opt_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -namespace gelc { -using Status = uint32_t; -using WorkMode = uint32_t; -const Status SUCCESS = 0x0; -const Status FAILED = 0xFFFFFFFF; -const WorkMode kOffline = 0x0; -const WorkMode kInline = 0x01; - -extern "C" { -__attribute__((visibility ("default"))) -Status GetOptInfo(WorkMode mode, const std::string &soc_ver, - std::map &opt_info_map); -} -} // namespace gelc - From e6e71fe317d331002491b27b3b26c6009c2a1ecf Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Sat, 19 Jun 2021 17:18:30 +0800 Subject: [PATCH 17/43] Normalize include files... --- ge/CMakeLists.txt | 30 ++-------- ge/analyzer/analyzer.cc | 2 +- ge/client/ge_api.cc | 4 +- ge/common/CMakeLists.txt | 14 ----- ge/common/base64.h | 4 +- ge/common/dump/dump_manager.h | 2 +- ge/common/dump/dump_op.h | 2 +- ge/common/dump/dump_properties.cc | 2 +- ge/common/dump/opdebug_register.cc | 2 +- ge/common/dump/opdebug_register.h | 4 +- .../format_transfer_fractal_z.cc | 2 +- .../format_transfer_nchw_fz_c04.cc | 2 +- ge/common/ge/datatype_util.h | 2 +- ge/common/ge/plugin_manager.h | 4 +- ge/common/ge_format_util.cc | 2 +- ge/common/helper/model_cache_helper.h | 2 +- ge/common/math/fp16_math.cc | 2 +- ge/common/model_parser/model_parser.cc | 2 +- ge/common/op/attr_value_util.cc | 2 +- ge/common/profiling/ge_profiling.cc | 2 +- ge/common/profiling/ge_runner_profiling.cc | 2 +- ge/common/profiling/profiling_manager.cc | 2 +- ge/common/properties_manager.cc | 2 +- ge/common/properties_manager.h | 2 +- ge/common/thread_pool.cc | 2 +- ge/common/thread_pool.h | 2 +- ge/common/types.cc | 2 +- ge/engine_manager/dnnengine_manager.cc | 2 +- ge/engine_manager/dnnengine_manager.h | 4 +- ge/executor/CMakeLists.txt | 6 -- ge/executor/ge_executor.cc | 6 +- ge/ge_local_engine/CMakeLists.txt | 10 ---- ge/ge_local_engine/engine/ge_local_engine.cc | 6 +- ge/ge_local_engine/engine/host_cpu_engine.cc | 2 +- ge/ge_local_engine/engine/host_cpu_engine.h | 2 +- .../ge_local_ops_kernel_builder.cc | 4 +- .../ge_local_ops_kernel_info.cc | 6 +- .../ops_kernel_store/op/ge_deleted_op.cc | 2 +- .../ops_kernel_store/op/no_op.cc | 2 +- ge/ge_local_engine/ops_kernel_store/op/op.cc | 2 +- ge/ge_local_engine/ops_kernel_store/op/op.h | 2 +- .../ops_kernel_store/op/op_factory.cc | 2 +- ge/ge_runtime/CMakeLists.txt | 8 --- ge/ge_runtime/model_runner.cc | 8 +-- ge/ge_runtime/output.cc | 4 +- ge/ge_runtime/output.h | 4 +- ge/ge_runtime/runtime_model.cc | 14 ++--- ge/ge_runtime/runtime_model.h | 4 +- ge/ge_runtime/task/task.h | 2 +- ge/ge_runtime/task/task_factory.h | 4 +- ge/generator/ge_generator.cc | 10 ++-- ge/generator/generator_api.cc | 6 +- ge/graph/build/graph_builder.cc | 2 +- ge/graph/build/graph_builder.h | 10 ++-- ge/graph/build/label_allocator.cc | 6 +- ge/graph/build/memory/block_mem_assigner.cc | 4 +- ge/graph/build/memory/block_mem_assigner.h | 6 +- ge/graph/build/memory/hybrid_mem_assigner.h | 4 +- ge/graph/build/memory/mem_assigner.h | 4 +- ge/graph/build/memory/memory_assigner.cc | 2 +- ge/graph/build/memory/var_mem_assign_util.cc | 6 +- ge/graph/build/memory/var_mem_assign_util.h | 4 +- ge/graph/build/model_builder.cc | 10 ++-- ge/graph/build/model_builder.h | 8 +-- ge/graph/build/run_context.cc | 2 +- ge/graph/build/run_context.h | 2 +- ge/graph/build/stream_allocator.cc | 2 +- ge/graph/build/stream_graph_optimizer.cc | 4 +- ge/graph/build/stream_graph_optimizer.h | 2 +- ge/graph/build/task_generator.cc | 6 +- ge/graph/build/task_generator.h | 2 +- ge/graph/common/bcast.cc | 2 +- ge/graph/common/bcast.h | 6 +- ge/graph/common/local_context.cc | 6 +- ge/graph/common/local_context.h | 2 +- ge/graph/common/omg_util.h | 4 +- ge/graph/common/transop_util.cc | 2 +- ge/graph/execute/graph_execute.h | 12 ++-- ge/graph/label/case_label_maker.cc | 6 +- ge/graph/label/if_label_maker.cc | 6 +- ge/graph/label/label_maker.cc | 4 +- .../label/partitioned_call_label_maker.cc | 6 +- ge/graph/label/while_label_maker.cc | 6 +- ge/graph/load/graph_loader.cc | 2 +- ge/graph/load/graph_loader.h | 6 +- ge/graph/load/model_manager/aipp_utils.cc | 4 +- ge/graph/load/model_manager/aipp_utils.h | 4 +- .../load/model_manager/cpu_queue_schedule.cc | 4 +- .../load/model_manager/cpu_queue_schedule.h | 2 +- ge/graph/load/model_manager/data_dumper.cc | 2 +- ge/graph/load/model_manager/data_dumper.h | 2 +- ge/graph/load/model_manager/data_inputer.cc | 6 +- ge/graph/load/model_manager/data_inputer.h | 4 +- ge/graph/load/model_manager/davinci_model.cc | 8 +-- ge/graph/load/model_manager/davinci_model.h | 12 ++-- ge/graph/load/model_manager/model_manager.cc | 2 +- ge/graph/load/model_manager/model_manager.h | 12 ++-- ge/graph/load/model_manager/model_utils.cc | 6 +- ge/graph/load/model_manager/model_utils.h | 4 +- .../task_info/kernel_ex_task_info.cc | 2 +- .../task_info/kernel_task_info.cc | 4 +- .../task_info/super_kernel/super_kernel.cc | 2 +- .../super_kernel/super_kernel_factory.cc | 2 +- .../super_kernel/super_kernel_factory.h | 2 +- .../load/model_manager/tbe_handle_store.cc | 4 +- .../load/model_manager/tbe_handle_store.h | 2 +- .../load/model_manager/zero_copy_offset.h | 2 +- ge/graph/load/model_manager/zero_copy_task.cc | 2 +- ge/graph/manager/graph_manager.h | 4 +- ge/graph/manager/graph_manager_utils.cc | 4 +- ge/graph/manager/graph_manager_utils.h | 10 ++-- ge/graph/manager/graph_var_manager.h | 2 +- ge/graph/manager/host_mem_manager.h | 2 +- .../manager/model_manager/event_manager.h | 6 +- ge/graph/manager/trans_var_data_utils.cc | 6 +- ge/graph/manager/trans_var_data_utils.h | 2 +- ge/graph/manager/util/debug.h | 6 +- ge/graph/manager/util/hcom_util.cc | 6 +- ge/graph/manager/util/hcom_util.h | 8 +-- ge/graph/optimize/common/params.h | 2 +- ge/graph/optimize/graph_optimize.h | 6 +- ge/graph/optimize/summary_optimize.cc | 2 +- ge/graph/partition/dynamic_shape_partition.h | 2 +- ge/graph/partition/engine_place.cc | 2 +- ge/graph/partition/engine_place.h | 2 +- ge/graph/partition/graph_partition.cc | 2 +- ge/graph/partition/graph_partition.h | 2 +- ge/graph/partition/stage_partition.cc | 4 +- ge/graph/partition/stage_partition.h | 2 +- ge/graph/passes/addn_pass.h | 4 +- .../passes/aicpu_constant_folding_pass.cc | 4 +- ge/graph/passes/atomic_addr_clean_pass.cc | 2 +- ge/graph/passes/atomic_addr_clean_pass.h | 2 +- ge/graph/passes/attach_stream_label_pass.cc | 2 +- ge/graph/passes/base_pass.cc | 2 +- ge/graph/passes/bitcast_pass.h | 4 +- ge/graph/passes/buffer_pool_memory_pass.h | 2 +- .../common_subexpression_elimination_pass.cc | 2 +- .../common_subexpression_elimination_pass.h | 2 +- ge/graph/passes/compile_nodes_pass.cc | 2 +- ge/graph/passes/cond_pass.cc | 2 +- ge/graph/passes/cond_remove_pass.cc | 2 +- ge/graph/passes/constant_folding_pass.cc | 2 +- ge/graph/passes/constant_fuse_same_pass.h | 2 +- ge/graph/passes/data_pass.h | 2 +- ge/graph/passes/dimension_adjust_pass.h | 6 +- ge/graph/passes/dimension_compute_pass.cc | 2 +- .../passes/end_of_sequence_add_control_pass.h | 2 +- ge/graph/passes/flow_ctrl_pass.h | 2 +- ge/graph/passes/for_pass.cc | 2 +- .../fuse_data_nodes_with_common_input_pass.cc | 2 +- .../fuse_data_nodes_with_common_input_pass.h | 2 +- ge/graph/passes/get_original_format_pass.cc | 6 +- ge/graph/passes/global_step_insert_pass.h | 2 +- ge/graph/passes/guarantee_const_pass.cc | 4 +- .../passes/hccl_continuous_memcpy_pass.cc | 4 +- ge/graph/passes/hccl_continuous_memcpy_pass.h | 2 +- ge/graph/passes/hccl_group_pass.cc | 2 +- ge/graph/passes/hccl_memcpy_pass.cc | 4 +- ge/graph/passes/hccl_memcpy_pass.h | 2 +- .../passes/hccl_tailing_optimization_pass.cc | 2 +- ge/graph/passes/infershape_pass.cc | 4 +- .../input_output_connection_identify_pass.cc | 2 +- .../input_output_connection_identify_pass.h | 2 +- ge/graph/passes/iterator_op_pass.cc | 4 +- ge/graph/passes/iterator_op_pass.h | 2 +- ge/graph/passes/link_gen_mask_nodes_pass.cc | 2 +- ge/graph/passes/link_gen_mask_nodes_pass.h | 2 +- .../mark_force_unknown_for_cond_pass.cc | 2 +- .../passes/mark_graph_unknown_status_pass.h | 2 +- .../passes/mark_node_unknown_shape_pass.h | 2 +- ge/graph/passes/mark_same_addr_pass.h | 2 +- ge/graph/passes/merge_input_memcpy_pass.cc | 2 +- ge/graph/passes/merge_to_stream_merge_pass.cc | 2 +- ge/graph/passes/net_output_pass.h | 2 +- ge/graph/passes/no_use_reshape_remove_pass.cc | 2 +- ge/graph/passes/parallel_group_pass.h | 2 +- ge/graph/passes/pass_manager.cc | 8 +-- ge/graph/passes/pass_utils.cc | 8 +-- ge/graph/passes/pass_utils.h | 2 +- ge/graph/passes/permute_pass.cc | 4 +- ge/graph/passes/print_op_pass.h | 2 +- ge/graph/passes/prune_pass.cc | 4 +- .../passes/ref_identity_delete_op_pass.cc | 2 +- ge/graph/passes/remove_same_const_pass.cc | 2 +- ge/graph/passes/remove_same_const_pass.h | 2 +- ge/graph/passes/replace_transshape_pass.cc | 2 +- .../passes/resource_pair_add_control_pass.cc | 6 +- .../resource_pair_remove_control_pass.cc | 6 +- .../same_transdata_breadth_fusion_pass.cc | 4 +- ge/graph/passes/save_pass.cc | 2 +- ge/graph/passes/save_pass.h | 2 +- .../passes/shape_operate_op_remove_pass.cc | 6 +- ge/graph/passes/stop_gradient_pass.h | 2 +- .../passes/subexpression_migration_pass.cc | 2 +- .../passes/subexpression_migration_pass.h | 2 +- .../passes/subgraph_const_migration_pass.cc | 2 +- .../passes/subgraph_const_migration_pass.h | 2 +- ge/graph/passes/switch_data_edges_bypass.cc | 8 +-- ge/graph/passes/switch_logic_remove_pass.cc | 2 +- .../passes/switch_to_stream_switch_pass.cc | 2 +- .../passes/transop_breadth_fusion_pass.cc | 2 +- ge/graph/passes/transop_depth_fusion_pass.cc | 4 +- .../transop_nearby_allreduce_fusion_pass.cc | 4 +- .../transop_symmetry_elimination_pass.cc | 4 +- .../transop_without_reshape_fusion_pass.cc | 4 +- ge/graph/passes/unused_args_clean_pass.cc | 2 +- ge/graph/passes/unused_args_clean_pass.h | 2 +- ge/graph/passes/variable_op_pass.cc | 2 +- ge/graph/passes/variable_op_pass.h | 2 +- ...ble_ref_useless_control_out_delete_pass.cc | 2 +- ge/graph/preprocess/graph_preprocess.cc | 8 +-- ge/graph/preprocess/graph_preprocess.h | 10 ++-- .../preprocess/insert_op/base_insert_op.h | 4 +- ge/graph/preprocess/insert_op/ge_aipp_op.cc | 4 +- ge/graph/preprocess/insert_op/ge_aipp_op.h | 2 +- .../insert_op/util_insert_aipp_op.cc | 4 +- ge/graph/preprocess/multi_batch_options.cc | 2 +- ge/host_kernels/broadcast_args_kernel.cc | 6 +- .../broadcast_gradient_args_kernel.cc | 6 +- ge/host_kernels/cast_kernel.cc | 8 +-- ge/host_kernels/concat_offset_kernel.cc | 6 +- ge/host_kernels/concat_v2_kernel.cc | 4 +- ge/host_kernels/dynamic_stitch_kernel.cc | 6 +- ge/host_kernels/empty_kernel.cc | 4 +- ge/host_kernels/expanddims_kernel.cc | 6 +- ge/host_kernels/fill_kernel.cc | 4 +- ge/host_kernels/floordiv_kernel.cc | 4 +- ge/host_kernels/floormod_kernel.cc | 4 +- ge/host_kernels/gather_v2_kernel.cc | 8 +-- ge/host_kernels/greater_kernel.cc | 6 +- ge/host_kernels/identity_kernel.cc | 2 +- ge/host_kernels/kernel_utils.cc | 4 +- ge/host_kernels/kernel_utils.h | 4 +- ge/host_kernels/maximum_kernel.cc | 6 +- ge/host_kernels/mul_kernel.cc | 6 +- ge/host_kernels/pack_kernel.cc | 6 +- ge/host_kernels/permute_kernel.cc | 8 +-- ge/host_kernels/range_kernel.cc | 6 +- ge/host_kernels/rank_kernel.cc | 8 +-- ge/host_kernels/reduce_prod_kernel.cc | 4 +- ge/host_kernels/reformat_kernel.cc | 8 +-- ge/host_kernels/reshape_kernel.cc | 6 +- ge/host_kernels/rsqrt_kernel.cc | 8 +-- ge/host_kernels/size_kernel.cc | 6 +- ge/host_kernels/slice_d_kernel.cc | 4 +- ge/host_kernels/slice_kernel.cc | 8 +-- ge/host_kernels/squeeze_kernel.cc | 6 +- ge/host_kernels/ssd_prior_box_kernel.cc | 2 +- ge/host_kernels/sub_kernel.cc | 4 +- ge/host_kernels/transdata_kernel.cc | 8 +-- ge/host_kernels/transpose_kernel.cc | 8 +-- ge/host_kernels/unpack_kernel.cc | 8 +-- ge/host_kernels/unsqueeze_kernel.cc | 6 +- ge/hybrid/common/npu_memory_allocator.cc | 2 +- ge/hybrid/common/npu_memory_allocator.h | 2 +- ge/hybrid/common/tensor_value.h | 2 +- .../executor/hybrid_execution_context.cc | 2 +- .../executor/hybrid_model_async_executor.cc | 2 +- ge/hybrid/executor/hybrid_model_executor.cc | 2 +- .../hybrid_model_pipeline_executor.cc | 18 +++++- .../executor/hybrid_model_pipeline_executor.h | 18 +++++- ge/hybrid/executor/hybrid_profiler.cc | 2 +- ge/hybrid/executor/node_state.h | 2 +- ge/hybrid/executor/rt_callback_manager.h | 2 +- ge/hybrid/executor/subgraph_context.cc | 2 +- ge/hybrid/hybrid_davinci_model.cc | 2 +- ge/hybrid/hybrid_davinci_model_stub.cc | 2 +- ge/hybrid/model/graph_item.cc | 2 +- ge/hybrid/model/hybrid_model.cc | 4 +- ge/hybrid/model/hybrid_model_builder.cc | 2 +- ge/hybrid/model/node_item.cc | 4 +- .../aicore/aicore_node_executor.cc | 2 +- .../node_executor/aicore/aicore_op_task.cc | 2 +- .../node_executor/aicore/aicore_op_task.h | 2 +- .../aicore/aicore_task_builder.cc | 6 +- .../aicore/aicore_task_builder.h | 2 +- .../aicore/aicore_task_compiler.cc | 2 +- .../aicore/aicore_task_compiler.h | 2 +- .../node_executor/aicpu/aicpu_node_executor.h | 2 +- .../compiledsubgraph/known_node_executor.cc | 2 +- .../controlop/control_op_executor.cc | 2 +- .../node_executor/hccl/hccl_node_executor.cc | 4 +- ge/hybrid/node_executor/node_executor.h | 2 +- .../partitioned_call_node_executor.cc | 2 +- .../node_executor/rts/rts_node_executor.cc | 4 +- ge/hybrid/node_executor/rts/rts_node_task.cc | 2 +- ge/hybrid/node_executor/task_context.cc | 4 +- ge/inc/graph_pass.h | 6 +- ge/inc/kernel.h | 4 +- ge/inc/kernel_factory.h | 2 +- ge/inc/pass.h | 2 +- ge/init/gelib.cc | 2 +- ge/init/gelib.h | 4 +- ge/ir_build/attr_options/attr_options.h | 56 +++++++++---------- ge/ir_build/attr_options/keep_dtype_option.cc | 2 +- ge/ir_build/attr_options/utils.cc | 2 +- .../attr_options/weight_compress_option.cc | 2 +- ge/ir_build/ge_ir_build.cc | 4 +- ge/ir_build/option_utils.cc | 2 +- ge/model/ge_model.cc | 2 +- ge/model/ge_model.h | 2 +- ge/model/ge_root_model.cc | 2 +- ge/offline/CMakeLists.txt | 16 ------ ge/offline/main.cc | 18 +++--- ge/offline/single_op_parser.cc | 4 +- ge/offline/single_op_parser.h | 4 +- .../ops_kernel_builder_manager.cc | 2 +- ge/opskernel_manager/ops_kernel_manager.cc | 4 +- ge/opskernel_manager/ops_kernel_manager.h | 6 +- ge/plugin/engine/CMakeLists.txt | 3 +- ge/plugin/engine/dnnengines.h | 2 +- ge/plugin/engine/engine_manage.h | 2 +- ge/session/inner_session.cc | 2 +- ge/session/inner_session.h | 2 +- ge/session/omg.cc | 20 +++---- ge/session/session_manager.h | 4 +- ge/single_op/single_op.cc | 4 +- ge/single_op/single_op.h | 4 +- ge/single_op/single_op_model.cc | 8 +-- ge/single_op/single_op_model.h | 2 +- ge/single_op/stream_resource.h | 2 +- .../task/aicpu_kernel_task_builder.cc | 2 +- ge/single_op/task/op_task.cc | 2 +- ge/single_op/task/op_task.h | 2 +- ge/single_op/task/rts_kernel_task_builder.cc | 2 +- .../common/profiling/ge_runner_profiling.h | 2 +- 327 files changed, 656 insertions(+), 701 deletions(-) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 81e2d539..2b9122da 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -754,22 +754,15 @@ target_compile_options(ge_runner PRIVATE target_include_directories(ge_runner SYSTEM PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/analyzer ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common - ${METADEF_DIR} ${METADEF_DIR}/inc - ${METADEF_DIR}/inc/external/graph ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/external - ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external #### blue zone @@ -835,22 +828,15 @@ target_compile_options(ge_compiler PRIVATE target_include_directories(ge_compiler SYSTEM PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/analyzer ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common - ${METADEF_DIR} ${METADEF_DIR}/inc - ${METADEF_DIR}/inc/external/graph ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/external - ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external #### blue zone #### @@ -1000,18 +986,14 @@ set_target_properties(atc_stub_ge_compiler PROPERTIES ) target_include_directories(atc_stub_ge_compiler PRIVATE - ${GE_CODE_DIR} ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/analyzer ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common ${GE_CODE_DIR}/inc/external ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph + ${METADEF_DIR}/inc #### yellow zone #### - ${GE_CODE_DIR}/../inc/cce + ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external #### blue zone #### @@ -1041,18 +1023,14 @@ set_target_properties(fwk_stub_ge_runner PROPERTIES ) target_include_directories(fwk_stub_ge_runner PRIVATE - ${GE_CODE_DIR} ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/analyzer ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph + ${METADEF_DIR}/inc #### yellow zone #### - ${GE_CODE_DIR}/../inc/cce + ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external #### blue zone #### diff --git a/ge/analyzer/analyzer.cc b/ge/analyzer/analyzer.cc index 95036267..97b59411 100755 --- a/ge/analyzer/analyzer.cc +++ b/ge/analyzer/analyzer.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "analyzer.h" +#include "analyzer/analyzer.h" #include #include diff --git a/ge/client/ge_api.cc b/ge/client/ge_api.cc index 1aa4c41d..aa88cfb4 100644 --- a/ge/client/ge_api.cc +++ b/ge/client/ge_api.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "ge/ge_api.h" +#include "external/ge/ge_api.h" #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" #include "common/ge/datatype_util.h" #include "proto/ge_api.pb.h" diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index f55ff427..313f1ff3 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -72,20 +72,15 @@ target_compile_options(ge_common PRIVATE target_include_directories(ge_common PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/common - ${GE_CODE_DIR}/ge/common/op ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> - $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> @@ -141,20 +136,15 @@ target_compile_options(ge_common_static PRIVATE target_include_directories(ge_common_static PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/common - ${GE_CODE_DIR}/ge/common/op ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> - $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> @@ -200,15 +190,11 @@ target_compile_options(ge_common PRIVATE target_include_directories(ge_common PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/ge/common - ${GE_CODE_DIR}/ge/common/op ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos ${GE_CODE_DIR}/third_party/fwkacllib/inc diff --git a/ge/common/base64.h b/ge/common/base64.h index a537e585..22a78b46 100644 --- a/ge/common/base64.h +++ b/ge/common/base64.h @@ -20,8 +20,8 @@ #include #include -#include "debug/ge_log.h" -#include "ge_error_codes.h" +#include "framework/common/debug/ge_log.h" +#include "external/ge/ge_error_codes.h" namespace ge { namespace { diff --git a/ge/common/dump/dump_manager.h b/ge/common/dump/dump_manager.h index fa96de93..69152bcf 100644 --- a/ge/common/dump/dump_manager.h +++ b/ge/common/dump/dump_manager.h @@ -20,7 +20,7 @@ #include #include "common/dump/dump_properties.h" -#include "common/ge_types.h" +#include "framework/common/ge_types.h" namespace ge { class DumpManager { diff --git a/ge/common/dump/dump_op.h b/ge/common/dump/dump_op.h index b664495a..73922cb3 100755 --- a/ge/common/dump/dump_op.h +++ b/ge/common/dump/dump_op.h @@ -19,7 +19,7 @@ #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/properties_manager.h" #include "proto/op_mapping.pb.h" #include "runtime/stream.h" diff --git a/ge/common/dump/dump_properties.cc b/ge/common/dump/dump_properties.cc index 08bddf43..ef755540 100644 --- a/ge/common/dump/dump_properties.cc +++ b/ge/common/dump/dump_properties.cc @@ -20,7 +20,7 @@ #include #include "common/ge/ge_util.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" #include "framework/common/ge_types.h" diff --git a/ge/common/dump/opdebug_register.cc b/ge/common/dump/opdebug_register.cc index 816455a0..41c85ff6 100644 --- a/ge/common/dump/opdebug_register.cc +++ b/ge/common/dump/opdebug_register.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "opdebug_register.h" +#include "common/dump/opdebug_register.h" namespace { const size_t kOpDebugMemorySize = 2048UL; diff --git a/ge/common/dump/opdebug_register.h b/ge/common/dump/opdebug_register.h index 1826287d..5b927b67 100644 --- a/ge/common/dump/opdebug_register.h +++ b/ge/common/dump/opdebug_register.h @@ -18,8 +18,8 @@ #define GE_COMMON_DUMP_OPDEBUG_REGISTER_H_ #include -#include "common/debug/ge_log.h" -#include "common/debug/log.h" +#include "framework/common/debug/ge_log.h" +#include "framework/common/debug/log.h" #include "graph/load/model_manager/data_dumper.h" namespace ge { diff --git a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc index ddce348b..38125979 100644 --- a/ge/common/formats/format_transfers/format_transfer_fractal_z.cc +++ b/ge/common/formats/format_transfers/format_transfer_fractal_z.cc @@ -19,7 +19,7 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/utils/formats_definitions.h" #include "common/formats/utils/formats_trans_utils.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/common/formats/format_transfers/format_transfer_nchw_fz_c04.cc b/ge/common/formats/format_transfers/format_transfer_nchw_fz_c04.cc index 5efe486c..88de4d14 100644 --- a/ge/common/formats/format_transfers/format_transfer_nchw_fz_c04.cc +++ b/ge/common/formats/format_transfers/format_transfer_nchw_fz_c04.cc @@ -23,7 +23,7 @@ #include "common/formats/utils/formats_definitions.h" #include "common/formats/utils/formats_trans_utils.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" diff --git a/ge/common/ge/datatype_util.h b/ge/common/ge/datatype_util.h index e42b25a7..c3b41b81 100644 --- a/ge/common/ge/datatype_util.h +++ b/ge/common/ge/datatype_util.h @@ -20,7 +20,7 @@ #include #include -#include "graph/types.h" +#include "external/graph/types.h" namespace ge { static const int32_t kGeSizeFloat = sizeof(float); diff --git a/ge/common/ge/plugin_manager.h b/ge/common/ge/plugin_manager.h index 8c351e62..0869704f 100755 --- a/ge/common/ge/plugin_manager.h +++ b/ge/common/ge/plugin_manager.h @@ -26,8 +26,8 @@ #include #include -#include "common/ge_inner_error_codes.h" -#include "engine/dnnengine.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/engine/dnnengine.h" #include "framework/common/debug/ge_log.h" #include "mmpa/mmpa_api.h" diff --git a/ge/common/ge_format_util.cc b/ge/common/ge_format_util.cc index d0240224..f3dee571 100755 --- a/ge/common/ge_format_util.cc +++ b/ge/common/ge_format_util.cc @@ -15,7 +15,7 @@ */ #include "framework/common/ge_format_util.h" -#include "formats/formats.h" +#include "common/formats/formats.h" namespace ge { GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status GeFormatUtil::TransShape(const TensorDesc &src_desc, diff --git a/ge/common/helper/model_cache_helper.h b/ge/common/helper/model_cache_helper.h index 398d6c03..13253cbe 100755 --- a/ge/common/helper/model_cache_helper.h +++ b/ge/common/helper/model_cache_helper.h @@ -21,7 +21,7 @@ #include #include -#include "ge/ge_api_error_codes.h" +#include "external/ge/ge_api_error_codes.h" #include "graph/compute_graph.h" #include "graph/manager/graph_var_manager.h" #include "model/ge_model.h" diff --git a/ge/common/math/fp16_math.cc b/ge/common/math/fp16_math.cc index e465c953..6a9c2fb3 100755 --- a/ge/common/math/fp16_math.cc +++ b/ge/common/math/fp16_math.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "fp16_math.h" +#include "common/math/fp16_math.h" #include "external/register/register_types.h" namespace ge { diff --git a/ge/common/model_parser/model_parser.cc b/ge/common/model_parser/model_parser.cc index ef9ab9e6..7447cdf8 100644 --- a/ge/common/model_parser/model_parser.cc +++ b/ge/common/model_parser/model_parser.cc @@ -20,7 +20,7 @@ #include #include "securec.h" -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" namespace ge { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelParserBase::ModelParserBase() {} diff --git a/ge/common/op/attr_value_util.cc b/ge/common/op/attr_value_util.cc index 4315a25d..8be0ecd1 100644 --- a/ge/common/op/attr_value_util.cc +++ b/ge/common/op/attr_value_util.cc @@ -17,7 +17,7 @@ #include "framework/common/op/attr_value_util.h" #include "framework/common/debug/log.h" #include "framework/common/util.h" -#include "register/register_types.h" +#include "external/register/register_types.h" namespace ge { #define DEFINE_SET_ATTR_VALUE_ONE(ARG_TYPE, FIELD) \ diff --git a/ge/common/profiling/ge_profiling.cc b/ge/common/profiling/ge_profiling.cc index d0343326..6ec1143c 100644 --- a/ge/common/profiling/ge_profiling.cc +++ b/ge/common/profiling/ge_profiling.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/profiling/ge_profiling.h" +#include "framework/common/profiling/ge_profiling.h" #include "runtime/base.h" #include "common/profiling/profiling_manager.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/common/profiling/ge_runner_profiling.cc b/ge/common/profiling/ge_runner_profiling.cc index 067aafe3..f74ce384 100644 --- a/ge/common/profiling/ge_runner_profiling.cc +++ b/ge/common/profiling/ge_runner_profiling.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/profiling/ge_runner_profiling.h" +#include "framework/common/profiling/ge_runner_profiling.h" #include "init/gelib.h" bool IsInitialize() { diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index 61210de6..6707d78e 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -21,7 +21,7 @@ #include "framework/common/string_util.h" #include "graph/ge_context.h" #include "graph/utils/type_utils.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "runtime/base.h" #include "graph/load/model_manager/davinci_model.h" #include "mmpa/mmpa_api.h" diff --git a/ge/common/properties_manager.cc b/ge/common/properties_manager.cc index e1f4c66e..0c5ef1fe 100644 --- a/ge/common/properties_manager.cc +++ b/ge/common/properties_manager.cc @@ -21,7 +21,7 @@ #include #include "common/ge/ge_util.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" #include "framework/common/ge_types.h" diff --git a/ge/common/properties_manager.h b/ge/common/properties_manager.h index 7079eecb..f3f9d7c9 100644 --- a/ge/common/properties_manager.h +++ b/ge/common/properties_manager.h @@ -25,7 +25,7 @@ #include "common/dump/dump_properties.h" #include "graph/op_desc.h" -#include "common/ge_compiler_options.h" +#include "framework/common/ge_compiler_options.h" namespace ge { // Configuration property management diff --git a/ge/common/thread_pool.cc b/ge/common/thread_pool.cc index dead0127..f9b7bb99 100644 --- a/ge/common/thread_pool.cc +++ b/ge/common/thread_pool.cc @@ -23,7 +23,7 @@ #include #include -#include "register/register_types.h" +#include "external/register/register_types.h" namespace ge { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ThreadPool::ThreadPool(uint32_t size) : is_stoped_(false) { diff --git a/ge/common/thread_pool.h b/ge/common/thread_pool.h index e173618f..7e52edcc 100755 --- a/ge/common/thread_pool.h +++ b/ge/common/thread_pool.h @@ -31,7 +31,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "external/ge/ge_api_error_codes.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "common/ge/ge_util.h" namespace ge { diff --git a/ge/common/types.cc b/ge/common/types.cc index 98ae7737..b1127483 100644 --- a/ge/common/types.cc +++ b/ge/common/types.cc @@ -15,7 +15,7 @@ */ #include "framework/common/types.h" -#include "graph/types.h" +#include "external/graph/types.h" namespace ge { // dump diff --git a/ge/engine_manager/dnnengine_manager.cc b/ge/engine_manager/dnnengine_manager.cc index e89fc847..9e338295 100644 --- a/ge/engine_manager/dnnengine_manager.cc +++ b/ge/engine_manager/dnnengine_manager.cc @@ -22,7 +22,7 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/engine_manager/dnnengine_manager.h b/ge/engine_manager/dnnengine_manager.h index c3ae5b95..42da3596 100755 --- a/ge/engine_manager/dnnengine_manager.h +++ b/ge/engine_manager/dnnengine_manager.h @@ -26,9 +26,9 @@ #include "nlohmann/json.hpp" #include "common/ge/plugin_manager.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/opskernel/ops_kernel_info_types.h" -#include "engine/dnnengine.h" +#include "framework/engine/dnnengine.h" #include "graph/op_desc.h" #include "graph/node.h" diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index b6342973..f258dffe 100755 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -182,13 +182,10 @@ target_include_directories(ge_executor SYSTEM PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> - $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain> @@ -236,13 +233,10 @@ target_include_directories(ge_executor_shared PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### $<$>:${GE_DEPEND_DIR}/inc> - $<$>:${GE_DEPEND_DIR}/inc/cce> #### blue zone #### $<$:${GE_CODE_DIR}/third_party/fwkacllib/inc> ) diff --git a/ge/executor/ge_executor.cc b/ge/executor/ge_executor.cc index 049d012f..486764bd 100755 --- a/ge/executor/ge_executor.cc +++ b/ge/executor/ge_executor.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "executor/ge_executor.h" +#include "framework/executor/ge_executor.h" #include #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "common/profiling/profiling_manager.h" #include "common/dump/dump_manager.h" #include "graph/execute/graph_execute.h" diff --git a/ge/ge_local_engine/CMakeLists.txt b/ge/ge_local_engine/CMakeLists.txt index 3675d333..01a10eaa 100755 --- a/ge/ge_local_engine/CMakeLists.txt +++ b/ge/ge_local_engine/CMakeLists.txt @@ -41,8 +41,6 @@ target_include_directories(ge_local_engine PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### @@ -91,8 +89,6 @@ target_include_directories(atc_ge_local_engine PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### @@ -146,8 +142,6 @@ target_include_directories(ge_local_opskernel_builder PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### @@ -197,8 +191,6 @@ target_include_directories(atc_ge_local_opskernel_builder PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### @@ -254,8 +246,6 @@ target_include_directories(ge_local_opskernel_builder_static PRIVATE ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### diff --git a/ge/ge_local_engine/engine/ge_local_engine.cc b/ge/ge_local_engine/engine/ge_local_engine.cc index ac3e5473..910bb924 100755 --- a/ge/ge_local_engine/engine/ge_local_engine.cc +++ b/ge/ge_local_engine/engine/ge_local_engine.cc @@ -19,10 +19,10 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" -#include "common/constant/constant.h" +#include "framework/common/ge_inner_error_codes.h" +#include "ge_local_engine/common/constant/constant.h" #include "common/ge/ge_util.h" -#include "ops_kernel_store/ge_local_ops_kernel_info.h" +#include "ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.h" namespace ge { namespace ge_local { diff --git a/ge/ge_local_engine/engine/host_cpu_engine.cc b/ge/ge_local_engine/engine/host_cpu_engine.cc index cd68ae15..488a5ee8 100755 --- a/ge/ge_local_engine/engine/host_cpu_engine.cc +++ b/ge/ge_local_engine/engine/host_cpu_engine.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "host_cpu_engine.h" +#include "ge_local_engine/engine/host_cpu_engine.h" #include "graph/common/omg_util.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/ge_local_engine/engine/host_cpu_engine.h b/ge/ge_local_engine/engine/host_cpu_engine.h index d13fcae1..5d6fa664 100644 --- a/ge/ge_local_engine/engine/host_cpu_engine.h +++ b/ge/ge_local_engine/engine/host_cpu_engine.h @@ -33,7 +33,7 @@ #include #include "framework/common/ge_inner_error_codes.h" #include "graph/node.h" -#include "graph/operator.h" +#include "external/graph/operator.h" #include "external/../register/register.h" namespace ge { diff --git a/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_builder.cc b/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_builder.cc index 5842fe29..33aa407d 100644 --- a/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_builder.cc +++ b/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_builder.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "ge_local_ops_kernel_builder.h" +#include "ge_local_engine/ops_kernel_store/ge_local_ops_kernel_builder.h" #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/node_utils.h" diff --git a/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.cc b/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.cc index 504c3f2f..d775309d 100755 --- a/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.cc +++ b/ge/ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.cc @@ -16,14 +16,14 @@ #include "ge_local_engine/ops_kernel_store/ge_local_ops_kernel_info.h" #include -#include "common/constant/constant.h" +#include "ge_local_engine/common/constant/constant.h" #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/node_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" -#include "op/op_factory.h" +#include "ge_local_engine/ops_kernel_store/op/op_factory.h" #include "proto/task.pb.h" namespace ge { diff --git a/ge/ge_local_engine/ops_kernel_store/op/ge_deleted_op.cc b/ge/ge_local_engine/ops_kernel_store/op/ge_deleted_op.cc index ee601a99..dc4abfb8 100755 --- a/ge/ge_local_engine/ops_kernel_store/op/ge_deleted_op.cc +++ b/ge/ge_local_engine/ops_kernel_store/op/ge_deleted_op.cc @@ -16,7 +16,7 @@ #include "ge_local_engine/ops_kernel_store/op/ge_deleted_op.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "ge_local_engine/ops_kernel_store/op/op_factory.h" namespace ge { diff --git a/ge/ge_local_engine/ops_kernel_store/op/no_op.cc b/ge/ge_local_engine/ops_kernel_store/op/no_op.cc index c2104693..45d9da47 100755 --- a/ge/ge_local_engine/ops_kernel_store/op/no_op.cc +++ b/ge/ge_local_engine/ops_kernel_store/op/no_op.cc @@ -16,7 +16,7 @@ #include "ge_local_engine/ops_kernel_store/op/no_op.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "ge_local_engine/ops_kernel_store/op/op_factory.h" namespace ge { diff --git a/ge/ge_local_engine/ops_kernel_store/op/op.cc b/ge/ge_local_engine/ops_kernel_store/op/op.cc index 11229b2c..c2ef0091 100644 --- a/ge/ge_local_engine/ops_kernel_store/op/op.cc +++ b/ge/ge_local_engine/ops_kernel_store/op/op.cc @@ -16,7 +16,7 @@ #include "ge_local_engine/ops_kernel_store/op/op.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/op_desc.h" #include "graph/utils/anchor_utils.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/ge_local_engine/ops_kernel_store/op/op.h b/ge/ge_local_engine/ops_kernel_store/op/op.h index b75a8bed..004723e1 100644 --- a/ge/ge_local_engine/ops_kernel_store/op/op.h +++ b/ge/ge_local_engine/ops_kernel_store/op/op.h @@ -20,7 +20,7 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/node.h" namespace ge { diff --git a/ge/ge_local_engine/ops_kernel_store/op/op_factory.cc b/ge/ge_local_engine/ops_kernel_store/op/op_factory.cc index 2e56b7bb..18f3b7b9 100644 --- a/ge/ge_local_engine/ops_kernel_store/op/op_factory.cc +++ b/ge/ge_local_engine/ops_kernel_store/op/op_factory.cc @@ -16,7 +16,7 @@ #include "ge_local_engine/ops_kernel_store/op/op_factory.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/op_desc.h" namespace ge { diff --git a/ge/ge_runtime/CMakeLists.txt b/ge/ge_runtime/CMakeLists.txt index b00dd5b3..3243766f 100644 --- a/ge/ge_runtime/CMakeLists.txt +++ b/ge/ge_runtime/CMakeLists.txt @@ -34,21 +34,13 @@ target_compile_definitions(ge_runtime PRIVATE target_include_directories(ge_runtime PRIVATE ${CMAKE_CURRENT_LIST_DIR} - ${GE_CODE_DIR} ${GE_CODE_DIR}/ge ${GE_CODE_DIR}/inc - ${GE_CODE_DIR}/inc/graph ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common - ${GE_CODE_DIR}/inc/framework/ge_runtime - ${GE_CODE_DIR}/inc/cce ${GE_CODE_DIR}/third_party/fwkacllib/inc - ${METADEF_DIR} ${METADEF_DIR}/inc - ${METADEF_DIR}/inc/external/graph ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/graph ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/ge ) diff --git a/ge/ge_runtime/model_runner.cc b/ge/ge_runtime/model_runner.cc index 9961ab4e..9338aae2 100644 --- a/ge/ge_runtime/model_runner.cc +++ b/ge/ge_runtime/model_runner.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "ge_runtime/model_runner.h" -#include "./runtime_model.h" +#include "framework/ge_runtime/model_runner.h" +#include "ge_runtime/runtime_model.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" -#include "ge_runtime/davinci_model.h" +#include "framework/ge_runtime/davinci_model.h" #include "graph/op_desc.h" namespace ge { diff --git a/ge/ge_runtime/output.cc b/ge/ge_runtime/output.cc index 90c33bb4..0be053d5 100644 --- a/ge/ge_runtime/output.cc +++ b/ge/ge_runtime/output.cc @@ -15,8 +15,8 @@ */ #include "ge_runtime/output.h" -#include "common/ge_inner_error_codes.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" namespace ge { diff --git a/ge/ge_runtime/output.h b/ge/ge_runtime/output.h index 1f7f91ee..61fcf94e 100644 --- a/ge/ge_runtime/output.h +++ b/ge/ge_runtime/output.h @@ -19,8 +19,8 @@ #include #include -#include "ge_runtime/davinci_model.h" -#include "common/ge_types.h" +#include "framework/ge_runtime/davinci_model.h" +#include "framework/common/ge_types.h" namespace ge { namespace model_runner { diff --git a/ge/ge_runtime/runtime_model.cc b/ge/ge_runtime/runtime_model.cc index efaad251..490ac25b 100644 --- a/ge/ge_runtime/runtime_model.cc +++ b/ge/ge_runtime/runtime_model.cc @@ -16,15 +16,15 @@ #include "ge_runtime/runtime_model.h" #include -#include "./model_context.h" -#include "./task/task.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" -#include "common/util.h" +#include "ge_runtime/model_context.h" +#include "ge_runtime/task/task.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/op/op_parser_util.h" -#include "graph/types.h" -#include "task/task_factory.h" +#include "external/graph/types.h" +#include "ge_runtime/task/task_factory.h" #include "ge/common/math/math_util.h" namespace ge { diff --git a/ge/ge_runtime/runtime_model.h b/ge/ge_runtime/runtime_model.h index d0c466d4..429a143f 100644 --- a/ge/ge_runtime/runtime_model.h +++ b/ge/ge_runtime/runtime_model.h @@ -20,8 +20,8 @@ #include #include #include -#include "ge_runtime/davinci_model.h" -#include "common/ge_types.h" +#include "framework/ge_runtime/davinci_model.h" +#include "framework/common/ge_types.h" #include "runtime/base.h" #include "runtime/rt_model.h" diff --git a/ge/ge_runtime/task/task.h b/ge/ge_runtime/task/task.h index c255fd22..8170f3ca 100644 --- a/ge/ge_runtime/task/task.h +++ b/ge/ge_runtime/task/task.h @@ -23,7 +23,7 @@ #include #include "runtime/rt_model.h" #include "ge_runtime/model_context.h" -#include "ge_runtime/task_info.h" +#include "framework/ge_runtime/task_info.h" #include "external/runtime/rt_error_codes.h" namespace ge { diff --git a/ge/ge_runtime/task/task_factory.h b/ge/ge_runtime/task/task_factory.h index 670d1fef..f19b7419 100644 --- a/ge/ge_runtime/task/task_factory.h +++ b/ge/ge_runtime/task/task_factory.h @@ -21,9 +21,9 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" -#include "ge_runtime/task_info.h" +#include "framework/ge_runtime/task_info.h" namespace ge { namespace model_runner { diff --git a/ge/generator/ge_generator.cc b/ge/generator/ge_generator.cc index 58047c89..24b35bca 100644 --- a/ge/generator/ge_generator.cc +++ b/ge/generator/ge_generator.cc @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "generator/ge_generator.h" +#include "framework/generator/ge_generator.h" #include #include "common/ge/ge_util.h" #include "common/ge/plugin_manager.h" -#include "common/helper/model_helper.h" -#include "common/helper/om_file_helper.h" -#include "common/util.h" +#include "framework/common/helper/model_helper.h" +#include "framework/common/helper/om_file_helper.h" +#include "framework/common/util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" -#include "ge/ge_api.h" +#include "external/ge/ge_api.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_context.h" #include "graph/manager/graph_manager.h" diff --git a/ge/generator/generator_api.cc b/ge/generator/generator_api.cc index b64a9eb3..56a35130 100644 --- a/ge/generator/generator_api.cc +++ b/ge/generator/generator_api.cc @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "generator/generator_api.h" +#include "framework/generator/generator_api.h" #include "common/ge/ge_util.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" -#include "generator/ge_generator.h" +#include "framework/generator/ge_generator.h" #include "graph/ge_attr_value.h" #include "graph/ge_tensor.h" #include "graph/op_desc.h" diff --git a/ge/graph/build/graph_builder.cc b/ge/graph/build/graph_builder.cc index 8b172e63..96dea02e 100644 --- a/ge/graph/build/graph_builder.cc +++ b/ge/graph/build/graph_builder.cc @@ -17,7 +17,7 @@ #include "graph/build/graph_builder.h" #include "graph/build/memory/graph_mem_assigner.h" #include "common/ge/ge_util.h" -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "graph/build/logical_stream_allocator.h" #include "graph/build/run_context.h" #include "graph/build/stream_graph_optimizer.h" diff --git a/ge/graph/build/graph_builder.h b/ge/graph/build/graph_builder.h index fb9ab6bd..c4b16814 100644 --- a/ge/graph/build/graph_builder.h +++ b/ge/graph/build/graph_builder.h @@ -22,16 +22,16 @@ #include #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" #include "common/properties_manager.h" -#include "common/string_util.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/string_util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/build/model_builder.h" #include "graph/build/task_generator.h" #include "graph/compute_graph.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/manager/graph_manager_utils.h" #include "graph/model.h" #include "graph/node.h" diff --git a/ge/graph/build/label_allocator.cc b/ge/graph/build/label_allocator.cc index dd7ee828..6d81c17d 100644 --- a/ge/graph/build/label_allocator.cc +++ b/ge/graph/build/label_allocator.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "label_allocator.h" +#include "graph/build/label_allocator.h" #include "framework/common/types.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/label/label_maker.h" diff --git a/ge/graph/build/memory/block_mem_assigner.cc b/ge/graph/build/memory/block_mem_assigner.cc index 9b81eae3..159e68a7 100755 --- a/ge/graph/build/memory/block_mem_assigner.cc +++ b/ge/graph/build/memory/block_mem_assigner.cc @@ -24,7 +24,7 @@ #include "graph/buffer.h" #include "graph/ge_attr_value.h" #include "graph/ge_context.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/node.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" @@ -36,7 +36,7 @@ #include "graph/common/local_context.h" #include "graph/optimize/common/params.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" #include "runtime/mem.h" using std::map; diff --git a/ge/graph/build/memory/block_mem_assigner.h b/ge/graph/build/memory/block_mem_assigner.h index 231cce09..651daed5 100755 --- a/ge/graph/build/memory/block_mem_assigner.h +++ b/ge/graph/build/memory/block_mem_assigner.h @@ -24,9 +24,9 @@ #include #include #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/build/memory/mem_assigner.h" #include "graph/compute_graph.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/build/memory/hybrid_mem_assigner.h b/ge/graph/build/memory/hybrid_mem_assigner.h index 2bdfd5c5..33bb152b 100755 --- a/ge/graph/build/memory/hybrid_mem_assigner.h +++ b/ge/graph/build/memory/hybrid_mem_assigner.h @@ -22,8 +22,8 @@ #include "graph/build/memory/block_mem_assigner.h" #include "graph/compute_graph.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" namespace ge { using BlockMemAssignerPtr = std::shared_ptr; diff --git a/ge/graph/build/memory/mem_assigner.h b/ge/graph/build/memory/mem_assigner.h index 7d0252d9..d607b989 100755 --- a/ge/graph/build/memory/mem_assigner.h +++ b/ge/graph/build/memory/mem_assigner.h @@ -17,8 +17,8 @@ #ifndef GE_GRAPH_BUILD_MEMORY_MEM_ASSIGNER_H_ #define GE_GRAPH_BUILD_MEMORY_MEM_ASSIGNER_H_ -#include "common/ge_inner_error_codes.h" -#include "memory/memory_assigner.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/memory/memory_assigner.h" namespace ge { static const int64_t kInvalidOffset = -1; diff --git a/ge/graph/build/memory/memory_assigner.cc b/ge/graph/build/memory/memory_assigner.cc index 570aae07..6e49827f 100755 --- a/ge/graph/build/memory/memory_assigner.cc +++ b/ge/graph/build/memory/memory_assigner.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "memory/memory_assigner.h" +#include "framework/memory/memory_assigner.h" #include #include "framework/common/debug/ge_log.h" #include "graph/build/memory/graph_mem_assigner.h" diff --git a/ge/graph/build/memory/var_mem_assign_util.cc b/ge/graph/build/memory/var_mem_assign_util.cc index b8138a30..adddf6bd 100755 --- a/ge/graph/build/memory/var_mem_assign_util.cc +++ b/ge/graph/build/memory/var_mem_assign_util.cc @@ -16,14 +16,14 @@ #include "graph/build/memory/var_mem_assign_util.h" #include -#include "common/types.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/common/transop_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/graph_mem_allocator.h" #include "graph/manager/graph_var_manager.h" -#include "graph/tensor.h" -#include "graph/types.h" +#include "external/graph/tensor.h" +#include "external/graph/types.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/graph/build/memory/var_mem_assign_util.h b/ge/graph/build/memory/var_mem_assign_util.h index 9528dbdb..26da9111 100644 --- a/ge/graph/build/memory/var_mem_assign_util.h +++ b/ge/graph/build/memory/var_mem_assign_util.h @@ -17,8 +17,8 @@ #ifndef GE_GRAPH_BUILD_MEMORY_VAR_MEM_ASSIGN_UTIL_H_ #define GE_GRAPH_BUILD_MEMORY_VAR_MEM_ASSIGN_UTIL_H_ #include -#include "common/debug/log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/debug/log.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/utils/node_utils.h" namespace ge { diff --git a/ge/graph/build/model_builder.cc b/ge/graph/build/model_builder.cc index 431e4882..d38e89fe 100755 --- a/ge/graph/build/model_builder.cc +++ b/ge/graph/build/model_builder.cc @@ -22,7 +22,7 @@ #include "common/dump/dump_manager.h" #include "framework/common/debug/ge_log.h" #include "graph/anchor.h" -#include "graph/attr_value.h" +#include "external/graph/attr_value.h" #include "graph/buffer.h" #include "graph/build/stream_allocator.h" #include "graph/common/omg_util.h" @@ -31,11 +31,11 @@ #include "graph/debug/ge_attr_define.h" #include "graph/ge_attr_value.h" #include "graph/ge_context.h" -#include "graph/ge_error_codes.h" +#include "external/graph/ge_error_codes.h" #include "graph/manager/graph_mem_allocator.h" #include "graph/manager/graph_var_manager.h" #include "graph/optimize/common/params.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" @@ -43,8 +43,8 @@ #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "init/gelib.h" -#include "memory/memory_assigner.h" -#include "omg/version.h" +#include "framework/memory/memory_assigner.h" +#include "framework/omg/version.h" #include "register/op_registry.h" #include "graph/passes/set_input_output_offset_pass.h" #include "graph/build/memory/block_mem_assigner.h" diff --git a/ge/graph/build/model_builder.h b/ge/graph/build/model_builder.h index 6f097329..151e6006 100644 --- a/ge/graph/build/model_builder.h +++ b/ge/graph/build/model_builder.h @@ -23,17 +23,17 @@ #include #include #include -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "common/tbe_kernel_store.h" #include "common/cust_aicpu_kernel_store.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/compute_graph.h" #include "graph/manager/graph_manager_utils.h" #include "graph/model.h" #include "graph/node.h" #include "model/ge_model.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace ge { class ModelBuilder { diff --git a/ge/graph/build/run_context.cc b/ge/graph/build/run_context.cc index 05e40b63..e7f07c0a 100644 --- a/ge/graph/build/run_context.cc +++ b/ge/graph/build/run_context.cc @@ -15,7 +15,7 @@ */ #include "graph/build/run_context.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" #include "graph/common/omg_util.h" diff --git a/ge/graph/build/run_context.h b/ge/graph/build/run_context.h index 82f799aa..20ba76d4 100755 --- a/ge/graph/build/run_context.h +++ b/ge/graph/build/run_context.h @@ -18,7 +18,7 @@ #define GE_GRAPH_BUILD_RUN_CONTEXT_H_ #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/opskernel/ops_kernel_info_types.h" #include "framework/common/types.h" #include "graph/compute_graph.h" diff --git a/ge/graph/build/stream_allocator.cc b/ge/graph/build/stream_allocator.cc index d896925c..bc34a228 100644 --- a/ge/graph/build/stream_allocator.cc +++ b/ge/graph/build/stream_allocator.cc @@ -27,7 +27,7 @@ #include "graph/ge_context.h" #include "graph/utils/graph_utils.h" #include "init/gelib.h" -#include "common/string_util.h" +#include "framework/common/string_util.h" #include "common/util/error_manager/error_manager.h" using std::map; diff --git a/ge/graph/build/stream_graph_optimizer.cc b/ge/graph/build/stream_graph_optimizer.cc index 30142c2b..acf91ad5 100644 --- a/ge/graph/build/stream_graph_optimizer.cc +++ b/ge/graph/build/stream_graph_optimizer.cc @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "stream_graph_optimizer.h" +#include "graph/build/stream_graph_optimizer.h" #include -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/node_utils.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/graph/build/stream_graph_optimizer.h b/ge/graph/build/stream_graph_optimizer.h index d69fa7ba..ec32f7fb 100644 --- a/ge/graph/build/stream_graph_optimizer.h +++ b/ge/graph/build/stream_graph_optimizer.h @@ -18,7 +18,7 @@ #define GE_GRAPH_BUILD_OPTIMIZE_STREAM_GRAPH_H_ #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/opskernel/ops_kernel_info_types.h" #include "framework/common/types.h" #include "graph/compute_graph.h" diff --git a/ge/graph/build/task_generator.cc b/ge/graph/build/task_generator.cc index f9456aab..5dee37d6 100755 --- a/ge/graph/build/task_generator.cc +++ b/ge/graph/build/task_generator.cc @@ -18,8 +18,8 @@ #include #include #include "common/profiling/profiling_manager.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" @@ -32,7 +32,7 @@ #include "graph/common/ge_call_wrapper.h" #include "init/gelib.h" #include "graph/ge_local_context.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "opskernel_manager/ops_kernel_builder_manager.h" using domi::LogTimeStampDef; diff --git a/ge/graph/build/task_generator.h b/ge/graph/build/task_generator.h index 40cef3ba..6f460906 100755 --- a/ge/graph/build/task_generator.h +++ b/ge/graph/build/task_generator.h @@ -21,7 +21,7 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/opskernel/ops_kernel_info_types.h" #include "framework/common/types.h" #include "graph/compute_graph.h" diff --git a/ge/graph/common/bcast.cc b/ge/graph/common/bcast.cc index b36b50b2..fcc8f9a1 100644 --- a/ge/graph/common/bcast.cc +++ b/ge/graph/common/bcast.cc @@ -19,7 +19,7 @@ #include #include "common/math_util.h" -#include "common/util.h" +#include "framework/common/util.h" using domi::Status; diff --git a/ge/graph/common/bcast.h b/ge/graph/common/bcast.h index a8399896..184751fe 100644 --- a/ge/graph/common/bcast.h +++ b/ge/graph/common/bcast.h @@ -21,11 +21,11 @@ #include #include -#include "common/debug/log.h" -#include "common/types.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/attr_value.h" +#include "external/graph/attr_value.h" #include "graph/ge_tensor.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/graph/common/local_context.cc b/ge/graph/common/local_context.cc index d3e66861..fa2f78e0 100644 --- a/ge/graph/common/local_context.cc +++ b/ge/graph/common/local_context.cc @@ -16,9 +16,9 @@ #include "graph/common/local_context.h" -#include "common/ge_inner_error_codes.h" -#include "common/debug/ge_log.h" -#include "omg/omg_inner_types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/debug/ge_log.h" +#include "framework/omg/omg_inner_types.h" namespace ge { namespace { diff --git a/ge/graph/common/local_context.h b/ge/graph/common/local_context.h index 83367766..4aa95855 100644 --- a/ge/graph/common/local_context.h +++ b/ge/graph/common/local_context.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_COMMON_LOCAL_CONTEXT_H_ #define GE_GRAPH_COMMON_LOCAL_CONTEXT_H_ -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace ge { void SetLocalOmgContext(OmgContext &context); diff --git a/ge/graph/common/omg_util.h b/ge/graph/common/omg_util.h index edaafa45..d55cc7c8 100644 --- a/ge/graph/common/omg_util.h +++ b/ge/graph/common/omg_util.h @@ -22,8 +22,8 @@ #include #include -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/node.h" namespace ge { diff --git a/ge/graph/common/transop_util.cc b/ge/graph/common/transop_util.cc index 62b4c4e4..871ecdb1 100755 --- a/ge/graph/common/transop_util.cc +++ b/ge/graph/common/transop_util.cc @@ -16,7 +16,7 @@ #include "graph/common/transop_util.h" -#include "common/types.h" +#include "framework/common/types.h" #include "graph/utils/type_utils.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/graph/execute/graph_execute.h b/ge/graph/execute/graph_execute.h index aa791c9b..879a124c 100755 --- a/ge/graph/execute/graph_execute.h +++ b/ge/graph/execute/graph_execute.h @@ -24,14 +24,14 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" -#include "common/ge_types.h" +#include "framework/common/ge_types.h" #include "common/properties_manager.h" -#include "common/string_util.h" -#include "common/types.h" -#include "common/util.h" -#include "ge/ge_api_types.h" +#include "framework/common/string_util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" +#include "external/ge/ge_api_types.h" #include "graph/compute_graph.h" #include "graph/manager/graph_context.h" #include "graph/manager/graph_manager_utils.h" diff --git a/ge/graph/label/case_label_maker.cc b/ge/graph/label/case_label_maker.cc index 3fdb1783..88d698d1 100644 --- a/ge/graph/label/case_label_maker.cc +++ b/ge/graph/label/case_label_maker.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "case_label_maker.h" +#include "graph/label/case_label_maker.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" #include "framework/common/op/ge_op_utils.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/label/if_label_maker.cc b/ge/graph/label/if_label_maker.cc index 72b33015..df911e70 100644 --- a/ge/graph/label/if_label_maker.cc +++ b/ge/graph/label/if_label_maker.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "if_label_maker.h" +#include "graph/label/if_label_maker.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" #include "framework/common/op/ge_op_utils.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/label/label_maker.cc b/ge/graph/label/label_maker.cc index 638cbbae..47eeda86 100644 --- a/ge/graph/label/label_maker.cc +++ b/ge/graph/label/label_maker.cc @@ -16,8 +16,8 @@ #include "graph/label/label_maker.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" #include "framework/common/op/ge_op_utils.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/label/partitioned_call_label_maker.cc b/ge/graph/label/partitioned_call_label_maker.cc index 7b4bcbd8..ec8b8c89 100644 --- a/ge/graph/label/partitioned_call_label_maker.cc +++ b/ge/graph/label/partitioned_call_label_maker.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "partitioned_call_label_maker.h" +#include "graph/label/partitioned_call_label_maker.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/label/while_label_maker.cc b/ge/graph/label/while_label_maker.cc index cd6b3743..7e6b8a98 100644 --- a/ge/graph/label/while_label_maker.cc +++ b/ge/graph/label/while_label_maker.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "while_label_maker.h" +#include "graph/label/while_label_maker.h" -#include "common/util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/util.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" #include "framework/common/op/ge_op_utils.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/load/graph_loader.cc b/ge/graph/load/graph_loader.cc index 94b90d69..b2a61106 100755 --- a/ge/graph/load/graph_loader.cc +++ b/ge/graph/load/graph_loader.cc @@ -19,7 +19,7 @@ #include #include -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "common/model_parser/model_parser.h" #include "graph/ge_context.h" #include "graph/load/model_manager/model_manager.h" diff --git a/ge/graph/load/graph_loader.h b/ge/graph/load/graph_loader.h index e11af749..f6324c98 100755 --- a/ge/graph/load/graph_loader.h +++ b/ge/graph/load/graph_loader.h @@ -21,9 +21,9 @@ #include #include -#include "common/debug/log.h" -#include "common/fmk_types.h" -#include "common/ge_types.h" +#include "framework/common/debug/log.h" +#include "framework/common/fmk_types.h" +#include "framework/common/ge_types.h" #include "graph/compute_graph.h" #include "graph/manager/graph_manager_utils.h" #include "graph/model.h" diff --git a/ge/graph/load/model_manager/aipp_utils.cc b/ge/graph/load/model_manager/aipp_utils.cc index 8a18c421..a9f885f8 100755 --- a/ge/graph/load/model_manager/aipp_utils.cc +++ b/ge/graph/load/model_manager/aipp_utils.cc @@ -18,8 +18,8 @@ #include -#include "common/debug/log.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/debug/log.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/attr_utils.h" diff --git a/ge/graph/load/model_manager/aipp_utils.h b/ge/graph/load/model_manager/aipp_utils.h index 78107f3e..237eeced 100755 --- a/ge/graph/load/model_manager/aipp_utils.h +++ b/ge/graph/load/model_manager/aipp_utils.h @@ -19,8 +19,8 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/ge_types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/ge_types.h" #include "graph/op_desc.h" #include "proto/insert_op.pb.h" diff --git a/ge/graph/load/model_manager/cpu_queue_schedule.cc b/ge/graph/load/model_manager/cpu_queue_schedule.cc index 9821aa73..0ec80b34 100644 --- a/ge/graph/load/model_manager/cpu_queue_schedule.cc +++ b/ge/graph/load/model_manager/cpu_queue_schedule.cc @@ -15,8 +15,8 @@ */ #include "graph/load/model_manager/cpu_queue_schedule.h" -#include "common/debug/ge_log.h" -#include "common/debug/log.h" +#include "framework/common/debug/ge_log.h" +#include "framework/common/debug/log.h" namespace { const uint32_t kCoreDim = 1; // for rtCpuKernelLaunch diff --git a/ge/graph/load/model_manager/cpu_queue_schedule.h b/ge/graph/load/model_manager/cpu_queue_schedule.h index 8dc44538..d3c8915e 100644 --- a/ge/graph/load/model_manager/cpu_queue_schedule.h +++ b/ge/graph/load/model_manager/cpu_queue_schedule.h @@ -19,7 +19,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/load/model_manager/task_info/task_info.h" #include "graph/load/model_manager/zero_copy_offset.h" #include "runtime/kernel.h" diff --git a/ge/graph/load/model_manager/data_dumper.cc b/ge/graph/load/model_manager/data_dumper.cc index c96b3885..7b5d9df9 100644 --- a/ge/graph/load/model_manager/data_dumper.cc +++ b/ge/graph/load/model_manager/data_dumper.cc @@ -24,7 +24,7 @@ #include "common/debug/memory_dumper.h" #include "common/properties_manager.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" #include "graph/anchor.h" diff --git a/ge/graph/load/model_manager/data_dumper.h b/ge/graph/load/model_manager/data_dumper.h index d1714950..2851e63a 100755 --- a/ge/graph/load/model_manager/data_dumper.h +++ b/ge/graph/load/model_manager/data_dumper.h @@ -29,7 +29,7 @@ #include "proto/ge_ir.pb.h" #include "proto/op_mapping.pb.h" #include "runtime/mem.h" -#include "task_info/task_info.h" +#include "graph/load/model_manager/task_info/task_info.h" #include "framework/common/ge_types.h" #include "runtime/base.h" diff --git a/ge/graph/load/model_manager/data_inputer.cc b/ge/graph/load/model_manager/data_inputer.cc index d286b9b4..d68e95aa 100755 --- a/ge/graph/load/model_manager/data_inputer.cc +++ b/ge/graph/load/model_manager/data_inputer.cc @@ -18,9 +18,9 @@ #include -#include "common/debug/log.h" -#include "common/scope_guard.h" -#include "common/types.h" +#include "framework/common/debug/log.h" +#include "framework/common/scope_guard.h" +#include "framework/common/types.h" namespace ge { domi::Status InputDataWrapper::Init(const InputData &input, const OutputData &output) { diff --git a/ge/graph/load/model_manager/data_inputer.h b/ge/graph/load/model_manager/data_inputer.h index b8d145d4..28b6fb26 100755 --- a/ge/graph/load/model_manager/data_inputer.h +++ b/ge/graph/load/model_manager/data_inputer.h @@ -22,8 +22,8 @@ #include #include "common/blocking_queue.h" -#include "common/ge_types.h" -#include "common/types.h" +#include "framework/common/ge_types.h" +#include "framework/common/types.h" namespace ge { /// diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 97238a4a..b6c4c7b0 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -21,14 +21,14 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "common/profiling/profiling_manager.h" #include "common/properties_manager.h" -#include "common/scope_guard.h" +#include "framework/common/scope_guard.h" #include "common/thread_pool.h" #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" @@ -36,7 +36,7 @@ #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_context.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/load/model_manager/cpu_queue_schedule.h" #include "graph/load/model_manager/model_manager.h" #include "graph/load/model_manager/tbe_handle_store.h" diff --git a/ge/graph/load/model_manager/davinci_model.h b/ge/graph/load/model_manager/davinci_model.h index 4c06ad98..1e964855 100755 --- a/ge/graph/load/model_manager/davinci_model.h +++ b/ge/graph/load/model_manager/davinci_model.h @@ -24,14 +24,14 @@ #include #include -#include "common/ge_types.h" -#include "common/helper/model_helper.h" -#include "common/helper/om_file_helper.h" +#include "framework/common/ge_types.h" +#include "framework/common/helper/model_helper.h" +#include "framework/common/helper/om_file_helper.h" #include "common/opskernel/ge_task_info.h" #include "common/properties_manager.h" #include "common/dump/exception_dumper.h" #include "common/dump/opdebug_register.h" -#include "common/types.h" +#include "framework/common/types.h" #include "framework/common/util.h" #include "graph/debug/ge_attr_define.h" #include "graph/load/model_manager/aipp_utils.h" @@ -43,12 +43,12 @@ #include "graph/model.h" #include "graph/node.h" #include "graph/op_desc.h" -#include "graph/operator.h" +#include "external/graph/operator.h" #include "graph/utils/attr_utils.h" #include "graph/utils/tensor_utils.h" #include "mmpa/mmpa_api.h" #include "proto/task.pb.h" -#include "task_info/task_info.h" +#include "graph/load/model_manager/task_info/task_info.h" #include "graph/common/local_context.h" using std::mutex; diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 6a563d2f..2cb31074 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -21,7 +21,7 @@ #include "aicpu/aicpu_schedule/aicpu_op_type_list.h" #include "common/model_parser/model_parser.h" #include "common/dump/dump_manager.h" -#include "common/l2_cache_optimize.h" +#include "framework/common/l2_cache_optimize.h" #include "common/profiling/profiling_manager.h" #include "graph/common/ge_call_wrapper.h" #include "graph/load/model_manager/davinci_model.h" diff --git a/ge/graph/load/model_manager/model_manager.h b/ge/graph/load/model_manager/model_manager.h index e35bb7aa..63a03dd7 100755 --- a/ge/graph/load/model_manager/model_manager.h +++ b/ge/graph/load/model_manager/model_manager.h @@ -26,13 +26,13 @@ #include #include #include "cce/aicpu_engine_struct.h" -#include "common/ge_inner_error_codes.h" -#include "common/ge_types.h" -#include "common/helper/model_helper.h" -#include "common/helper/om_file_helper.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/ge_types.h" +#include "framework/common/helper/model_helper.h" +#include "framework/common/helper/om_file_helper.h" #include "common/properties_manager.h" -#include "common/types.h" -#include "ge/ge_api_types.h" +#include "framework/common/types.h" +#include "external/ge/ge_api_types.h" #include "graph/ge_context.h" #include "graph/model.h" #include "hybrid/hybrid_davinci_model.h" diff --git a/ge/graph/load/model_manager/model_utils.cc b/ge/graph/load/model_manager/model_utils.cc index 224a3331..a31837ca 100755 --- a/ge/graph/load/model_manager/model_utils.cc +++ b/ge/graph/load/model_manager/model_utils.cc @@ -16,11 +16,11 @@ #include "graph/load/model_manager/model_utils.h" #include -#include "common/debug/log.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/debug/log.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/manager/graph_var_manager.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/build/memory/block_mem_assigner.h" #include "common/math/math_util.h" diff --git a/ge/graph/load/model_manager/model_utils.h b/ge/graph/load/model_manager/model_utils.h index 8ce1b060..0eadc7a8 100755 --- a/ge/graph/load/model_manager/model_utils.h +++ b/ge/graph/load/model_manager/model_utils.h @@ -19,8 +19,8 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/load/model_manager/task_info/task_info.h" #include "graph/op_desc.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc index 356919f6..a4b3de75 100644 --- a/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_ex_task_info.cc @@ -23,7 +23,7 @@ #include "common/properties_manager.h" #include "framework/common/debug/ge_log.h" #include "framework/common/fmk_error_codes.h" -#include "graph/attr_value.h" +#include "external/graph/attr_value.h" #include "graph/load/model_manager/davinci_model.h" #include "graph/load/model_manager/model_manager.h" #include "hybrid/node_executor/aicpu/aicpu_ext_info.h" diff --git a/ge/graph/load/model_manager/task_info/kernel_task_info.cc b/ge/graph/load/model_manager/task_info/kernel_task_info.cc index 919a56cd..bfb6e24b 100755 --- a/ge/graph/load/model_manager/task_info/kernel_task_info.cc +++ b/ge/graph/load/model_manager/task_info/kernel_task_info.cc @@ -29,8 +29,8 @@ #include "graph/load/model_manager/model_manager.h" #include "graph/load/model_manager/model_utils.h" #include "runtime/kernel.h" -#include "super_kernel/super_kernel.h" -#include "super_kernel/super_kernel_factory.h" +#include "graph/load/model_manager/task_info/super_kernel/super_kernel.h" +#include "graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h" #include "cce/aicpu_engine_struct.h" #include "hybrid/node_executor/aicpu/aicpu_ext_info.h" #include "framework/common/debug/log.h" diff --git a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc index 44aac465..b5db845d 100644 --- a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc +++ b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "super_kernel.h" +#include "graph/load/model_manager/task_info/super_kernel/super_kernel.h" #include "framework/common/debug/ge_log.h" namespace ge { diff --git a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc index 07dc5d19..d1f53cc4 100644 --- a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc +++ b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "super_kernel_factory.h" +#include "graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h" #include "framework/common/debug/ge_log.h" namespace ge { diff --git a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h index c5058b6a..741d1c13 100644 --- a/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h +++ b/ge/graph/load/model_manager/task_info/super_kernel/super_kernel_factory.h @@ -18,7 +18,7 @@ #define SUPER_KERNEL_FACTORY_H #include -#include "super_kernel.h" +#include "graph/load/model_manager/task_info/super_kernel/super_kernel.h" #include "framework/common/debug/log.h" namespace ge { diff --git a/ge/graph/load/model_manager/tbe_handle_store.cc b/ge/graph/load/model_manager/tbe_handle_store.cc index 36207aa2..d20b1bbf 100755 --- a/ge/graph/load/model_manager/tbe_handle_store.cc +++ b/ge/graph/load/model_manager/tbe_handle_store.cc @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "tbe_handle_store.h" +#include "graph/load/model_manager/tbe_handle_store.h" #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "runtime/kernel.h" diff --git a/ge/graph/load/model_manager/tbe_handle_store.h b/ge/graph/load/model_manager/tbe_handle_store.h index 6c3ad750..ba934fc3 100644 --- a/ge/graph/load/model_manager/tbe_handle_store.h +++ b/ge/graph/load/model_manager/tbe_handle_store.h @@ -25,7 +25,7 @@ #include #include -#include "common/fmk_types.h" +#include "framework/common/fmk_types.h" #include "graph/op_kernel_bin.h" namespace ge { diff --git a/ge/graph/load/model_manager/zero_copy_offset.h b/ge/graph/load/model_manager/zero_copy_offset.h index 2dea5666..f3dd07a8 100644 --- a/ge/graph/load/model_manager/zero_copy_offset.h +++ b/ge/graph/load/model_manager/zero_copy_offset.h @@ -29,7 +29,7 @@ #include "graph/utils/attr_utils.h" #include "graph/utils/tensor_utils.h" #include "runtime/mem.h" -#include "task_info/task_info.h" +#include "graph/load/model_manager/task_info/task_info.h" using std::map; using std::set; diff --git a/ge/graph/load/model_manager/zero_copy_task.cc b/ge/graph/load/model_manager/zero_copy_task.cc index 4957f8ea..85be6d7b 100755 --- a/ge/graph/load/model_manager/zero_copy_task.cc +++ b/ge/graph/load/model_manager/zero_copy_task.cc @@ -19,7 +19,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" #include "graph/load/model_manager/model_utils.h" -#include "common/ge_compiler_options.h" +#include "framework/common/ge_compiler_options.h" namespace ge { ZeroCopyTask::ZeroCopyTask(const string &name, uint8_t *args, size_t size) diff --git a/ge/graph/manager/graph_manager.h b/ge/graph/manager/graph_manager.h index 945a5e5d..93ce354a 100644 --- a/ge/graph/manager/graph_manager.h +++ b/ge/graph/manager/graph_manager.h @@ -26,10 +26,10 @@ #include #include "common/blocking_queue.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/helper/model_cache_helper.h" #include "external/graph/types.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/build/graph_builder.h" #include "graph/execute/graph_execute.h" #include "graph/ge_local_context.h" diff --git a/ge/graph/manager/graph_manager_utils.cc b/ge/graph/manager/graph_manager_utils.cc index a70b15a6..42251b10 100644 --- a/ge/graph/manager/graph_manager_utils.cc +++ b/ge/graph/manager/graph_manager_utils.cc @@ -21,12 +21,12 @@ #include "framework/common/debug/ge_log.h" #include "common/ge/ge_util.h" -#include "common/string_util.h" +#include "framework/common/string_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/compute_graph.h" #include "graph/op_desc.h" #include "graph/optimize/common/params.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" #include "runtime/mem.h" namespace ge { diff --git a/ge/graph/manager/graph_manager_utils.h b/ge/graph/manager/graph_manager_utils.h index d38b4321..6ed76e57 100644 --- a/ge/graph/manager/graph_manager_utils.h +++ b/ge/graph/manager/graph_manager_utils.h @@ -27,17 +27,17 @@ #include #include "common/blocking_queue.h" -#include "common/ge_types.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_types.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/model.h" #include "model/ge_model.h" #include "model/ge_root_model.h" -#include "register/register_fmk_types.h" +#include "external/register/register_fmk_types.h" #include "external/ge/ge_api_types.h" namespace ge { diff --git a/ge/graph/manager/graph_var_manager.h b/ge/graph/manager/graph_var_manager.h index 0da12f9c..736466c4 100755 --- a/ge/graph/manager/graph_var_manager.h +++ b/ge/graph/manager/graph_var_manager.h @@ -30,7 +30,7 @@ #include "framework/common/l2_cache_optimize.h" #include "graph/ge_tensor.h" #include "graph/op_desc.h" -#include "graph/tensor.h" +#include "external/graph/tensor.h" #include "runtime/mem.h" namespace ge { diff --git a/ge/graph/manager/host_mem_manager.h b/ge/graph/manager/host_mem_manager.h index 84d5aebe..6ff19edb 100644 --- a/ge/graph/manager/host_mem_manager.h +++ b/ge/graph/manager/host_mem_manager.h @@ -32,7 +32,7 @@ #include "framework/common/l2_cache_optimize.h" #include "graph/ge_tensor.h" #include "graph/op_desc.h" -#include "graph/tensor.h" +#include "external/graph/tensor.h" #include "runtime/mem.h" namespace ge { diff --git a/ge/graph/manager/model_manager/event_manager.h b/ge/graph/manager/model_manager/event_manager.h index a7464e0c..2cb1c3f6 100644 --- a/ge/graph/manager/model_manager/event_manager.h +++ b/ge/graph/manager/model_manager/event_manager.h @@ -20,9 +20,9 @@ #include -#include "common/fmk_error_codes.h" -#include "common/fmk_types.h" -#include "common/util.h" +#include "framework/common/fmk_error_codes.h" +#include "framework/common/fmk_types.h" +#include "framework/common/util.h" #include "runtime/event.h" namespace ge { diff --git a/ge/graph/manager/trans_var_data_utils.cc b/ge/graph/manager/trans_var_data_utils.cc index 621eba79..4c25dff1 100644 --- a/ge/graph/manager/trans_var_data_utils.cc +++ b/ge/graph/manager/trans_var_data_utils.cc @@ -16,14 +16,14 @@ #include "graph/manager/trans_var_data_utils.h" -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "graph/manager/graph_var_manager.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/utils/type_utils.h" #include "common/thread_pool.h" #include diff --git a/ge/graph/manager/trans_var_data_utils.h b/ge/graph/manager/trans_var_data_utils.h index 95ebd09a..d5096ef2 100755 --- a/ge/graph/manager/trans_var_data_utils.h +++ b/ge/graph/manager/trans_var_data_utils.h @@ -24,7 +24,7 @@ #include "graph/utils/tensor_utils.h" #include "graph/node.h" #include "runtime/context.h" -#include "graph_var_manager.h" +#include "graph/manager/graph_var_manager.h" namespace ge { class TransVarDataUtils { diff --git a/ge/graph/manager/util/debug.h b/ge/graph/manager/util/debug.h index e1b13caf..02cacb72 100755 --- a/ge/graph/manager/util/debug.h +++ b/ge/graph/manager/util/debug.h @@ -33,10 +33,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "mmpa/mmpa_api.h" #include "proto/om.pb.h" #include "runtime/kernel.h" diff --git a/ge/graph/manager/util/hcom_util.cc b/ge/graph/manager/util/hcom_util.cc index 2da19cc9..8e12ff27 100644 --- a/ge/graph/manager/util/hcom_util.cc +++ b/ge/graph/manager/util/hcom_util.cc @@ -16,10 +16,10 @@ #include "graph/manager/util/hcom_util.h" -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/math/math_util.h" -#include "common/op/attr_value_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/attr_value_util.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/manager/util/hcom_util.h b/ge/graph/manager/util/hcom_util.h index f80ced35..96ef92bf 100644 --- a/ge/graph/manager/util/hcom_util.h +++ b/ge/graph/manager/util/hcom_util.h @@ -21,11 +21,11 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/opskernel/ge_task_info.h" -#include "common/string_util.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/string_util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/op_desc.h" #include "hccl/hcom.h" #include "proto/task.pb.h" diff --git a/ge/graph/optimize/common/params.h b/ge/graph/optimize/common/params.h index d5b66b8f..fbe58c6b 100644 --- a/ge/graph/optimize/common/params.h +++ b/ge/graph/optimize/common/params.h @@ -20,7 +20,7 @@ #include #include "common/singleton.h" -#include "common/types.h" +#include "framework/common/types.h" namespace ge { class Params : public Singleton { diff --git a/ge/graph/optimize/graph_optimize.h b/ge/graph/optimize/graph_optimize.h index 702b7e33..a3d359b6 100755 --- a/ge/graph/optimize/graph_optimize.h +++ b/ge/graph/optimize/graph_optimize.h @@ -25,13 +25,13 @@ #include #include -#include "common/ge_inner_error_codes.h" -#include "common/ge_types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/ge_types.h" #include "common/optimizer/graph_optimizer.h" #include "graph/compute_graph.h" #include "graph/manager/graph_context.h" #include "graph/manager/graph_manager_utils.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace ge { using ComputeGraphPtr = std::shared_ptr; diff --git a/ge/graph/optimize/summary_optimize.cc b/ge/graph/optimize/summary_optimize.cc index d3c02d3e..08a27c4e 100644 --- a/ge/graph/optimize/summary_optimize.cc +++ b/ge/graph/optimize/summary_optimize.cc @@ -21,7 +21,7 @@ #include "graph/optimize/graph_optimize.h" #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace { const char *const kSummary = "Summary"; diff --git a/ge/graph/partition/dynamic_shape_partition.h b/ge/graph/partition/dynamic_shape_partition.h index bd3b128f..31146570 100644 --- a/ge/graph/partition/dynamic_shape_partition.h +++ b/ge/graph/partition/dynamic_shape_partition.h @@ -21,7 +21,7 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" namespace ge { diff --git a/ge/graph/partition/engine_place.cc b/ge/graph/partition/engine_place.cc index 93cc3e61..8639f015 100755 --- a/ge/graph/partition/engine_place.cc +++ b/ge/graph/partition/engine_place.cc @@ -22,7 +22,7 @@ #include #include -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "common/util/error_manager/error_manager.h" #include "graph/utils/graph_utils.h" #include "graph/utils/op_desc_utils.h" diff --git a/ge/graph/partition/engine_place.h b/ge/graph/partition/engine_place.h index 5dc3e6a0..125babb6 100755 --- a/ge/graph/partition/engine_place.h +++ b/ge/graph/partition/engine_place.h @@ -20,7 +20,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" namespace ge { diff --git a/ge/graph/partition/graph_partition.cc b/ge/graph/partition/graph_partition.cc index a810aab0..6f221d97 100755 --- a/ge/graph/partition/graph_partition.cc +++ b/ge/graph/partition/graph_partition.cc @@ -24,7 +24,7 @@ #include "analyzer/analyzer.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/graph_manager_utils.h" diff --git a/ge/graph/partition/graph_partition.h b/ge/graph/partition/graph_partition.h index f34c67e6..560aa9e7 100644 --- a/ge/graph/partition/graph_partition.h +++ b/ge/graph/partition/graph_partition.h @@ -28,7 +28,7 @@ #include #include "graph/compute_graph.h" #include "graph/manager/graph_manager_utils.h" -#include "graph/operator_reg.h" +#include "external/graph/operator_reg.h" #include "graph/partition/engine_place.h" namespace ge { diff --git a/ge/graph/partition/stage_partition.cc b/ge/graph/partition/stage_partition.cc index 309e24c4..68b4209f 100644 --- a/ge/graph/partition/stage_partition.cc +++ b/ge/graph/partition/stage_partition.cc @@ -21,8 +21,8 @@ #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/utils/op_desc_utils.h" -#include "common/util.h" -#include "common/types.h" +#include "framework/common/util.h" +#include "framework/common/types.h" namespace ge { namespace { diff --git a/ge/graph/partition/stage_partition.h b/ge/graph/partition/stage_partition.h index bac00e6b..99aac2b9 100644 --- a/ge/graph/partition/stage_partition.h +++ b/ge/graph/partition/stage_partition.h @@ -21,7 +21,7 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" namespace ge { diff --git a/ge/graph/passes/addn_pass.h b/ge/graph/passes/addn_pass.h index 373d1842..075ff9fc 100644 --- a/ge/graph/passes/addn_pass.h +++ b/ge/graph/passes/addn_pass.h @@ -17,10 +17,10 @@ #ifndef GE_GRAPH_PASSES_ADDN_PASS_H_ #define GE_GRAPH_PASSES_ADDN_PASS_H_ -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "framework/common/types.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/passes/base_pass.h" #include "graph/passes/pass_utils.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/aicpu_constant_folding_pass.cc b/ge/graph/passes/aicpu_constant_folding_pass.cc index 8fdb51a1..d33d4db2 100644 --- a/ge/graph/passes/aicpu_constant_folding_pass.cc +++ b/ge/graph/passes/aicpu_constant_folding_pass.cc @@ -19,9 +19,9 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" -#include "common/types.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/attr_utils.h" diff --git a/ge/graph/passes/atomic_addr_clean_pass.cc b/ge/graph/passes/atomic_addr_clean_pass.cc index 9f202c77..cc22d126 100755 --- a/ge/graph/passes/atomic_addr_clean_pass.cc +++ b/ge/graph/passes/atomic_addr_clean_pass.cc @@ -22,7 +22,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" #include "graph/common/ge_call_wrapper.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/passes/atomic_addr_clean_pass.h b/ge/graph/passes/atomic_addr_clean_pass.h index 0d0b8fff..30162359 100755 --- a/ge/graph/passes/atomic_addr_clean_pass.h +++ b/ge/graph/passes/atomic_addr_clean_pass.h @@ -19,7 +19,7 @@ #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/attach_stream_label_pass.cc b/ge/graph/passes/attach_stream_label_pass.cc index d5b28ec7..bcf86bc2 100644 --- a/ge/graph/passes/attach_stream_label_pass.cc +++ b/ge/graph/passes/attach_stream_label_pass.cc @@ -15,7 +15,7 @@ */ #include "graph/passes/attach_stream_label_pass.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/common/omg_util.h" using std::string; diff --git a/ge/graph/passes/base_pass.cc b/ge/graph/passes/base_pass.cc index 165e7e81..a1551eb2 100755 --- a/ge/graph/passes/base_pass.cc +++ b/ge/graph/passes/base_pass.cc @@ -19,7 +19,7 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" #include "graph/compute_graph.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/bitcast_pass.h b/ge/graph/passes/bitcast_pass.h index 34acaf57..60990dea 100644 --- a/ge/graph/passes/bitcast_pass.h +++ b/ge/graph/passes/bitcast_pass.h @@ -17,10 +17,10 @@ #ifndef GE_GRAPH_PASSES_BITCAST_PASS_H_ #define GE_GRAPH_PASSES_BITCAST_PASS_H_ -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "framework/common/types.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/op_desc.h" #include "graph/passes/base_pass.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/passes/buffer_pool_memory_pass.h b/ge/graph/passes/buffer_pool_memory_pass.h index e3d1c159..89fc5363 100644 --- a/ge/graph/passes/buffer_pool_memory_pass.h +++ b/ge/graph/passes/buffer_pool_memory_pass.h @@ -18,7 +18,7 @@ #define GE_GRAPH_PASSES_BUFFER_POOL_MEMORY_PASS_H_ #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/common_subexpression_elimination_pass.cc b/ge/graph/passes/common_subexpression_elimination_pass.cc index 852ed98a..c41a5cf5 100644 --- a/ge/graph/passes/common_subexpression_elimination_pass.cc +++ b/ge/graph/passes/common_subexpression_elimination_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "common_subexpression_elimination_pass.h" +#include "graph/passes/common_subexpression_elimination_pass.h" #include #include diff --git a/ge/graph/passes/common_subexpression_elimination_pass.h b/ge/graph/passes/common_subexpression_elimination_pass.h index 83bfbace..b182f8b9 100644 --- a/ge/graph/passes/common_subexpression_elimination_pass.h +++ b/ge/graph/passes/common_subexpression_elimination_pass.h @@ -16,7 +16,7 @@ #ifndef GE_COMMON_SUBEXPRESSION_ELIMINATION_H_ #define GE_COMMON_SUBEXPRESSION_ELIMINATION_H_ -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/compile_nodes_pass.cc b/ge/graph/passes/compile_nodes_pass.cc index d0dcec16..1e734178 100755 --- a/ge/graph/passes/compile_nodes_pass.cc +++ b/ge/graph/passes/compile_nodes_pass.cc @@ -19,7 +19,7 @@ #include #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" #include "graph/common/ge_call_wrapper.h" diff --git a/ge/graph/passes/cond_pass.cc b/ge/graph/passes/cond_pass.cc index 116e4f89..47a75cd8 100644 --- a/ge/graph/passes/cond_pass.cc +++ b/ge/graph/passes/cond_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "graph/passes/cond_pass.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/utils/graph_utils.h" #include "graph/utils/type_utils.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/cond_remove_pass.cc b/ge/graph/passes/cond_remove_pass.cc index 478858a9..91e44458 100644 --- a/ge/graph/passes/cond_remove_pass.cc +++ b/ge/graph/passes/cond_remove_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "graph/passes/cond_remove_pass.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/constant_folding_pass.cc b/ge/graph/passes/constant_folding_pass.cc index 25fe26da..6607388f 100644 --- a/ge/graph/passes/constant_folding_pass.cc +++ b/ge/graph/passes/constant_folding_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/constant_folding_pass.h" #include -#include "graph/operator_factory.h" +#include "external/graph/operator_factory.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" #include "init/gelib.h" diff --git a/ge/graph/passes/constant_fuse_same_pass.h b/ge/graph/passes/constant_fuse_same_pass.h index 3ff2d6b7..a7326c32 100755 --- a/ge/graph/passes/constant_fuse_same_pass.h +++ b/ge/graph/passes/constant_fuse_same_pass.h @@ -22,7 +22,7 @@ #include #include #include "graph/aligned_ptr.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/data_pass.h b/ge/graph/passes/data_pass.h index 519ae046..6f841139 100644 --- a/ge/graph/passes/data_pass.h +++ b/ge/graph/passes/data_pass.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_PASSES_DATA_PASS_H_ #define GE_GRAPH_PASSES_DATA_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/dimension_adjust_pass.h b/ge/graph/passes/dimension_adjust_pass.h index 7766f140..a84f0d8d 100755 --- a/ge/graph/passes/dimension_adjust_pass.h +++ b/ge/graph/passes/dimension_adjust_pass.h @@ -17,10 +17,10 @@ #ifndef GE_GRAPH_PASSES_DIMENSION_ADJUST_PASS_H_ #define GE_GRAPH_PASSES_DIMENSION_ADJUST_PASS_H_ -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/common/omg_util.h" #include "graph/passes/base_pass.h" #include "graph/utils/attr_utils.h" diff --git a/ge/graph/passes/dimension_compute_pass.cc b/ge/graph/passes/dimension_compute_pass.cc index 350faf71..a24a6bd4 100755 --- a/ge/graph/passes/dimension_compute_pass.cc +++ b/ge/graph/passes/dimension_compute_pass.cc @@ -20,7 +20,7 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/utils/attr_utils.h" diff --git a/ge/graph/passes/end_of_sequence_add_control_pass.h b/ge/graph/passes/end_of_sequence_add_control_pass.h index dcc65848..32ee0b25 100644 --- a/ge/graph/passes/end_of_sequence_add_control_pass.h +++ b/ge/graph/passes/end_of_sequence_add_control_pass.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_PASSES_END_OF_SEQUENCE_ADD_CONTROL_EDGE_PASS_H_ #define GE_GRAPH_PASSES_END_OF_SEQUENCE_ADD_CONTROL_EDGE_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/flow_ctrl_pass.h b/ge/graph/passes/flow_ctrl_pass.h index 74f3cce0..cf1af97a 100755 --- a/ge/graph/passes/flow_ctrl_pass.h +++ b/ge/graph/passes/flow_ctrl_pass.h @@ -20,7 +20,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/for_pass.cc b/ge/graph/passes/for_pass.cc index 7d09f370..260e6ea0 100644 --- a/ge/graph/passes/for_pass.cc +++ b/ge/graph/passes/for_pass.cc @@ -16,7 +16,7 @@ #include "graph/passes/for_pass.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" #include "framework/common/ge_inner_error_codes.h" diff --git a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc index ec7b2388..280afb6f 100644 --- a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc +++ b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.cc @@ -21,7 +21,7 @@ #include #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/type_utils.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.h b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.h index 9ff6ab89..33543ded 100755 --- a/ge/graph/passes/fuse_data_nodes_with_common_input_pass.h +++ b/ge/graph/passes/fuse_data_nodes_with_common_input_pass.h @@ -20,7 +20,7 @@ #include #include #include -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/get_original_format_pass.cc b/ge/graph/passes/get_original_format_pass.cc index 670cd50c..4b27dd0e 100644 --- a/ge/graph/passes/get_original_format_pass.cc +++ b/ge/graph/passes/get_original_format_pass.cc @@ -18,9 +18,9 @@ #include -#include "common/debug/log.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/omg_inner_types.h" #include "graph/utils/attr_utils.h" diff --git a/ge/graph/passes/global_step_insert_pass.h b/ge/graph/passes/global_step_insert_pass.h index da83e93a..16be3d4a 100755 --- a/ge/graph/passes/global_step_insert_pass.h +++ b/ge/graph/passes/global_step_insert_pass.h @@ -20,7 +20,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/guarantee_const_pass.cc b/ge/graph/passes/guarantee_const_pass.cc index 1d369f38..b1df73a9 100644 --- a/ge/graph/passes/guarantee_const_pass.cc +++ b/ge/graph/passes/guarantee_const_pass.cc @@ -19,8 +19,8 @@ #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/common/omg_util.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/hccl_continuous_memcpy_pass.cc b/ge/graph/passes/hccl_continuous_memcpy_pass.cc index 56cbb005..7f4597b3 100644 --- a/ge/graph/passes/hccl_continuous_memcpy_pass.cc +++ b/ge/graph/passes/hccl_continuous_memcpy_pass.cc @@ -18,9 +18,9 @@ #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" #include "framework/common/types.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/hccl_continuous_memcpy_pass.h b/ge/graph/passes/hccl_continuous_memcpy_pass.h index 5fbb6fd0..d710531d 100644 --- a/ge/graph/passes/hccl_continuous_memcpy_pass.h +++ b/ge/graph/passes/hccl_continuous_memcpy_pass.h @@ -20,7 +20,7 @@ #include #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/hccl_group_pass.cc b/ge/graph/passes/hccl_group_pass.cc index bbfd9b56..35baade6 100644 --- a/ge/graph/passes/hccl_group_pass.cc +++ b/ge/graph/passes/hccl_group_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hccl_group_pass.h" +#include "graph/passes/hccl_group_pass.h" #include #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/passes/hccl_memcpy_pass.cc b/ge/graph/passes/hccl_memcpy_pass.cc index d56ee342..2d83bf51 100755 --- a/ge/graph/passes/hccl_memcpy_pass.cc +++ b/ge/graph/passes/hccl_memcpy_pass.cc @@ -18,9 +18,9 @@ #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" #include "framework/common/types.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/hccl_memcpy_pass.h b/ge/graph/passes/hccl_memcpy_pass.h index b75b27d1..e6ee519b 100755 --- a/ge/graph/passes/hccl_memcpy_pass.h +++ b/ge/graph/passes/hccl_memcpy_pass.h @@ -20,7 +20,7 @@ #include #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/hccl_tailing_optimization_pass.cc b/ge/graph/passes/hccl_tailing_optimization_pass.cc index e1e2f276..d952885d 100644 --- a/ge/graph/passes/hccl_tailing_optimization_pass.cc +++ b/ge/graph/passes/hccl_tailing_optimization_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "hccl_tailing_optimization_pass.h" +#include "graph/passes/hccl_tailing_optimization_pass.h" #include "graph/common/transop_util.h" namespace ge { diff --git a/ge/graph/passes/infershape_pass.cc b/ge/graph/passes/infershape_pass.cc index b74d1c97..60a2f09a 100755 --- a/ge/graph/passes/infershape_pass.cc +++ b/ge/graph/passes/infershape_pass.cc @@ -24,8 +24,8 @@ #include "graph/utils/node_utils.h" #include "graph/common/omg_util.h" #include "graph/debug/ge_attr_define.h" -#include "utils/tensor_utils.h" -#include "utils/type_utils.h" +#include "graph/utils/tensor_utils.h" +#include "graph/utils/type_utils.h" namespace ge { diff --git a/ge/graph/passes/input_output_connection_identify_pass.cc b/ge/graph/passes/input_output_connection_identify_pass.cc index 5779fb41..d5551bdc 100644 --- a/ge/graph/passes/input_output_connection_identify_pass.cc +++ b/ge/graph/passes/input_output_connection_identify_pass.cc @@ -23,7 +23,7 @@ #include #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/input_output_connection_identify_pass.h b/ge/graph/passes/input_output_connection_identify_pass.h index 97ed315d..c4a4653e 100755 --- a/ge/graph/passes/input_output_connection_identify_pass.h +++ b/ge/graph/passes/input_output_connection_identify_pass.h @@ -19,7 +19,7 @@ #include #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/iterator_op_pass.cc b/ge/graph/passes/iterator_op_pass.cc index 3e85887b..d1de809d 100644 --- a/ge/graph/passes/iterator_op_pass.cc +++ b/ge/graph/passes/iterator_op_pass.cc @@ -21,13 +21,13 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" #include "common/ge/ge_util.h" #include "framework/common/debug/ge_log.h" #include "graph/anchor.h" #include "graph/common/omg_util.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/node.h" #include "graph/passes/pass_utils.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/iterator_op_pass.h b/ge/graph/passes/iterator_op_pass.h index d9303358..611109dc 100644 --- a/ge/graph/passes/iterator_op_pass.h +++ b/ge/graph/passes/iterator_op_pass.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_PASSES_ITERATOR_OP_PASS_H_ #define GE_GRAPH_PASSES_ITERATOR_OP_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/link_gen_mask_nodes_pass.cc b/ge/graph/passes/link_gen_mask_nodes_pass.cc index 522c20ad..9ff3bfd7 100755 --- a/ge/graph/passes/link_gen_mask_nodes_pass.cc +++ b/ge/graph/passes/link_gen_mask_nodes_pass.cc @@ -18,7 +18,7 @@ #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "framework/common/types.h" #include "init/gelib.h" diff --git a/ge/graph/passes/link_gen_mask_nodes_pass.h b/ge/graph/passes/link_gen_mask_nodes_pass.h index 12d68f1b..c6c1e703 100644 --- a/ge/graph/passes/link_gen_mask_nodes_pass.h +++ b/ge/graph/passes/link_gen_mask_nodes_pass.h @@ -21,7 +21,7 @@ #include #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc index 74babadc..fbf69c04 100644 --- a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc +++ b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "mark_force_unknown_for_cond_pass.h" +#include "graph/passes/mark_force_unknown_for_cond_pass.h" #include diff --git a/ge/graph/passes/mark_graph_unknown_status_pass.h b/ge/graph/passes/mark_graph_unknown_status_pass.h index a1148c6e..2cc86dbd 100644 --- a/ge/graph/passes/mark_graph_unknown_status_pass.h +++ b/ge/graph/passes/mark_graph_unknown_status_pass.h @@ -16,7 +16,7 @@ #ifndef GE_GRAPH_PASSES_MARK_GRAPH_UNKNOWN_STATUS_PASS_H_ #define GE_GRAPH_PASSES_MARK_GRAPH_UNKNOWN_STATUS_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/mark_node_unknown_shape_pass.h b/ge/graph/passes/mark_node_unknown_shape_pass.h index b78b7826..acd12582 100644 --- a/ge/graph/passes/mark_node_unknown_shape_pass.h +++ b/ge/graph/passes/mark_node_unknown_shape_pass.h @@ -16,7 +16,7 @@ #ifndef GE_GRAPH_PASSES_MARK_NODE_UNKNOWN_SHAPE_PASS_H_ #define GE_GRAPH_PASSES_MARK_NODE_UNKNOWN_SHAPE_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/mark_same_addr_pass.h b/ge/graph/passes/mark_same_addr_pass.h index 518fe418..adf971a2 100644 --- a/ge/graph/passes/mark_same_addr_pass.h +++ b/ge/graph/passes/mark_same_addr_pass.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" #ifndef GE_GRAPH_PASSES_MARK_SAME_ADDR_PASS_H_ diff --git a/ge/graph/passes/merge_input_memcpy_pass.cc b/ge/graph/passes/merge_input_memcpy_pass.cc index 00c04131..044d4ad9 100644 --- a/ge/graph/passes/merge_input_memcpy_pass.cc +++ b/ge/graph/passes/merge_input_memcpy_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/merge_input_memcpy_pass.h" #include "common/ge/ge_util.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/common/omg_util.h" namespace ge { diff --git a/ge/graph/passes/merge_to_stream_merge_pass.cc b/ge/graph/passes/merge_to_stream_merge_pass.cc index dbcff620..c58def59 100644 --- a/ge/graph/passes/merge_to_stream_merge_pass.cc +++ b/ge/graph/passes/merge_to_stream_merge_pass.cc @@ -16,7 +16,7 @@ #include "graph/passes/merge_to_stream_merge_pass.h" #include "common/ge/ge_util.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/common/omg_util.h" namespace ge { diff --git a/ge/graph/passes/net_output_pass.h b/ge/graph/passes/net_output_pass.h index ab190169..fecccc35 100644 --- a/ge/graph/passes/net_output_pass.h +++ b/ge/graph/passes/net_output_pass.h @@ -22,7 +22,7 @@ #include #include -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/no_use_reshape_remove_pass.cc b/ge/graph/passes/no_use_reshape_remove_pass.cc index b3074565..e0a0ceb8 100644 --- a/ge/graph/passes/no_use_reshape_remove_pass.cc +++ b/ge/graph/passes/no_use_reshape_remove_pass.cc @@ -19,7 +19,7 @@ #include #include -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "external/graph/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" diff --git a/ge/graph/passes/parallel_group_pass.h b/ge/graph/passes/parallel_group_pass.h index 9b895598..cdcdabab 100644 --- a/ge/graph/passes/parallel_group_pass.h +++ b/ge/graph/passes/parallel_group_pass.h @@ -19,7 +19,7 @@ #include #include -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/pass_manager.cc b/ge/graph/passes/pass_manager.cc index fa2f1e17..7c9aa414 100644 --- a/ge/graph/passes/pass_manager.cc +++ b/ge/graph/passes/pass_manager.cc @@ -15,12 +15,12 @@ */ #include "inc/pass_manager.h" -#include "common/debug/log.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/utils/node_utils.h" #include "graph/common/ge_call_wrapper.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace ge { const vector>& PassManager::GraphPasses() const { return names_to_graph_passes_; } diff --git a/ge/graph/passes/pass_utils.cc b/ge/graph/passes/pass_utils.cc index c0ef7685..d5306f5f 100644 --- a/ge/graph/passes/pass_utils.cc +++ b/ge/graph/passes/pass_utils.cc @@ -23,10 +23,10 @@ #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "graph/common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_tensor.h" @@ -35,7 +35,7 @@ #include "graph/utils/op_desc_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" -#include "utils/node_utils.h" +#include "graph/utils/node_utils.h" #include "common/formats/utils/formats_trans_utils.h" namespace ge { diff --git a/ge/graph/passes/pass_utils.h b/ge/graph/passes/pass_utils.h index bd506d09..475c4e77 100755 --- a/ge/graph/passes/pass_utils.h +++ b/ge/graph/passes/pass_utils.h @@ -19,7 +19,7 @@ #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" namespace ge { diff --git a/ge/graph/passes/permute_pass.cc b/ge/graph/passes/permute_pass.cc index 8254db72..21222b2c 100644 --- a/ge/graph/passes/permute_pass.cc +++ b/ge/graph/passes/permute_pass.cc @@ -17,8 +17,8 @@ #include "graph/passes/permute_pass.h" #include #include -#include "common/debug/log.h" -#include "common/types.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" #include "graph/utils/attr_utils.h" #include "graph/utils/op_desc_utils.h" #include "inc/kernel.h" diff --git a/ge/graph/passes/print_op_pass.h b/ge/graph/passes/print_op_pass.h index deaf559b..7ee19d5d 100755 --- a/ge/graph/passes/print_op_pass.h +++ b/ge/graph/passes/print_op_pass.h @@ -21,7 +21,7 @@ #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/common/omg_util.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/passes/base_pass.h" #include "graph/utils/graph_utils.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/passes/prune_pass.cc b/ge/graph/passes/prune_pass.cc index 1e2ec4ab..cc6c7618 100644 --- a/ge/graph/passes/prune_pass.cc +++ b/ge/graph/passes/prune_pass.cc @@ -19,8 +19,8 @@ #include #include #include -#include "common/debug/log.h" -#include "common/types.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/ref_identity_delete_op_pass.cc b/ge/graph/passes/ref_identity_delete_op_pass.cc index 39794cff..7bc5804b 100644 --- a/ge/graph/passes/ref_identity_delete_op_pass.cc +++ b/ge/graph/passes/ref_identity_delete_op_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ref_identity_delete_op_pass.h" +#include "graph/passes/ref_identity_delete_op_pass.h" #include #include #include "graph/common/transop_util.h" diff --git a/ge/graph/passes/remove_same_const_pass.cc b/ge/graph/passes/remove_same_const_pass.cc index a06eea43..947ff3f3 100644 --- a/ge/graph/passes/remove_same_const_pass.cc +++ b/ge/graph/passes/remove_same_const_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "remove_same_const_pass.h" +#include "graph/passes/remove_same_const_pass.h" #include #include diff --git a/ge/graph/passes/remove_same_const_pass.h b/ge/graph/passes/remove_same_const_pass.h index 08905bd2..6934a472 100644 --- a/ge/graph/passes/remove_same_const_pass.h +++ b/ge/graph/passes/remove_same_const_pass.h @@ -16,7 +16,7 @@ #ifndef GE_GRAPH_PASSES_REMOVE_SAME_CONST_PASS_H_ #define GE_GRAPH_PASSES_REMOVE_SAME_CONST_PASS_H_ -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/replace_transshape_pass.cc b/ge/graph/passes/replace_transshape_pass.cc index 28957a61..c7844619 100644 --- a/ge/graph/passes/replace_transshape_pass.cc +++ b/ge/graph/passes/replace_transshape_pass.cc @@ -19,7 +19,7 @@ #include #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "graph/common/omg_util.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/resource_pair_add_control_pass.cc b/ge/graph/passes/resource_pair_add_control_pass.cc index a104a95e..14f04fe0 100755 --- a/ge/graph/passes/resource_pair_add_control_pass.cc +++ b/ge/graph/passes/resource_pair_add_control_pass.cc @@ -21,9 +21,9 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/utils/attr_utils.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/graph/passes/resource_pair_remove_control_pass.cc b/ge/graph/passes/resource_pair_remove_control_pass.cc index 73b96008..138efb43 100755 --- a/ge/graph/passes/resource_pair_remove_control_pass.cc +++ b/ge/graph/passes/resource_pair_remove_control_pass.cc @@ -21,9 +21,9 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/utils/attr_utils.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/graph/passes/same_transdata_breadth_fusion_pass.cc b/ge/graph/passes/same_transdata_breadth_fusion_pass.cc index 60f5c7c9..afd78a4d 100644 --- a/ge/graph/passes/same_transdata_breadth_fusion_pass.cc +++ b/ge/graph/passes/same_transdata_breadth_fusion_pass.cc @@ -20,8 +20,8 @@ #include #include #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/utils/op_desc_utils.h" diff --git a/ge/graph/passes/save_pass.cc b/ge/graph/passes/save_pass.cc index 1181461b..6fec3a3b 100755 --- a/ge/graph/passes/save_pass.cc +++ b/ge/graph/passes/save_pass.cc @@ -20,7 +20,7 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/utils/graph_utils.h" namespace ge { diff --git a/ge/graph/passes/save_pass.h b/ge/graph/passes/save_pass.h index 512dfa62..8efcc46e 100755 --- a/ge/graph/passes/save_pass.h +++ b/ge/graph/passes/save_pass.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_PASSES_SAVE_PASS_H_ #define GE_GRAPH_PASSES_SAVE_PASS_H_ -#include "graph/graph.h" +#include "external/graph/graph.h" #include "inc/graph_pass.h" namespace ge { diff --git a/ge/graph/passes/shape_operate_op_remove_pass.cc b/ge/graph/passes/shape_operate_op_remove_pass.cc index a703f1c9..f6ce0ec1 100755 --- a/ge/graph/passes/shape_operate_op_remove_pass.cc +++ b/ge/graph/passes/shape_operate_op_remove_pass.cc @@ -15,9 +15,9 @@ */ #include "graph/passes/shape_operate_op_remove_pass.h" -#include "common/debug/log.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/utils/attr_utils.h" using domi::SUCCESS; diff --git a/ge/graph/passes/stop_gradient_pass.h b/ge/graph/passes/stop_gradient_pass.h index 808174bc..5132b889 100755 --- a/ge/graph/passes/stop_gradient_pass.h +++ b/ge/graph/passes/stop_gradient_pass.h @@ -18,7 +18,7 @@ #define GE_GRAPH_PASSES_STOP_GRADIENT_PASS_H_ #include "framework/common/debug/ge_log.h" -#include "common/types.h" +#include "framework/common/types.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/omg_util.h" #include "graph/passes/base_pass.h" diff --git a/ge/graph/passes/subexpression_migration_pass.cc b/ge/graph/passes/subexpression_migration_pass.cc index 6265851a..f39e02e5 100755 --- a/ge/graph/passes/subexpression_migration_pass.cc +++ b/ge/graph/passes/subexpression_migration_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "subexpression_migration_pass.h" +#include "graph/passes/subexpression_migration_pass.h" #include "graph/utils/node_utils.h" #include "ge_local_engine/engine/host_cpu_engine.h" diff --git a/ge/graph/passes/subexpression_migration_pass.h b/ge/graph/passes/subexpression_migration_pass.h index d2733fcf..52326798 100755 --- a/ge/graph/passes/subexpression_migration_pass.h +++ b/ge/graph/passes/subexpression_migration_pass.h @@ -17,7 +17,7 @@ #ifndef GE_COMMON_SUBEXPRESSION_MIGRATION_H_ #define GE_COMMON_SUBEXPRESSION_MIGRATION_H_ -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" #include diff --git a/ge/graph/passes/subgraph_const_migration_pass.cc b/ge/graph/passes/subgraph_const_migration_pass.cc index d15e60cf..eac0c84b 100644 --- a/ge/graph/passes/subgraph_const_migration_pass.cc +++ b/ge/graph/passes/subgraph_const_migration_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "subgraph_const_migration_pass.h" +#include "graph/passes/subgraph_const_migration_pass.h" #include "graph/utils/node_utils.h" #include "ge_local_engine/engine/host_cpu_engine.h" diff --git a/ge/graph/passes/subgraph_const_migration_pass.h b/ge/graph/passes/subgraph_const_migration_pass.h index 2834fd66..e43a3049 100755 --- a/ge/graph/passes/subgraph_const_migration_pass.h +++ b/ge/graph/passes/subgraph_const_migration_pass.h @@ -17,7 +17,7 @@ #ifndef GE_COMMON_SUBGRAPH_CONST_MIGRATION_H_ #define GE_COMMON_SUBGRAPH_CONST_MIGRATION_H_ -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" #include diff --git a/ge/graph/passes/switch_data_edges_bypass.cc b/ge/graph/passes/switch_data_edges_bypass.cc index 5f66a0ca..c7b46b7c 100644 --- a/ge/graph/passes/switch_data_edges_bypass.cc +++ b/ge/graph/passes/switch_data_edges_bypass.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "switch_data_edges_bypass.h" +#include "graph/passes/switch_data_edges_bypass.h" #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/util.h" #include "graph/utils/node_utils.h" namespace ge { diff --git a/ge/graph/passes/switch_logic_remove_pass.cc b/ge/graph/passes/switch_logic_remove_pass.cc index 13b409c5..0d6bc2ce 100644 --- a/ge/graph/passes/switch_logic_remove_pass.cc +++ b/ge/graph/passes/switch_logic_remove_pass.cc @@ -21,7 +21,7 @@ #include "framework/common/debug/ge_log.h" #include "graph/utils/graph_utils.h" #include "graph/passes/pass_utils.h" -#include "common/util.h" +#include "framework/common/util.h" namespace ge { namespace { diff --git a/ge/graph/passes/switch_to_stream_switch_pass.cc b/ge/graph/passes/switch_to_stream_switch_pass.cc index e4ab0111..77a7c9db 100644 --- a/ge/graph/passes/switch_to_stream_switch_pass.cc +++ b/ge/graph/passes/switch_to_stream_switch_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/switch_to_stream_switch_pass.h" #include #include "common/ge/ge_util.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/common/omg_util.h" #include "graph/ge_context.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/transop_breadth_fusion_pass.cc b/ge/graph/passes/transop_breadth_fusion_pass.cc index 58b40a5f..5b8e1940 100644 --- a/ge/graph/passes/transop_breadth_fusion_pass.cc +++ b/ge/graph/passes/transop_breadth_fusion_pass.cc @@ -19,7 +19,7 @@ #include #include -#include "common/types.h" +#include "framework/common/types.h" #include "graph/common/transop_util.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/transop_depth_fusion_pass.cc b/ge/graph/passes/transop_depth_fusion_pass.cc index ea4add35..66ce346a 100755 --- a/ge/graph/passes/transop_depth_fusion_pass.cc +++ b/ge/graph/passes/transop_depth_fusion_pass.cc @@ -17,8 +17,8 @@ #include "graph/passes/transop_depth_fusion_pass.h" #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/compute_graph.h" #include "graph/ge_tensor.h" #include "graph/op_desc.h" diff --git a/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc b/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc index 76233f53..483575a4 100644 --- a/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc +++ b/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc @@ -16,8 +16,8 @@ #include "graph/passes/transop_nearby_allreduce_fusion_pass.h" #include "framework/common/debug/ge_log.h" -#include "common/debug/log.h" -#include "common/types.h" +#include "framework/common/debug/log.h" +#include "framework/common/types.h" #include "graph/utils/graph_utils.h" #include "graph/common/transop_util.h" diff --git a/ge/graph/passes/transop_symmetry_elimination_pass.cc b/ge/graph/passes/transop_symmetry_elimination_pass.cc index 665f4bd8..fe0e48f9 100644 --- a/ge/graph/passes/transop_symmetry_elimination_pass.cc +++ b/ge/graph/passes/transop_symmetry_elimination_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "transop_symmetry_elimination_pass.h" +#include "graph/passes/transop_symmetry_elimination_pass.h" #include "common/formats/utils/formats_trans_utils.h" #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" @@ -23,7 +23,7 @@ #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" -#include "types.h" +#include "framework/common/types.h" namespace { const std::set white_list_op{ge::TRANSPOSED, ge::RESHAPE, ge::REFORMAT, ge::CAST, ge::TRANSDATA}; diff --git a/ge/graph/passes/transop_without_reshape_fusion_pass.cc b/ge/graph/passes/transop_without_reshape_fusion_pass.cc index 7e80299b..10e619b9 100644 --- a/ge/graph/passes/transop_without_reshape_fusion_pass.cc +++ b/ge/graph/passes/transop_without_reshape_fusion_pass.cc @@ -20,8 +20,8 @@ #include #include #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "graph/common/transop_util.h" #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/passes/unused_args_clean_pass.cc b/ge/graph/passes/unused_args_clean_pass.cc index 33250311..bc338b86 100755 --- a/ge/graph/passes/unused_args_clean_pass.cc +++ b/ge/graph/passes/unused_args_clean_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "unused_args_clean_pass.h" +#include "graph/passes/unused_args_clean_pass.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/unused_args_clean_pass.h b/ge/graph/passes/unused_args_clean_pass.h index 90a146b2..400cc802 100644 --- a/ge/graph/passes/unused_args_clean_pass.h +++ b/ge/graph/passes/unused_args_clean_pass.h @@ -16,7 +16,7 @@ #ifndef GE_COMMON_CASE_ARGS_CLEAN_H_ #define GE_COMMON_CASE_ARGS_CLEAN_H_ -#include "graph/types.h" +#include "external/graph/types.h" #include "inc/graph_pass.h" #include diff --git a/ge/graph/passes/variable_op_pass.cc b/ge/graph/passes/variable_op_pass.cc index 862b7016..e803949e 100644 --- a/ge/graph/passes/variable_op_pass.cc +++ b/ge/graph/passes/variable_op_pass.cc @@ -21,7 +21,7 @@ #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" #include "graph/ge_context.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/manager/graph_var_manager.h" #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/graph/passes/variable_op_pass.h b/ge/graph/passes/variable_op_pass.h index 3b18882c..d442fdf4 100755 --- a/ge/graph/passes/variable_op_pass.h +++ b/ge/graph/passes/variable_op_pass.h @@ -19,7 +19,7 @@ #include #include #include "graph/common/transop_util.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/manager/graph_var_manager.h" #include "graph/manager/util/variable_accelerate_ctrl.h" #include "inc/graph_pass.h" diff --git a/ge/graph/passes/variable_ref_useless_control_out_delete_pass.cc b/ge/graph/passes/variable_ref_useless_control_out_delete_pass.cc index 1c8eb0ec..cac6bf75 100644 --- a/ge/graph/passes/variable_ref_useless_control_out_delete_pass.cc +++ b/ge/graph/passes/variable_ref_useless_control_out_delete_pass.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "variable_ref_useless_control_out_delete_pass.h" +#include "graph/passes/variable_ref_useless_control_out_delete_pass.h" namespace ge { Status VariableRefUselessControlOutDeletePass::Run(ge::ComputeGraphPtr graph) { diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index a73c6a96..6fd83623 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -24,9 +24,9 @@ #include "common/formats/format_transfers/format_transfer_transpose.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/util/error_manager/error_manager.h" -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "ir_build/option_utils.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" @@ -39,7 +39,7 @@ #include "graph/passes/addn_pass.h" #include "graph/passes/aicpu_constant_folding_pass.h" #include "graph/passes/assert_pass.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/passes/common_subexpression_elimination_pass.h" #include "graph/passes/cond_pass.h" #include "graph/passes/cond_remove_pass.h" @@ -79,7 +79,7 @@ #include "graph/utils/type_utils.h" #include "inc/pass_manager.h" #include "init/gelib.h" -#include "multi_batch_copy_graph.h" +#include "graph/preprocess/multi_batch_copy_graph.h" #include "graph/passes/data_pass.h" #include "graph/passes/mark_agnostic_pass.h" diff --git a/ge/graph/preprocess/graph_preprocess.h b/ge/graph/preprocess/graph_preprocess.h index 22bc566c..3dfe1797 100755 --- a/ge/graph/preprocess/graph_preprocess.h +++ b/ge/graph/preprocess/graph_preprocess.h @@ -21,13 +21,13 @@ #include #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" #include "common/model_parser/model_parser.h" #include "common/properties_manager.h" -#include "common/string_util.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/string_util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/compute_graph.h" #include "graph/manager/graph_manager_utils.h" #include "graph/manager/util/variable_accelerate_ctrl.h" @@ -35,7 +35,7 @@ #include "graph/node.h" #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" #include "runtime/context.h" namespace ge { diff --git a/ge/graph/preprocess/insert_op/base_insert_op.h b/ge/graph/preprocess/insert_op/base_insert_op.h index b0d7a7a6..6b1eb177 100644 --- a/ge/graph/preprocess/insert_op/base_insert_op.h +++ b/ge/graph/preprocess/insert_op/base_insert_op.h @@ -21,8 +21,8 @@ #include #include #include -#include "common/fmk_error_codes.h" -#include "common/types.h" +#include "framework/common/fmk_error_codes.h" +#include "framework/common/types.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" #include "proto/insert_op.pb.h" diff --git a/ge/graph/preprocess/insert_op/ge_aipp_op.cc b/ge/graph/preprocess/insert_op/ge_aipp_op.cc index 5c191af7..5d3a2a85 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.cc @@ -20,10 +20,10 @@ #include #include #include -#include "base_insert_op.h" +#include "graph/preprocess/insert_op/base_insert_op.h" #include "common/dynamic_aipp.h" #include "common/ge/ge_util.h" -#include "common/util.h" +#include "framework/common/util.h" #include "common/util/error_manager/error_manager.h" #include "external/graph/operator_factory.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/graph/preprocess/insert_op/ge_aipp_op.h b/ge/graph/preprocess/insert_op/ge_aipp_op.h index 5e509dda..87f80291 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.h +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.h @@ -19,7 +19,7 @@ #include #include -#include "common/op/attr_value_util.h" +#include "framework/common/op/attr_value_util.h" #include "graph/preprocess/insert_op/base_insert_op.h" #include "proto/insert_op.pb.h" diff --git a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc index d76b79b9..3cd26139 100755 --- a/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc @@ -20,8 +20,8 @@ #include "common/dynamic_aipp.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" diff --git a/ge/graph/preprocess/multi_batch_options.cc b/ge/graph/preprocess/multi_batch_options.cc index b3e5b616..21cbc0c2 100644 --- a/ge/graph/preprocess/multi_batch_options.cc +++ b/ge/graph/preprocess/multi_batch_options.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "multi_batch_options.h" +#include "graph/preprocess/multi_batch_options.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/omg_inner_types.h" diff --git a/ge/host_kernels/broadcast_args_kernel.cc b/ge/host_kernels/broadcast_args_kernel.cc index d8880db9..796142f4 100644 --- a/ge/host_kernels/broadcast_args_kernel.cc +++ b/ge/host_kernels/broadcast_args_kernel.cc @@ -18,9 +18,9 @@ #include -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" #include "graph/passes/pass_utils.h" diff --git a/ge/host_kernels/broadcast_gradient_args_kernel.cc b/ge/host_kernels/broadcast_gradient_args_kernel.cc index 51ff4a4c..59993171 100644 --- a/ge/host_kernels/broadcast_gradient_args_kernel.cc +++ b/ge/host_kernels/broadcast_gradient_args_kernel.cc @@ -17,9 +17,9 @@ #include -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/cast_kernel.cc b/ge/host_kernels/cast_kernel.cc index 056081a1..3f09974f 100644 --- a/ge/host_kernels/cast_kernel.cc +++ b/ge/host_kernels/cast_kernel.cc @@ -19,13 +19,13 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/fp16_t.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/concat_offset_kernel.cc b/ge/host_kernels/concat_offset_kernel.cc index b6940eb4..79552183 100644 --- a/ge/host_kernels/concat_offset_kernel.cc +++ b/ge/host_kernels/concat_offset_kernel.cc @@ -18,9 +18,9 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/concat_v2_kernel.cc b/ge/host_kernels/concat_v2_kernel.cc index 234d8c8a..c5a7d889 100644 --- a/ge/host_kernels/concat_v2_kernel.cc +++ b/ge/host_kernels/concat_v2_kernel.cc @@ -19,9 +19,9 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/fp16_t.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/dynamic_stitch_kernel.cc b/ge/host_kernels/dynamic_stitch_kernel.cc index 52f6cdcf..0313c856 100644 --- a/ge/host_kernels/dynamic_stitch_kernel.cc +++ b/ge/host_kernels/dynamic_stitch_kernel.cc @@ -20,10 +20,10 @@ #include #include "common/fp16_t.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/empty_kernel.cc b/ge/host_kernels/empty_kernel.cc index 61310abc..68ba7f9f 100644 --- a/ge/host_kernels/empty_kernel.cc +++ b/ge/host_kernels/empty_kernel.cc @@ -19,8 +19,8 @@ #include #include "common/fp16_t.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "host_kernels/kernel_utils.h" diff --git a/ge/host_kernels/expanddims_kernel.cc b/ge/host_kernels/expanddims_kernel.cc index f304fbdb..d6ea0287 100644 --- a/ge/host_kernels/expanddims_kernel.cc +++ b/ge/host_kernels/expanddims_kernel.cc @@ -18,9 +18,9 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/fill_kernel.cc b/ge/host_kernels/fill_kernel.cc index 0022791c..e41c5bf3 100644 --- a/ge/host_kernels/fill_kernel.cc +++ b/ge/host_kernels/fill_kernel.cc @@ -20,8 +20,8 @@ #include #include "common/fp16_t.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/floordiv_kernel.cc b/ge/host_kernels/floordiv_kernel.cc index df381212..566a45a3 100644 --- a/ge/host_kernels/floordiv_kernel.cc +++ b/ge/host_kernels/floordiv_kernel.cc @@ -21,8 +21,8 @@ #include #include -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/floormod_kernel.cc b/ge/host_kernels/floormod_kernel.cc index 31e4e19b..bef6d014 100644 --- a/ge/host_kernels/floormod_kernel.cc +++ b/ge/host_kernels/floormod_kernel.cc @@ -19,8 +19,8 @@ #include #include -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/gather_v2_kernel.cc b/ge/host_kernels/gather_v2_kernel.cc index 5702954c..45445143 100644 --- a/ge/host_kernels/gather_v2_kernel.cc +++ b/ge/host_kernels/gather_v2_kernel.cc @@ -20,10 +20,10 @@ #include #include "common/fp16_t.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/greater_kernel.cc b/ge/host_kernels/greater_kernel.cc index a245ec8d..3e62db04 100644 --- a/ge/host_kernels/greater_kernel.cc +++ b/ge/host_kernels/greater_kernel.cc @@ -19,10 +19,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/fp16_t.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/identity_kernel.cc b/ge/host_kernels/identity_kernel.cc index ef1446a8..30f55027 100644 --- a/ge/host_kernels/identity_kernel.cc +++ b/ge/host_kernels/identity_kernel.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "identity_kernel.h" +#include "host_kernels/identity_kernel.h" #include "inc/kernel_factory.h" #include "framework/common/types.h" diff --git a/ge/host_kernels/kernel_utils.cc b/ge/host_kernels/kernel_utils.cc index 595f9517..6447fa43 100755 --- a/ge/host_kernels/kernel_utils.cc +++ b/ge/host_kernels/kernel_utils.cc @@ -18,8 +18,8 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/host_kernels/kernel_utils.h b/ge/host_kernels/kernel_utils.h index c9c90634..7a7545ea 100755 --- a/ge/host_kernels/kernel_utils.h +++ b/ge/host_kernels/kernel_utils.h @@ -20,8 +20,8 @@ #include #include -#include "common/ge_inner_error_codes.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/compute_graph.h" diff --git a/ge/host_kernels/maximum_kernel.cc b/ge/host_kernels/maximum_kernel.cc index 2ced113f..314bc7be 100644 --- a/ge/host_kernels/maximum_kernel.cc +++ b/ge/host_kernels/maximum_kernel.cc @@ -19,10 +19,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/fp16_t.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/mul_kernel.cc b/ge/host_kernels/mul_kernel.cc index b01a5c79..e3657197 100644 --- a/ge/host_kernels/mul_kernel.cc +++ b/ge/host_kernels/mul_kernel.cc @@ -19,10 +19,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/math/math_util.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/pack_kernel.cc b/ge/host_kernels/pack_kernel.cc index bf7a2a1f..103f4029 100644 --- a/ge/host_kernels/pack_kernel.cc +++ b/ge/host_kernels/pack_kernel.cc @@ -18,10 +18,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/utils/formats_trans_utils.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" #include "host_kernels/kernel_utils.h" diff --git a/ge/host_kernels/permute_kernel.cc b/ge/host_kernels/permute_kernel.cc index 327c94f8..93d56415 100755 --- a/ge/host_kernels/permute_kernel.cc +++ b/ge/host_kernels/permute_kernel.cc @@ -19,11 +19,11 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "framework/common/debug/ge_log.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "graph/common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/range_kernel.cc b/ge/host_kernels/range_kernel.cc index 97254fff..d8f8200a 100644 --- a/ge/host_kernels/range_kernel.cc +++ b/ge/host_kernels/range_kernel.cc @@ -19,10 +19,10 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/fp16_t.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/rank_kernel.cc b/ge/host_kernels/rank_kernel.cc index b246b976..9bc404f3 100755 --- a/ge/host_kernels/rank_kernel.cc +++ b/ge/host_kernels/rank_kernel.cc @@ -19,12 +19,12 @@ #include #include -#include "graph/types.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" +#include "external/graph/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "inc/kernel_factory.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" #include "framework/common/types.h" namespace { diff --git a/ge/host_kernels/reduce_prod_kernel.cc b/ge/host_kernels/reduce_prod_kernel.cc index 4837a921..efe48997 100644 --- a/ge/host_kernels/reduce_prod_kernel.cc +++ b/ge/host_kernels/reduce_prod_kernel.cc @@ -20,8 +20,8 @@ #include #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "host_kernels/kernel_utils.h" diff --git a/ge/host_kernels/reformat_kernel.cc b/ge/host_kernels/reformat_kernel.cc index c1942983..b841ed39 100644 --- a/ge/host_kernels/reformat_kernel.cc +++ b/ge/host_kernels/reformat_kernel.cc @@ -17,10 +17,10 @@ #include "host_kernels/reformat_kernel.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/ge/ge_util.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/reshape_kernel.cc b/ge/host_kernels/reshape_kernel.cc index 7c4f58f6..bead8468 100644 --- a/ge/host_kernels/reshape_kernel.cc +++ b/ge/host_kernels/reshape_kernel.cc @@ -16,9 +16,9 @@ #include "host_kernels/reshape_kernel.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/rsqrt_kernel.cc b/ge/host_kernels/rsqrt_kernel.cc index 74c78787..f1f74a99 100755 --- a/ge/host_kernels/rsqrt_kernel.cc +++ b/ge/host_kernels/rsqrt_kernel.cc @@ -19,10 +19,10 @@ #include -#include "common/debug/ge_log.h" -#include "common/debug/log.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/debug/ge_log.h" +#include "framework/common/debug/log.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/size_kernel.cc b/ge/host_kernels/size_kernel.cc index caa5febc..9f7bc0ff 100644 --- a/ge/host_kernels/size_kernel.cc +++ b/ge/host_kernels/size_kernel.cc @@ -19,8 +19,8 @@ #include #include -#include "common/debug/log.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/debug/log.h" +#include "framework/common/op/ge_op_utils.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" @@ -28,7 +28,7 @@ #include "host_kernels/kernel_utils.h" #include "graph/passes/pass_utils.h" #include "inc/kernel_factory.h" -#include "omg/omg_inner_types.h" +#include "framework/omg/omg_inner_types.h" namespace ge { namespace { diff --git a/ge/host_kernels/slice_d_kernel.cc b/ge/host_kernels/slice_d_kernel.cc index b8572290..60caac38 100644 --- a/ge/host_kernels/slice_d_kernel.cc +++ b/ge/host_kernels/slice_d_kernel.cc @@ -19,8 +19,8 @@ #include #include "common/fp16_t.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/host_kernels/slice_kernel.cc b/ge/host_kernels/slice_kernel.cc index 6e398e96..0b1e7325 100644 --- a/ge/host_kernels/slice_kernel.cc +++ b/ge/host_kernels/slice_kernel.cc @@ -18,10 +18,10 @@ #include -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/type_utils.h" #include "host_kernels/kernel_utils.h" diff --git a/ge/host_kernels/squeeze_kernel.cc b/ge/host_kernels/squeeze_kernel.cc index 4a2c6725..852a46a1 100644 --- a/ge/host_kernels/squeeze_kernel.cc +++ b/ge/host_kernels/squeeze_kernel.cc @@ -16,9 +16,9 @@ #include "host_kernels/squeeze_kernel.h" -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/ssd_prior_box_kernel.cc b/ge/host_kernels/ssd_prior_box_kernel.cc index 3661fa9d..496cc185 100644 --- a/ge/host_kernels/ssd_prior_box_kernel.cc +++ b/ge/host_kernels/ssd_prior_box_kernel.cc @@ -23,7 +23,7 @@ #include "common/math/math_util.h" #include "common/math_util.h" -#include "common/types.h" +#include "framework/common/types.h" #include "framework/common/util.h" #include "graph/debug/ge_attr_define.h" #include "graph/passes/pass_utils.h" diff --git a/ge/host_kernels/sub_kernel.cc b/ge/host_kernels/sub_kernel.cc index deb36cb3..84c334b0 100644 --- a/ge/host_kernels/sub_kernel.cc +++ b/ge/host_kernels/sub_kernel.cc @@ -20,9 +20,9 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/transdata_kernel.cc b/ge/host_kernels/transdata_kernel.cc index 2b16b075..a06db78b 100644 --- a/ge/host_kernels/transdata_kernel.cc +++ b/ge/host_kernels/transdata_kernel.cc @@ -19,13 +19,13 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" #include "common/fp16_t.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/common/bcast.h" diff --git a/ge/host_kernels/transpose_kernel.cc b/ge/host_kernels/transpose_kernel.cc index 03d112aa..9291ecf5 100755 --- a/ge/host_kernels/transpose_kernel.cc +++ b/ge/host_kernels/transpose_kernel.cc @@ -17,13 +17,13 @@ #include "host_kernels/transpose_kernel.h" #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/formats/format_transfers/format_transfer_transpose.h" #include "common/formats/formats.h" #include "common/formats/utils/formats_trans_utils.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "host_kernels/kernel_utils.h" diff --git a/ge/host_kernels/unpack_kernel.cc b/ge/host_kernels/unpack_kernel.cc index 1c28151f..a90e3616 100755 --- a/ge/host_kernels/unpack_kernel.cc +++ b/ge/host_kernels/unpack_kernel.cc @@ -15,10 +15,10 @@ */ #include "host_kernels/unpack_kernel.h" -#include "common/debug/ge_log.h" -#include "common/op/ge_op_utils.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/debug/ge_log.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/unsqueeze_kernel.cc b/ge/host_kernels/unsqueeze_kernel.cc index 4ceaba3f..d2b0d05f 100644 --- a/ge/host_kernels/unsqueeze_kernel.cc +++ b/ge/host_kernels/unsqueeze_kernel.cc @@ -16,9 +16,9 @@ #include "host_kernels/unsqueeze_kernel.h" #include -#include "common/ge_inner_error_codes.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "host_kernels/kernel_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/hybrid/common/npu_memory_allocator.cc b/ge/hybrid/common/npu_memory_allocator.cc index b66038d9..8a9aa0cc 100644 --- a/ge/hybrid/common/npu_memory_allocator.cc +++ b/ge/hybrid/common/npu_memory_allocator.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "npu_memory_allocator.h" +#include "hybrid/common/npu_memory_allocator.h" #include #include "framework/common/debug/log.h" #include "graph/manager/graph_mem_manager.h" diff --git a/ge/hybrid/common/npu_memory_allocator.h b/ge/hybrid/common/npu_memory_allocator.h index 55cb13ad..8df89108 100644 --- a/ge/hybrid/common/npu_memory_allocator.h +++ b/ge/hybrid/common/npu_memory_allocator.h @@ -23,7 +23,7 @@ #include #include #include "external/ge/ge_api_error_codes.h" -#include "memory/memory_api.h" +#include "framework/memory/memory_api.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/common/tensor_value.h b/ge/hybrid/common/tensor_value.h index 348e4e6d..c20074fd 100644 --- a/ge/hybrid/common/tensor_value.h +++ b/ge/hybrid/common/tensor_value.h @@ -20,7 +20,7 @@ #include #include #include -#include "memory/memory_api.h" +#include "framework/memory/memory_api.h" #include "framework/common/util.h" namespace ge { diff --git a/ge/hybrid/executor/hybrid_execution_context.cc b/ge/hybrid/executor/hybrid_execution_context.cc index 0f978bf8..2de9b1ce 100644 --- a/ge/hybrid/executor/hybrid_execution_context.cc +++ b/ge/hybrid/executor/hybrid_execution_context.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hybrid_execution_context.h" +#include "hybrid/executor/hybrid_execution_context.h" #include namespace ge { diff --git a/ge/hybrid/executor/hybrid_model_async_executor.cc b/ge/hybrid/executor/hybrid_model_async_executor.cc index 930412e3..1519a880 100644 --- a/ge/hybrid/executor/hybrid_model_async_executor.cc +++ b/ge/hybrid/executor/hybrid_model_async_executor.cc @@ -19,7 +19,7 @@ #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "graph/ge_context.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/graph_caching_allocator.h" #include "graph/manager/graph_mem_allocator.h" diff --git a/ge/hybrid/executor/hybrid_model_executor.cc b/ge/hybrid/executor/hybrid_model_executor.cc index 9bf70d26..58da451c 100755 --- a/ge/hybrid/executor/hybrid_model_executor.cc +++ b/ge/hybrid/executor/hybrid_model_executor.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hybrid_model_executor.h" +#include "hybrid/executor/hybrid_model_executor.h" #include "graph/ge_context.h" #include "graph/runtime_inference_context.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/hybrid/executor/hybrid_model_pipeline_executor.cc b/ge/hybrid/executor/hybrid_model_pipeline_executor.cc index c0bd5c7d..45e61138 100644 --- a/ge/hybrid/executor/hybrid_model_pipeline_executor.cc +++ b/ge/hybrid/executor/hybrid_model_pipeline_executor.cc @@ -1,4 +1,20 @@ -#include "hybrid_model_pipeline_executor.h" +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "hybrid/executor/hybrid_model_pipeline_executor.h" #include "common/math/math_util.h" #include "common/dump/dump_manager.h" diff --git a/ge/hybrid/executor/hybrid_model_pipeline_executor.h b/ge/hybrid/executor/hybrid_model_pipeline_executor.h index c59e1462..f694c4e4 100644 --- a/ge/hybrid/executor/hybrid_model_pipeline_executor.h +++ b/ge/hybrid/executor/hybrid_model_pipeline_executor.h @@ -1,3 +1,19 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #ifndef GE_HYBRID_EXECUTOR_HYBRID_MODEL_PIPELINE_EXECUTOR_H_ #define GE_HYBRID_EXECUTOR_HYBRID_MODEL_PIPELINE_EXECUTOR_H_ @@ -6,7 +22,7 @@ #include "hybrid/executor/hybrid_execution_context.h" #include "hybrid/executor/rt_callback_manager.h" #include "hybrid/executor/subgraph_executor.h" -#include "hybrid_model_executor.h" +#include "hybrid/executor/hybrid_model_executor.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/executor/hybrid_profiler.cc b/ge/hybrid/executor/hybrid_profiler.cc index 384dc770..f9231a39 100644 --- a/ge/hybrid/executor/hybrid_profiler.cc +++ b/ge/hybrid/executor/hybrid_profiler.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hybrid_profiler.h" +#include "hybrid/executor/hybrid_profiler.h" #include #include #include diff --git a/ge/hybrid/executor/node_state.h b/ge/hybrid/executor/node_state.h index b80b60b0..727402f1 100644 --- a/ge/hybrid/executor/node_state.h +++ b/ge/hybrid/executor/node_state.h @@ -24,7 +24,7 @@ #include "common/blocking_queue.h" #include "external/ge/ge_api_error_codes.h" #include "hybrid/model/node_item.h" -#include "node_done_manager.h" +#include "hybrid/executor/node_done_manager.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/executor/rt_callback_manager.h b/ge/hybrid/executor/rt_callback_manager.h index 9c062134..15b0dede 100644 --- a/ge/hybrid/executor/rt_callback_manager.h +++ b/ge/hybrid/executor/rt_callback_manager.h @@ -23,7 +23,7 @@ #include #include "common/blocking_queue.h" -#include "ge/ge_api_error_codes.h" +#include "external/ge/ge_api_error_codes.h" #include "runtime/rt.h" namespace ge { diff --git a/ge/hybrid/executor/subgraph_context.cc b/ge/hybrid/executor/subgraph_context.cc index 5e97a9a2..4b748e3f 100644 --- a/ge/hybrid/executor/subgraph_context.cc +++ b/ge/hybrid/executor/subgraph_context.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "subgraph_context.h" +#include "hybrid/executor/subgraph_context.h" #include "hybrid/executor/hybrid_model_executor.h" namespace ge { diff --git a/ge/hybrid/hybrid_davinci_model.cc b/ge/hybrid/hybrid_davinci_model.cc index 7368784c..c4500b6d 100755 --- a/ge/hybrid/hybrid_davinci_model.cc +++ b/ge/hybrid/hybrid_davinci_model.cc @@ -15,7 +15,7 @@ */ #include -#include "hybrid_davinci_model.h" +#include "hybrid/hybrid_davinci_model.h" #include "hybrid/model/hybrid_model.h" #include "hybrid/executor/hybrid_model_async_executor.h" #include "hybrid/node_executor/node_executor.h" diff --git a/ge/hybrid/hybrid_davinci_model_stub.cc b/ge/hybrid/hybrid_davinci_model_stub.cc index 67cd29b8..b8a2f242 100644 --- a/ge/hybrid/hybrid_davinci_model_stub.cc +++ b/ge/hybrid/hybrid_davinci_model_stub.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hybrid_davinci_model.h" +#include "hybrid/hybrid_davinci_model.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/model/graph_item.cc b/ge/hybrid/model/graph_item.cc index c38e0a0d..ca23108d 100644 --- a/ge/hybrid/model/graph_item.cc +++ b/ge/hybrid/model/graph_item.cc @@ -15,7 +15,7 @@ */ #include "framework/common/util.h" -#include "graph_item.h" +#include "hybrid/model/graph_item.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/model/hybrid_model.cc b/ge/hybrid/model/hybrid_model.cc index 5e496c3b..e6ddbb8d 100644 --- a/ge/hybrid/model/hybrid_model.cc +++ b/ge/hybrid/model/hybrid_model.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "hybrid_model.h" +#include "hybrid/model/hybrid_model.h" #include #include "graph/debug/ge_attr_define.h" #include "graph/load/model_manager/model_utils.h" @@ -25,7 +25,7 @@ #include "hybrid/common/npu_memory_allocator.h" #include "hybrid/model/hybrid_model_builder.h" #include "hybrid/node_executor/node_executor.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index 5337a0cf..d3f00253 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -17,7 +17,7 @@ #include "hybrid/model/hybrid_model_builder.h" #include #include "common/math/math_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/ge_context.h" #include "graph/build/memory/var_mem_assign_util.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/hybrid/model/node_item.cc b/ge/hybrid/model/node_item.cc index cef06fc6..5c3d7db3 100644 --- a/ge/hybrid/model/node_item.cc +++ b/ge/hybrid/model/node_item.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "node_item.h" +#include "hybrid/model/node_item.h" #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "graph/common/omg_util.h" #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_node_executor.cc b/ge/hybrid/node_executor/aicore/aicore_node_executor.cc index 7ebb9e39..c2ce24a4 100755 --- a/ge/hybrid/node_executor/aicore/aicore_node_executor.cc +++ b/ge/hybrid/node_executor/aicore/aicore_node_executor.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "aicore_node_executor.h" +#include "hybrid/node_executor/aicore/aicore_node_executor.h" #include "framework/common/taskdown_common.h" #include "hybrid/executor/hybrid_execution_context.h" #include "external/runtime/rt_error_codes.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.cc b/ge/hybrid/node_executor/aicore/aicore_op_task.cc index 76082cb3..bca79d7f 100644 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.cc +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.cc @@ -21,7 +21,7 @@ #include "hybrid/executor/hybrid_execution_context.h" #include "hybrid/node_executor/aicore/aicore_task_builder.h" #include "graph/load/model_manager/tbe_handle_store.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "single_op/task/build_task_utils.h" #include "single_op/task/tbe_task_builder.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_op_task.h b/ge/hybrid/node_executor/aicore/aicore_op_task.h index 3c8db8c9..b03bd9e4 100755 --- a/ge/hybrid/node_executor/aicore/aicore_op_task.h +++ b/ge/hybrid/node_executor/aicore/aicore_op_task.h @@ -19,7 +19,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "runtime/stream.h" #include "hybrid/common/tensor_value.h" #include "hybrid/node_executor/task_context.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_task_builder.cc b/ge/hybrid/node_executor/aicore/aicore_task_builder.cc index 114451b3..0ba71fe4 100755 --- a/ge/hybrid/node_executor/aicore/aicore_task_builder.cc +++ b/ge/hybrid/node_executor/aicore/aicore_task_builder.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "aicore_task_builder.h" -#include "common/debug/log.h" -#include "aicore_node_executor.h" +#include "hybrid/node_executor/aicore/aicore_task_builder.h" +#include "framework/common/debug/log.h" +#include "hybrid/node_executor/aicore/aicore_node_executor.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/node_executor/aicore/aicore_task_builder.h b/ge/hybrid/node_executor/aicore/aicore_task_builder.h index 6a472a21..e57538ba 100755 --- a/ge/hybrid/node_executor/aicore/aicore_task_builder.h +++ b/ge/hybrid/node_executor/aicore/aicore_task_builder.h @@ -19,7 +19,7 @@ #include #include -#include "aicore_op_task.h" +#include "hybrid/node_executor/aicore/aicore_op_task.h" #include "framework/common/debug/ge_log.h" #include "graph/utils/attr_utils.h" #include "graph/op_kernel_bin.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_task_compiler.cc b/ge/hybrid/node_executor/aicore/aicore_task_compiler.cc index 0cdea5d5..43563bb6 100755 --- a/ge/hybrid/node_executor/aicore/aicore_task_compiler.cc +++ b/ge/hybrid/node_executor/aicore/aicore_task_compiler.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "aicore_task_compiler.h" +#include "hybrid/node_executor/aicore/aicore_task_compiler.h" #include "framework/common/debug/log.h" #include "graph/debug/ge_attr_define.h" #include "opskernel_manager/ops_kernel_builder_manager.h" diff --git a/ge/hybrid/node_executor/aicore/aicore_task_compiler.h b/ge/hybrid/node_executor/aicore/aicore_task_compiler.h index 4cb4dc58..2778aeb0 100755 --- a/ge/hybrid/node_executor/aicore/aicore_task_compiler.h +++ b/ge/hybrid/node_executor/aicore/aicore_task_compiler.h @@ -19,7 +19,7 @@ #include #include "opskernel_manager/ops_kernel_manager.h" -#include "aicore_node_executor.h" +#include "hybrid/node_executor/aicore/aicore_node_executor.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.h b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.h index 7577d486..14bc8fcc 100644 --- a/ge/hybrid/node_executor/aicpu/aicpu_node_executor.h +++ b/ge/hybrid/node_executor/aicpu/aicpu_node_executor.h @@ -20,7 +20,7 @@ #include "external/graph/types.h" #include "cce/aicpu_engine_struct.h" #include "hybrid/node_executor/node_executor.h" -#include "aicpu_ext_info.h" +#include "hybrid/node_executor/aicpu/aicpu_ext_info.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc index 8b839849..4db223e0 100755 --- a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc +++ b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc @@ -20,7 +20,7 @@ #include "framework/common/fmk_error_codes.h" #include "common/dump/dump_manager.h" #include "common/ge/ge_util.h" -#include "graph/attr_value.h" +#include "external/graph/attr_value.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/load/model_manager/model_utils.h" diff --git a/ge/hybrid/node_executor/controlop/control_op_executor.cc b/ge/hybrid/node_executor/controlop/control_op_executor.cc index d55607ff..fa44d761 100644 --- a/ge/hybrid/node_executor/controlop/control_op_executor.cc +++ b/ge/hybrid/node_executor/controlop/control_op_executor.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "control_op_executor.h" +#include "hybrid/node_executor/controlop/control_op_executor.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" #include "hybrid/executor/hybrid_execution_context.h" diff --git a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc index 72092cd8..522d0649 100644 --- a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc +++ b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc @@ -17,11 +17,11 @@ #include "hybrid/node_executor/hccl/hccl_node_executor.h" #include "common/ge/plugin_manager.h" #include "common/math/math_util.h" -#include "graph/attr_value.h" +#include "external/graph/attr_value.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/util/hcom_util.h" #include "graph/utils/type_utils.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "hybrid/executor/hybrid_execution_context.h" #include "hccl/hcom.h" diff --git a/ge/hybrid/node_executor/node_executor.h b/ge/hybrid/node_executor/node_executor.h index fffd4e7d..ad4a9296 100644 --- a/ge/hybrid/node_executor/node_executor.h +++ b/ge/hybrid/node_executor/node_executor.h @@ -20,7 +20,7 @@ #include "external/ge/ge_api_error_codes.h" #include "common/opskernel/ops_kernel_builder.h" #include "graph/node.h" -#include "task_context.h" +#include "hybrid/node_executor/task_context.h" namespace ge { const uint32_t MEMORY_ALIGN_RATIO = 2; diff --git a/ge/hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc b/ge/hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc index 28a5dea1..ad1f7e61 100755 --- a/ge/hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc +++ b/ge/hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "partitioned_call_node_executor.h" +#include "hybrid/node_executor/partitioned_call/partitioned_call_node_executor.h" #include "graph/utils/node_utils.h" namespace ge { diff --git a/ge/hybrid/node_executor/rts/rts_node_executor.cc b/ge/hybrid/node_executor/rts/rts_node_executor.cc index 3ad791b6..5cd971df 100644 --- a/ge/hybrid/node_executor/rts/rts_node_executor.cc +++ b/ge/hybrid/node_executor/rts/rts_node_executor.cc @@ -17,9 +17,9 @@ #include "hybrid/node_executor/rts/rts_node_executor.h" #include "hybrid/node_executor/rts/rts_task_factory.h" -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" -#include "common/types.h" +#include "framework/common/types.h" #include "graph/common/omg_util.h" #include "graph/utils/tensor_utils.h" #include "hybrid/model/hybrid_model.h" diff --git a/ge/hybrid/node_executor/rts/rts_node_task.cc b/ge/hybrid/node_executor/rts/rts_node_task.cc index 104196ee..9af54815 100644 --- a/ge/hybrid/node_executor/rts/rts_node_task.cc +++ b/ge/hybrid/node_executor/rts/rts_node_task.cc @@ -22,7 +22,7 @@ #include "graph/utils/type_utils.h" #include "graph/utils/node_utils.h" #include "common/ge/ge_util.h" -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" namespace { constexpr uint8_t kSwitchPredIndex = 0; diff --git a/ge/hybrid/node_executor/task_context.cc b/ge/hybrid/node_executor/task_context.cc index fe580c1e..78ccb54a 100644 --- a/ge/hybrid/node_executor/task_context.cc +++ b/ge/hybrid/node_executor/task_context.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "task_context.h" +#include "hybrid/node_executor/task_context.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/log.h" #include "graph/utils/tensor_utils.h" -#include "graph/types.h" +#include "external/graph/types.h" #include "graph/debug/ge_attr_define.h" #include "hybrid/executor/hybrid_execution_context.h" #include "hybrid/executor/subgraph_executor.h" diff --git a/ge/inc/graph_pass.h b/ge/inc/graph_pass.h index 642b94ea..a9cc7a32 100644 --- a/ge/inc/graph_pass.h +++ b/ge/inc/graph_pass.h @@ -20,9 +20,9 @@ #include #include -#include "common/op/attr_value_util.h" -#include "common/op/ge_op_utils.h" -#include "common/types.h" +#include "framework/common/op/attr_value_util.h" +#include "framework/common/op/ge_op_utils.h" +#include "framework/common/types.h" #include "framework/common/debug/ge_log.h" #include "graph/compute_graph.h" #include "graph/utils/attr_utils.h" diff --git a/ge/inc/kernel.h b/ge/inc/kernel.h index 84af5234..a83776a9 100644 --- a/ge/inc/kernel.h +++ b/ge/inc/kernel.h @@ -19,9 +19,9 @@ #include -#include "common/op/ge_op_utils.h" +#include "framework/common/op/ge_op_utils.h" #include "graph/compute_graph.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/op_desc.h" using std::vector; diff --git a/ge/inc/kernel_factory.h b/ge/inc/kernel_factory.h index 61455836..e532b894 100644 --- a/ge/inc/kernel_factory.h +++ b/ge/inc/kernel_factory.h @@ -24,7 +24,7 @@ #include "common/ge/ge_util.h" #include "framework/common/debug/ge_log.h" -#include "graph/graph.h" +#include "external/graph/graph.h" using std::string; diff --git a/ge/inc/pass.h b/ge/inc/pass.h index 9f8519e1..56f77fef 100644 --- a/ge/inc/pass.h +++ b/ge/inc/pass.h @@ -19,7 +19,7 @@ #include -#include "common/fmk_error_codes.h" +#include "framework/common/fmk_error_codes.h" namespace ge { /// diff --git a/ge/init/gelib.cc b/ge/init/gelib.cc index 2374e75f..b34871a9 100644 --- a/ge/init/gelib.cc +++ b/ge/init/gelib.cc @@ -33,7 +33,7 @@ #include "framework/common/util.h" #include "framework/omg/ge_init.h" #include "analyzer/analyzer.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "ge_local_engine/engine/host_cpu_engine.h" #include "graph/common/ge_call_wrapper.h" #include "graph/ge_context.h" diff --git a/ge/init/gelib.h b/ge/init/gelib.h index ed6fe5d4..eb367578 100644 --- a/ge/init/gelib.h +++ b/ge/init/gelib.h @@ -23,8 +23,8 @@ #include "engine_manager/dnnengine_manager.h" #include "opskernel_manager/ops_kernel_manager.h" #include "session/session_manager.h" -#include "common/ge_inner_error_codes.h" -#include "common/ge_types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "framework/common/ge_types.h" using std::string; using std::map; diff --git a/ge/ir_build/attr_options/attr_options.h b/ge/ir_build/attr_options/attr_options.h index 7c0f4f4f..b1b794c0 100644 --- a/ge/ir_build/attr_options/attr_options.h +++ b/ge/ir_build/attr_options/attr_options.h @@ -1,29 +1,29 @@ -/** - * Copyright 2020 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef ATTR_OPTIONS_H_ -#define ATTR_OPTIONS_H_ - -#include -#include "graph/compute_graph.h" -#include "graph/ge_error_codes.h" - -namespace ge { -bool IsOriginalOpFind(OpDescPtr &op_desc, const std::string &op_name); - -graphStatus KeepDtypeFunc(ComputeGraphPtr &graph, const std::string &cfg_path); -graphStatus WeightCompressFunc(ComputeGraphPtr &graph, const std::string &cfg_path); -} // namespace +/** + * Copyright 2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ATTR_OPTIONS_H_ +#define ATTR_OPTIONS_H_ + +#include +#include "graph/compute_graph.h" +#include "external/graph/ge_error_codes.h" + +namespace ge { +bool IsOriginalOpFind(OpDescPtr &op_desc, const std::string &op_name); + +graphStatus KeepDtypeFunc(ComputeGraphPtr &graph, const std::string &cfg_path); +graphStatus WeightCompressFunc(ComputeGraphPtr &graph, const std::string &cfg_path); +} // namespace #endif // ATTR_OPTIONS_H_ \ No newline at end of file diff --git a/ge/ir_build/attr_options/keep_dtype_option.cc b/ge/ir_build/attr_options/keep_dtype_option.cc index dfdd0df3..9da08cc0 100644 --- a/ge/ir_build/attr_options/keep_dtype_option.cc +++ b/ge/ir_build/attr_options/keep_dtype_option.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "attr_options.h" +#include "ir_build/attr_options/attr_options.h" #include #include #include diff --git a/ge/ir_build/attr_options/utils.cc b/ge/ir_build/attr_options/utils.cc index f0b559ec..ed63ffe3 100644 --- a/ge/ir_build/attr_options/utils.cc +++ b/ge/ir_build/attr_options/utils.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "attr_options.h" +#include "ir_build/attr_options/attr_options.h" #include #include "graph/debug/ge_attr_define.h" #include "common/util/error_manager/error_manager.h" diff --git a/ge/ir_build/attr_options/weight_compress_option.cc b/ge/ir_build/attr_options/weight_compress_option.cc index 3c057d04..b59c6adc 100644 --- a/ge/ir_build/attr_options/weight_compress_option.cc +++ b/ge/ir_build/attr_options/weight_compress_option.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "attr_options.h" +#include "ir_build/attr_options/attr_options.h" #include #include #include diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index befffa93..ea521f5b 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -25,8 +25,8 @@ #include "framework/common/util.h" #include "framework/omg/omg_inner_types.h" #include "framework/omg/omg_inner_types.h" -#include "ge/ge_api_types.h" -#include "generator/ge_generator.h" +#include "external/ge/ge_api_types.h" +#include "framework/generator/ge_generator.h" #include "graph/compute_graph.h" #include "graph/ge_tensor.h" #include "graph/utils/type_utils.h" diff --git a/ge/ir_build/option_utils.cc b/ge/ir_build/option_utils.cc index cecc2588..e2665eac 100755 --- a/ge/ir_build/option_utils.cc +++ b/ge/ir_build/option_utils.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "option_utils.h" +#include "ir_build/option_utils.h" #include "common/util/error_manager/error_manager.h" #include "external/ge/ge_api_types.h" #include "framework/common/string_util.h" diff --git a/ge/model/ge_model.cc b/ge/model/ge_model.cc index bcccc6f8..1bf35afc 100755 --- a/ge/model/ge_model.cc +++ b/ge/model/ge_model.cc @@ -16,7 +16,7 @@ #include "model/ge_model.h" #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/attr_utils.h" diff --git a/ge/model/ge_model.h b/ge/model/ge_model.h index 08db8cc3..6356c621 100755 --- a/ge/model/ge_model.h +++ b/ge/model/ge_model.h @@ -26,7 +26,7 @@ #include "framework/common/debug/log.h" #include "framework/common/fmk_error_codes.h" #include "graph/buffer.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "proto/task.pb.h" namespace ge { diff --git a/ge/model/ge_root_model.cc b/ge/model/ge_root_model.cc index 68f868dd..b6a1e175 100644 --- a/ge/model/ge_root_model.cc +++ b/ge/model/ge_root_model.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ge_root_model.h" +#include "model/ge_root_model.h" #include "graph/debug/ge_attr_define.h" namespace ge { void GeRootModel::SetSubgraphInstanceNameToModel(string instance_name, GeModelPtr ge_model) { diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index a520652f..3a320226 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -30,25 +30,17 @@ target_compile_definitions(atc_atc.bin PRIVATE target_include_directories(atc_atc.bin PRIVATE ${CMAKE_CURRENT_LIST_DIR} - ${GE_CODE_DIR} ${GE_CODE_DIR}/ge ${GE_CODE_DIR}/inc/external - ${GE_CODE_DIR}/common/inc/external - ${GE_CODE_DIR}/common/inc/external/graph ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc - ${METADEF_DIR}/inc/graph - ${METADEF_DIR}/inc/register ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/external/register ${PARSER_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/common #### blue zone #### ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain @@ -107,25 +99,17 @@ target_compile_definitions(fwk_atc.bin PRIVATE target_include_directories(fwk_atc.bin PRIVATE ${CMAKE_CURRENT_LIST_DIR} - ${GE_CODE_DIR} ${GE_CODE_DIR}/ge ${GE_CODE_DIR}/inc/external - ${GE_CODE_DIR}/common/inc/external - ${GE_CODE_DIR}/common/inc/external/graph ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc - ${METADEF_DIR}/inc/graph - ${METADEF_DIR}/inc/register ${METADEF_DIR}/inc/external - ${METADEF_DIR}/inc/external/graph - ${METADEF_DIR}/inc/external/register ${PARSER_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/graphengine_protos #### yellow zone #### ${GE_CODE_DIR}/../inc - ${GE_CODE_DIR}/../inc/common #### blue zone #### ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain diff --git a/ge/offline/main.cc b/ge/offline/main.cc index a1ae476b..80a71b7f 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -23,26 +23,26 @@ #include #include #include -#include "common/gflags_util.h" -#include "common/util.h" +#include "framework/common/gflags_util.h" +#include "framework/common/util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" -#include "ge/ge_api.h" -#include "generator/ge_generator.h" +#include "external/ge/ge_api.h" +#include "framework/generator/ge_generator.h" #include "graph/anchor.h" #include "graph/debug/ge_attr_define.h" -#include "graph/graph.h" +#include "external/graph/graph.h" #include "graph/op_desc.h" #include "graph/utils/graph_utils.h" #include "graph/utils/type_utils.h" #include "init/gelib.h" #include "ir_build/option_utils.h" -#include "omg/omg.h" -#include "omg/parser/parser_factory.h" -#include "omg/parser/parser_inner_ctx.h" +#include "framework/omg/omg.h" +#include "framework/omg/parser/parser_factory.h" +#include "framework/omg/parser/parser_inner_ctx.h" #include "parser/common/register_tbe.h" #include "register/op_registry.h" -#include "single_op_parser.h" +#include "offline/single_op_parser.h" #include "external/ge/ge_ir_build.h" using domi::BuildMode; diff --git a/ge/offline/single_op_parser.cc b/ge/offline/single_op_parser.cc index dac2e15c..6bc5cb3d 100644 --- a/ge/offline/single_op_parser.cc +++ b/ge/offline/single_op_parser.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "single_op_parser.h" +#include "offline/single_op_parser.h" #include #include @@ -24,7 +24,7 @@ #include "framework/common/debug/ge_log.h" #include "common/util/error_manager/error_manager.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/common/util.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/offline/single_op_parser.h b/ge/offline/single_op_parser.h index 11f5512e..25699552 100644 --- a/ge/offline/single_op_parser.h +++ b/ge/offline/single_op_parser.h @@ -21,8 +21,8 @@ #include -#include "ge/ge_api_error_codes.h" -#include "graph/types.h" +#include "external/ge/ge_api_error_codes.h" +#include "external/graph/types.h" #include "graph/ge_attr_value.h" #include "graph/op_desc.h" diff --git a/ge/opskernel_manager/ops_kernel_builder_manager.cc b/ge/opskernel_manager/ops_kernel_builder_manager.cc index 04262e1b..33ffddf5 100644 --- a/ge/opskernel_manager/ops_kernel_builder_manager.cc +++ b/ge/opskernel_manager/ops_kernel_builder_manager.cc @@ -15,7 +15,7 @@ */ #include "init/gelib.h" -#include "ops_kernel_builder_manager.h" +#include "opskernel_manager/ops_kernel_builder_manager.h" #include "register/ops_kernel_builder_registry.h" namespace ge { diff --git a/ge/opskernel_manager/ops_kernel_manager.cc b/ge/opskernel_manager/ops_kernel_manager.cc index ac5e9153..fc7bbdc2 100644 --- a/ge/opskernel_manager/ops_kernel_manager.cc +++ b/ge/opskernel_manager/ops_kernel_manager.cc @@ -24,9 +24,9 @@ #include #include #include -#include "../init/gelib.h" +#include "init/gelib.h" #include "framework/common/debug/ge_log.h" -#include "ge/ge_api.h" +#include "external/ge/ge_api.h" #include "proto/optimizer_priority.pb.h" namespace { diff --git a/ge/opskernel_manager/ops_kernel_manager.h b/ge/opskernel_manager/ops_kernel_manager.h index 19d703e3..5a72dc50 100644 --- a/ge/opskernel_manager/ops_kernel_manager.h +++ b/ge/opskernel_manager/ops_kernel_manager.h @@ -23,15 +23,15 @@ #include #include -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/ge/plugin_manager.h" #include "common/ge/op_tiling_manager.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "common/opskernel/ops_kernel_info_store.h" #include "common/optimizer/graph_optimizer.h" #include "graph/optimize/graph_optimize.h" #include "framework/common/ge_inner_error_codes.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "runtime/base.h" using std::string; diff --git a/ge/plugin/engine/CMakeLists.txt b/ge/plugin/engine/CMakeLists.txt index b4ea9c52..b8628ad1 100644 --- a/ge/plugin/engine/CMakeLists.txt +++ b/ge/plugin/engine/CMakeLists.txt @@ -24,9 +24,8 @@ target_compile_definitions(engine PRIVATE target_include_directories(engine PRIVATE ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/inc/ + ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework - ${GE_CODE_DIR}/inc/framework/common ${GE_CODE_DIR}/inc/external ${METADEF_DIR}/inc ${METADEF_DIR}/inc/external diff --git a/ge/plugin/engine/dnnengines.h b/ge/plugin/engine/dnnengines.h index 0633c104..829c83f1 100644 --- a/ge/plugin/engine/dnnengines.h +++ b/ge/plugin/engine/dnnengines.h @@ -21,7 +21,7 @@ #include #include -#include "engine/dnnengine.h" +#include "framework/engine/dnnengine.h" #include "plugin/engine/engine_manage.h" namespace ge { diff --git a/ge/plugin/engine/engine_manage.h b/ge/plugin/engine/engine_manage.h index 7eb88805..a047e5de 100644 --- a/ge/plugin/engine/engine_manage.h +++ b/ge/plugin/engine/engine_manage.h @@ -36,7 +36,7 @@ #include #include -#include "engine/dnnengine.h" +#include "framework/engine/dnnengine.h" namespace ge { using DNNEnginePtr = std::shared_ptr; diff --git a/ge/session/inner_session.cc b/ge/session/inner_session.cc index 8248eecf..aabbe19c 100755 --- a/ge/session/inner_session.cc +++ b/ge/session/inner_session.cc @@ -24,7 +24,7 @@ #include "adx_datadump_server.h" #include "common/dump/dump_properties.h" #include "common/dump/dump_manager.h" -#include "common/util.h" +#include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/ge_context.h" #include "graph/ge_global_options.h" diff --git a/ge/session/inner_session.h b/ge/session/inner_session.h index a2ec35df..35fe4692 100644 --- a/ge/session/inner_session.h +++ b/ge/session/inner_session.h @@ -21,7 +21,7 @@ #include #include #include "framework/common/ge_types.h" -#include "ge/ge_api_types.h" +#include "external/ge/ge_api_types.h" #include "graph/manager/graph_manager.h" namespace ge { diff --git a/ge/session/omg.cc b/ge/session/omg.cc index 878b0b39..f7f3def7 100755 --- a/ge/session/omg.cc +++ b/ge/session/omg.cc @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "omg/omg.h" +#include "framework/omg/omg.h" #include #include #include #include "common/auth/file_saver.h" -#include "common/debug/log.h" +#include "framework/common/debug/log.h" #include "common/debug/memory_dumper.h" #include "common/ge/ge_util.h" -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "common/model_parser/model_parser.h" #include "common/model_saver.h" #include "common/properties_manager.h" -#include "common/string_util.h" -#include "common/types.h" -#include "common/util.h" +#include "framework/common/string_util.h" +#include "framework/common/types.h" +#include "framework/common/util.h" #include "common/util/error_manager/error_manager.h" #include "framework/common/debug/ge_log.h" #include "framework/omg/parser/parser_inner_ctx.h" @@ -39,10 +39,10 @@ #include "graph/optimize/common/params.h" #include "graph/utils/type_utils.h" #include "ir_build/option_utils.h" -#include "omg/omg_inner_types.h" -#include "omg/parser/model_parser.h" -#include "omg/parser/parser_factory.h" -#include "omg/parser/weights_parser.h" +#include "framework/omg/omg_inner_types.h" +#include "framework/omg/parser/model_parser.h" +#include "framework/omg/parser/parser_factory.h" +#include "framework/omg/parser/weights_parser.h" #include "parser/common/pre_checker.h" #include "parser/common/convert/pb2json.h" #include "proto/ge_ir.pb.h" diff --git a/ge/session/session_manager.h b/ge/session/session_manager.h index 17152b0a..4c3429c2 100644 --- a/ge/session/session_manager.h +++ b/ge/session/session_manager.h @@ -22,8 +22,8 @@ #include #include #include -#include "common/ge_inner_error_codes.h" -#include "ge/ge_api_types.h" +#include "framework/common/ge_inner_error_codes.h" +#include "external/ge/ge_api_types.h" #include "session/inner_session.h" #include "runtime/base.h" diff --git a/ge/single_op/single_op.cc b/ge/single_op/single_op.cc index d09e8398..9df6d5dd 100755 --- a/ge/single_op/single_op.cc +++ b/ge/single_op/single_op.cc @@ -16,8 +16,8 @@ #include "single_op/single_op.h" -#include "common/fmk_types.h" -#include "common/ge_types.h" +#include "framework/common/fmk_types.h" +#include "framework/common/ge_types.h" #include "common/math/math_util.h" #include "common/profiling/profiling_manager.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/single_op/single_op.h b/ge/single_op/single_op.h index deb4532e..7e05dd5f 100755 --- a/ge/single_op/single_op.h +++ b/ge/single_op/single_op.h @@ -23,10 +23,10 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "framework/executor/ge_executor.h" #include "runtime/stream.h" -#include "task/op_task.h" +#include "single_op/task/op_task.h" #include "cce/aicpu_engine_struct.h" #include "hybrid/executor/hybrid_model_executor.h" diff --git a/ge/single_op/single_op_model.cc b/ge/single_op/single_op_model.cc index 90a6362c..eefa5165 100755 --- a/ge/single_op/single_op_model.cc +++ b/ge/single_op/single_op_model.cc @@ -28,10 +28,10 @@ #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" #include "runtime/rt.h" -#include "task/aicpu_task_builder.h" -#include "task/aicpu_kernel_task_builder.h" -#include "task/rts_kernel_task_builder.h" -#include "task/tbe_task_builder.h" +#include "single_op/task/aicpu_task_builder.h" +#include "single_op/task/aicpu_kernel_task_builder.h" +#include "single_op/task/rts_kernel_task_builder.h" +#include "single_op/task/tbe_task_builder.h" #include "hybrid/executor/hybrid_model_executor.h" #include "hybrid/node_executor/node_executor.h" diff --git a/ge/single_op/single_op_model.h b/ge/single_op/single_op_model.h index 529a442d..bf3ad050 100755 --- a/ge/single_op/single_op_model.h +++ b/ge/single_op/single_op_model.h @@ -23,7 +23,7 @@ #include #include -#include "common/helper/model_helper.h" +#include "framework/common/helper/model_helper.h" #include "single_op/single_op.h" #include "single_op/stream_resource.h" #include "single_op/task/op_task.h" diff --git a/ge/single_op/stream_resource.h b/ge/single_op/stream_resource.h index aecb38c8..8986634b 100755 --- a/ge/single_op/stream_resource.h +++ b/ge/single_op/stream_resource.h @@ -23,7 +23,7 @@ #include #include -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "runtime/stream.h" #include "single_op/single_op.h" diff --git a/ge/single_op/task/aicpu_kernel_task_builder.cc b/ge/single_op/task/aicpu_kernel_task_builder.cc index 18f13691..2f0856bf 100755 --- a/ge/single_op/task/aicpu_kernel_task_builder.cc +++ b/ge/single_op/task/aicpu_kernel_task_builder.cc @@ -17,7 +17,7 @@ #include "single_op/task/aicpu_kernel_task_builder.h" #include "framework/common/taskdown_common.h" #include "graph/load/model_manager/model_manager.h" -#include "build_task_utils.h" +#include "single_op/task/build_task_utils.h" namespace ge { AiCpuCCTaskBuilder::AiCpuCCTaskBuilder(const OpDescPtr &op_desc, const domi::KernelDef &kernel_def) diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index 66d70e7e..b189ab00 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -29,7 +29,7 @@ #include "framework/common/debug/log.h" #include "register/op_tiling.h" #include "runtime/rt.h" -#include "build_task_utils.h" +#include "single_op/task/build_task_utils.h" namespace ge { namespace { diff --git a/ge/single_op/task/op_task.h b/ge/single_op/task/op_task.h index ed6cf40f..2fbb4dc7 100644 --- a/ge/single_op/task/op_task.h +++ b/ge/single_op/task/op_task.h @@ -23,7 +23,7 @@ #include "common/dump/dump_op.h" #include "common/dump/dump_properties.h" -#include "common/ge_inner_error_codes.h" +#include "framework/common/ge_inner_error_codes.h" #include "graph/op_kernel_bin.h" #include "runtime/stream.h" #include "graph/node.h" diff --git a/ge/single_op/task/rts_kernel_task_builder.cc b/ge/single_op/task/rts_kernel_task_builder.cc index aad78fd9..07bcbd19 100644 --- a/ge/single_op/task/rts_kernel_task_builder.cc +++ b/ge/single_op/task/rts_kernel_task_builder.cc @@ -15,7 +15,7 @@ */ #include "single_op/task/rts_kernel_task_builder.h" -#include "build_task_utils.h" +#include "single_op/task/build_task_utils.h" namespace ge { namespace { diff --git a/inc/framework/common/profiling/ge_runner_profiling.h b/inc/framework/common/profiling/ge_runner_profiling.h index 011797a3..27e19bce 100644 --- a/inc/framework/common/profiling/ge_runner_profiling.h +++ b/inc/framework/common/profiling/ge_runner_profiling.h @@ -17,7 +17,7 @@ #ifndef INC_FRAMEWORK_COMMON_GE_RUNNER_PROFILING_H_ #define INC_FRAMEWORK_COMMON_GE_RUNNER_PROFILING_H_ -#include "profiling/ge_profiling.h" +#include "framework/common/profiling/ge_profiling.h" GE_FUNC_VISIBILITY bool IsInitialize(); From 109973df92d23d8bbbf88d29d5d0bd34a9bc6617 Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Tue, 22 Jun 2021 11:21:13 +0800 Subject: [PATCH 18/43] Update submodule for proto --- metadef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadef b/metadef index f75dbad2..310610e5 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit f75dbad2f2249608080e482acc6d723e04fec3da +Subproject commit 310610e5392e01659d214ad380e9ed2c39f9f5a3 From af91789d4559ee3913dd07470bd918c84282e326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=A3=8A?= Date: Mon, 21 Jun 2021 21:10:25 +0800 Subject: [PATCH 19/43] update protobuf to 3.13.0 --- cmake/external_libs/protobuf_static.cmake | 2 +- parser | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/external_libs/protobuf_static.cmake b/cmake/external_libs/protobuf_static.cmake index b8ff90bb..51f6ffbc 100755 --- a/cmake/external_libs/protobuf_static.cmake +++ b/cmake/external_libs/protobuf_static.cmake @@ -13,7 +13,7 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR endif() if(GE_PB_PKG) - set(REQ_URL "${GE_PB_PKG}/libs/protobuf/v3.8.0.tar.gz") + set(REQ_URL "${GE_PB_PKG}/libs/protobuf/v3.13.0.tar.gz") else() if (ENABLE_GITEE) set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.13.0.tar.gz") diff --git a/parser b/parser index db5ce472..79536a19 160000 --- a/parser +++ b/parser @@ -1 +1 @@ -Subproject commit db5ce472de0086c3e2abdaab3b0685c1d2656c96 +Subproject commit 79536a196f89cf7a1f5852ff7304b9a7d7b12eff From beea153eb9be9a76e86233b192a2b25b65c5d8d3 Mon Sep 17 00:00:00 2001 From: liudingyan Date: Tue, 22 Jun 2021 12:53:55 +0800 Subject: [PATCH 20/43] atc test keepdtype --- ge/ir_build/attr_options/attr_options.h | 5 ++- ge/ir_build/attr_options/keep_dtype_option.cc | 35 +++++++++++----- ge/ir_build/attr_options/utils.cc | 39 +++++++++++++++++- tests/ut/ge/graph_ir/ge_ir_build_unittest.cc | 41 +++++++++++++++---- 4 files changed, 97 insertions(+), 23 deletions(-) diff --git a/ge/ir_build/attr_options/attr_options.h b/ge/ir_build/attr_options/attr_options.h index b1b794c0..9ea2b9a1 100644 --- a/ge/ir_build/attr_options/attr_options.h +++ b/ge/ir_build/attr_options/attr_options.h @@ -18,11 +18,12 @@ #include #include "graph/compute_graph.h" -#include "external/graph/ge_error_codes.h" +#include "graph/ge_error_codes.h" namespace ge { bool IsOriginalOpFind(OpDescPtr &op_desc, const std::string &op_name); - +bool IsOpTypeEqual(const ge::NodePtr &node, const std::string &op_type); +bool IsContainOpType(const std::string &cfg_line, std::string &op_type); graphStatus KeepDtypeFunc(ComputeGraphPtr &graph, const std::string &cfg_path); graphStatus WeightCompressFunc(ComputeGraphPtr &graph, const std::string &cfg_path); } // namespace diff --git a/ge/ir_build/attr_options/keep_dtype_option.cc b/ge/ir_build/attr_options/keep_dtype_option.cc index 9da08cc0..88f238c0 100644 --- a/ge/ir_build/attr_options/keep_dtype_option.cc +++ b/ge/ir_build/attr_options/keep_dtype_option.cc @@ -32,18 +32,24 @@ void KeepDtypeReportError(const std::vector &invalid_list, const st size_t list_size = invalid_list.size(); err_msg << "config file contains " << list_size; if (list_size == 1) { - err_msg << " operator not in the graph, op name:"; + err_msg << " operator not in the graph, "; } else { - err_msg << " operators not in the graph, op names:"; + err_msg << " operators not in the graph, "; } - + std::string cft_type; for (size_t i = 0; i < list_size; i++) { if (i == kMaxOpsNum) { err_msg << ".."; break; } - err_msg << invalid_list[i]; - if (i != list_size - 1) { + bool istype = IsContainOpType(invalid_list[i], cft_type); + if (!istype) { + err_msg << "op name:"; + } else { + err_msg << "op type:"; + } + err_msg << cft_type; + if (i != (list_size - 1)) { err_msg << " "; } } @@ -72,7 +78,7 @@ graphStatus KeepDtypeFunc(ComputeGraphPtr &graph, const std::string &cfg_path) { return GRAPH_FAILED; } - std::string op_name; + std::string op_name, op_type; std::vector invalid_list; while (std::getline(ifs, op_name)) { if (op_name.empty()) { @@ -80,13 +86,20 @@ graphStatus KeepDtypeFunc(ComputeGraphPtr &graph, const std::string &cfg_path) { } op_name = StringUtils::Trim(op_name); bool is_find = false; - for (auto &node_ptr : graph->GetDirectNode()) { + bool is_type = IsContainOpType(op_name, op_type); + for (auto &node_ptr : graph->GetAllNodes()) { auto op_desc = node_ptr->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); - - if ((op_desc->GetName() == op_name) || IsOriginalOpFind(op_desc, op_name)) { - is_find = true; - (void)AttrUtils::SetInt(op_desc, ATTR_NAME_KEEP_DTYPE, 1); + if (is_type) { + if (IsOpTypeEqual(node_ptr, op_type)) { + is_find = true; + (void)AttrUtils::SetInt(op_desc, ATTR_NAME_KEEP_DTYPE, 1); + } + } else { + if (op_desc->GetName() == op_name || IsOriginalOpFind(op_desc, op_name)) { + is_find = true; + (void)AttrUtils::SetInt(op_desc, ATTR_NAME_KEEP_DTYPE, 1); + } } } if (!is_find) { diff --git a/ge/ir_build/attr_options/utils.cc b/ge/ir_build/attr_options/utils.cc index ed63ffe3..5398c220 100644 --- a/ge/ir_build/attr_options/utils.cc +++ b/ge/ir_build/attr_options/utils.cc @@ -16,9 +16,12 @@ #include "ir_build/attr_options/attr_options.h" #include #include "graph/debug/ge_attr_define.h" -#include "common/util/error_manager/error_manager.h" - +#include "framework/common/debug/ge_log.h" +#include "graph/common/omg_util.h" namespace ge { + namespace { + const std::string CFG_PRE_OPTYPE = "OpType::"; +} bool IsOriginalOpFind(OpDescPtr &op_desc, const std::string &op_name) { std::vector original_op_names; if (!AttrUtils::GetListStr(op_desc, ATTR_NAME_DATA_DUMP_ORIGIN_OP_NAMES, original_op_names)) { @@ -33,4 +36,36 @@ bool IsOriginalOpFind(OpDescPtr &op_desc, const std::string &op_name) { return false; } + +bool IsOpTypeEqual(const ge::NodePtr &node, const std::string &op_type) { + if (op_type != node->GetOpDesc()->GetType()) { + return false; + } + std::string origin_type; + auto ret = GetOriginalType(node, origin_type); + if (ret != SUCCESS) { + GELOGW("[Get][OriginalType] from op:%s failed.", node->GetName().c_str()); + return false; + } + if (op_type != origin_type) { + return false; + } + return true; +} + +bool IsContainOpType(const std::string &cfg_line, std::string &op_type) { + op_type = cfg_line; + size_t pos = op_type.find(CFG_PRE_OPTYPE); + if (pos != std::string::npos) { + if (pos == 0) { + op_type = cfg_line.substr(CFG_PRE_OPTYPE.length()); + return true; + } else { + GELOGW("[Check][Param] %s must be at zero pos of %s", CFG_PRE_OPTYPE.c_str(), cfg_line.c_str()); + } + return false; + } + GELOGW("[Check][Param] %s not contain optype", cfg_line.c_str()); + return false; +} } // namespace ge \ No newline at end of file diff --git a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc index 047c9e1d..197c9300 100644 --- a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc +++ b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +#include #include #include "ir_build/option_utils.h" #include "graph/testcase/ge_graph/graph_builder_utils.h" @@ -21,7 +21,7 @@ #include "graph/utils/graph_utils.h" #include "ge/ge_ir_build.h" #include "graph/ops_stub.h" - +#include "ge/ir_build/attr_options/attr_options.h" #define protected public #define private public @@ -70,6 +70,22 @@ static ComputeGraphPtr BuildComputeGraph() { return builder.GetGraph(); } +static ComputeGraphPtr BuildComputeGraph1() { + auto builder = ut::GraphBuilder("test"); + auto data1 = builder.AddNode("input1", DATA, 1, 1, FORMAT_NCHW, DT_FLOAT, {1, 2, 3}); + auto data2 = builder.AddNode("input2", DATA, 1, 1, FORMAT_NCHW, DT_FLOAT, {4, 10}); + auto addn1 = builder.AddNode("addn1", AddNYes, 2, 1); + auto node1 = builder.AddNode("addd", "Mul", 2, 1); + auto node2 = builder.AddNode("ffm", "FrameworkOp", 2, 1); + auto netoutput = builder.AddNode("netoutput", NETOUTPUT, 1, 0); + + builder.AddDataEdge(data1, 0, addn1, 0); + builder.AddDataEdge(data2, 0, addn1, 1); + builder.AddDataEdge(addn1, 0,netoutput, 0); + + return builder.GetGraph(); +} + // data not set attr index; // but becasue of op proto, register attr index. so all data index is zero; static Graph BuildIrGraph() { @@ -89,10 +105,12 @@ static Graph BuildIrGraph1() { auto data1 = op::Data("data1").set_attr_index(0); auto data2 = op::Data("data2").set_attr_index(1); auto data3 = op::Data("data3"); - std::vector inputs {data1, data2, data3}; + auto data4 = op::Data("Test"); + std::vector inputs {data1, data2, data3, data4}; std::vector outputs; Graph graph("test_graph"); + graph.AddNodeByOp(Operator("gg", "Mul")); graph.SetInputs(inputs).SetOutputs(outputs); return graph; } @@ -373,9 +391,16 @@ TEST(UtestIrBuild, check_modify_mixlist_param) { EXPECT_EQ(ret, GRAPH_PARAM_INVALID); } -TEST(UtestIrCommon, check_dynamic_imagesize_input_shape_valid_format_empty) { - std::map> shape_map; - std::string dynamic_image_size = ""; - bool ret = CheckDynamicImagesizeInputShapeValid(shape_map, "123", dynamic_image_size); - EXPECT_EQ(ret, false); +TEST(UtestIrBuild, atc_cfg_optype_param) { + ComputeGraphPtr graph = BuildComputeGraph1(); + FILE *fp = fopen("./keep.txt", "w+"); + if (fp) { + fprintf(fp, "Test\n"); + fprintf(fp, "OpType::Mul\n"); + fprintf(fp, "Optype::Sub\n"); + fclose(fp); + } + auto ret = KeepDtypeFunc(graph, "./keep.txt"); + (void)remove("./keep.txt"); + EXPECT_EQ(ret, GRAPH_PARAM_INVALID); } \ No newline at end of file From fe77ec974ade91b5a41d713bf7ed0639ac92f176 Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Tue, 22 Jun 2021 16:20:29 +0800 Subject: [PATCH 21/43] Fix BuildPartitionFrame failed --- ge/graph/partition/dynamic_shape_partition.cc | 25 ++++++++++--------- ge/graph/partition/dynamic_shape_partition.h | 4 ++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/ge/graph/partition/dynamic_shape_partition.cc b/ge/graph/partition/dynamic_shape_partition.cc index 1db47498..8fc19ff2 100755 --- a/ge/graph/partition/dynamic_shape_partition.cc +++ b/ge/graph/partition/dynamic_shape_partition.cc @@ -284,9 +284,6 @@ Status DynamicShapePartitioner::InitClusters() { auto cluster = MakeShared(rank++, type, node, this); REQUIRE_NOT_NULL(cluster, "[New][Memory] for cluster failed."); node_2_cluster_[node] = cluster; - if (cluster->IsUnknownShape()) { - ordered_cluster_.push_back(cluster); - } int64_t group_index = -1; if (AttrUtils::GetInt(node->GetOpDesc(), ATTR_NAME_CONTROL_FLOW_GROUP, group_index)) { @@ -306,7 +303,7 @@ Status DynamicShapePartitioner::InitClusters() { return SUCCESS; } -Status DynamicShapePartitioner::TopologicalSortClusters() { +Status DynamicShapePartitioner::TopologicalSortClusters(const OrderedFilter &ordered_filter) { ordered_cluster_.clear(); // BFS topological sort clusters for known shape cluster std::queue ready_clusters; @@ -331,7 +328,7 @@ Status DynamicShapePartitioner::TopologicalSortClusters() { auto cluster = ready_clusters.front(); ready_clusters.pop(); cluster->UpdateRank(rank++); - if (cluster->IsKnownShape() || cluster->IsInputNode()) { + if (ordered_filter == nullptr || ordered_filter(cluster)) { ordered_cluster_.push_back(cluster); } for (const auto &out_cluster : cluster->Outputs()) { @@ -378,7 +375,6 @@ void DynamicShapePartitioner::MergeClustersControlFlow() { continue; } - bool is_unknown_cluster = cluster->IsUnknownShape(); for (++rit; rit != control_cluster.rend(); ++rit) { const auto &cluster_from = *rit; if (all_merged_clusters.count(cluster_from) > 0) { @@ -395,11 +391,6 @@ void DynamicShapePartitioner::MergeClustersControlFlow() { } } } - - if (!is_unknown_cluster && cluster->IsUnknownShape()) { - GELOGD("Add to ordered cluster: %s", cluster->DebugString().c_str()); - ordered_cluster_.push_back(cluster); - } } } @@ -475,9 +466,19 @@ void DynamicShapePartitioner::MergeClustersInputData() { } Status DynamicShapePartitioner::MergeClusters() { + const auto filter_known = [](const ClusterPtr &cluster) { + return cluster->IsKnownShape() || cluster->IsInputNode(); + }; + const auto filter_unknown = [](const ClusterPtr &cluster) { + return cluster->IsUnknownShape(); + }; + MergeClustersControlFlow(); + REQUIRE_SUCCESS(TopologicalSortClusters(filter_unknown), + "[TopologicalSort][Clusters] after merge control flow clusters failed."); MergeClustersUnknownShape(); - REQUIRE_SUCCESS(TopologicalSortClusters(), "[TopologicalSort][Clusters] after merge unknown shape clusters failed."); + REQUIRE_SUCCESS(TopologicalSortClusters(filter_known), + "[TopologicalSort][Clusters] after merge unknown shape clusters failed."); MergeClustersKnownShape(); MergeClustersInputData(); return SUCCESS; diff --git a/ge/graph/partition/dynamic_shape_partition.h b/ge/graph/partition/dynamic_shape_partition.h index 31146570..0eb282a2 100644 --- a/ge/graph/partition/dynamic_shape_partition.h +++ b/ge/graph/partition/dynamic_shape_partition.h @@ -111,6 +111,8 @@ class DynamicShapePartitioner { Status Partition(); + using OrderedFilter = std::function &cluster)>; + private: Status PartitionImpl(); // Collect nodes that satisfy the unknowshape rules: @@ -138,7 +140,7 @@ class DynamicShapePartitioner { // Merge clusters step3 void MergeClustersInputData(); // Topological sort clusters after merge unknown shape clusters. - Status TopologicalSortClusters(); + Status TopologicalSortClusters(const OrderedFilter &ordered_filter); // Deduplicate merged clusters void PruneUniqueClusters(); // Establish the input-output anchors for each partition of the cluster and record links to other clusters From 3df837167ca0a7fa738b10815e5e8180ac1b59e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8D=8E?= Date: Tue, 22 Jun 2021 15:03:25 +0800 Subject: [PATCH 22/43] opt_info --- CMakeLists.txt | 1 + ge/CMakeLists.txt | 8 ++ ge/ge_opt_info/ge_opt_info.cc | 58 +++++++++ ge/ge_opt_info/ge_opt_info.h | 31 +++++ ge/graph/manager/graph_manager.cc | 7 + tests/CMakeLists.txt | 1 + tests/depends/opt_info/CMakeLists.txt | 37 ++++++ tests/depends/opt_info/src/opt_info_stub.cc | 46 +++++++ tests/framework/cmake/graphengine.cmake | 2 + tests/st/testcase/test_ge_opt_info.cc | 123 ++++++++++++++++++ tests/ut/ge/CMakeLists.txt | 14 ++ .../ut/ge/ge_opt_info/ge_opt_info_unittest.cc | 82 ++++++++++++ third_party/fwkacllib/inc/opt_info/opt_info.h | 34 +++++ 13 files changed, 444 insertions(+) create mode 100644 ge/ge_opt_info/ge_opt_info.cc create mode 100644 ge/ge_opt_info/ge_opt_info.h create mode 100644 tests/depends/opt_info/CMakeLists.txt create mode 100644 tests/depends/opt_info/src/opt_info_stub.cc create mode 100644 tests/st/testcase/test_ge_opt_info.cc create mode 100644 tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc create mode 100644 third_party/fwkacllib/inc/opt_info/opt_info.h diff --git a/CMakeLists.txt b/CMakeLists.txt index e3cc1e32..41520b14 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ else () #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) else() find_module(slog libalog.so ${ASCEND_ATC_DIR}) + find_module(opt_feature libopt_feature.so ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) if(PLATFORM STREQUAL "train") find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 2b9122da..5db2e7a9 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -434,6 +434,7 @@ set(TRAIN_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" + "ge_opt_info/ge_opt_info.cc" ) set(INFER_SRC_LIST @@ -711,6 +712,7 @@ set(INFER_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" + "ge_opt_info/ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) @@ -765,11 +767,13 @@ target_include_directories(ge_runner SYSTEM PRIVATE ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external + ${GE_CODE_DIR}/../abl/licctrl #### blue zone ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_runner PRIVATE @@ -792,6 +796,7 @@ target_link_libraries(ge_runner PRIVATE runtime error_manager ascend_hal_stub + opt_feature -Wl,--as-needed json -lrt @@ -839,11 +844,13 @@ target_include_directories(ge_compiler SYSTEM PRIVATE ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external + ${GE_CODE_DIR}/../abl/licctrl #### blue zone #### ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_compiler PRIVATE @@ -863,6 +870,7 @@ target_link_libraries(ge_compiler PRIVATE error_manager slog runtime_compile + opt_feature -Wl,--as-needed json -lrt diff --git a/ge/ge_opt_info/ge_opt_info.cc b/ge/ge_opt_info/ge_opt_info.cc new file mode 100644 index 00000000..8c1b84ab --- /dev/null +++ b/ge/ge_opt_info/ge_opt_info.cc @@ -0,0 +1,58 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ge_opt_info/ge_opt_info.h" + +#include +#include +#include "graph/ge_local_context.h" +#include "ge/ge_api_types.h" +#include "common/debug/ge_log.h" +#include "opt_info.h" + +namespace ge { +Status GeOptInfo::SetOptInfo() { + std::string soc_ver; + graphStatus ret = GetThreadLocalContext().GetOption(SOC_VERSION, soc_ver); + if (ret != GRAPH_SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get soc version failed."); + GELOGE(FAILED, "[Get][SocVersion]Get soc version failed."); + return FAILED; + } + GELOGD("Soc version:%s.", soc_ver.c_str()); + std::map opt_info; + // the first arg does not work at present. + if (gelc::GetOptInfo(gelc::kOffline, soc_ver, opt_info) != gelc::SUCCESS) { + REPORT_CALL_ERROR("E19999", "Get optional information failed, is_offline:%d, soc version:%s", + gelc::kOffline, soc_ver.c_str()); + GELOGE(FAILED, "[Get][OptInfo]Get optional information failed, is_offline:%d, soc version:%s", + gelc::kOffline, soc_ver.c_str()); + return FAILED; + } + // do nothing if get empty information + if (opt_info.empty()) { + GELOGI("Optional information is empty."); + return SUCCESS; + } + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + for (const auto &itr : opt_info) { + graph_options.emplace(itr.first, itr.second); + GELOGI("Get optional information success, key:%s, value:%s.", itr.first.c_str(), itr.second.c_str()); + } + GetThreadLocalContext().SetGraphOption(graph_options); + return SUCCESS; +} +} // namespace ge diff --git a/ge/ge_opt_info/ge_opt_info.h b/ge/ge_opt_info/ge_opt_info.h new file mode 100644 index 00000000..935dff25 --- /dev/null +++ b/ge/ge_opt_info/ge_opt_info.h @@ -0,0 +1,31 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef GE_OPT_INFO_GE_OPT_INFO_H_ +#define GE_OPT_INFO_GE_OPT_INFO_H_ + +#include "ge/ge_api_error_codes.h" +#include "register/register_types.h" + +namespace ge { +class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeOptInfo { + public: + GeOptInfo() = default; + static Status SetOptInfo(); +}; +} // namespace ge + +#endif // GE_OPT_INFO_GE_OPT_INFO_H_ diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index f36c1c0d..0b27fdf3 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -27,6 +27,7 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/dump/dump_manager.h" +#include "ge_opt_info/ge_opt_info.h" #include "analyzer/analyzer.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" @@ -1001,6 +1002,12 @@ Status GraphManager::PreRun(const GraphNodePtr &graph_node, const std::vector + c_sec +) + +target_include_directories(opt_feature_stub INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src) diff --git a/tests/depends/opt_info/src/opt_info_stub.cc b/tests/depends/opt_info/src/opt_info_stub.cc new file mode 100644 index 00000000..df518c4b --- /dev/null +++ b/tests/depends/opt_info/src/opt_info_stub.cc @@ -0,0 +1,46 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "opt_info.h" +#include +#include +#include +#include + +namespace gelc { +namespace { +const std::vector kSocVersions = {"Ascend910"}; +} + +void SetAllOptInfo(std::map &opt_infos) { + opt_infos.emplace("opt_module.fe", "all"); + opt_infos.emplace("opt_module.pass", "all"); + opt_infos.emplace("opt_module.op_tune", "all"); + opt_infos.emplace("opt_module.rl_tune", "all"); + opt_infos.emplace("opt_module.aoe", "all"); +} + +Status GetOptInfo(WorkMode mode, const std::string &soc_ver, + std::map &opt_infos) { + if (std::find(kSocVersions.begin(), kSocVersions.end(), soc_ver)== kSocVersions.end()) { + SetAllOptInfo(opt_infos); + return SUCCESS; + } + opt_infos.emplace("opt_module.fe", "all"); + opt_infos.emplace("opt_module.pass", "all"); + opt_infos.emplace("opt_module.op_tune", "all"); + return SUCCESS; +} +} // namespace gelc diff --git a/tests/framework/cmake/graphengine.cmake b/tests/framework/cmake/graphengine.cmake index 81aa00cc..c4380016 100644 --- a/tests/framework/cmake/graphengine.cmake +++ b/tests/framework/cmake/graphengine.cmake @@ -103,6 +103,7 @@ list(APPEND INCLUDE_DIRECTORIES "${GE_CODE_DIR}/third_party/fwkacllib/inc/cce" "${GE_CODE_DIR}/third_party/fwkacllib/inc/ops" "${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain" + "${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info" "${GE_CODE_DIR}/tests/ut/ge" "${GE_CODE_DIR}/tests/ut/common" "${CMAKE_BINARY_DIR}" @@ -117,6 +118,7 @@ list(APPEND STUB_LIBS runtime_stub profiler_stub hccl_stub + opt_feature_stub error_manager_stub ascend_protobuf json diff --git a/tests/st/testcase/test_ge_opt_info.cc b/tests/st/testcase/test_ge_opt_info.cc new file mode 100644 index 00000000..457473b1 --- /dev/null +++ b/tests/st/testcase/test_ge_opt_info.cc @@ -0,0 +1,123 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "easy_graph/graph/box.h" +#include "easy_graph/graph/node.h" +#include "easy_graph/builder/graph_dsl.h" +#include "easy_graph/builder/box_builder.h" +#include "easy_graph/layout/graph_layout.h" +#include "easy_graph/layout/engines/graph_easy/graph_easy_option.h" +#include "easy_graph/layout/engines/graph_easy/graph_easy_executor.h" +#include "graph/graph.h" +#include "graph/compute_graph.h" +#include "framework/common/types.h" +#include "graph/debug/ge_attr_define.h" +#include "ge_graph_dsl/graph_dsl.h" +#include "ge_graph_dsl/op_desc/op_desc_cfg_box.h" +#define protected public +#define private public +#include "ge_opt_info/ge_opt_info.h" +#undef private +#undef protected + +namespace ge { +class STEST_opt_info : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(STEST_opt_info, get_opt_info_all) { + std::map options = {{ge::SOC_VERSION, "Ascend310"}}; + GetThreadLocalContext().SetGlobalOption(options); + + /// data1 data2 + /// \ / + /// add + // build graph + DEF_GRAPH(g1) { + CHAIN(NODE("data1", DATA)->NODE("add", ADD)); + CHAIN(NODE("data2", DATA)->NODE("add")); + }); + + auto graph = ToGeGraph(g1); + + // new session & add graph + Session session(options); + auto ret = session.AddGraph(1, graph, options); + EXPECT_EQ(ret, SUCCESS); + // build input tensor + std::vector inputs; + // build_graph through session + ret = session.BuildGraph(1, inputs); + EXPECT_EQ(ret, SUCCESS); + + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.rl_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.aoe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(STEST_opt_info, get_opt_info_success) { + std::map options = {{ge::SOC_VERSION, "Ascend910"}}; + GetThreadLocalContext().SetGlobalOption(options); + + /// data1 data2 + /// \ / + /// add + // build graph + DEF_GRAPH(g1) { + CHAIN(NODE("data1", DATA)->NODE("add", ADD)); + CHAIN(NODE("data2", DATA)->NODE("add")); + }); + + auto graph = ToGeGraph(g1); + + // new session & add graph + Session session(options); + auto ret = session.AddGraph(1, graph, options); + EXPECT_EQ(ret, SUCCESS); + // build input tensor + std::vector inputs; + // build_graph through session + ret = session.BuildGraph(1, inputs); + EXPECT_EQ(ret, SUCCESS); + + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} +} // namespace ge diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index f1ede616..37906457 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -62,6 +62,7 @@ include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/cce) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/ops) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain) +include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info) include_directories(${GE_CODE_DIR}/tests/ut/ge) include_directories(${GE_CODE_DIR}/tests/ut/common) include_directories(${CMAKE_BINARY_DIR}) @@ -346,6 +347,7 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/ge/datatype_util.cc" "${GE_CODE_DIR}/ge/ge_local_engine/engine/host_cpu_engine.cc" "${GE_CODE_DIR}/ge/session/omg.cc" + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" ) set(COMMON_FORMAT_SRC_FILES @@ -453,6 +455,7 @@ set(GRAPH_EXECUTE_COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/manager/graph_manager.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.cc" "${GE_CODE_DIR}/ge/graph/manager/util/rt_context_util.cc" + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.h" ) @@ -628,6 +631,10 @@ set(SINGLE_OP_SRC_FILES "${GE_CODE_DIR}/ge/hybrid/hybrid_davinci_model.cc" ) +set(GE_OPT_INFO_SRC_FILES + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" +) + # test files set(COMMON_TEST_FILES "graph/passes/graph_builder_utils.cc" @@ -813,6 +820,10 @@ set(MULTI_PARTS_TEST_FILES "common/host_cpu_engine_unittest.cc" ) +set(GE_OPT_INFO_TEST_FILES + "ge_opt_info/ge_opt_info_unittest.cc" +) + set(GENERATOR_TEST_FILES "generator/ge_generator_unittest.cc" ) @@ -862,6 +873,7 @@ list(APPEND COMMON_SHARED_LIBRARIES mmpa_stub hccl_stub error_manager_stub + opt_feature_stub ascend_protobuf json ) @@ -1107,10 +1119,12 @@ target_link_libraries(ut_libge_multiparts_utest # libge_others_utest add_executable(ut_libge_others_utest + ${GE_OPT_INFO_SRC_FILES} ${COMMON_TEST_FILES} ${PASS_TEST_FILES} ${EXECUTE_TEST_FILES} ${OTHERS_TEST_FILES} + ${GE_OPT_INFO_TEST_FILES} ) target_compile_options(ut_libge_others_utest PRIVATE diff --git a/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc b/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc new file mode 100644 index 00000000..20c123e9 --- /dev/null +++ b/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc @@ -0,0 +1,82 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#define protected public +#define private public +#include "ge_opt_info/ge_opt_info.h" +#include "graph/ge_local_context.h" +#include "external/ge/ge_api_types.h" +#undef private +#undef protected + +namespace ge { +class UTEST_opt_info : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(UTEST_opt_info, get_opt_info_success) { + std::map options = {{ge::SOC_VERSION, "Ascend910"}}; + GetThreadLocalContext().SetGlobalOption(options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::SUCCESS); + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(UTEST_opt_info, get_opt_info_all) { + std::map global_options = {{ge::SOC_VERSION, "Ascend310"}}; + GetThreadLocalContext().SetGlobalOption(global_options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::SUCCESS); + std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); + auto itr = graph_options.find("opt_module.fe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.pass"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.op_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.rl_tune"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); + itr = graph_options.find("opt_module.aoe"); + EXPECT_NE(itr, graph_options.end()); + EXPECT_EQ(itr->second, "all"); +} + +TEST_F(UTEST_opt_info, get_opt_info_failed) { + std::map options; + GetThreadLocalContext().SetGlobalOption(options); + auto ret = GeOptInfo::SetOptInfo(); + EXPECT_EQ(ret, ge::FAILED); +} + +} // namespace ge diff --git a/third_party/fwkacllib/inc/opt_info/opt_info.h b/third_party/fwkacllib/inc/opt_info/opt_info.h new file mode 100644 index 00000000..ea9bb529 --- /dev/null +++ b/third_party/fwkacllib/inc/opt_info/opt_info.h @@ -0,0 +1,34 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +namespace gelc { +using Status = uint32_t; +using WorkMode = uint32_t; +const Status SUCCESS = 0x0; +const Status FAILED = 0xFFFFFFFF; +const WorkMode kOffline = 0x0; +const WorkMode kInline = 0x01; + +extern "C" { +__attribute__((visibility ("default"))) +Status GetOptInfo(WorkMode mode, const std::string &soc_ver, + std::map &opt_info_map); +} +} // namespace gelc + From 69a27208a039ef30f389a0d3ea8f7247a214c4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Tue, 22 Jun 2021 19:17:03 +0800 Subject: [PATCH 23/43] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!1?= =?UTF-8?q?704=20:=20remove=20updation=20of=20session=5Fid'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ge/graph/manager/graph_manager.cc | 2 +- ge/hybrid/model/hybrid_model_builder.cc | 46 ++++--------------- ge/hybrid/model/hybrid_model_builder.h | 1 - ge/model/ge_root_model.h | 5 -- .../executor/subgraph_executor_unittest.cc | 3 -- .../model/hybrid_model_builder_unittest.cc | 26 ++--------- 6 files changed, 16 insertions(+), 67 deletions(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index f36c1c0d..b862a7d6 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -3132,10 +3132,10 @@ void GraphManager::PreRunThread(GraphManager *graph_manager) { } // Avoid repeatively prerun for graphs owns same graph_id in online inference concurrency if (count > 1 && graph_node->GetBuildFlag()) { + graph_node->Lock(); GELOGD("Avoid repeatively prerun, graph_id:%u.", args.graph_id); // In online inference concurrency senario, graph_node is allowed to be locked for 'count' times graph_node->SetSemSize(count); - graph_node->Lock(); graph_manager->run_args_q_.Push(RunArgs( { graph_node, args.graph_id, args.session_id, args.error_context, args.input_tensor, graph_node->GetGeRootModel(), GetThreadLocalContext(), args.callback })); GELOGI("[PreRunThread] Loop end. Start to run with cached build model."); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index c050875e..d3f00253 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -147,7 +147,6 @@ Status HybridModelBuilder::Build() { GE_CHK_STATUS_RET(ValidateParams(), "[Invoke][ValidateParams] failed, model_name_:[%s]", GetGraphName()); hybrid_model_.model_name_ = ge_root_model_->GetModelName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); - GE_CHK_STATUS_RET(CopyGraph(), "[Invoke][CopyGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitRuntimeParams(), "[Invoke][InitRuntimeParams] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(RecoverGraphUnknownFlag(), "[Invoke][RecoverGraphUnknownFlag] failed, model_name_:[%s]", GetGraphName()); @@ -175,8 +174,8 @@ Status HybridModelBuilder::BuildForSingleOp() { hybrid_model_.model_name_ = ge_root_model_->GetRootGraph()->GetName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); auto ret = ge_root_model_->GetSubgraphInstanceNameToModel(); - const GeModelPtr ge_model = ret[hybrid_model_.root_graph_->GetName()]; - GE_CHK_STATUS_RET(IndexTaskDefs(hybrid_model_.root_graph_, ge_model), + const GeModelPtr ge_model = ret[ge_root_model_->GetRootGraph()->GetName()]; + GE_CHK_STATUS_RET(IndexTaskDefs(ge_root_model_->GetRootGraph(), ge_model), "[Invoke][IndexTaskDefs] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(LoadGraph(), "[Invoke][LoadGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitWeights(), "[Invoke][InitWeights] failed, model_name_:[%s]", GetGraphName()); @@ -191,29 +190,6 @@ Status HybridModelBuilder::ValidateParams() { return SUCCESS; } -Status HybridModelBuilder::CopyGraph() { - GELOGD("Copy compute graph begin."); - auto root_graph = ge_root_model_->GetRootGraph(); - - ge_root_model_->IncreaseBuildTimes(); - std::string new_graph_name = ge_root_model_->GetRootGraph()->GetName() + "_" + - std::to_string(ge_root_model_->GetBuildTimes()); - ComputeGraphPtr new_root_graph = MakeShared(new_graph_name); - GE_CHECK_NOTNULL(new_root_graph); - int32_t depth = 0; - std::map node_old_2_new; - std::map op_desc_old_2_new; - graphStatus ret = GraphUtils::CopyComputeGraph(root_graph, new_root_graph, node_old_2_new, op_desc_old_2_new, depth); - if (ret != GRAPH_SUCCESS) { - GELOGE(GRAPH_FAILED, "Copy compute graph failed."); - return GRAPH_FAILED; - } - hybrid_model_.root_graph_ = new_root_graph; - - GELOGD("Copy compute graph[%s] success.", new_graph_name.c_str()); - return SUCCESS; -} - Status HybridModelBuilder::BuildNodeItem(const NodePtr &node, NodeItem &node_item) { auto op_desc = node->GetOpDesc(); GE_CHK_STATUS_RET(ParseForceInfershapeNodes(node, node_item), @@ -838,7 +814,7 @@ Status HybridModelBuilder::BuildOutputMapping(GraphItem &graph_item, } Status HybridModelBuilder::LoadGraph() { - auto root_graph = hybrid_model_.root_graph_; + auto root_graph = ge_root_model_->GetRootGraph(); if (!GetContext().GetHostExecFlag()) { std::shared_ptr merged_graph; GELOGI("Before merging subgraphs DirectNodesSize = %zu, GetAllNodesSize = %zu", @@ -852,6 +828,7 @@ Status HybridModelBuilder::LoadGraph() { root_graph->GetAllNodesSize()); } + hybrid_model_.root_graph_ = root_graph; GE_CHK_STATUS_RET(RelinkNextIteration(), "[%s] Relink NextIteration failed", GetGraphName()); // Reset node id by topological order across all subgraphs int64_t index = 0; @@ -900,7 +877,6 @@ Status HybridModelBuilder::LoadGraph() { } for (auto &it : hybrid_model_.known_shape_sub_models_) { auto node_item = MutableNodeItem(it.first); - GE_CHECK_NOTNULL(node_item); AscendString graph_name; GE_CHK_GRAPH_STATUS_RET(it.second->GetGraph().GetName(graph_name), "Failed to get subgraph name"); auto subgraph = hybrid_model_.GetRootGraph()->GetSubgraph(graph_name.GetString()); @@ -1149,9 +1125,7 @@ Status HybridModelBuilder::InitWeights() { sub_weight_buffer->GetSize()); auto subgraph = GraphUtils::GetComputeGraph(subgraph_model.second->GetGraph()); if (subgraph != ge_root_model_->GetRootGraph()) { - subgraph = hybrid_model_.root_graph_->GetSubgraph(subgraph_model.first); - } else { - subgraph = hybrid_model_.root_graph_; + subgraph = ge_root_model_->GetRootGraph()->GetSubgraph(subgraph_model.first); } GE_CHECK_NOTNULL(subgraph); hybrid_model_.weight_buffer_map_.emplace(subgraph->GetName(), std::move(sub_weight_buffer)); @@ -1308,7 +1282,7 @@ Status HybridModelBuilder::IndexTaskDefs(const ComputeGraphPtr &sub_graph, const } Status HybridModelBuilder::IndexTaskDefs() { - const auto &root_graph = hybrid_model_.root_graph_; + const auto root_graph = ge_root_model_->GetRootGraph(); const auto &root_graph_name = root_graph->GetName(); if (SetOutputNameAttr(*root_graph) != SUCCESS) { GELOGW("Set output name attr failed."); @@ -1342,7 +1316,7 @@ Status HybridModelBuilder::IndexTaskDefs() { Status HybridModelBuilder::IndexSpecialNodes() { GELOGD("Start to index special nodes"); - const auto &root_graph = hybrid_model_.root_graph_; + const auto &root_graph = ge_root_model_->GetRootGraph(); for (auto &node : root_graph->GetAllNodes()) { GE_CHECK_NOTNULL(node); GE_CHECK_NOTNULL(node->GetOpDesc()); @@ -1497,7 +1471,7 @@ Status HybridModelBuilder::InitRuntimeParams() { runtime_param_.session_id = ret ? static_cast(value) : 0; ret = ge::AttrUtils::GetInt(first_model, ATTR_MODEL_TASK_GEN_VAR_ADDR, value); runtime_param_.logic_var_base = ret ? static_cast(value) : 0; - runtime_param_.graph_id = hybrid_model_.root_graph_->GetGraphID(); + runtime_param_.graph_id = ge_root_model_->GetRootGraph()->GetGraphID(); value = 0; for (auto &it : ge_root_model_->GetSubgraphInstanceNameToModel()) { (void) ge::AttrUtils::GetInt(it.second, ATTR_MODEL_VAR_SIZE, value); @@ -1634,7 +1608,7 @@ Status HybridModelBuilder::TransAllVarData() { } Status HybridModelBuilder::CopyVarData() { - GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(hybrid_model_.root_graph_, + GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(ge_root_model_->GetRootGraph(), runtime_param_.session_id, hybrid_model_.device_id_), "[Invoke][CopyVarData] failed."); @@ -1717,7 +1691,7 @@ Status HybridModelBuilder::LoadKnownShapedSubgraph(ComputeGraph &graph, NodeItem } Status HybridModelBuilder::RecoverGraphUnknownFlag() { - const auto &root_graph = hybrid_model_.root_graph_; + const auto &root_graph = ge_root_model_->GetRootGraph(); for (auto &sub_graph : root_graph->GetAllSubgraphs()) { GE_CHECK_NOTNULL(sub_graph); for (const auto &node : sub_graph->GetDirectNode()) { diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index 3ab43b7f..92974441 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -56,7 +56,6 @@ class HybridModelBuilder { Status BuildOutputMapping(GraphItem &partitioned_call, const NodeItem &node_item, bool is_root_graph); Status ValidateParams(); Status LoadGraph(); - Status CopyGraph(); Status LoadGeModel(ComputeGraph &graph, const GeModelPtr &ge_model); Status LoadTask(NodeItem &node_item); Status LoadTasks(); diff --git a/ge/model/ge_root_model.h b/ge/model/ge_root_model.h index b6e3d081..9e8e116e 100755 --- a/ge/model/ge_root_model.h +++ b/ge/model/ge_root_model.h @@ -60,10 +60,6 @@ class GeRootModel { bool GetTrainFlag() const { return train_flag_; } - int32_t GetBuildTimes() const { return hybrid_build_times_; } - - void IncreaseBuildTimes() { hybrid_build_times_++; } - private: ComputeGraphPtr root_graph_ = nullptr; std::map subgraph_instance_name_to_model_; @@ -73,7 +69,6 @@ class GeRootModel { bool train_flag_ = false; std::string model_name_; bool is_specific_stream_ = false; - int32_t hybrid_build_times_ = 0; }; } // namespace ge using GeRootModelPtr = std::shared_ptr; diff --git a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc index 827705ae..2dc3b639 100644 --- a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc +++ b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc @@ -249,9 +249,6 @@ TEST_F(UtestSubgraphExecutor, cond_graph_schedule_tasks) { graph_context.callback_manager = std::unique_ptr(new CallbackManager()); ASSERT_EQ(graph_context.callback_manager->Init(), SUCCESS); - auto root_graph = hybrid_model.root_graph_; - switch_t = root_graph->FindNode("switch_t"); - switch_f = root_graph->FindNode("switch_f"); const auto node_it_t = hybrid_model.node_items_.find(switch_t); const auto node_it_f = hybrid_model.node_items_.find(switch_f); ASSERT_NE(hybrid_model.node_items_.end(), node_it_t); diff --git a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc index 95669b73..2ab82350 100644 --- a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc +++ b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc @@ -214,17 +214,11 @@ TEST_F(UtestHybridModelBuilder, normal_hybrid_model_build) { ASSERT_EQ(it->second->frame_index_, index); ASSERT_EQ(it->second->parent_frame_, -1); }; - auto root_graph = hybrid_model.root_graph_; - auto enter1_node = root_graph->FindNode("enter"); - auto active1_node = root_graph->FindNode("active1"); - auto active2_node = root_graph->FindNode("active2"); - auto active3_node = root_graph->FindNode("active3"); - auto output1_node = root_graph->FindNode("net_output"); - TestFrameGroup(enter1_node, control_group_index); - TestFrameGroup(active1_node, control_group_index); - TestFrameGroup(active2_node, control_group_index); - TestFrameGroup(active3_node, control_group_index); - TestFrameGroup(output1_node, -1); + TestFrameGroup(enter1, control_group_index); + TestFrameGroup(active1, control_group_index); + TestFrameGroup(active2, control_group_index); + TestFrameGroup(active3, control_group_index); + TestFrameGroup(output1, -1); engine_mapping.clear(); task_executor.clear(); @@ -352,14 +346,4 @@ EXPECT_EQ(hybrid_model_builder.InitVariableTensors(), SUCCESS); EXPECT_EQ(hybrid_model_builder.hybrid_model_.variable_tensors_.size(), 1); HostMemManager::Instance().var_memory_base_map_.clear(); } - -TEST_F(UtestHybridModelBuilder, copy_graph_success) { -ComputeGraphPtr graph = std::make_shared("test"); -GeRootModelPtr ge_root_model = make_shared(graph); -HybridModel hybrid_model(ge_root_model); -HybridModelBuilder hybrid_model_builder(hybrid_model); - -Status st = hybrid_model_builder.CopyGraph(); -EXPECT_EQ(st, SUCCESS); -} } // namespace ge From ad3e70748e8cfebdc8fa141af8d8cfd6a8cbd1aa Mon Sep 17 00:00:00 2001 From: chuxing Date: Sat, 19 Jun 2021 16:41:25 +0800 Subject: [PATCH 24/43] Init hccl node executor on-demand --- ge/hybrid/model/hybrid_model_builder.cc | 22 ++++ ge/hybrid/model/hybrid_model_builder.h | 1 + ge/hybrid/node_executor/node_executor.cc | 80 +++++++------- ge/hybrid/node_executor/node_executor.h | 9 +- tests/ut/ge/CMakeLists.txt | 2 + .../model/hybrid_model_builder_unittest.cc | 27 +++++ .../node_executor/node_executor_unittest.cc | 103 ++++++++++++++++++ 7 files changed, 200 insertions(+), 44 deletions(-) create mode 100644 tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index d3f00253..bb405605 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -1227,6 +1227,28 @@ Status HybridModelBuilder::LoadGeModel(ComputeGraph &sub_graph, const GeModelPtr hybrid_model_.known_shape_sub_models_.emplace(parent_node, ge_model); } + GE_CHK_STATUS_RET_NOLOG(InitHcclExecutorOnDemand(ge_model)); + return SUCCESS; +} + +Status HybridModelBuilder::InitHcclExecutorOnDemand(const GeModelPtr &ge_model) { + if (NodeExecutorManager::GetInstance().IsExecutorInitialized(NodeExecutorManager::ExecutorType::HCCL)) { + return SUCCESS; + } + + // HCCL tasks in known-shaped subgraph which resides in a dynamic root graph + // still depends on the initialization of the HcclExecutor + auto tasks = ge_model->GetModelTaskDefPtr()->task(); + for (int i = 0; i < tasks.size(); ++i) { + const domi::TaskDef &task_def = tasks[i]; + auto task_type = static_cast(task_def.type()); + if (task_type == RT_MODEL_TASK_HCCL) { + const NodeExecutor *unused = nullptr; + GE_CHK_STATUS_RET_NOLOG(NodeExecutorManager::GetInstance() + .GetOrCreateExecutor(NodeExecutorManager::ExecutorType::HCCL, &unused)); + return SUCCESS; + } + } return SUCCESS; } diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index 92974441..9c1eb187 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -57,6 +57,7 @@ class HybridModelBuilder { Status ValidateParams(); Status LoadGraph(); Status LoadGeModel(ComputeGraph &graph, const GeModelPtr &ge_model); + static Status InitHcclExecutorOnDemand(const GeModelPtr &ge_model); Status LoadTask(NodeItem &node_item); Status LoadTasks(); Status IdentifyVariableOutputs(NodeItem &node_item, const ComputeGraphPtr &subgraph); diff --git a/ge/hybrid/node_executor/node_executor.cc b/ge/hybrid/node_executor/node_executor.cc index 5f3d6e45..9e9354d9 100755 --- a/ge/hybrid/node_executor/node_executor.cc +++ b/ge/hybrid/node_executor/node_executor.cc @@ -58,8 +58,8 @@ Status NodeExecutor::CompileTask(const HybridModel &model, const NodePtr &node, } Status NodeExecutorManager::EnsureInitialized() { - GE_CHK_STATUS_RET(InitializeExecutors()); std::lock_guard lk(mu_); + ++ref_count_; if (initialized_) { return SUCCESS; } @@ -115,17 +115,14 @@ NodeExecutorManager::ExecutorType NodeExecutorManager::ResolveExecutorType(Node return it->second; } -Status NodeExecutorManager::GetExecutor(Node &node, const NodeExecutor **executor) const { +Status NodeExecutorManager::GetExecutor(Node &node, const NodeExecutor **executor) { auto executor_type = ResolveExecutorType(node); + GELOGD("[%s] Set node executor by type: %d.", node.GetName().c_str(), static_cast(executor_type)); const auto it = executors_.find(executor_type); if (it == executors_.end()) { - REPORT_INNER_ERROR("E19999", "Failed to get executor by type: %d.", static_cast(executor_type)); - GELOGE(INTERNAL_ERROR, "[Check][ExecutorType]Failed to get executor by type: %d.", - static_cast(executor_type)); - return INTERNAL_ERROR; + return GetOrCreateExecutor(executor_type, executor); } - GELOGD("[%s] Set node executor by type: %d.", node.GetName().c_str(), static_cast(executor_type)); *executor = it->second.get(); return SUCCESS; } @@ -178,51 +175,55 @@ Status NodeExecutorManager::CalcOpRunningParam(Node &node) const { return OpsKernelBuilderManager::Instance().CalcOpRunningParam(node); } -Status NodeExecutorManager::InitializeExecutors() { +bool NodeExecutorManager::IsExecutorInitialized(NodeExecutorManager::ExecutorType executor_type) { + std::lock_guard lk(mu_); + return executors_.find(executor_type) != executors_.end(); +} + +Status NodeExecutorManager::GetOrCreateExecutor(ExecutorType executor_type, const NodeExecutor **out_executor) { std::lock_guard lk(mu_); - if (executor_initialized_) { - ++ref_count_; - GELOGI("Executor is already initialized. add ref count to [%d]", ref_count_); + const auto executor_it = executors_.find(executor_type); + if (executor_it != executors_.end()) { + *out_executor = executor_it->second.get(); return SUCCESS; } - GELOGI("Start to Initialize NodeExecutors"); - for (auto &it : builders_) { - auto engine_type = it.first; - auto build_fn = it.second; - GE_CHECK_NOTNULL(build_fn); - auto executor = std::unique_ptr(build_fn()); - if (executor == nullptr) { - REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for engine type = %d", - static_cast(engine_type)); - GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for engine type = %d", static_cast(engine_type)); - return INTERNAL_ERROR; - } + GELOGI("Start to Initialize NodeExecutor, type = %d", static_cast(executor_type)); + auto it = builders_.find(executor_type); + if (it == builders_.end()) { + REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for executor type = %d", + static_cast(executor_type)); + GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for executor type = %d", static_cast(executor_type)); + return INTERNAL_ERROR; + } - GELOGD("Executor of engine type = %d was created successfully", static_cast(engine_type)); - auto ret = executor->Initialize(); - if (ret != SUCCESS) { - REPORT_CALL_ERROR("E19999", "Initialize NodeExecutor failed for type = %d", static_cast(engine_type)); - GELOGE(ret, "[Initialize][NodeExecutor] failed for type = %d", static_cast(engine_type)); - for (auto &executor_it : executors_) { - executor_it.second->Finalize(); - } - executors_.clear(); - return ret; - } + auto build_fn = it->second; + GE_CHECK_NOTNULL(build_fn); + auto executor = std::unique_ptr(build_fn()); + if (executor == nullptr) { + REPORT_CALL_ERROR("E19999", "Create NodeExecutor failed for executor type = %d", + static_cast(executor_type)); + GELOGE(INTERNAL_ERROR, "[Create][NodeExecutor] failed for engine type = %d", static_cast(executor_type)); + return INTERNAL_ERROR; + } - executors_.emplace(engine_type, std::move(executor)); + GELOGD("Executor of engine type = %d was created successfully", static_cast(executor_type)); + auto ret = executor->Initialize(); + if (ret != SUCCESS) { + REPORT_CALL_ERROR("E19999", "Initialize NodeExecutor failed for type = %d", static_cast(executor_type)); + GELOGE(ret, "[Initialize][NodeExecutor] failed for type = %d", static_cast(executor_type)); + return ret; } - ++ref_count_; - executor_initialized_ = true; - GELOGI("Initializing NodeExecutors successfully."); + *out_executor = executor.get(); + executors_.emplace(executor_type, std::move(executor)); + GELOGI("Initializing NodeExecutor successfully, type = %d", static_cast(executor_type)); return SUCCESS; } void NodeExecutorManager::FinalizeExecutors() { std::lock_guard lk(mu_); - if (!executor_initialized_) { + if (ref_count_ <= 0) { GELOGD("No need for finalizing for not initialized."); return; } @@ -237,7 +238,6 @@ void NodeExecutorManager::FinalizeExecutors() { it.second->Finalize(); } executors_.clear(); - executor_initialized_ = false; GELOGD("Done invoking Finalize successfully."); } diff --git a/ge/hybrid/node_executor/node_executor.h b/ge/hybrid/node_executor/node_executor.h index ad4a9296..0e4a8464 100644 --- a/ge/hybrid/node_executor/node_executor.h +++ b/ge/hybrid/node_executor/node_executor.h @@ -179,8 +179,6 @@ class NodeExecutorManager { */ Status EnsureInitialized(); - Status InitializeExecutors(); - void FinalizeExecutors(); /** @@ -196,7 +194,7 @@ class NodeExecutorManager { * @param executor executor * @return SUCCESS on success, error code otherwise */ - Status GetExecutor(Node &node, const NodeExecutor **executor) const; + Status GetExecutor(Node &node, const NodeExecutor **executor); /** * Resolve executor type by node @@ -205,13 +203,16 @@ class NodeExecutorManager { */ ExecutorType ResolveExecutorType(Node &node) const; + Status GetOrCreateExecutor(ExecutorType executor_type, const NodeExecutor **executor); + + bool IsExecutorInitialized(ExecutorType executor_type); + private: std::map> executors_; std::map> builders_; std::map engine_mapping_; std::mutex mu_; bool initialized_ = false; - bool executor_initialized_ = false; int ref_count_ = 0; }; diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index f1ede616..06b3e0f2 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -840,6 +840,7 @@ set(HYBRID_TEST_FILES "hybrid/executor/subgraph_executor_unittest.cc" "hybrid/executor/worker/execution_engine_unittest.cc" "hybrid/model/hybrid_model_builder_unittest.cc" + "hybrid/node_executor/node_executor_unittest.cc" "hybrid/node_executor/rts/rts_node_task_unittest.cc" "hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc" "hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc" @@ -847,6 +848,7 @@ set(HYBRID_TEST_FILES "hybrid/executor/hybrid_model_async_executor_unittest.cc" "hybrid/executor/hybrid_model_pipeline_executor_unittest.cc" "hybrid/node_executor/aicore/aicore_task_compiler_unittest.cc" + ) set(OTHERS_TEST_FILES diff --git a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc index 2ab82350..5567aca2 100644 --- a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc +++ b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc @@ -346,4 +346,31 @@ EXPECT_EQ(hybrid_model_builder.InitVariableTensors(), SUCCESS); EXPECT_EQ(hybrid_model_builder.hybrid_model_.variable_tensors_.size(), 1); HostMemManager::Instance().var_memory_base_map_.clear(); } + +TEST_F(UtestHybridModelBuilder, TestInitHcclExecutorOnDemand) { + NodeExecutorManager::GetInstance().builders_.erase(NodeExecutorManager::ExecutorType::HCCL); + // build aicore task + domi::ModelTaskDef model_task_def; + std::shared_ptr model_task_def_ptr = make_shared(model_task_def); + GeModelPtr ge_model = make_shared(); + ge_model->SetModelTaskDef(model_task_def_ptr); + + // No hccl task + domi::TaskDef *task_def = model_task_def_ptr->add_task(); + task_def->set_type(RT_MODEL_TASK_MEMCPY_ASYNC); + ASSERT_EQ(HybridModelBuilder::InitHcclExecutorOnDemand(ge_model), SUCCESS); + + // get executor failed due to no builder + task_def = model_task_def_ptr->add_task(); + task_def->set_type(RT_MODEL_TASK_HCCL); + ASSERT_EQ(HybridModelBuilder::InitHcclExecutorOnDemand(ge_model), INTERNAL_ERROR); + + // get executor success + REGISTER_NODE_EXECUTOR_BUILDER(NodeExecutorManager::ExecutorType::HCCL, NodeExecutor); + ASSERT_EQ(HybridModelBuilder::InitHcclExecutorOnDemand(ge_model), SUCCESS); + + // repeat get, do not access builder + NodeExecutorManager::GetInstance().builders_.erase(NodeExecutorManager::ExecutorType::HCCL); + ASSERT_EQ(HybridModelBuilder::InitHcclExecutorOnDemand(ge_model), SUCCESS); +} } // namespace ge diff --git a/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc b/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc new file mode 100644 index 00000000..8a1240d3 --- /dev/null +++ b/tests/ut/ge/hybrid/node_executor/node_executor_unittest.cc @@ -0,0 +1,103 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#define private public +#define protected public +#include "hybrid/node_executor/node_executor.h" +#undef protected +#undef private + +using namespace std; +using namespace testing; + +namespace ge { +using namespace hybrid; + +namespace { + bool finalized = false; +} + +class NodeExecutorTest : public testing::Test { + protected: + void SetUp() {} + void TearDown() { } +}; + +class FailureNodeExecutor : public NodeExecutor { + public: + Status Initialize() override { + return INTERNAL_ERROR; + } +}; + +class SuccessNodeExecutor : public NodeExecutor { + public: + Status Initialize() override { + initialized = true; + finalized = false; + return SUCCESS; + } + + Status Finalize() override { + finalized = true; + } + + bool initialized = false; +}; + +REGISTER_NODE_EXECUTOR_BUILDER(NodeExecutorManager::ExecutorType::AICORE, FailureNodeExecutor); +REGISTER_NODE_EXECUTOR_BUILDER(NodeExecutorManager::ExecutorType::AICPU_TF, SuccessNodeExecutor); + +TEST_F(NodeExecutorTest, TestGetOrCreateExecutor) { + auto &manager = NodeExecutorManager::GetInstance(); + const NodeExecutor *executor = nullptr; + Status ret = SUCCESS; + // no builder + ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::RESERVED, &executor); + ASSERT_EQ(ret, INTERNAL_ERROR); + // initialize failure + ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICORE, &executor); + ASSERT_EQ(ret, INTERNAL_ERROR); + ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); + ASSERT_EQ(ret, SUCCESS); + ASSERT_TRUE(executor != nullptr); + ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); + ASSERT_EQ(ret, SUCCESS); + ASSERT_TRUE(executor != nullptr); + ASSERT_TRUE(((SuccessNodeExecutor*)executor)->initialized); +} + +TEST_F(NodeExecutorTest, TestInitAndFinalize) { + auto &manager = NodeExecutorManager::GetInstance(); + manager.FinalizeExecutors(); + manager.EnsureInitialized(); + manager.EnsureInitialized(); + const NodeExecutor *executor = nullptr; + auto ret = manager.GetOrCreateExecutor(NodeExecutorManager::ExecutorType::AICPU_TF, &executor); + ASSERT_EQ(ret, SUCCESS); + ASSERT_TRUE(executor != nullptr); + ASSERT_TRUE(((SuccessNodeExecutor*)executor)->initialized); + manager.FinalizeExecutors(); + ASSERT_FALSE(manager.executors_.empty()); + manager.FinalizeExecutors(); + ASSERT_TRUE(manager.executors_.empty()); + ASSERT_TRUE(finalized); +} +} // namespace ge From f0942201572d6430d1d6ca4b808fe72f65577210 Mon Sep 17 00:00:00 2001 From: lianghao Date: Mon, 21 Jun 2021 21:51:33 +0800 Subject: [PATCH 25/43] train_graph_flag --- ge/graph/manager/graph_manager.cc | 23 +++++++++---------- ge/graph/manager/graph_manager.h | 2 +- ge/graph/passes/global_step_insert_pass.cc | 11 --------- ge/ir_build/ge_ir_build.cc | 1 + .../buffer_pool_mem_assigner_unittest.cc | 5 ++++ .../global_step_insert_pass_unittest.cc | 7 +----- 6 files changed, 19 insertions(+), 30 deletions(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index f36c1c0d..01a2e502 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -122,6 +122,7 @@ const char *const kVectorEngine = "VectorEngine"; const char *const kAIcoreEngine = "AIcoreEngine"; const int32_t kDynamicDimsTypeIsGetNext = 0; const int32_t kDynamicDimsTypeIsData = 1; +const int32_t kBase = 10; const char *const kGetNextName = "IteratorV2"; const uint32_t kInitGraphCount = 1; const uint32_t kNotAdded = 0; @@ -1788,7 +1789,7 @@ Status GraphManager::ParseOptions(const std::map &opti return GE_GRAPH_OPTIONS_INVALID); // ge.graphType - ret = ParseTrainGraphFlag(options_.run_graph_flag, options_.train_graph_flag); + ret = ParseTrainGraphFlag(options_.train_graph_flag); GE_IF_BOOL_EXEC(ret != SUCCESS, GELOGE(GE_GRAPH_OPTIONS_INVALID, "[Parse][TrainGraphFlag] Key:ge.runFlag value is invalid"); return GE_GRAPH_OPTIONS_INVALID); @@ -1833,19 +1834,17 @@ Status GraphManager::ParseOptions(const std::map &opti return SUCCESS; } -Status GraphManager::ParseTrainGraphFlag(const bool &run_flag, bool &train_flag) { - std::shared_ptr ge_instance_ptr = ge::GELib::GetInstance(); - if (ge_instance_ptr == nullptr) { - GELOGW("[Initialize] set train_graph_flag to 0 when GE is not initialized or finalized"); - train_flag = false; - } else if (!ge_instance_ptr->isTrainMode()) { - train_flag = false; - } else { // ge_instance_ptr->isTrainMode() is true - train_flag = true; - if (!run_flag) { - GELOGW("Key:ge.runFlag, its value %d is invalid, it must be 1 when GElib::is_train_mode_ flag is 1", run_flag); +// OPTION_GRAPH_RUN_MODE is supposed to be a session-level option, but it used to be set to global-level in the past. +// If can not parse from session, it can parse from global by GetContext(). +Status GraphManager::ParseTrainGraphFlag(bool &train_flag) { + train_flag = false; + string run_mode; + if (GetContext().GetOption(ge::OPTION_GRAPH_RUN_MODE, run_mode) == SUCCESS && !run_mode.empty()) { + if (GraphRunMode(std::strtol(run_mode.c_str(), nullptr, kBase)) >= TRAIN) { + train_flag = true; } } + GELOGI("Is train flag: %d.", train_flag); return SUCCESS; } diff --git a/ge/graph/manager/graph_manager.h b/ge/graph/manager/graph_manager.h index 93ce354a..3475da6d 100644 --- a/ge/graph/manager/graph_manager.h +++ b/ge/graph/manager/graph_manager.h @@ -292,7 +292,7 @@ class GraphManager { static Status ParseParallelNum(const std::string ¶llel_num, const std::string &key, int &num); - static Status ParseTrainGraphFlag(const bool &run_flag, bool &train_flag); + static Status ParseTrainGraphFlag(bool &train_flag); static bool IsPerfLevelInvalid(int32_t perf_level); diff --git a/ge/graph/passes/global_step_insert_pass.cc b/ge/graph/passes/global_step_insert_pass.cc index f27641fc..297e4ee2 100755 --- a/ge/graph/passes/global_step_insert_pass.cc +++ b/ge/graph/passes/global_step_insert_pass.cc @@ -28,10 +28,6 @@ #include "graph/passes/pass_utils.h" #include "graph/ge_context.h" -namespace { -const char *const kFlagOff = "0"; -} // namespace - namespace ge { NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, const string &node_type, @@ -80,13 +76,6 @@ NodePtr GlobalStepInsertPass::InsertOp(ComputeGraphPtr &compute_graph, } Status GlobalStepInsertPass::Run(ComputeGraphPtr compute_graph) { - // run_flag off means offline, no need insert global step node which type is variable - std::string run_flag; - if (ge::GetContext().GetOption(ge::RUN_FLAG, run_flag) == GRAPH_SUCCESS && run_flag == kFlagOff) { - GELOGI("compute_graph [%u] [%s] skip insert global step", compute_graph->GetGraphID(), - compute_graph->GetName().c_str()); - return SUCCESS; - } NodePtr output_node = compute_graph->FindFirstNodeMatchType(NETOUTPUT); if (output_node == nullptr) { GELOGD("Node type %s can't be found in graph %u", NETOUTPUT, compute_graph->GetGraphID()); diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index ea521f5b..a7671a74 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -574,6 +574,7 @@ graphStatus Impl::Init(const Graph &graph, const std::map(string(ge::RUN_FLAG), to_string(0))); options_.insert(std::pair(string(ge::TRAIN_FLAG), to_string(0))); options_.insert(std::pair(string(ge::SAVE_ORIGINAL_MODEL), to_string(0))); + options_.insert(std::pair(string(ge::OPTION_GRAPH_RUN_MODE), to_string(0))); // print ge option map ge::PrintOptionMap(options_, "ge option"); diff --git a/tests/ut/ge/graph/build/buffer_pool_mem_assigner_unittest.cc b/tests/ut/ge/graph/build/buffer_pool_mem_assigner_unittest.cc index 96283250..05141785 100644 --- a/tests/ut/ge/graph/build/buffer_pool_mem_assigner_unittest.cc +++ b/tests/ut/ge/graph/build/buffer_pool_mem_assigner_unittest.cc @@ -29,6 +29,7 @@ #include "graph/build/memory/buffer_pool_mem_assigner.h" #include "graph/build/memory/graph_mem_assigner.h" #include "graph/build/stream_allocator.h" +#include "graph/ge_local_context.h" #undef protected #undef private @@ -260,6 +261,10 @@ TEST_F(UtestBufferPoolMemAssignerTest, buffer_pool_serial_graph_assign_success) } TEST_F(UtestBufferPoolMemAssignerTest, buffer_pool_subgraph_with_inner_dependency_assign_success) { + std::string build_mode; + std::map options_map; + options_map.insert({ge::OPTION_GRAPH_RUN_MODE, "1"}); + ge::GetThreadLocalContext().SetGraphOption(options_map); ut::BufferPoolGraphBuilder builder("SubgraphWithInnerDependency"); ge::ComputeGraphPtr graph = builder.BuildSubgraphWithInnerDependency(); BufferPoolMemoryPass buffer_pool_mem_pass; diff --git a/tests/ut/ge/graph/passes/global_step_insert_pass_unittest.cc b/tests/ut/ge/graph/passes/global_step_insert_pass_unittest.cc index 9da2565d..cc9a4077 100644 --- a/tests/ut/ge/graph/passes/global_step_insert_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/global_step_insert_pass_unittest.cc @@ -34,7 +34,6 @@ #include "graph/tuning_utils.h" #include "graph_builder_utils.h" #include "graph/ge_context.h" -#include "graph/ge_local_context.h" #include "inc/pass_manager.h" #undef protected #undef private @@ -62,13 +61,9 @@ static ComputeGraphPtr BuildGraph1() { TEST_F(UtestGlobalStepInsertPass, skip_insert) { auto graph = BuildGraph1(); - std::string build_mode; - std::map options_map; - options_map.insert({ge::RUN_FLAG, "0"}); - ge::GetThreadLocalContext().SetGraphOption(options_map); GlobalStepInsertPass pass; Status status = pass.Run(graph); EXPECT_EQ(status, SUCCESS); NodePtr found_node = graph->FindNode(NODE_NAME_GLOBAL_STEP); - EXPECT_EQ(found_node, nullptr); + EXPECT_NE(found_node, nullptr); } From 17a37ca7507a9b6923e99771735069cd264aa7cf Mon Sep 17 00:00:00 2001 From: lichun Date: Wed, 23 Jun 2021 14:28:45 +0800 Subject: [PATCH 26/43] add atc_params: check_report for ConvertModelToJson --- ge/offline/main.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/ge/offline/main.cc b/ge/offline/main.cc index a78ff392..6caed1b7 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -847,6 +847,7 @@ domi::Status GenerateInfershapeJson() { ge::Graph graph; std::map atc_params; atc_params.insert(std::pair("input_format", FLAGS_input_format)); + atc_params.insert(std::pair("check_report", FLAGS_check_report)); ret = ParseGraph(graph, atc_params, FLAGS_om.c_str(), FLAGS_weight.c_str(), (domi::FrameworkType) FLAGS_framework, "", FLAGS_target.c_str(), (ge::RunMode) FLAGS_mode, false); if (ret != ge::SUCCESS) { From f595a577dd4f4e69e1d0a6d305bff17c4374bba5 Mon Sep 17 00:00:00 2001 From: lianghuikang <505519763@qq.com> Date: Wed, 23 Jun 2021 09:31:54 +0800 Subject: [PATCH 27/43] add op_precision_mode option and support op_debug_level = 4 --- ge/ir_build/ge_ir_build.cc | 69 +++++++++++++------ ge/offline/main.cc | 36 ++++++++-- ge/session/inner_session.cc | 12 ++++ inc/external/ge/ge_api_types.h | 5 ++ tests/ut/ge/graph_ir/ge_ir_build_unittest.cc | 37 ++++++++++ tests/ut/ge/session/ge_api_unittest.cc | 2 +- tests/ut/ge/session/inner_session_unittest.cc | 10 +++ 7 files changed, 144 insertions(+), 27 deletions(-) diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index ea521f5b..052af2f6 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -263,6 +263,7 @@ class Impl { omg_context_.user_attr_index_valid = false; }; ~Impl() { (void)generator_.Finalize(); }; + graphStatus CheckBuildModeAndBuildStep(); graphStatus GetSupportedOptions(const std::map &in, std::map &out); graphStatus CheckOptions(const std::map &options); @@ -451,6 +452,37 @@ graphStatus Impl::UpdateDataOpAttr(const Graph &graph) { return GRAPH_SUCCESS; } +graphStatus Impl::CheckBuildModeAndBuildStep() { + std::string build_mode; + auto it = options_.find(BUILD_MODE); + if (it != options_.end() && !(it->second.empty())) { + if (build_mode_options.find(it->second) == build_mode_options.end()) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({BUILD_MODE, it->second, "value is unsupported. Please check!"})); + GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildMode]:%s is unsupported. Please check!", it->second.c_str()); + return GRAPH_PARAM_INVALID; + } + build_mode = it->second; + } + it = options_.find(BUILD_STEP); + if (it != options_.end() && !(it->second.empty())) { + if (build_step_options.find(it->second) == build_step_options.end()) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({BUILD_STEP, it->second, "value is unsupported. Please check!"})); + GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildStep]:%s is unsupported. Please check!", it->second.c_str()); + return GRAPH_PARAM_INVALID; + } + } else { + if (build_mode == BUILD_MODE_TUNING) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({BUILD_MODE, it->second, "tuning must specify build step. Please check!"})); + GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildMode] tuning must specify build step. Please check!"); + return GRAPH_PARAM_INVALID; + } + } + return GRAPH_SUCCESS; +} + graphStatus Impl::GetSupportedOptions(const std::map &in, std::map &out) { for (auto &ele : in) { @@ -475,29 +507,12 @@ graphStatus Impl::CheckOptions(const std::map &options } // Check options build_mode and build_step. - std::string build_mode; - auto it = options_.find(BUILD_MODE); - if (it != options_.end() && !(it->second.empty())) { - if (build_mode_options.find(it->second) == build_mode_options.end()) { - GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildMode]:%s is unsupported. Please check!", it->second.c_str()); - return GRAPH_PARAM_INVALID; - } - build_mode = it->second; - } - it = options_.find(BUILD_STEP); - if (it != options_.end() && !(it->second.empty())) { - if (build_step_options.find(it->second) == build_step_options.end()) { - GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildStep]:%s is unsupported. Please check!", it->second.c_str()); - return GRAPH_PARAM_INVALID; - } - } else { - if (build_mode == BUILD_MODE_TUNING) { - GELOGE(GRAPH_PARAM_INVALID, "[Check][BuildMode] tuning must specify build step. Please check!"); - return GRAPH_PARAM_INVALID; - } + ret = CheckBuildModeAndBuildStep(); + if (ret != GRAPH_SUCCESS) { + return ret; } // Check option EXEC_DISABLE_REUSED_MEMORY - it = options_.find(ge::ir_option::EXEC_DISABLE_REUSED_MEMORY); + auto it = options_.find(ge::ir_option::EXEC_DISABLE_REUSED_MEMORY); if (it != options_.end() && (CheckDisableReuseMemoryParamValid(it->second) != GRAPH_SUCCESS)) { return GRAPH_PARAM_INVALID; } @@ -505,6 +520,18 @@ graphStatus Impl::CheckOptions(const std::map &options if (ge::CheckModifyMixlistParamValid(options_) != GRAPH_SUCCESS) { return GRAPH_PARAM_INVALID; } + // Check option OP_PRECISION_MODE + it = options_.find(ge::ir_option::OP_PRECISION_MODE); + if (it != options_.end() && !it->second.empty() && !ge::CheckInputPathValid(it->second)) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({ge::ir_option::OP_PRECISION_MODE, it->second, "path is not found"})); + GELOGE(GRAPH_PARAM_INVALID, "[Check][OP_PRECISION_MODE] %s not found", it->second.c_str()); + return GRAPH_PARAM_INVALID; + } + if (it != options_.end()) { + GELOGI("Option set successfully, option_key=%s, option_value=%s", + ge::ir_option::OP_PRECISION_MODE, it->second.c_str()); + } // Check Input Format if (options_.find(kInputFormat) != options_.end()) { return CheckInputFormat(options_[kInputFormat]); diff --git a/ge/offline/main.cc b/ge/offline/main.cc index a78ff392..54bded4b 100755 --- a/ge/offline/main.cc +++ b/ge/offline/main.cc @@ -106,10 +106,14 @@ DEFINE_string(out_nodes, "", "Optional; output nodes designated by users." "Format: \"node_name1:0;node_name1:1;node_name2:0\""); +DEFINE_string(op_precision_mode, "", "Optional; operator precision mode configuration file path"); + DEFINE_string(precision_mode, "force_fp16", "Optional; precision mode." "Support force_fp16, force_fp32, allow_mix_precision, allow_fp32_to_fp16, must_keep_origin_dtype."); +DEFINE_string(modify_mixlist, "", "Optional; operator mixed precision configuration file path"); + DEFINE_string(keep_dtype, "", "Optional; config file to specify the precision used by the operator during compilation."); @@ -192,8 +196,11 @@ DEFINE_string(log, "null", "Optional; generate atc log. Support debug, info, war DEFINE_string(dump_mode, "0", "Optional; generate infershape json,only support 1 , 0."); -DEFINE_int32(op_debug_level, 0, "Optional; configure debug level of compiler. 0(default): close debug;" - "1: open TBE compiler, export ccec file and TBE instruction mapping file; 2: open ccec compiler"); +DEFINE_int32(op_debug_level, 0, "Optional; configure debug level of compiler. 0(default): close debug; " + "1: open TBE compiler, export ccec file and TBE instruction mapping file; 2: open ccec compiler; " + "3: disable debug, and keep generating kernel file (.o and .json); 4: disable debug, " + "keep generation kernel file (.o and .json) and generate the operator CCE file (.cce) " + "and the UB fusion computing description file (.json)"); DEFINE_string(enable_scope_fusion_passes, "", "Optional; validate the non-general scope fusion pass," "multiple names can be set and separated by ','."); DEFINE_string(debug_dir, "", "Optional; the path to save the intermediate files of operator compilation"); @@ -210,8 +217,6 @@ DEFINE_string(display_model_info, "0", "Optional; display model info"); DEFINE_string(device_id, "0", "Optional; user device id"); -DEFINE_string(modify_mixlist, "", "Optional; operator mixed precision configuration file path"); - class GFlagUtils { public: /** @@ -298,8 +303,10 @@ class GFlagUtils { "\"l1_optimize\", \"off_optimize\"\n" " --mdl_bank_path Set the path of the custom repository generated after model tuning.\n" "\n[Operator Tuning]\n" + " --op_precision_mode Set the path of operator precision mode configuration file (.ini)\n" " --precision_mode precision mode, support force_fp16(default), force_fp32, allow_mix_precision, " "allow_fp32_to_fp16, must_keep_origin_dtype.\n" + " --modify_mixlist Set the path of operator mixed precision configuration file.\n" " --keep_dtype Retains the precision of certain operators in inference " "scenarios by using a configuration file.\n" " --auto_tune_mode Set tune mode. E.g.: \"GA,RL\", support configure multiple, spit by ,\n" @@ -315,7 +322,8 @@ class GFlagUtils { " 2: Enable TBE pipe_all, generate the operator CCE file and Python-CCE mapping file " "(.json), and enable the CCE compiler -O0-g.\n" " 3: Disable debug, and keep generating kernel file (.o and .json)\n" - " --modify_mixlist Set the path of operator mixed precision configuration file.\n" + " 4: Disable debug, keep generation kernel file (.o and .json) and generate the " + "operator CCE file (.cce) and the UB fusion computing description file (.json)" "\n[Debug]\n" " --save_original_model Control whether to output original model. E.g.: true: output original model\n" " --log Generate log with level. Support debug, info, warning, error, null\n" @@ -365,6 +373,14 @@ class GFlagUtils { FLAGS_op_select_implmode) != ge::SUCCESS, ret = ge::FAILED, "[Check][ImplMode]check optypelist_for_implmode and op_select_implmode failed!"); + if (!FLAGS_op_precision_mode.empty() && !ge::CheckInputPathValid(FLAGS_op_precision_mode, "--op_precision_mode")) { + ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, + {"op_precision_mode", FLAGS_op_precision_mode.c_str(), + "path is not found"}); + GELOGE(ge::FAILED, "[Check][op_precision_mode] %s not found", FLAGS_op_precision_mode.c_str()); + ret = ge::FAILED; + } + if (ge::CheckModifyMixlistParamValid(FLAGS_precision_mode, FLAGS_modify_mixlist) != ge::SUCCESS) { ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, {"modify_mixlist", FLAGS_modify_mixlist.c_str(), @@ -1049,6 +1065,7 @@ static void SetEnvForSingleOp(std::map &options) { options.emplace(ge::RUN_FLAG, flag_off); options.emplace(ge::OPTION_GRAPH_RUN_MODE, flag_off); options.emplace(ge::SINGLE_OP_FLAG, flag_on); + options.emplace(ge::OP_PRECISION_MODE, FLAGS_op_precision_mode); options.emplace(ge::PRECISION_MODE, FLAGS_precision_mode); options.emplace(ge::SOC_VERSION, FLAGS_soc_version); options.emplace(ge::CORE_TYPE, FLAGS_core_type); @@ -1076,6 +1093,14 @@ domi::Status GenerateSingleOp(const std::string& json_file_path) { ge::CheckImplmodeParamValid(FLAGS_optypelist_for_implmode, FLAGS_op_select_implmode) != ge::SUCCESS, return ge::FAILED, "[Check][ImplmodeParam] fail for input optypelist_for_implmode and op_select_implmode."); + if (!FLAGS_op_precision_mode.empty() && !ge::CheckInputPathValid(FLAGS_op_precision_mode, "--op_precision_mode")) { + ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, + {"op_precision_mode", FLAGS_op_precision_mode.c_str(), + "path is not found"}); + GELOGE(ge::FAILED, "[Check][op_precision_mode] %s not found", FLAGS_op_precision_mode.c_str()); + return ge::FAILED; + } + if (ge::CheckModifyMixlistParamValid(FLAGS_precision_mode, FLAGS_modify_mixlist) != ge::SUCCESS) { ErrorManager::GetInstance().ATCReportErrMessage("E10001", {"parameter", "value", "reason"}, {"modify_mixlist", FLAGS_modify_mixlist.c_str(), @@ -1159,6 +1184,7 @@ domi::Status GenerateOmModel() { options.insert(std::pair(string(ge::CALIBRATION_CONF_FILE), FLAGS_cal_conf)); options.insert(std::pair(string(ge::OUTPUT_NODE_NAME), FLAGS_out_nodes)); options.insert(std::pair(string(ge::INSERT_OP_FILE), FLAGS_insert_op_conf)); + options.insert(std::pair(string(ge::OP_PRECISION_MODE), FLAGS_op_precision_mode)); options.insert(std::pair(string(ge::PRECISION_MODE), FLAGS_precision_mode)); options.insert(std::pair(string(ge::TUNE_DEVICE_IDS), FLAGS_device_id)); diff --git a/ge/session/inner_session.cc b/ge/session/inner_session.cc index aabbe19c..54e62d32 100755 --- a/ge/session/inner_session.cc +++ b/ge/session/inner_session.cc @@ -82,6 +82,18 @@ Status InnerSession::Initialize() { return ret; } + //Check option OP_PRECISION_MODE + auto iter = all_options.find(ge::OP_PRECISION_MODE); + if (iter != all_options.end() && !iter->second.empty() && !ge::CheckInputPathValid(iter->second)) { + REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), + std::vector({ge::OP_PRECISION_MODE, iter->second, "path is not found"})); + GELOGE(PARAM_INVALID, "[Check][OP_PRECISION_MODE] %s not found", iter->second.c_str()); + return FAILED; + } + if (iter != all_options.end()) { + GELOGI("Option set successfully, option_key=%s, option_value=%s", + ge::OP_PRECISION_MODE.c_str(), iter->second.c_str()); + } // Check option modify_mixlist if (ge::CheckModifyMixlistParamValid(all_options) != ge::SUCCESS) { return FAILED; diff --git a/inc/external/ge/ge_api_types.h b/inc/external/ge/ge_api_types.h index fbd6c020..6f5bbfbf 100644 --- a/inc/external/ge/ge_api_types.h +++ b/inc/external/ge/ge_api_types.h @@ -113,6 +113,7 @@ const char *const INPUT_FP16_NODES = "ge.INPUT_NODES_SET_FP16"; const char *const OP_DEBUG_LEVEL = "ge.opDebugLevel"; const char *const PERFORMANCE_MODE = "ge.performance_mode"; const char *const MODIFY_MIXLIST = "ge.exec.modify_mixlist"; +const char *const OP_PRECISION_MODE = "ge.exec.op_precision_mode"; } // namespace configure_option // Configure stream num by Session constructor options param, // its value should be int32_t type, default value is "1" @@ -326,6 +327,8 @@ const std::string PERFORMANCE_MODE = "ge.performance_mode"; const std::string MODIFY_MIXLIST = "ge.exec.modify_mixlist"; +const std::string OP_PRECISION_MODE = "ge.exec.op_precision_mode"; + // Graph run mode enum GraphRunMode { PREDICTION = 0, TRAIN }; @@ -405,6 +408,7 @@ static const char *const OP_BANK_UPDATE = ge::OP_BANK_UPDATE_FLAG.c_str(); static const char *const OP_DEBUG_LEVEL = ge::OP_DEBUG_LEVEL.c_str(); static const char *const PERFORMANCE_MODE = ge::PERFORMANCE_MODE.c_str(); static const char *const MODIFY_MIXLIST = ge::MODIFY_MIXLIST.c_str(); +static const char *const OP_PRECISION_MODE = ge::OP_PRECISION_MODE.c_str(); // for interface: aclgrphBuildModel #ifdef __GNUC__ @@ -416,6 +420,7 @@ const std::set ir_builder_suppported_options = {INPUT_FORMAT, DYNAMIC_IMAGE_SIZE, DYNAMIC_DIMS, INSERT_OP_FILE, + OP_PRECISION_MODE, PRECISION_MODE, TUNE_DEVICE_IDS, EXEC_DISABLE_REUSED_MEMORY, diff --git a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc index 197c9300..60f33ed3 100644 --- a/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc +++ b/tests/ut/ge/graph_ir/ge_ir_build_unittest.cc @@ -391,6 +391,43 @@ TEST(UtestIrBuild, check_modify_mixlist_param) { EXPECT_EQ(ret, GRAPH_PARAM_INVALID); } +TEST(UtestIrBuild, check_op_precision_mode_param) { + Graph graph = BuildIrGraph1(); + const std::map build_options = { + {"ge.exec.op_precision_mode", "./op_precision_mode.ini"} + }; + ModelBufferData model; + + auto ret = aclgrphBuildModel(graph, build_options, model); + EXPECT_EQ(ret, GRAPH_PARAM_INVALID); +} + +TEST(UtestIrBuild, check_build_model_and_build_step) { + Graph graph_1 = BuildIrGraph1(); + const std::map build_options_1 = { + {"ge.buildMode", "xxx"} + }; + ModelBufferData model_1; + auto ret_1 = aclgrphBuildModel(graph_1, build_options_1, model_1); + EXPECT_NE(ret_1, GRAPH_SUCCESS); + + Graph graph_2 = BuildIrGraph1(); + const std::map build_options_2 = { + {"ge.buildStep", "xxx"} + }; + ModelBufferData model_2; + auto ret_2 = aclgrphBuildModel(graph_2, build_options_2, model_2); + EXPECT_NE(ret_2, GRAPH_SUCCESS); + + Graph graph_3 = BuildIrGraph1(); + const std::map build_options_3 = { + {"ge.buildMode", "tuning"} + }; + ModelBufferData model_3; + auto ret_3 = aclgrphBuildModel(graph_3, build_options_3, model_3); + EXPECT_NE(ret_3, GRAPH_SUCCESS); +} + TEST(UtestIrBuild, atc_cfg_optype_param) { ComputeGraphPtr graph = BuildComputeGraph1(); FILE *fp = fopen("./keep.txt", "w+"); diff --git a/tests/ut/ge/session/ge_api_unittest.cc b/tests/ut/ge/session/ge_api_unittest.cc index 2cabc4a3..9a7058f3 100644 --- a/tests/ut/ge/session/ge_api_unittest.cc +++ b/tests/ut/ge/session/ge_api_unittest.cc @@ -64,7 +64,7 @@ TEST_F(UtestGeApi, build_graph_success) { ASSERT_NE(ret, SUCCESS); } -TEST_F(UtestGeApi, ge_initialize) { +TEST_F(UtestGeApi, ge_initialize_modify_mixlist) { std::map options = { {ge::MODIFY_MIXLIST, "/mixlist.json"} }; diff --git a/tests/ut/ge/session/inner_session_unittest.cc b/tests/ut/ge/session/inner_session_unittest.cc index ecad56d6..0d20f06a 100644 --- a/tests/ut/ge/session/inner_session_unittest.cc +++ b/tests/ut/ge/session/inner_session_unittest.cc @@ -53,4 +53,14 @@ TEST_F(Utest_Inner_session, initialize) { auto ret = inner_session.Initialize(); EXPECT_NE(ret, ge::SUCCESS); } + +TEST_F(Utest_Inner_session, check_op_precision_mode) { + std::map options = { + {ge::OP_PRECISION_MODE, "./op_precision_mode.ini"} + }; + uint64_t session_id = 1; + InnerSession inner_session(session_id, options); + auto ret = inner_session.Initialize(); + EXPECT_NE(ret, ge::SUCCESS); +} } // namespace ge From 48be801e80aaac9e2b06d1c209fb92adb07064b4 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 16:49:10 +0800 Subject: [PATCH 28/43] Fix mem leak and recursive depth protection --- ge/common/ge/tbe_plugin_manager.cc | 14 +++++++ ge/session/omg.cc | 13 ++++++ ge/single_op/single_op_model.cc | 8 ++-- ge/single_op/single_op_model.h | 2 +- ge/single_op/task/aicpu_task_builder.cc | 8 ++-- ge/single_op/task/aicpu_task_builder.h | 4 +- ge/single_op/task/op_task.cc | 4 +- ge/single_op/task/op_task.h | 1 - tests/ut/ge/CMakeLists.txt | 1 + .../ge/common/tbe_plugin_manager_unittest.cc | 40 +++++++++++++++++++ tests/ut/ge/session/omg_omg_unittest.cc | 9 +++++ .../ge/single_op/single_op_model_unittest.cc | 24 +++++++++++ 12 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 tests/ut/ge/common/tbe_plugin_manager_unittest.cc diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index 94ba8a9a..c876e300 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -105,17 +105,29 @@ void TBEPluginManager::ProcessSoFullName(vector &file_list, string &caff } void TBEPluginManager::FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { + static uint32_t temp_depth = 0; + static const uint32_t max_recursive_depth = 20; // For recursive depth protection + + temp_depth++; + if (temp_depth >= max_recursive_depth) { + GELOGW("Recursive depth is become %u, Please check input!", temp_depth); + temp_depth--; + return; + } + // Path, change to absolute path string real_path = RealPath(path.c_str()); // Plugin path does not exist if (real_path.empty()) { GELOGW("RealPath is empty."); + temp_depth--; return; } INT32 is_dir = mmIsDir(real_path.c_str()); // Lib plugin path not exist if (is_dir != EN_OK) { GELOGW("%s is not a dir. errmsg:%s", real_path.c_str(), strerror(errno)); + temp_depth--; return; } @@ -123,6 +135,7 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis auto ret = mmScandir(real_path.c_str(), &entries, nullptr, nullptr); if (ret < EN_OK) { GELOGW("scan dir failed. path = %s, ret = %d, errmsg = %s", real_path.c_str(), ret, strerror(errno)); + temp_depth--; return; } for (int i = 0; i < ret; ++i) { @@ -142,6 +155,7 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis } } mmScandirFree(entries, ret); + temp_depth--; } void TBEPluginManager::GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path) { diff --git a/ge/session/omg.cc b/ge/session/omg.cc index f7f3def7..8d826043 100755 --- a/ge/session/omg.cc +++ b/ge/session/omg.cc @@ -221,14 +221,25 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) { } void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { + static uint32_t temp_depth = 0; + static const uint32_t max_recursive_depth = 20; // For recursive depth protection + + temp_depth++; + if (temp_depth >= max_recursive_depth) { + GELOGW("Recursive depth is become %u, Please check input!", temp_depth); + temp_depth--; + return; + } // path, Change to absolute path string real_path = RealPath(path.c_str()); if (real_path.empty()) { // plugin path does not exist + temp_depth--; return; } struct stat stat_buf; if ((stat(real_path.c_str(), &stat_buf) != 0) || (!S_ISDIR(stat_buf.st_mode))) { GELOGI("The path %s is not a directory.", real_path.c_str()); + temp_depth--; return; } @@ -237,6 +248,7 @@ void FindParserSo(const string &path, vector &file_list, string &caffe_p if (nullptr == dir) { // plugin path does not exist GELOGW("Open directory %s failed.", path.c_str()); + temp_depth--; return; } @@ -260,6 +272,7 @@ void FindParserSo(const string &path, vector &file_list, string &caffe_p FindParserSo(full_name, file_list, caffe_parser_path); } closedir(dir); + temp_depth--; return; } diff --git a/ge/single_op/single_op_model.cc b/ge/single_op/single_op_model.cc index eefa5165..1d00127a 100755 --- a/ge/single_op/single_op_model.cc +++ b/ge/single_op/single_op_model.cc @@ -380,7 +380,7 @@ Status SingleOpModel::BuildTaskList(StreamResource *stream_resource, SingleOp &s uint64_t singleop_kernel_id = aicpu_kernel_id++; GELOGI("Build singleOp TfTask, kernel_id = %lu", singleop_kernel_id); GE_CHK_STATUS_RET_NOLOG( - BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, false, depend_compute_flag, singleop_kernel_id)); + BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, depend_compute_flag, singleop_kernel_id)); aicpu_task->SetModelArgs(model_name_, model_id_); ParseArgTable(aicpu_task, single_op); single_op.tasks_.emplace_back(aicpu_task); @@ -458,7 +458,7 @@ Status SingleOpModel::BuildKernelTask(const domi::TaskDef &task_def, TbeOpTask * } Status SingleOpModel::BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, - bool dynamic_flag, bool& depend_compute_flag, uint64_t kernel_id) { + bool& depend_compute_flag, uint64_t kernel_id) { auto iter = op_list_.find(kernel_def.op_index()); if (iter == op_list_.end()) { GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, @@ -476,7 +476,7 @@ Status SingleOpModel::BuildKernelExTask(const domi::KernelExDef &kernel_def, AiC return ACL_ERROR_GE_MEMORY_ALLOCATION; } auto builder = AiCpuTaskBuilder(iter->second->GetOpDesc(), kernel_def); - auto ret = builder.BuildTask(*aicpu_task, model_params_, dynamic_flag, kernel_id); + auto ret = builder.BuildTask(*aicpu_task, model_params_, kernel_id); if (ret != SUCCESS) { GELOGE(ret, "[Build][Task] failed, kernel_id:%lu.", kernel_id); return ret; @@ -631,7 +631,7 @@ Status SingleOpModel::BuildTaskListForDynamicOp(StreamResource *stream_resource, bool depend_compute_flag = false; uint64_t dynamic_singleop_kernel_id = aicpu_kernel_id++; GELOGI("Build dynamic singleOp TfTask, kernel_id = %lu", dynamic_singleop_kernel_id); - GE_CHK_STATUS_RET_NOLOG(BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, true, + GE_CHK_STATUS_RET_NOLOG(BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, depend_compute_flag, dynamic_singleop_kernel_id)); if (depend_compute_flag) { if (i >= tasks.size() - 1) { diff --git a/ge/single_op/single_op_model.h b/ge/single_op/single_op_model.h index bf3ad050..747d99e9 100755 --- a/ge/single_op/single_op_model.h +++ b/ge/single_op/single_op_model.h @@ -70,7 +70,7 @@ class SingleOpModel { Status BuildTaskListForDynamicOp(StreamResource *stream_resource, DynamicSingleOp &dynamic_single_op); Status BuildKernelTask(const domi::TaskDef &task_def, TbeOpTask **task); Status BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, - bool dynamic_flag, bool& depend_compute_flag, uint64_t kernel_id); + bool& depend_compute_flag, uint64_t kernel_id); Status BuildCpuKernelTask(const domi::KernelDef &kernel_def, OpTask **task, uint64_t kernel_id); Status BuildModelTaskKernel(StreamResource *stream_resource, const domi::TaskDef &task_def, DynamicSingleOp &single_op); diff --git a/ge/single_op/task/aicpu_task_builder.cc b/ge/single_op/task/aicpu_task_builder.cc index 805b1306..1b945280 100755 --- a/ge/single_op/task/aicpu_task_builder.cc +++ b/ge/single_op/task/aicpu_task_builder.cc @@ -63,7 +63,7 @@ namespace ge { return SUCCESS; } - Status AiCpuTaskBuilder::InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m, bool dynamic_flag) { + Status AiCpuTaskBuilder::InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m) { if (kernel_def_.args_size() > sizeof(STR_FWK_OP_KERNEL)) { GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Size]sizeof STR_FWK_OP_KERNEL is: %lu, but args_size is: %d", sizeof(STR_FWK_OP_KERNEL), kernel_def_.args_size()); @@ -83,9 +83,8 @@ namespace ge { return SUCCESS; } - Status AiCpuTaskBuilder::BuildTask(ge::AiCpuTask &task, const SingleOpModelParam ¶m, - bool dynamic_flag, uint64_t kernel_id) { - GE_CHK_STATUS_RET_NOLOG(InitWorkspaceAndIO(task, param, dynamic_flag)); + Status AiCpuTaskBuilder::BuildTask(ge::AiCpuTask &task, const SingleOpModelParam ¶m, uint64_t kernel_id) { + GE_CHK_STATUS_RET_NOLOG(InitWorkspaceAndIO(task, param)); STR_FWK_OP_KERNEL fwk_op_kernel = {0}; auto ret = SetFmkOpKernel(task.io_addr_, task.workspace_addr_, fwk_op_kernel); @@ -124,7 +123,6 @@ namespace ge { task.arg_size_ = sizeof(STR_FWK_OP_KERNEL); task.op_type_ = op_desc_->GetName(); task.task_info_ = kernel_def_.task_info(); - task.dynamic_flag_ = dynamic_flag; task.kernel_id_ = kernel_id; auto debug_info = BuildTaskUtils::GetTaskInfo(op_desc_); diff --git a/ge/single_op/task/aicpu_task_builder.h b/ge/single_op/task/aicpu_task_builder.h index fe9c9bc2..eca91254 100755 --- a/ge/single_op/task/aicpu_task_builder.h +++ b/ge/single_op/task/aicpu_task_builder.h @@ -29,12 +29,12 @@ namespace ge { AiCpuTaskBuilder(const OpDescPtr &op_desc, const domi::KernelExDef &kernel_def); ~AiCpuTaskBuilder() = default; - Status BuildTask(AiCpuTask &task, const SingleOpModelParam ¶m, bool dynamic_flag, uint64_t kernel_id); + Status BuildTask(AiCpuTask &task, const SingleOpModelParam ¶m, uint64_t kernel_id); private: static Status SetKernelArgs(void **args, STR_FWK_OP_KERNEL &kernel); Status SetFmkOpKernel(void *io_addr, void *ws_addr, STR_FWK_OP_KERNEL &kernel); - Status InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m, bool dynamic_flag); + Status InitWorkspaceAndIO(AiCpuTask &task, const SingleOpModelParam ¶m); const OpDescPtr op_desc_; const domi::KernelExDef &kernel_def_; diff --git a/ge/single_op/task/op_task.cc b/ge/single_op/task/op_task.cc index db2fdfeb..b6a78f9e 100755 --- a/ge/single_op/task/op_task.cc +++ b/ge/single_op/task/op_task.cc @@ -621,9 +621,7 @@ Status AiCpuBaseTask::UpdateIoAddr(const vector &inputs, const vecto AiCpuTask::~AiCpuTask() { FreeHbm(args_); FreeHbm(io_addr_); - if (dynamic_flag_) { - FreeHbm(workspace_addr_); - } + FreeHbm(workspace_addr_); FreeHbm(copy_workspace_buf_); FreeHbm(copy_ioaddr_dev_); FreeHbm(copy_input_release_flag_dev_); diff --git a/ge/single_op/task/op_task.h b/ge/single_op/task/op_task.h index 2fbb4dc7..19320bc0 100644 --- a/ge/single_op/task/op_task.h +++ b/ge/single_op/task/op_task.h @@ -192,7 +192,6 @@ class AiCpuTask : public AiCpuBaseTask { // host addr std::vector io_addr_host_; - bool dynamic_flag_ = false; // for copy task void *copy_task_args_buf_ = nullptr; void *copy_workspace_buf_ = nullptr; diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index cf573343..e3aecf80 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -818,6 +818,7 @@ set(MULTI_PARTS_TEST_FILES "session/inner_session_unittest.cc" "session/session_manager_unittest.cc" "common/host_cpu_engine_unittest.cc" + "common/tbe_plugin_manager_unittest.cc" ) set(GE_OPT_INFO_TEST_FILES diff --git a/tests/ut/ge/common/tbe_plugin_manager_unittest.cc b/tests/ut/ge/common/tbe_plugin_manager_unittest.cc new file mode 100644 index 00000000..16c1650b --- /dev/null +++ b/tests/ut/ge/common/tbe_plugin_manager_unittest.cc @@ -0,0 +1,40 @@ +/** + * Copyright 2021 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#define protected public +#define private public +#include "common/ge/tbe_plugin_manager.h" +#undef private +#undef protected + +namespace ge { +class UtestTBEPluginManager: public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(UtestTBEPluginManager, CheckFindParserSo) { + string path = ""; + vector file_list = {}; + string caffe_parser_path = ""; + TBEPluginManager::Instance().FindParserSo(path, file_list, caffe_parser_path); + path = "/lib64"; + TBEPluginManager::Instance().FindParserSo(path, file_list, caffe_parser_path); +} +} // namespace ge diff --git a/tests/ut/ge/session/omg_omg_unittest.cc b/tests/ut/ge/session/omg_omg_unittest.cc index 334df319..6176b7c0 100644 --- a/tests/ut/ge/session/omg_omg_unittest.cc +++ b/tests/ut/ge/session/omg_omg_unittest.cc @@ -48,4 +48,13 @@ TEST_F(UtestOmg, display_model_info_success) { attr_def->mutable_list()->add_i(4); PrintModelInfo(&model_def, 1); } + +TEST_F(UtestOmg, find_parser_so) { + string path = ""; + vector file_list = {}; + string caffe_parser_path = ""; + FindParserSo(path, file_list, caffe_parser_path); + path = "/lib64"; + FindParserSo(path, file_list, caffe_parser_path); +} } // namespace ge diff --git a/tests/ut/ge/single_op/single_op_model_unittest.cc b/tests/ut/ge/single_op/single_op_model_unittest.cc index 1975f9f4..e4a53340 100644 --- a/tests/ut/ge/single_op/single_op_model_unittest.cc +++ b/tests/ut/ge/single_op/single_op_model_unittest.cc @@ -310,3 +310,27 @@ TEST_F(UtestSingleOpModel, BuildTaskList) { MemcpyAsyncTask mem_task; ASSERT_EQ(mem_task.LaunchKernel(0), SUCCESS); } + +TEST_F(UtestSingleOpModel, build_aicpu_task) { + ComputeGraphPtr graph = make_shared("single_op"); + GeModelPtr ge_model = make_shared(); + ge_model->SetGraph(GraphUtils::CreateGraphFromComputeGraph(graph)); + shared_ptr model_task_def = make_shared(); + ge_model->SetModelTaskDef(model_task_def); + + domi::TaskDef *task_def = model_task_def->add_task(); + task_def->set_type(RT_MODEL_TASK_KERNEL_EX); + + string model_data_str = "123456789"; + SingleOpModel model("model", model_data_str.c_str(), model_data_str.size()); + std::mutex stream_mu; + rtStream_t stream = nullptr; + rtStreamCreate(&stream, 0); + DynamicSingleOp single_op(0, &stream_mu, stream); + model.model_helper_.model_ = ge_model; + auto op_desc = std::make_shared("add", "Add"); + NodePtr node = graph->AddNode(op_desc); + model.op_list_[0] = node; + StreamResource *res = new (std::nothrow) StreamResource(1); + ASSERT_EQ(model.BuildTaskListForDynamicOp(res, single_op), SUCCESS); +} From 0ed42e96f711bbe5287f77e1f04bbed02266d7f2 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 17:29:54 +0800 Subject: [PATCH 29/43] Fix mem leak and recursive depth protection --- ge/common/ge/tbe_plugin_manager.cc | 1 + ge/hybrid/node_executor/task_context.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index c876e300..6a461a6d 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -156,6 +156,7 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis } mmScandirFree(entries, ret); temp_depth--; + return; } void TBEPluginManager::GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path) { diff --git a/ge/hybrid/node_executor/task_context.cc b/ge/hybrid/node_executor/task_context.cc index 78ccb54a..c0464c87 100644 --- a/ge/hybrid/node_executor/task_context.cc +++ b/ge/hybrid/node_executor/task_context.cc @@ -43,6 +43,7 @@ TaskContext::~TaskContext() { output_tensor->Destroy(); } } + ReleaseWorkspace(); } void TaskContext::ReleaseWorkspace() { @@ -50,6 +51,7 @@ void TaskContext::ReleaseWorkspace() { for (auto ws_addr : workspaces_) { execution_context_->allocator->Deallocate(ws_addr); } + workspaces_.clear(); } std::unique_ptr TaskContext::Create(NodeState *node_state, SubgraphContext *subgraph_context) { From 350855d3dca3921f48d42553a5e1db923bd400a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Wed, 23 Jun 2021 09:51:02 +0000 Subject: [PATCH 30/43] update third_party/fwkacllib/inc/runtime/rt_model.h. --- third_party/fwkacllib/inc/runtime/rt_model.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/fwkacllib/inc/runtime/rt_model.h b/third_party/fwkacllib/inc/runtime/rt_model.h index 74539222..30b8f053 100644 --- a/third_party/fwkacllib/inc/runtime/rt_model.h +++ b/third_party/fwkacllib/inc/runtime/rt_model.h @@ -50,8 +50,9 @@ typedef enum tagModelTaskType { RT_MODEL_TASK_STREAM_LABEL_SWITCH_BY_INDEX, RT_MODEL_TASK_STREAM_LABEL_GOTO, RT_MODEL_TASK_MODEL_EXIT, - RT_MODEL_TASK_FFTS_TASK, RT_MODEL_TASK_ALL_KERNEL, + RT_MODEL_TASK_PROFILER_TRACE_EX, + RT_MODEL_TASK_FFTS_TASK, } rtModelTaskType_t; typedef enum tagModelStreamType { From d30366d2c96061538a7f6fed2830b94f0a7e3403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B6=9B?= Date: Wed, 23 Jun 2021 17:53:02 +0800 Subject: [PATCH 31/43] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!1?= =?UTF-8?q?840=20:=20opt=20info'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 1 - ge/CMakeLists.txt | 8 -- ge/ge_opt_info/ge_opt_info.cc | 58 --------- ge/ge_opt_info/ge_opt_info.h | 31 ----- ge/graph/manager/graph_manager.cc | 7 - tests/CMakeLists.txt | 1 - tests/depends/opt_info/CMakeLists.txt | 37 ------ tests/depends/opt_info/src/opt_info_stub.cc | 46 ------- tests/framework/cmake/graphengine.cmake | 2 - tests/st/testcase/test_ge_opt_info.cc | 123 ------------------ tests/ut/ge/CMakeLists.txt | 14 -- .../ut/ge/ge_opt_info/ge_opt_info_unittest.cc | 82 ------------ third_party/fwkacllib/inc/opt_info/opt_info.h | 34 ----- 13 files changed, 444 deletions(-) delete mode 100644 ge/ge_opt_info/ge_opt_info.cc delete mode 100644 ge/ge_opt_info/ge_opt_info.h delete mode 100644 tests/depends/opt_info/CMakeLists.txt delete mode 100644 tests/depends/opt_info/src/opt_info_stub.cc delete mode 100644 tests/st/testcase/test_ge_opt_info.cc delete mode 100644 tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc delete mode 100644 third_party/fwkacllib/inc/opt_info/opt_info.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 41520b14..e3cc1e32 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,6 @@ else () #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) else() find_module(slog libalog.so ${ASCEND_ATC_DIR}) - find_module(opt_feature libopt_feature.so ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) if(PLATFORM STREQUAL "train") find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 5db2e7a9..2b9122da 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -434,7 +434,6 @@ set(TRAIN_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" - "ge_opt_info/ge_opt_info.cc" ) set(INFER_SRC_LIST @@ -712,7 +711,6 @@ set(INFER_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" - "ge_opt_info/ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) @@ -767,13 +765,11 @@ target_include_directories(ge_runner SYSTEM PRIVATE ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external - ${GE_CODE_DIR}/../abl/licctrl #### blue zone ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_runner PRIVATE @@ -796,7 +792,6 @@ target_link_libraries(ge_runner PRIVATE runtime error_manager ascend_hal_stub - opt_feature -Wl,--as-needed json -lrt @@ -844,13 +839,11 @@ target_include_directories(ge_compiler SYSTEM PRIVATE ${GE_CODE_DIR}/../inc ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external - ${GE_CODE_DIR}/../abl/licctrl #### blue zone #### ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_compiler PRIVATE @@ -870,7 +863,6 @@ target_link_libraries(ge_compiler PRIVATE error_manager slog runtime_compile - opt_feature -Wl,--as-needed json -lrt diff --git a/ge/ge_opt_info/ge_opt_info.cc b/ge/ge_opt_info/ge_opt_info.cc deleted file mode 100644 index 8c1b84ab..00000000 --- a/ge/ge_opt_info/ge_opt_info.cc +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ge_opt_info/ge_opt_info.h" - -#include -#include -#include "graph/ge_local_context.h" -#include "ge/ge_api_types.h" -#include "common/debug/ge_log.h" -#include "opt_info.h" - -namespace ge { -Status GeOptInfo::SetOptInfo() { - std::string soc_ver; - graphStatus ret = GetThreadLocalContext().GetOption(SOC_VERSION, soc_ver); - if (ret != GRAPH_SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get soc version failed."); - GELOGE(FAILED, "[Get][SocVersion]Get soc version failed."); - return FAILED; - } - GELOGD("Soc version:%s.", soc_ver.c_str()); - std::map opt_info; - // the first arg does not work at present. - if (gelc::GetOptInfo(gelc::kOffline, soc_ver, opt_info) != gelc::SUCCESS) { - REPORT_CALL_ERROR("E19999", "Get optional information failed, is_offline:%d, soc version:%s", - gelc::kOffline, soc_ver.c_str()); - GELOGE(FAILED, "[Get][OptInfo]Get optional information failed, is_offline:%d, soc version:%s", - gelc::kOffline, soc_ver.c_str()); - return FAILED; - } - // do nothing if get empty information - if (opt_info.empty()) { - GELOGI("Optional information is empty."); - return SUCCESS; - } - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - for (const auto &itr : opt_info) { - graph_options.emplace(itr.first, itr.second); - GELOGI("Get optional information success, key:%s, value:%s.", itr.first.c_str(), itr.second.c_str()); - } - GetThreadLocalContext().SetGraphOption(graph_options); - return SUCCESS; -} -} // namespace ge diff --git a/ge/ge_opt_info/ge_opt_info.h b/ge/ge_opt_info/ge_opt_info.h deleted file mode 100644 index 935dff25..00000000 --- a/ge/ge_opt_info/ge_opt_info.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef GE_OPT_INFO_GE_OPT_INFO_H_ -#define GE_OPT_INFO_GE_OPT_INFO_H_ - -#include "ge/ge_api_error_codes.h" -#include "register/register_types.h" - -namespace ge { -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeOptInfo { - public: - GeOptInfo() = default; - static Status SetOptInfo(); -}; -} // namespace ge - -#endif // GE_OPT_INFO_GE_OPT_INFO_H_ diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 0a4633ad..b862a7d6 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -27,7 +27,6 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/dump/dump_manager.h" -#include "ge_opt_info/ge_opt_info.h" #include "analyzer/analyzer.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" @@ -1002,12 +1001,6 @@ Status GraphManager::PreRun(const GraphNodePtr &graph_node, const std::vector - c_sec -) - -target_include_directories(opt_feature_stub INTERFACE ${CMAKE_CURRENT_LIST_DIR}/src) diff --git a/tests/depends/opt_info/src/opt_info_stub.cc b/tests/depends/opt_info/src/opt_info_stub.cc deleted file mode 100644 index df518c4b..00000000 --- a/tests/depends/opt_info/src/opt_info_stub.cc +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "opt_info.h" -#include -#include -#include -#include - -namespace gelc { -namespace { -const std::vector kSocVersions = {"Ascend910"}; -} - -void SetAllOptInfo(std::map &opt_infos) { - opt_infos.emplace("opt_module.fe", "all"); - opt_infos.emplace("opt_module.pass", "all"); - opt_infos.emplace("opt_module.op_tune", "all"); - opt_infos.emplace("opt_module.rl_tune", "all"); - opt_infos.emplace("opt_module.aoe", "all"); -} - -Status GetOptInfo(WorkMode mode, const std::string &soc_ver, - std::map &opt_infos) { - if (std::find(kSocVersions.begin(), kSocVersions.end(), soc_ver)== kSocVersions.end()) { - SetAllOptInfo(opt_infos); - return SUCCESS; - } - opt_infos.emplace("opt_module.fe", "all"); - opt_infos.emplace("opt_module.pass", "all"); - opt_infos.emplace("opt_module.op_tune", "all"); - return SUCCESS; -} -} // namespace gelc diff --git a/tests/framework/cmake/graphengine.cmake b/tests/framework/cmake/graphengine.cmake index c4380016..81aa00cc 100644 --- a/tests/framework/cmake/graphengine.cmake +++ b/tests/framework/cmake/graphengine.cmake @@ -103,7 +103,6 @@ list(APPEND INCLUDE_DIRECTORIES "${GE_CODE_DIR}/third_party/fwkacllib/inc/cce" "${GE_CODE_DIR}/third_party/fwkacllib/inc/ops" "${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain" - "${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info" "${GE_CODE_DIR}/tests/ut/ge" "${GE_CODE_DIR}/tests/ut/common" "${CMAKE_BINARY_DIR}" @@ -118,7 +117,6 @@ list(APPEND STUB_LIBS runtime_stub profiler_stub hccl_stub - opt_feature_stub error_manager_stub ascend_protobuf json diff --git a/tests/st/testcase/test_ge_opt_info.cc b/tests/st/testcase/test_ge_opt_info.cc deleted file mode 100644 index 457473b1..00000000 --- a/tests/st/testcase/test_ge_opt_info.cc +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "easy_graph/graph/box.h" -#include "easy_graph/graph/node.h" -#include "easy_graph/builder/graph_dsl.h" -#include "easy_graph/builder/box_builder.h" -#include "easy_graph/layout/graph_layout.h" -#include "easy_graph/layout/engines/graph_easy/graph_easy_option.h" -#include "easy_graph/layout/engines/graph_easy/graph_easy_executor.h" -#include "graph/graph.h" -#include "graph/compute_graph.h" -#include "framework/common/types.h" -#include "graph/debug/ge_attr_define.h" -#include "ge_graph_dsl/graph_dsl.h" -#include "ge_graph_dsl/op_desc/op_desc_cfg_box.h" -#define protected public -#define private public -#include "ge_opt_info/ge_opt_info.h" -#undef private -#undef protected - -namespace ge { -class STEST_opt_info : public testing::Test { - protected: - void SetUp() {} - void TearDown() {} -}; - -TEST_F(STEST_opt_info, get_opt_info_all) { - std::map options = {{ge::SOC_VERSION, "Ascend310"}}; - GetThreadLocalContext().SetGlobalOption(options); - - /// data1 data2 - /// \ / - /// add - // build graph - DEF_GRAPH(g1) { - CHAIN(NODE("data1", DATA)->NODE("add", ADD)); - CHAIN(NODE("data2", DATA)->NODE("add")); - }); - - auto graph = ToGeGraph(g1); - - // new session & add graph - Session session(options); - auto ret = session.AddGraph(1, graph, options); - EXPECT_EQ(ret, SUCCESS); - // build input tensor - std::vector inputs; - // build_graph through session - ret = session.BuildGraph(1, inputs); - EXPECT_EQ(ret, SUCCESS); - - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.rl_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.aoe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(STEST_opt_info, get_opt_info_success) { - std::map options = {{ge::SOC_VERSION, "Ascend910"}}; - GetThreadLocalContext().SetGlobalOption(options); - - /// data1 data2 - /// \ / - /// add - // build graph - DEF_GRAPH(g1) { - CHAIN(NODE("data1", DATA)->NODE("add", ADD)); - CHAIN(NODE("data2", DATA)->NODE("add")); - }); - - auto graph = ToGeGraph(g1); - - // new session & add graph - Session session(options); - auto ret = session.AddGraph(1, graph, options); - EXPECT_EQ(ret, SUCCESS); - // build input tensor - std::vector inputs; - // build_graph through session - ret = session.BuildGraph(1, inputs); - EXPECT_EQ(ret, SUCCESS); - - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} -} // namespace ge diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index cf573343..06b3e0f2 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -62,7 +62,6 @@ include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/cce) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/ops) include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain) -include_directories(${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info) include_directories(${GE_CODE_DIR}/tests/ut/ge) include_directories(${GE_CODE_DIR}/tests/ut/common) include_directories(${CMAKE_BINARY_DIR}) @@ -347,7 +346,6 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/ge/datatype_util.cc" "${GE_CODE_DIR}/ge/ge_local_engine/engine/host_cpu_engine.cc" "${GE_CODE_DIR}/ge/session/omg.cc" - "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" ) set(COMMON_FORMAT_SRC_FILES @@ -455,7 +453,6 @@ set(GRAPH_EXECUTE_COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/manager/graph_manager.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.cc" "${GE_CODE_DIR}/ge/graph/manager/util/rt_context_util.cc" - "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.h" ) @@ -631,10 +628,6 @@ set(SINGLE_OP_SRC_FILES "${GE_CODE_DIR}/ge/hybrid/hybrid_davinci_model.cc" ) -set(GE_OPT_INFO_SRC_FILES - "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" -) - # test files set(COMMON_TEST_FILES "graph/passes/graph_builder_utils.cc" @@ -820,10 +813,6 @@ set(MULTI_PARTS_TEST_FILES "common/host_cpu_engine_unittest.cc" ) -set(GE_OPT_INFO_TEST_FILES - "ge_opt_info/ge_opt_info_unittest.cc" -) - set(GENERATOR_TEST_FILES "generator/ge_generator_unittest.cc" ) @@ -875,7 +864,6 @@ list(APPEND COMMON_SHARED_LIBRARIES mmpa_stub hccl_stub error_manager_stub - opt_feature_stub ascend_protobuf json ) @@ -1121,12 +1109,10 @@ target_link_libraries(ut_libge_multiparts_utest # libge_others_utest add_executable(ut_libge_others_utest - ${GE_OPT_INFO_SRC_FILES} ${COMMON_TEST_FILES} ${PASS_TEST_FILES} ${EXECUTE_TEST_FILES} ${OTHERS_TEST_FILES} - ${GE_OPT_INFO_TEST_FILES} ) target_compile_options(ut_libge_others_utest PRIVATE diff --git a/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc b/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc deleted file mode 100644 index 20c123e9..00000000 --- a/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -#define protected public -#define private public -#include "ge_opt_info/ge_opt_info.h" -#include "graph/ge_local_context.h" -#include "external/ge/ge_api_types.h" -#undef private -#undef protected - -namespace ge { -class UTEST_opt_info : public testing::Test { - protected: - void SetUp() {} - void TearDown() {} -}; - -TEST_F(UTEST_opt_info, get_opt_info_success) { - std::map options = {{ge::SOC_VERSION, "Ascend910"}}; - GetThreadLocalContext().SetGlobalOption(options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::SUCCESS); - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(UTEST_opt_info, get_opt_info_all) { - std::map global_options = {{ge::SOC_VERSION, "Ascend310"}}; - GetThreadLocalContext().SetGlobalOption(global_options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::SUCCESS); - std::map graph_options = GetThreadLocalContext().GetAllGraphOptions(); - auto itr = graph_options.find("opt_module.fe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.pass"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.op_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.rl_tune"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); - itr = graph_options.find("opt_module.aoe"); - EXPECT_NE(itr, graph_options.end()); - EXPECT_EQ(itr->second, "all"); -} - -TEST_F(UTEST_opt_info, get_opt_info_failed) { - std::map options; - GetThreadLocalContext().SetGlobalOption(options); - auto ret = GeOptInfo::SetOptInfo(); - EXPECT_EQ(ret, ge::FAILED); -} - -} // namespace ge diff --git a/third_party/fwkacllib/inc/opt_info/opt_info.h b/third_party/fwkacllib/inc/opt_info/opt_info.h deleted file mode 100644 index ea9bb529..00000000 --- a/third_party/fwkacllib/inc/opt_info/opt_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include - -namespace gelc { -using Status = uint32_t; -using WorkMode = uint32_t; -const Status SUCCESS = 0x0; -const Status FAILED = 0xFFFFFFFF; -const WorkMode kOffline = 0x0; -const WorkMode kInline = 0x01; - -extern "C" { -__attribute__((visibility ("default"))) -Status GetOptInfo(WorkMode mode, const std::string &soc_ver, - std::map &opt_info_map); -} -} // namespace gelc - From e7279c1a6c9a5df56da7af51de325bcd4e70c204 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 18:00:27 +0800 Subject: [PATCH 32/43] Fix ut. --- ge/common/ge/tbe_plugin_manager.cc | 1 - ge/single_op/single_op_model.cc | 13 ++++--------- ge/single_op/single_op_model.h | 3 +-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index 6a461a6d..c876e300 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -156,7 +156,6 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis } mmScandirFree(entries, ret); temp_depth--; - return; } void TBEPluginManager::GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path) { diff --git a/ge/single_op/single_op_model.cc b/ge/single_op/single_op_model.cc index 1d00127a..08a0fcbc 100755 --- a/ge/single_op/single_op_model.cc +++ b/ge/single_op/single_op_model.cc @@ -376,11 +376,10 @@ Status SingleOpModel::BuildTaskList(StreamResource *stream_resource, SingleOp &s } else if (task_type == RT_MODEL_TASK_KERNEL_EX) { GELOGD("Building AICPU_TF task"); AiCpuTask *aicpu_task = nullptr; - bool depend_compute_flag = false; uint64_t singleop_kernel_id = aicpu_kernel_id++; GELOGI("Build singleOp TfTask, kernel_id = %lu", singleop_kernel_id); GE_CHK_STATUS_RET_NOLOG( - BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, depend_compute_flag, singleop_kernel_id)); + BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, singleop_kernel_id)); aicpu_task->SetModelArgs(model_name_, model_id_); ParseArgTable(aicpu_task, single_op); single_op.tasks_.emplace_back(aicpu_task); @@ -457,8 +456,7 @@ Status SingleOpModel::BuildKernelTask(const domi::TaskDef &task_def, TbeOpTask * return SUCCESS; } -Status SingleOpModel::BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, - bool& depend_compute_flag, uint64_t kernel_id) { +Status SingleOpModel::BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, uint64_t kernel_id) { auto iter = op_list_.find(kernel_def.op_index()); if (iter == op_list_.end()) { GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, @@ -481,7 +479,6 @@ Status SingleOpModel::BuildKernelExTask(const domi::KernelExDef &kernel_def, AiC GELOGE(ret, "[Build][Task] failed, kernel_id:%lu.", kernel_id); return ret; } - depend_compute_flag = (aicpu_task->GetUnknownType() == DEPEND_COMPUTE); *task = aicpu_task.release(); return SUCCESS; @@ -628,12 +625,10 @@ Status SingleOpModel::BuildTaskListForDynamicOp(StreamResource *stream_resource, } GELOGD("Building AICPU_TF task"); AiCpuTask *aicpu_task = nullptr; - bool depend_compute_flag = false; uint64_t dynamic_singleop_kernel_id = aicpu_kernel_id++; GELOGI("Build dynamic singleOp TfTask, kernel_id = %lu", dynamic_singleop_kernel_id); - GE_CHK_STATUS_RET_NOLOG(BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, - depend_compute_flag, dynamic_singleop_kernel_id)); - if (depend_compute_flag) { + GE_CHK_STATUS_RET_NOLOG(BuildKernelExTask(task_def.kernel_ex(), &aicpu_task, dynamic_singleop_kernel_id)); + if (aicpu_task->GetUnknownType() == DEPEND_COMPUTE) { if (i >= tasks.size() - 1) { GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Task]The copy task of the fourth operator was not found."); REPORT_INNER_ERROR("E19999", "The copy task of the fourth operator was not found."); diff --git a/ge/single_op/single_op_model.h b/ge/single_op/single_op_model.h index 747d99e9..b7f6b42a 100755 --- a/ge/single_op/single_op_model.h +++ b/ge/single_op/single_op_model.h @@ -69,8 +69,7 @@ class SingleOpModel { Status BuildTaskList(StreamResource *stream_resource, SingleOp &single_op); Status BuildTaskListForDynamicOp(StreamResource *stream_resource, DynamicSingleOp &dynamic_single_op); Status BuildKernelTask(const domi::TaskDef &task_def, TbeOpTask **task); - Status BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, - bool& depend_compute_flag, uint64_t kernel_id); + Status BuildKernelExTask(const domi::KernelExDef &kernel_def, AiCpuTask **task, uint64_t kernel_id); Status BuildCpuKernelTask(const domi::KernelDef &kernel_def, OpTask **task, uint64_t kernel_id); Status BuildModelTaskKernel(StreamResource *stream_resource, const domi::TaskDef &task_def, DynamicSingleOp &single_op); From 3996f5df109662f59e7eca969ff9ce9392a8badf Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 19:32:49 +0800 Subject: [PATCH 33/43] Fix bug of recursive depth protection. --- ge/common/ge/tbe_plugin_manager.cc | 16 +++++----------- ge/common/ge/tbe_plugin_manager.h | 3 ++- ge/session/omg.cc | 16 +++++----------- inc/framework/omg/omg.h | 3 ++- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index c876e300..70c1ab94 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -104,14 +104,12 @@ void TBEPluginManager::ProcessSoFullName(vector &file_list, string &caff } } -void TBEPluginManager::FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { - static uint32_t temp_depth = 0; +void TBEPluginManager::FindParserSo(const string &path, vector &file_list, + string &caffe_parser_path, uint32_t recursive_depth) { static const uint32_t max_recursive_depth = 20; // For recursive depth protection - temp_depth++; - if (temp_depth >= max_recursive_depth) { - GELOGW("Recursive depth is become %u, Please check input!", temp_depth); - temp_depth--; + if (recursive_depth >= max_recursive_depth) { + GELOGW("Recursive depth is become %u, Please check input!", recursive_depth); return; } @@ -120,14 +118,12 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis // Plugin path does not exist if (real_path.empty()) { GELOGW("RealPath is empty."); - temp_depth--; return; } INT32 is_dir = mmIsDir(real_path.c_str()); // Lib plugin path not exist if (is_dir != EN_OK) { GELOGW("%s is not a dir. errmsg:%s", real_path.c_str(), strerror(errno)); - temp_depth--; return; } @@ -135,7 +131,6 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis auto ret = mmScandir(real_path.c_str(), &entries, nullptr, nullptr); if (ret < EN_OK) { GELOGW("scan dir failed. path = %s, ret = %d, errmsg = %s", real_path.c_str(), ret, strerror(errno)); - temp_depth--; return; } for (int i = 0; i < ret; ++i) { @@ -151,11 +146,10 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis ProcessSoFullName(file_list, caffe_parser_path, full_name, caffe_parser_so_suff, aicpu_so_suff, aicpu_host_so_suff); } else { - FindParserSo(full_name, file_list, caffe_parser_path); + FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1); } } mmScandirFree(entries, ret); - temp_depth--; } void TBEPluginManager::GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path) { diff --git a/ge/common/ge/tbe_plugin_manager.h b/ge/common/ge/tbe_plugin_manager.h index 4bd8c6e3..eada3e64 100755 --- a/ge/common/ge/tbe_plugin_manager.h +++ b/ge/common/ge/tbe_plugin_manager.h @@ -57,7 +57,8 @@ class TBEPluginManager { static void ProcessSoFullName(vector &file_list, string &caffe_parser_path, string &full_name, const string &caffe_parser_so_suff, const string &aicpu_so_suff, const string &aicpu_host_so_suff); - static void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path); + static void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path, + uint32_t recursive_depth = 0); static void GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path); static void GetCustomOpPath(std::string &customop_path); void LoadCustomOpLib(); diff --git a/ge/session/omg.cc b/ge/session/omg.cc index 8d826043..a2ee176f 100755 --- a/ge/session/omg.cc +++ b/ge/session/omg.cc @@ -220,26 +220,22 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) { return SUCCESS; } -void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { - static uint32_t temp_depth = 0; +void FindParserSo(const string &path, vector &file_list, + string &caffe_parser_path, uint32_t recursive_depth) { static const uint32_t max_recursive_depth = 20; // For recursive depth protection - temp_depth++; - if (temp_depth >= max_recursive_depth) { - GELOGW("Recursive depth is become %u, Please check input!", temp_depth); - temp_depth--; + if (recursive_depth >= max_recursive_depth) { + GELOGW("Recursive depth is become %u, Please check input!", recursive_depth); return; } // path, Change to absolute path string real_path = RealPath(path.c_str()); if (real_path.empty()) { // plugin path does not exist - temp_depth--; return; } struct stat stat_buf; if ((stat(real_path.c_str(), &stat_buf) != 0) || (!S_ISDIR(stat_buf.st_mode))) { GELOGI("The path %s is not a directory.", real_path.c_str()); - temp_depth--; return; } @@ -248,7 +244,6 @@ void FindParserSo(const string &path, vector &file_list, string &caffe_p if (nullptr == dir) { // plugin path does not exist GELOGW("Open directory %s failed.", path.c_str()); - temp_depth--; return; } @@ -269,10 +264,9 @@ void FindParserSo(const string &path, vector &file_list, string &caffe_p continue; } - FindParserSo(full_name, file_list, caffe_parser_path); + FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1); } closedir(dir); - temp_depth--; return; } diff --git a/inc/framework/omg/omg.h b/inc/framework/omg/omg.h index a0cdb449..1c39d203 100644 --- a/inc/framework/omg/omg.h +++ b/inc/framework/omg/omg.h @@ -91,7 +91,8 @@ GE_FUNC_VISIBILITY Status ConvertFwkModelToJson(domi::FrameworkType framework, c GE_FUNC_VISIBILITY void GetGroupName(ge::proto::ModelDef &model); -GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path); +GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path, + uint32_t recursive_depth = 0); GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file); From 3440d44062a01b1fd871e5ce069047b279c5afaf Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Wed, 23 Jun 2021 20:31:18 +0800 Subject: [PATCH 34/43] Fix multi control from one node --- ge/ge_local_engine/engine/host_cpu_engine.cc | 9 +++------ ge/hybrid/model/hybrid_model_builder.cc | 4 ---- ge/hybrid/model/node_item.cc | 15 ++++++--------- ge/hybrid/model/node_item.h | 2 +- .../node_executor/hccl/hccl_node_executor.cc | 1 + ge/hybrid/node_executor/rts/rts_node_executor.cc | 7 +------ 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/ge/ge_local_engine/engine/host_cpu_engine.cc b/ge/ge_local_engine/engine/host_cpu_engine.cc index 488a5ee8..d9b67736 100755 --- a/ge/ge_local_engine/engine/host_cpu_engine.cc +++ b/ge/ge_local_engine/engine/host_cpu_engine.cc @@ -14,14 +14,14 @@ * limitations under the License. */ #include "ge_local_engine/engine/host_cpu_engine.h" -#include "graph/common/omg_util.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/tensor_adapter.h" +#include "graph/utils/node_utils.h" +#include "graph/utils/type_utils.h" #include "register/op_kernel_registry.h" #include "register/host_cpu_context.h" #include "common/ge/ge_util.h" #include "common/ge/plugin_manager.h" -#include "graph/utils/type_utils.h" #include "common/fp16_t.h" #include "common/math/math_util.h" @@ -123,10 +123,7 @@ bool HostCpuEngine::CheckSupported(const string &op_type) { } Status HostCpuEngine::FindOpKernel(const ge::NodePtr &node, std::unique_ptr &op_kernel) { - std::string op_type; - auto status = GetOriginalType(node, op_type); - GE_CHK_BOOL_EXEC_NOLOG(status == SUCCESS, return status); - + const std::string op_type = NodeUtils::GetNodeType(node); auto kernel = OpKernelRegistry::GetInstance().CreateHostCpuOp(op_type); if (kernel == nullptr) { GELOGD("Op of type %s is not supported by host cpu engine", op_type.c_str()); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index c050875e..f6de6ef0 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -289,10 +289,6 @@ Status HybridModelBuilder::GetOrCreateNodeItem(const NodePtr &node, NodeItem **n return SUCCESS; } - if (node->GetType() == MEMCPYASYNC) { // Convert MemcpyAsync to Identity. - node->GetOpDesc()->SetType(IDENTITY); - } - std::unique_ptr new_node; GE_CHK_STATUS_RET(NodeItem::Create(node, new_node), "[Invoke][Create] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET_NOLOG(NodeExecutorManager::GetInstance().GetExecutor(*node, &new_node->node_executor)); diff --git a/ge/hybrid/model/node_item.cc b/ge/hybrid/model/node_item.cc index 5c3d7db3..250562ce 100644 --- a/ge/hybrid/model/node_item.cc +++ b/ge/hybrid/model/node_item.cc @@ -15,9 +15,7 @@ */ #include "hybrid/model/node_item.h" -#include -#include "framework/common/debug/log.h" -#include "graph/common/omg_util.h" + #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" #include "hybrid/executor/worker/shape_inference_engine.h" @@ -98,8 +96,7 @@ Status ParseFusedSubgraph(NodeItem &node_item) { GE_CHECK_NOTNULL(node); auto op_desc = node->GetOpDesc(); GE_CHECK_NOTNULL(op_desc); - std::string node_type; - GE_CHK_STATUS_RET(GetOriginalType(node, node_type)); + const std::string node_type = NodeUtils::GetNodeType(node); if (node_type == DATA) { GE_CHK_GRAPH_STATUS_RET(ParseInputMapping(*node, *op_desc, *fused_subgraph)); } else if (node_type == kNodeTypeRetVal) { @@ -409,8 +406,8 @@ void NodeItem::SetDataSend(NodeItem *node_item, int anchor_index) { void NodeItem::SetCtrlSend(NodeItem *node_item, uint32_t switch_index) { if (switch_index < switch_groups_.size()) { - std::vector &switch_group = switch_groups_[switch_index]; - switch_group.emplace_back(node_item); + auto &switch_group = switch_groups_[switch_index]; + switch_group.emplace(node_item); } else { ctrl_send_.insert(node_item); } @@ -433,8 +430,8 @@ void NodeItem::SetMergeCtrl(NodeItem *node_item, uint32_t merge_index) { } // this is StreamMerge node, node_item is StreamActive node. - std::vector &switch_group = switch_groups_[merge_index]; - switch_group.emplace_back(node_item); + auto &switch_group = switch_groups_[merge_index]; + switch_group.emplace(node_item); node_item->ctrl_send_.emplace(this); GELOGI("Node[%s] will control node[%s]", node_item->NodeName().c_str(), NodeName().c_str()); diff --git a/ge/hybrid/model/node_item.h b/ge/hybrid/model/node_item.h index ec66f094..12775b00 100644 --- a/ge/hybrid/model/node_item.h +++ b/ge/hybrid/model/node_item.h @@ -155,7 +155,7 @@ struct NodeItem { std::map data_recv_; // Recv data notify from std::set ctrl_send_; // Send ctrl notify to std::set ctrl_recv_; // Recv ctrl notify from - std::vector> switch_groups_; // Send ctrl notify to + std::vector> switch_groups_; // Send ctrl notify to std::shared_ptr kernel_task; std::unique_ptr fused_subgraph; diff --git a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc index b8819a42..3f887819 100644 --- a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc +++ b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc @@ -342,6 +342,7 @@ Status RdmaNodeTask::ExecuteAsync(TaskContext &context, std::function do GE_CHK_RT_RET(rtEventDestroy(evt)); } GELOGI("rdma callback success."); + return SUCCESS; }; HcclResult hccl_ret = HcomExecEnqueueRemoteAccess(context.GetNodeItem().NodeType(), addr_infos, callback); diff --git a/ge/hybrid/node_executor/rts/rts_node_executor.cc b/ge/hybrid/node_executor/rts/rts_node_executor.cc index 5cd971df..d52f56b9 100644 --- a/ge/hybrid/node_executor/rts/rts_node_executor.cc +++ b/ge/hybrid/node_executor/rts/rts_node_executor.cc @@ -17,13 +17,9 @@ #include "hybrid/node_executor/rts/rts_node_executor.h" #include "hybrid/node_executor/rts/rts_task_factory.h" -#include "framework/common/debug/log.h" #include "common/ge/ge_util.h" -#include "framework/common/types.h" -#include "graph/common/omg_util.h" #include "graph/utils/tensor_utils.h" #include "hybrid/model/hybrid_model.h" -#include "runtime/rt.h" namespace ge { namespace hybrid { @@ -133,8 +129,7 @@ Status ProfilingTraceNodeTask::ExecuteAsync(TaskContext &context, std::function< Status RtsNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &node, shared_ptr &task) const { GE_CHECK_NOTNULL(node); GELOGD("[%s] Load for local task.", node->GetName().c_str()); - std::string node_type; - GE_CHK_STATUS_RET(GetOriginalType(node, node_type), "Get original type failed."); + const std::string node_type = NodeUtils::GetNodeType(node); RtsNodeTaskPtr rts_task = RtsTaskFactory::GetInstance().Create(node_type); if (rts_task == nullptr) { GELOGE(UNSUPPORTED, "[%s] Unsupported RTS op type: %s", node->GetName().c_str(), node_type.c_str()); From 538394ffc5a60fe2b4c6f71de3033190e617173c Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Wed, 23 Jun 2021 20:53:47 +0800 Subject: [PATCH 35/43] Fix Guard for variable release --- ge/graph/load/model_manager/model_manager.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 2cb31074..8bcaa23f 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -1394,9 +1394,19 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { return SUCCESS; } + rtStream_t stream = nullptr; vector allocated_mem; + std::function callback = [&]() { + for (auto mem : allocated_mem) { + GE_CHK_RT(rtFree(mem)); + } + if (stream != nullptr) { + GE_CHK_RT(rtStreamDestroy(stream)); + } + }; + GE_MAKE_GUARD(release, callback); + rtError_t status; - rtStream_t stream = nullptr; vector v_cust_so; void *args = nullptr; @@ -1471,13 +1481,6 @@ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { GELOGE(RT_FAILED, "[Call][RtStreamSynchronize] fail, ret = 0x%X", status); return RT_ERROR_TO_GE_STATUS(status); } - std::function callback = [&]() { - for (auto mem : allocated_mem) { - GE_CHK_RT(rtFree(mem)); - } - GE_CHK_RT(rtStreamDestroy(stream)); - }; - GE_MAKE_GUARD(release, callback); GELOGI("Cpu kernel launch task success."); return SUCCESS; } From 8a1ec9739945e9292a6af47980370147d3931014 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 21:03:49 +0800 Subject: [PATCH 36/43] Fix st. --- ge/session/omg.cc | 11 ++--------- inc/framework/omg/omg.h | 3 +-- tests/ut/ge/session/omg_omg_unittest.cc | 9 --------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/ge/session/omg.cc b/ge/session/omg.cc index a2ee176f..f7f3def7 100755 --- a/ge/session/omg.cc +++ b/ge/session/omg.cc @@ -220,14 +220,7 @@ static Status ParseOutputFp16NodesFormat(const string &is_output_fp16) { return SUCCESS; } -void FindParserSo(const string &path, vector &file_list, - string &caffe_parser_path, uint32_t recursive_depth) { - static const uint32_t max_recursive_depth = 20; // For recursive depth protection - - if (recursive_depth >= max_recursive_depth) { - GELOGW("Recursive depth is become %u, Please check input!", recursive_depth); - return; - } +void FindParserSo(const string &path, vector &file_list, string &caffe_parser_path) { // path, Change to absolute path string real_path = RealPath(path.c_str()); if (real_path.empty()) { // plugin path does not exist @@ -264,7 +257,7 @@ void FindParserSo(const string &path, vector &file_list, continue; } - FindParserSo(full_name, file_list, caffe_parser_path, recursive_depth + 1); + FindParserSo(full_name, file_list, caffe_parser_path); } closedir(dir); return; diff --git a/inc/framework/omg/omg.h b/inc/framework/omg/omg.h index 1c39d203..a0cdb449 100644 --- a/inc/framework/omg/omg.h +++ b/inc/framework/omg/omg.h @@ -91,8 +91,7 @@ GE_FUNC_VISIBILITY Status ConvertFwkModelToJson(domi::FrameworkType framework, c GE_FUNC_VISIBILITY void GetGroupName(ge::proto::ModelDef &model); -GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path, - uint32_t recursive_depth = 0); +GE_FUNC_VISIBILITY void FindParserSo(const string &path, vector &fileList, string &caffe_parser_path); GE_FUNC_VISIBILITY Status DumpInfershapeJson(const ge::Graph &graph, const char *json_file); diff --git a/tests/ut/ge/session/omg_omg_unittest.cc b/tests/ut/ge/session/omg_omg_unittest.cc index 6176b7c0..334df319 100644 --- a/tests/ut/ge/session/omg_omg_unittest.cc +++ b/tests/ut/ge/session/omg_omg_unittest.cc @@ -48,13 +48,4 @@ TEST_F(UtestOmg, display_model_info_success) { attr_def->mutable_list()->add_i(4); PrintModelInfo(&model_def, 1); } - -TEST_F(UtestOmg, find_parser_so) { - string path = ""; - vector file_list = {}; - string caffe_parser_path = ""; - FindParserSo(path, file_list, caffe_parser_path); - path = "/lib64"; - FindParserSo(path, file_list, caffe_parser_path); -} } // namespace ge From 55a5e8019df6c0e53c474c27e91a045d5492002c Mon Sep 17 00:00:00 2001 From: lianghao Date: Tue, 22 Jun 2021 21:49:01 +0800 Subject: [PATCH 37/43] FillKernel --- ge/host_kernels/fill_kernel.cc | 8 +++++ .../folding_kernel/fill_kernel_unittest.cc | 36 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/ge/host_kernels/fill_kernel.cc b/ge/host_kernels/fill_kernel.cc index e41c5bf3..ac46101b 100644 --- a/ge/host_kernels/fill_kernel.cc +++ b/ge/host_kernels/fill_kernel.cc @@ -45,6 +45,7 @@ Status FillKernel::Compute(const ge::OpDescPtr op_desc_ptr, const std::vectorGetName().c_str()); GE_CHECK_NOTNULL(input.at(kFillDimsInputIndex)); GE_CHECK_NOTNULL(input.at(kFillDataInputIndex)); @@ -57,6 +58,13 @@ Status FillKernel::Compute(const ge::OpDescPtr op_desc_ptr, const std::vectorGetOutputDescPtr(0); + GE_CHECK_NOTNULL(output_desc); + if (output_desc->GetShape().IsUnknownShape()) { + GELOGD("Output is unknown shape, [%s] skip FillKernel.", op_desc_ptr->GetName().c_str()); + return NOT_CHANGED; + } + GeTensorPtr output_ptr; output_ptr = MakeShared(op_desc_ptr->GetOutputDesc(0)); if (output_ptr == nullptr) { diff --git a/tests/ut/ge/graph/passes/folding_kernel/fill_kernel_unittest.cc b/tests/ut/ge/graph/passes/folding_kernel/fill_kernel_unittest.cc index f58d6d9b..c0cce260 100644 --- a/tests/ut/ge/graph/passes/folding_kernel/fill_kernel_unittest.cc +++ b/tests/ut/ge/graph/passes/folding_kernel/fill_kernel_unittest.cc @@ -64,6 +64,7 @@ class UtestGraphPassesFoldingKernelFillKernel : public testing::Test { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -124,6 +125,7 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillBoolShape2And3) { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -230,6 +232,7 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillDimsHaveNegativeNumber) { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -284,6 +287,7 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillDimsTypeNotSupport) { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -310,6 +314,7 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillDimsOverflow) { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -336,6 +341,7 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillDimsMulDataTypeOverflow) { op_desc_ptr->AddInputDesc(dims_tensor_desc); op_desc_ptr->AddInputDesc(value_tensor_desc); + op_desc_ptr->AddOutputDesc(dims_tensor_desc); std::vector input = {dim_tensor, value_tensor}; std::vector outputs; @@ -343,3 +349,33 @@ TEST_F(UtestGraphPassesFoldingKernelFillKernel, FillDimsMulDataTypeOverflow) { EXPECT_EQ(PARAM_INVALID, status); } + +TEST_F(UtestGraphPassesFoldingKernelFillKernel, OutputdescUnknown) { + ge::OpDescPtr op_dims = std::make_shared(); + vector dims_vec = {2}; + vector dims_value_vec = {2, 3}; + GeTensorDesc dims_tensor_desc(GeShape(dims_vec), FORMAT_NCHW, DT_INT32); + GeTensorPtr dim_tensor = std::make_shared(dims_tensor_desc, (uint8_t *) dims_value_vec.data(), + dims_value_vec.size() * sizeof(int32_t)); + OpDescUtils::SetWeights(op_dims, dim_tensor); + + ge::OpDescPtr op_value = std::make_shared(); + vector data_vec = {1}; + GeTensorDesc value_tensor_desc(GeShape(), FORMAT_NCHW, DT_BOOL); + GeTensorPtr value_tensor = + std::make_shared(value_tensor_desc, (uint8_t *) data_vec.data(), data_vec.size() * sizeof(bool)); + OpDescUtils::SetWeights(op_value, value_tensor); + + op_desc_ptr->AddInputDesc(dims_tensor_desc); + op_desc_ptr->AddInputDesc(value_tensor_desc); + + vector out_vec = {-1, -1}; + GeTensorDesc out_tensor_desc(GeShape(out_vec), FORMAT_NCHW, DT_INT32); + op_desc_ptr->AddOutputDesc(out_tensor_desc); + + std::vector input = {dim_tensor, value_tensor}; + std::vector outputs; + Status status = kernel->Compute(op_desc_ptr, input, outputs); + + EXPECT_EQ(NOT_CHANGED, status); +} \ No newline at end of file From a55b872fc5de15af2c50e082a2f11b2d2d9fc38d Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Thu, 24 Jun 2021 09:32:14 +0800 Subject: [PATCH 38/43] UT for LaunchKernelCustAicpuSo --- ge/graph/load/model_manager/model_manager.cc | 4 +++- .../ut/ge/graph/load/model_manager_unittest.cc | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 8bcaa23f..3c31014d 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -1378,7 +1378,9 @@ Status ModelManager::LoadCustAicpuSo(const OpDescPtr &op_desc, const string &so_ Status ModelManager::LaunchKernelCustAicpuSo(const string &kernel_name) { GELOGD("Aicpu kernel launch task in, kernel name %s.", kernel_name.c_str()); std::lock_guard lock(cust_aicpu_mutex_); - if (cust_aicpu_so_.size() == 0) return SUCCESS; + if (cust_aicpu_so_.empty()) { + return SUCCESS; + } // get current context rtContext_t rt_cur_ctx = nullptr; auto rt_error = rtCtxGetCurrent(&rt_cur_ctx); diff --git a/tests/ut/ge/graph/load/model_manager_unittest.cc b/tests/ut/ge/graph/load/model_manager_unittest.cc index a3545b33..d9e4eabd 100644 --- a/tests/ut/ge/graph/load/model_manager_unittest.cc +++ b/tests/ut/ge/graph/load/model_manager_unittest.cc @@ -438,4 +438,22 @@ 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_launch_kernel_cust_aicpu) { + ModelManager mm; + + // cust_aicpu_so_ is empty. + EXPECT_EQ(mm.LaunchKernelCustAicpuSo("empty_cust_aicpu"), SUCCESS); + + // deleteCustOp after Launch will deleted. + uintptr_t resource_id = 1; // for rtCtxGetCurrent stub + std::vector kernel_bin(256); + auto &cust_resource_001 = mm.cust_aicpu_so_[resource_id]; + auto tbe_kernel = std::shared_ptr(new OpKernelBin("deleteCustOp", std::move(kernel_bin))); + auto &cust_opkernel_001 = cust_resource_001["deleteCustOp"] = tbe_kernel; + + EXPECT_FALSE(mm.cust_aicpu_so_.empty()); + EXPECT_EQ(mm.LaunchKernelCustAicpuSo("deleteCustOp"), SUCCESS); + EXPECT_TRUE(mm.cust_aicpu_so_.empty()); +} } // namespace ge From 4fd937eb056b6a82094428d0b31a4feb3cb1f19d Mon Sep 17 00:00:00 2001 From: zhangxiaokun Date: Thu, 24 Jun 2021 15:49:11 +0800 Subject: [PATCH 39/43] Replace MemcpyAsyncNodeTask --- .../node_executor/rts/rts_node_executor.cc | 1 + ge/hybrid/node_executor/rts/rts_node_task.cc | 29 ------------------- ge/hybrid/node_executor/rts/rts_node_task.h | 5 ---- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/ge/hybrid/node_executor/rts/rts_node_executor.cc b/ge/hybrid/node_executor/rts/rts_node_executor.cc index d52f56b9..e3058ee3 100644 --- a/ge/hybrid/node_executor/rts/rts_node_executor.cc +++ b/ge/hybrid/node_executor/rts/rts_node_executor.cc @@ -29,6 +29,7 @@ REGISTER_RTS_TASK_CREATOR(IDENTITY, IdentityNodeTask); REGISTER_RTS_TASK_CREATOR(IDENTITYN, IdentityNNodeTask); REGISTER_RTS_TASK_CREATOR(READVARIABLEOP, ReadVariableOpNodeTask); REGISTER_RTS_TASK_CREATOR(PROFILINGTRAININGTRACE, ProfilingTraceNodeTask); +REGISTER_RTS_TASK_CREATOR(MEMCPYASYNC, IdentityNodeTask); Status IdentityNodeTask::DoCopyTensor(TaskContext &context, int index) { auto input_desc = context.MutableInputDesc(index); diff --git a/ge/hybrid/node_executor/rts/rts_node_task.cc b/ge/hybrid/node_executor/rts/rts_node_task.cc index 9af54815..7b95f98a 100644 --- a/ge/hybrid/node_executor/rts/rts_node_task.cc +++ b/ge/hybrid/node_executor/rts/rts_node_task.cc @@ -43,7 +43,6 @@ namespace hybrid { REGISTER_RTS_TASK_CREATOR(STREAMACTIVE, StreamActiveNodeTask); REGISTER_RTS_TASK_CREATOR(STREAMSWITCH, StreamSwitchNodeTask); REGISTER_RTS_TASK_CREATOR(STREAMMERGE, StreamMergeNodeTask); -REGISTER_RTS_TASK_CREATOR(MEMCPYASYNC, MemcpyAsyncNodeTask); REGISTER_RTS_TASK_CREATOR(ENTER, PassThroughNodeTask); REGISTER_RTS_TASK_CREATOR(REFENTER, PassThroughNodeTask); @@ -168,34 +167,6 @@ Status StreamMergeNodeTask::ExecuteAsync(TaskContext &task_context, std::functio return SUCCESS; } -Status MemcpyAsyncNodeTask::ExecuteAsync(TaskContext &task_context, std::function done_callback) { - GELOGD("[%s] Start to execute.", task_context.GetNodeName()); - auto input_desc = task_context.MutableInputDesc(0); - GE_CHECK_NOTNULL(input_desc); - int64_t copy_size = 0; - GE_CHK_GRAPH_STATUS_RET(TensorUtils::GetTensorSizeInBytes(*input_desc, copy_size)); - // copy_size would not be negative since GetTensorSizeInBytes returned successfully. - if (copy_size > 0) { - const auto in_v = task_context.MutableInput(0); - const auto out_v = task_context.MutableOutput(0); - GE_CHECK_NOTNULL(in_v); - GE_CHECK_NOTNULL(out_v); - GELOGD("[%s] input size: %zu, output size: %zu, copy size: %ld", task_context.GetNodeName(), - in_v->GetSize(), out_v->GetSize(), copy_size); - GE_CHK_RT_RET(rtMemcpyAsync(out_v->MutableData(), out_v->GetSize(), in_v->GetData(), copy_size, - RT_MEMCPY_DEVICE_TO_DEVICE, task_context.GetStream())); - } else { - GELOGW("[%s] invalid copy size: %ld", task_context.GetNodeName(), copy_size); - } - - if (done_callback) { - GE_CHK_STATUS_RET(task_context.RegisterCallback(done_callback)); - } - - GELOGD("[%s] Done executing successfully.", task_context.GetNodeName()); - return SUCCESS; -} - Status PassThroughNodeTask::ExecuteAsync(TaskContext &task_context, std::function done_callback) { GELOGD("[%s] Start to execute.", task_context.GetNodeName()); const auto in_x = task_context.GetInput(0); // x diff --git a/ge/hybrid/node_executor/rts/rts_node_task.h b/ge/hybrid/node_executor/rts/rts_node_task.h index d7d63eb5..e18f9a8f 100644 --- a/ge/hybrid/node_executor/rts/rts_node_task.h +++ b/ge/hybrid/node_executor/rts/rts_node_task.h @@ -60,11 +60,6 @@ class StreamMergeNodeTask : public RtsNodeTask { Status ExecuteAsync(TaskContext &task_context, std::function done_callback) override; }; -class MemcpyAsyncNodeTask : public RtsNodeTask { - public: - Status ExecuteAsync(TaskContext &task_context, std::function done_callback) override; -}; - class PassThroughNodeTask : public RtsNodeTask { public: Status ExecuteAsync(TaskContext &task_context, std::function done_callback) override; From 27a9d527f9649d4e46c01052ab82b30533dca798 Mon Sep 17 00:00:00 2001 From: zhupuxu Date: Wed, 9 Jun 2021 14:13:41 +0800 Subject: [PATCH 40/43] step info Signed-off-by: zhupuxu --- ge/common/profiling/ge_profiling.cc | 39 ++++++++++++++++++- inc/framework/common/profiling/ge_profiling.h | 5 +++ tests/depends/profiler/src/profiler_stub.cc | 8 ++++ tests/ut/ge/CMakeLists.txt | 1 + .../ge_profiling_manager_unittest.cc | 19 ++++++++- 5 files changed, 69 insertions(+), 3 deletions(-) diff --git a/ge/common/profiling/ge_profiling.cc b/ge/common/profiling/ge_profiling.cc index d0343326..48d12609 100644 --- a/ge/common/profiling/ge_profiling.cc +++ b/ge/common/profiling/ge_profiling.cc @@ -22,6 +22,7 @@ #include "graph/load/graph_loader.h" #include "init/gelib.h" #include "framework/common/ge_inner_error_codes.h" +#include "model/ge_model.h" namespace { const uint32_t kDeviceListIndex = 3; @@ -42,6 +43,10 @@ const std::map kProfCommandTypeMap = { {kProfCommandhandleFinalize, kProfilingFinalize}, {kProfCommandhandleModelSubscribe, kProfModelSubscribe}, {kProfCommandhandleModelUnsubscribe, kProfModelUnsubscribe}}; + +const uint64_t kModelId = ge::INVALID_MODEL_ID; +const uint16_t kStepStart = 0; +const uint16_t kStepEnd = 1; } // namespace bool TransProfConfigToParam(const ProfCommandHandleData &profCommand, vector &prof_config_params) { @@ -216,6 +221,36 @@ ge::Status ProfCommandHandle(ProfCommandHandleType type, void *data, uint32_t le return ge::SUCCESS; } -GE_FUNC_VISIBILITY ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream) { - return ge::SUCCESS; +ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream) { + static bool is_first_run = true; + int32_t device_id = 0; + rtError_t rt_ret = rtGetDevice(&device_id); + if (rt_ret != RT_ERROR_NONE) { + GELOGE(rt_ret, "[Get][LogicDeviceId]Failed, ret 0x%X", rt_ret); + REPORT_CALL_ERROR("E19999", "Get logic device id failed, ret 0x%X", rt_ret); + return ge::FAILED; + } + if (is_first_run && tag_id == kStepStart) { + GE_CHK_STATUS_RET_NOLOG(ge::ProfilingManager::Instance().ProfileStepInfo(index_id, + kModelId, + tag_id, + stream, + device_id)); + is_first_run = false; + return ge::SUCCESS; + } + if (!is_first_run && tag_id == kStepEnd) { + GE_CHK_STATUS_RET_NOLOG(ge::ProfilingManager::Instance().ProfileStepInfo(index_id, + kModelId, + tag_id, + stream, + device_id)); + is_first_run = true; + return ge::SUCCESS; + } + GELOGE(ge::FAILED, "Param tag_id:%u invalid when is_first_run is %d", tag_id, is_first_run); + REPORT_INPUT_ERROR("E10001", std::vector({"value", "parameter", "reason"}), + std::vector({std::to_string(tag_id), "tag_id", + "tag id must be 0 when first run, must be 1 when second run"})); + return ge::FAILED; } diff --git a/inc/framework/common/profiling/ge_profiling.h b/inc/framework/common/profiling/ge_profiling.h index a8de56a8..7a238b2f 100644 --- a/inc/framework/common/profiling/ge_profiling.h +++ b/inc/framework/common/profiling/ge_profiling.h @@ -43,6 +43,11 @@ GE_FUNC_VISIBILITY ge::Status RegProfCtrlCallback(MsprofCtrlCallback func); GE_FUNC_VISIBILITY ge::Status RegProfSetDeviceCallback(MsprofSetDeviceCallback func); GE_FUNC_VISIBILITY ge::Status RegProfReporterCallback(MsprofReporterCallback func); GE_FUNC_VISIBILITY ge::Status ProfCommandHandle(ProfCommandHandleType type, void *data, uint32_t len); + +/// +/// @brief Output the profiling data of single operator in Pytorch, and does not support multithreading +/// @return Status result +/// GE_FUNC_VISIBILITY ge::Status ProfSetStepInfo(uint64_t index_id, uint16_t tag_id, rtStream_t stream); #endif // INC_FRAMEWORK_COMMON_GE_PROFILING_H_ diff --git a/tests/depends/profiler/src/profiler_stub.cc b/tests/depends/profiler/src/profiler_stub.cc index 1ed49fd8..0b8eaa88 100644 --- a/tests/depends/profiler/src/profiler_stub.cc +++ b/tests/depends/profiler/src/profiler_stub.cc @@ -16,6 +16,7 @@ #include "toolchain/prof_engine.h" #include "toolchain/prof_mgr_core.h" +#include "runtime/base.h" void * ProfMgrStartUp(const ProfMgrCfg *cfg) { @@ -32,3 +33,10 @@ int Msprof::Engine::RegisterEngine(const std::string& module, const Msprof::Engi return 0; } +rtError_t rtSetMsprofReporterCallback(MsprofReporterCallback callback) { + return 0; +} + +rtError_t rtRegDeviceStateCallback(const char *regName, rtDeviceStateCallback callback) { + return 0; +} diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 3ea4d1a7..25fe4947 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -158,6 +158,7 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/opskernel_manager/ops_kernel_builder_manager.cc" "${GE_CODE_DIR}/ge/graph/load/model_manager/model_manager.cc" "${GE_CODE_DIR}/ge/common/profiling/profiling_manager.cc" + "${GE_CODE_DIR}/ge/common/profiling/ge_profiling.cc" "${GE_CODE_DIR}/ge/graph/manager/host_mem_manager.cc" "${GE_CODE_DIR}/ge/graph/manager/memory_api.cc" "${GE_CODE_DIR}/ge/session/inner_session.cc" diff --git a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc index 9c615317..aae3f535 100644 --- a/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc +++ b/tests/ut/ge/profiling/ge_profiling_manager_unittest.cc @@ -25,6 +25,7 @@ #define private public #include "common/profiling/profiling_manager.h" #include "graph/ge_local_context.h" +#include "inc/framework/common/profiling/ge_profiling.h" #undef protected #undef private @@ -115,4 +116,20 @@ TEST_F(UtestGeProfilinganager, get_fp_bp_point_empty) { ProfilingManager::Instance().GetFpBpPoint(fp_point, bp_point); EXPECT_EQ(fp_point, ""); EXPECT_EQ(bp_point, ""); -} \ No newline at end of file +} + +TEST_F(UtestGeProfilinganager, set_step_info_success) { + uint64_t index_id = 0; + auto stream = (rtStream_t)0x1; + Status ret = ProfSetStepInfo(index_id, 0, stream); + EXPECT_EQ(ret, ge::SUCCESS); + ret = ProfSetStepInfo(index_id, 1, stream); + EXPECT_EQ(ret, ge::SUCCESS); +} + +TEST_F(UtestGeProfilinganager, set_step_info_failed) { + uint64_t index_id = 0; + auto stream = (rtStream_t)0x1; + Status ret = ProfSetStepInfo(index_id, 1, stream); + EXPECT_EQ(ret, ge::FAILED); +} From 6ab6ee4c72aae0b3cc3752a9edb9c62ce8a5bb2f Mon Sep 17 00:00:00 2001 From: zhou_chao1993 Date: Fri, 25 Jun 2021 11:15:15 +0800 Subject: [PATCH 41/43] add ptr checker --- ge/hybrid/common/tensor_value.h | 3 ++- ge/hybrid/executor/hybrid_model_async_executor.cc | 12 ++++++++---- ge/hybrid/executor/hybrid_model_async_executor.h | 4 ++-- .../executor/hybrid_model_async_executor_unittest.cc | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ge/hybrid/common/tensor_value.h b/ge/hybrid/common/tensor_value.h index c20074fd..c041263b 100644 --- a/ge/hybrid/common/tensor_value.h +++ b/ge/hybrid/common/tensor_value.h @@ -95,7 +95,8 @@ class TensorValue { name_ = name; } - MemStorageType GetMemType() const { + Status GetMemType(MemStorageType &mem_type) const { + GE_CHECK_NOTNULL(buffer_); return buffer_->GetMemType(); } diff --git a/ge/hybrid/executor/hybrid_model_async_executor.cc b/ge/hybrid/executor/hybrid_model_async_executor.cc index a6f31522..e0dd768d 100644 --- a/ge/hybrid/executor/hybrid_model_async_executor.cc +++ b/ge/hybrid/executor/hybrid_model_async_executor.cc @@ -458,7 +458,8 @@ Status HybridModelAsyncExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &a auto tensor = TensorAdapter::AsTensor(ge_tensor); outputs.emplace_back(std::move(tensor)); } else { - BuildDeviceTensor(output_tensor, ge_tensor_desc, output_size, outputs); + GE_CHK_STATUS_RET(BuildDeviceTensor(output_tensor, ge_tensor_desc, output_size, outputs), + "Build device tensor failed"); output_data->blobs.emplace_back(output_tensor.Release(), static_cast(output_size), false, static_cast(kPlacementDevice)); } @@ -478,13 +479,15 @@ Status HybridModelAsyncExecutor::CopyOutputs(HybridModelExecutor::ExecuteArgs &a return SUCCESS; } -void HybridModelAsyncExecutor::BuildDeviceTensor(TensorValue &output_tensor, GeTensorDesc &ge_tensor_desc, - int64_t output_size, std::vector &outputs) { +Status HybridModelAsyncExecutor::BuildDeviceTensor(TensorValue &output_tensor, GeTensorDesc &ge_tensor_desc, + int64_t output_size, std::vector &outputs) { GELOGD("Start to build device tensor"); - auto mem_type = output_tensor.GetMemType(); + MemStorageType mem_type = HBM; + GE_CHK_STATUS_RET(output_tensor.GetMemType(mem_type), "[Build][DeviceTensor] Get mem type failed"); GELOGD("Mem type is %d", static_cast(mem_type)); auto deleter = [=](uint8_t *device_data) { if (device_data != nullptr) { + GELOGD("Free device addr is %p", device_data); if (mem_type == RDMA_HBM) { MemManager::Instance().RdmaPoolInstance(RT_MEMORY_HBM).Free(device_data, device_id_); } else if (mem_type == HOST_DDR) { @@ -499,6 +502,7 @@ void HybridModelAsyncExecutor::BuildDeviceTensor(TensorValue &output_tensor, GeT auto tensor = TensorAdapter::AsTensor(ge_tensor); tensor.SetData(reinterpret_cast(output_tensor.Release()), static_cast(output_size), deleter); outputs.emplace_back(std::move(tensor)); + return SUCCESS; } Status HybridModelAsyncExecutor::Execute(const std::vector &inputs, diff --git a/ge/hybrid/executor/hybrid_model_async_executor.h b/ge/hybrid/executor/hybrid_model_async_executor.h index 5ae1a222..f94f6aa5 100644 --- a/ge/hybrid/executor/hybrid_model_async_executor.h +++ b/ge/hybrid/executor/hybrid_model_async_executor.h @@ -76,8 +76,8 @@ class HybridModelAsyncExecutor { OutputData *output_data); Status CopyOutputs(HybridModelExecutor::ExecuteArgs &args, OutputData *output_data, std::vector &outputs); - void BuildDeviceTensor(TensorValue &output_tensor, GeTensorDesc &ge_tensor_desc, int64_t output_size, - std::vector &outputs); + Status BuildDeviceTensor(TensorValue &output_tensor, GeTensorDesc &ge_tensor_desc, int64_t output_size, + std::vector &outputs); Status OnComputeDone(uint32_t data_index, uint32_t result_code, std::vector &outputs); diff --git a/tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc b/tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc index 98bb78f2..f772af23 100644 --- a/tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc +++ b/tests/ut/ge/hybrid/executor/hybrid_model_async_executor_unittest.cc @@ -82,7 +82,7 @@ TEST_F(UtestHybridModelAsyncExecutor, BuildDeviceTensor) { GeTensorDesc ge_tensor_desc; int64_t output_size = 100; std::vector outputs; - executor.BuildDeviceTensor(tensor, ge_tensor_desc, output_size, outputs); + auto ret = executor.BuildDeviceTensor(tensor, ge_tensor_desc, output_size, outputs); auto size = tensor.GetSize(); ASSERT_EQ(size, 100); } From 01e49940a6393583c274271fdba7119f689a9d6c Mon Sep 17 00:00:00 2001 From: wuweikang Date: Thu, 13 May 2021 16:14:41 +0800 Subject: [PATCH 42/43] add copy graph --- ge/graph/manager/graph_manager.cc | 2 +- ge/hybrid/model/hybrid_model.h | 1 + ge/hybrid/model/hybrid_model_builder.cc | 47 +++++++++++++++---- ge/hybrid/model/hybrid_model_builder.h | 1 + ge/model/ge_root_model.h | 5 ++ .../executor/subgraph_executor_unittest.cc | 3 ++ .../model/hybrid_model_builder_unittest.cc | 26 ++++++++-- 7 files changed, 70 insertions(+), 15 deletions(-) diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 0a4633ad..0b27fdf3 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -3139,10 +3139,10 @@ void GraphManager::PreRunThread(GraphManager *graph_manager) { } // Avoid repeatively prerun for graphs owns same graph_id in online inference concurrency if (count > 1 && graph_node->GetBuildFlag()) { - graph_node->Lock(); GELOGD("Avoid repeatively prerun, graph_id:%u.", args.graph_id); // In online inference concurrency senario, graph_node is allowed to be locked for 'count' times graph_node->SetSemSize(count); + graph_node->Lock(); graph_manager->run_args_q_.Push(RunArgs( { graph_node, args.graph_id, args.session_id, args.error_context, args.input_tensor, graph_node->GetGeRootModel(), GetThreadLocalContext(), args.callback })); GELOGI("[PreRunThread] Loop end. Start to run with cached build model."); diff --git a/ge/hybrid/model/hybrid_model.h b/ge/hybrid/model/hybrid_model.h index 9821242a..77246e20 100644 --- a/ge/hybrid/model/hybrid_model.h +++ b/ge/hybrid/model/hybrid_model.h @@ -147,6 +147,7 @@ class HybridModel { GeRootModelPtr ge_root_model_; std::map input_nodes_; ComputeGraphPtr root_graph_; + ComputeGraphPtr orig_root_graph_; std::map device_variable_nodes_; //lint !e148 std::map host_variable_nodes_; //lint !e148 std::map> variable_tensors_; diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index bb405605..351f8a02 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -147,6 +147,7 @@ Status HybridModelBuilder::Build() { GE_CHK_STATUS_RET(ValidateParams(), "[Invoke][ValidateParams] failed, model_name_:[%s]", GetGraphName()); hybrid_model_.model_name_ = ge_root_model_->GetModelName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); + GE_CHK_STATUS_RET(CopyGraph(), "[Invoke][CopyGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitRuntimeParams(), "[Invoke][InitRuntimeParams] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(RecoverGraphUnknownFlag(), "[Invoke][RecoverGraphUnknownFlag] failed, model_name_:[%s]", GetGraphName()); @@ -171,11 +172,12 @@ Status HybridModelBuilder::Build() { Status HybridModelBuilder::BuildForSingleOp() { GE_CHK_STATUS_RET(ValidateParams(), "[Invoke][ValidateParams] failed, model_name_:[%s]", GetGraphName()); + hybrid_model_.root_graph_ = ge_root_model_->GetRootGraph(); hybrid_model_.model_name_ = ge_root_model_->GetRootGraph()->GetName(); GELOGI("[%s] Start to build hybrid model.", GetGraphName()); auto ret = ge_root_model_->GetSubgraphInstanceNameToModel(); - const GeModelPtr ge_model = ret[ge_root_model_->GetRootGraph()->GetName()]; - GE_CHK_STATUS_RET(IndexTaskDefs(ge_root_model_->GetRootGraph(), ge_model), + const GeModelPtr ge_model = ret[hybrid_model_.root_graph_->GetName()]; + GE_CHK_STATUS_RET(IndexTaskDefs(hybrid_model_.root_graph_, ge_model), "[Invoke][IndexTaskDefs] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(LoadGraph(), "[Invoke][LoadGraph] failed, model_name_:[%s]", GetGraphName()); GE_CHK_STATUS_RET(InitWeights(), "[Invoke][InitWeights] failed, model_name_:[%s]", GetGraphName()); @@ -190,6 +192,29 @@ Status HybridModelBuilder::ValidateParams() { return SUCCESS; } +Status HybridModelBuilder::CopyGraph() { + GELOGD("Copy compute graph begin."); + auto root_graph = ge_root_model_->GetRootGraph(); + + ge_root_model_->IncreaseBuildTimes(); + std::string new_graph_name = ge_root_model_->GetRootGraph()->GetName() + "_" + + std::to_string(ge_root_model_->GetBuildTimes()); + ComputeGraphPtr new_root_graph = MakeShared(new_graph_name); + GE_CHECK_NOTNULL(new_root_graph); + int32_t depth = 0; + std::map node_old_2_new; + std::map op_desc_old_2_new; + graphStatus ret = GraphUtils::CopyComputeGraph(root_graph, new_root_graph, node_old_2_new, op_desc_old_2_new, depth); + if (ret != GRAPH_SUCCESS) { + GELOGE(GRAPH_FAILED, "Copy compute graph failed."); + return GRAPH_FAILED; + } + hybrid_model_.root_graph_ = new_root_graph; + + GELOGD("Copy compute graph[%s] success.", new_graph_name.c_str()); + return SUCCESS; +} + Status HybridModelBuilder::BuildNodeItem(const NodePtr &node, NodeItem &node_item) { auto op_desc = node->GetOpDesc(); GE_CHK_STATUS_RET(ParseForceInfershapeNodes(node, node_item), @@ -814,12 +839,13 @@ Status HybridModelBuilder::BuildOutputMapping(GraphItem &graph_item, } Status HybridModelBuilder::LoadGraph() { - auto root_graph = ge_root_model_->GetRootGraph(); + auto root_graph = hybrid_model_.root_graph_; if (!GetContext().GetHostExecFlag()) { std::shared_ptr merged_graph; GELOGI("Before merging subgraphs DirectNodesSize = %zu, GetAllNodesSize = %zu", root_graph->GetDirectNodesSize(), root_graph->GetAllNodesSize()); + hybrid_model_.orig_root_graph_ = root_graph; GE_CHK_GRAPH_STATUS_RET(UnfoldSubgraphs(root_graph, merged_graph), "[Invoke][UnfoldSubgraphs]Failed to unfold subgraphs, model_name_:%s.", GetGraphName()); root_graph = std::move(merged_graph); @@ -877,6 +903,7 @@ Status HybridModelBuilder::LoadGraph() { } for (auto &it : hybrid_model_.known_shape_sub_models_) { auto node_item = MutableNodeItem(it.first); + GE_CHECK_NOTNULL(node_item); AscendString graph_name; GE_CHK_GRAPH_STATUS_RET(it.second->GetGraph().GetName(graph_name), "Failed to get subgraph name"); auto subgraph = hybrid_model_.GetRootGraph()->GetSubgraph(graph_name.GetString()); @@ -1125,7 +1152,9 @@ Status HybridModelBuilder::InitWeights() { sub_weight_buffer->GetSize()); auto subgraph = GraphUtils::GetComputeGraph(subgraph_model.second->GetGraph()); if (subgraph != ge_root_model_->GetRootGraph()) { - subgraph = ge_root_model_->GetRootGraph()->GetSubgraph(subgraph_model.first); + subgraph = hybrid_model_.root_graph_->GetSubgraph(subgraph_model.first); + } else { + subgraph = hybrid_model_.root_graph_; } GE_CHECK_NOTNULL(subgraph); hybrid_model_.weight_buffer_map_.emplace(subgraph->GetName(), std::move(sub_weight_buffer)); @@ -1304,7 +1333,7 @@ Status HybridModelBuilder::IndexTaskDefs(const ComputeGraphPtr &sub_graph, const } Status HybridModelBuilder::IndexTaskDefs() { - const auto root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; const auto &root_graph_name = root_graph->GetName(); if (SetOutputNameAttr(*root_graph) != SUCCESS) { GELOGW("Set output name attr failed."); @@ -1338,7 +1367,7 @@ Status HybridModelBuilder::IndexTaskDefs() { Status HybridModelBuilder::IndexSpecialNodes() { GELOGD("Start to index special nodes"); - const auto &root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; for (auto &node : root_graph->GetAllNodes()) { GE_CHECK_NOTNULL(node); GE_CHECK_NOTNULL(node->GetOpDesc()); @@ -1493,7 +1522,7 @@ Status HybridModelBuilder::InitRuntimeParams() { runtime_param_.session_id = ret ? static_cast(value) : 0; ret = ge::AttrUtils::GetInt(first_model, ATTR_MODEL_TASK_GEN_VAR_ADDR, value); runtime_param_.logic_var_base = ret ? static_cast(value) : 0; - runtime_param_.graph_id = ge_root_model_->GetRootGraph()->GetGraphID(); + runtime_param_.graph_id = hybrid_model_.root_graph_->GetGraphID(); value = 0; for (auto &it : ge_root_model_->GetSubgraphInstanceNameToModel()) { (void) ge::AttrUtils::GetInt(it.second, ATTR_MODEL_VAR_SIZE, value); @@ -1630,7 +1659,7 @@ Status HybridModelBuilder::TransAllVarData() { } Status HybridModelBuilder::CopyVarData() { - GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(ge_root_model_->GetRootGraph(), + GE_CHK_STATUS_RET(TransVarDataUtils::CopyVarData(hybrid_model_.root_graph_, runtime_param_.session_id, hybrid_model_.device_id_), "[Invoke][CopyVarData] failed."); @@ -1713,7 +1742,7 @@ Status HybridModelBuilder::LoadKnownShapedSubgraph(ComputeGraph &graph, NodeItem } Status HybridModelBuilder::RecoverGraphUnknownFlag() { - const auto &root_graph = ge_root_model_->GetRootGraph(); + const auto &root_graph = hybrid_model_.root_graph_; for (auto &sub_graph : root_graph->GetAllSubgraphs()) { GE_CHECK_NOTNULL(sub_graph); for (const auto &node : sub_graph->GetDirectNode()) { diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index 9c1eb187..05830e82 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -56,6 +56,7 @@ class HybridModelBuilder { Status BuildOutputMapping(GraphItem &partitioned_call, const NodeItem &node_item, bool is_root_graph); Status ValidateParams(); Status LoadGraph(); + Status CopyGraph(); Status LoadGeModel(ComputeGraph &graph, const GeModelPtr &ge_model); static Status InitHcclExecutorOnDemand(const GeModelPtr &ge_model); Status LoadTask(NodeItem &node_item); diff --git a/ge/model/ge_root_model.h b/ge/model/ge_root_model.h index 9e8e116e..b6e3d081 100755 --- a/ge/model/ge_root_model.h +++ b/ge/model/ge_root_model.h @@ -60,6 +60,10 @@ class GeRootModel { bool GetTrainFlag() const { return train_flag_; } + int32_t GetBuildTimes() const { return hybrid_build_times_; } + + void IncreaseBuildTimes() { hybrid_build_times_++; } + private: ComputeGraphPtr root_graph_ = nullptr; std::map subgraph_instance_name_to_model_; @@ -69,6 +73,7 @@ class GeRootModel { bool train_flag_ = false; std::string model_name_; bool is_specific_stream_ = false; + int32_t hybrid_build_times_ = 0; }; } // namespace ge using GeRootModelPtr = std::shared_ptr; diff --git a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc index 2dc3b639..827705ae 100644 --- a/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc +++ b/tests/ut/ge/hybrid/executor/subgraph_executor_unittest.cc @@ -249,6 +249,9 @@ TEST_F(UtestSubgraphExecutor, cond_graph_schedule_tasks) { graph_context.callback_manager = std::unique_ptr(new CallbackManager()); ASSERT_EQ(graph_context.callback_manager->Init(), SUCCESS); + auto root_graph = hybrid_model.root_graph_; + switch_t = root_graph->FindNode("switch_t"); + switch_f = root_graph->FindNode("switch_f"); const auto node_it_t = hybrid_model.node_items_.find(switch_t); const auto node_it_f = hybrid_model.node_items_.find(switch_f); ASSERT_NE(hybrid_model.node_items_.end(), node_it_t); diff --git a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc index 5567aca2..10f7c0fe 100644 --- a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc +++ b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc @@ -214,11 +214,17 @@ TEST_F(UtestHybridModelBuilder, normal_hybrid_model_build) { ASSERT_EQ(it->second->frame_index_, index); ASSERT_EQ(it->second->parent_frame_, -1); }; - TestFrameGroup(enter1, control_group_index); - TestFrameGroup(active1, control_group_index); - TestFrameGroup(active2, control_group_index); - TestFrameGroup(active3, control_group_index); - TestFrameGroup(output1, -1); + auto root_graph = hybrid_model.root_graph_; + auto enter1_node = root_graph->FindNode("enter"); + auto active1_node = root_graph->FindNode("active1"); + auto active2_node = root_graph->FindNode("active2"); + auto active3_node = root_graph->FindNode("active3"); + auto output1_node = root_graph->FindNode("net_output"); + TestFrameGroup(enter1_node, control_group_index); + TestFrameGroup(active1_node, control_group_index); + TestFrameGroup(active2_node, control_group_index); + TestFrameGroup(active3_node, control_group_index); + TestFrameGroup(output1_node, -1); engine_mapping.clear(); task_executor.clear(); @@ -373,4 +379,14 @@ TEST_F(UtestHybridModelBuilder, TestInitHcclExecutorOnDemand) { NodeExecutorManager::GetInstance().builders_.erase(NodeExecutorManager::ExecutorType::HCCL); ASSERT_EQ(HybridModelBuilder::InitHcclExecutorOnDemand(ge_model), SUCCESS); } + +TEST_F(UtestHybridModelBuilder, copy_graph_success) { +ComputeGraphPtr graph = std::make_shared("test"); +GeRootModelPtr ge_root_model = make_shared(graph); +HybridModel hybrid_model(ge_root_model); +HybridModelBuilder hybrid_model_builder(hybrid_model); + +Status st = hybrid_model_builder.CopyGraph(); +EXPECT_EQ(st, SUCCESS); +} } // namespace ge From 66b63a27ef778deeb3f7df0681e1e41b8fe9d100 Mon Sep 17 00:00:00 2001 From: y00500818 Date: Fri, 25 Jun 2021 16:52:48 +0800 Subject: [PATCH 43/43] bugfix for InitNetOutput --- ge/graph/load/model_manager/davinci_model.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index a00d2b9d..7d82879f 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -1156,7 +1156,6 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & } size_t num = output_data_info_.size(); - bool fusion_flag = false; size_t input_count = input_size_list.size(); is_getnext_sink_dynamic_ = false; @@ -1166,6 +1165,7 @@ Status DavinciModel::InitNetOutput(const ComputeGraphPtr &graph, const NodePtr & } for (size_t idx = 0; idx < input_count; ++idx) { ZeroCopyOffset zero_copy_offset; + bool fusion_flag = false; Status ret = zero_copy_offset.InitOutputDataInfo(input_size_list, virtual_addr_list, op_desc, idx, fusion_flag); GE_IF_BOOL_EXEC(ret != SUCCESS, GELOGE(PARAM_INVALID, "[Init][DataInfo] of input_info %s failed.", op_desc->GetName().c_str());