From 171d09457f4180cc5dc543884801db7d7ea4d560 Mon Sep 17 00:00:00 2001 From: dingpeifei Date: Sat, 5 Jun 2021 14:18:59 +0800 Subject: [PATCH] upgrade_ascend_0604 --- graphengine | 2 +- .../parallel_compile/tbe_compiler/helper.py | 2 ++ .../kernel_compiler/tbe/tbe_kernel_build.cc | 3 +++ mindspore/ccsrc/cxx_api/CMakeLists.txt | 6 ++++-- mindspore/ccsrc/runtime/device/CMakeLists.txt | 5 ++++- .../runtime/device/ascend/kernel_build_ascend.cc | 15 +++++++++++++++ .../ccsrc/runtime/hccl_adapter/CMakeLists.txt | 5 ++++- .../runtime/hccl_adapter/plugin/CMakeLists.txt | 5 ++++- mindspore/run_check/_check_version.py | 2 +- tests/ut/cpp/CMakeLists.txt | 3 ++- 10 files changed, 40 insertions(+), 8 deletions(-) diff --git a/graphengine b/graphengine index c5be7f3198..3442c74c1e 160000 --- a/graphengine +++ b/graphengine @@ -1 +1 @@ -Subproject commit c5be7f3198ea2ffcd100303fd12c1a7943adb6f0 +Subproject commit 3442c74c1e99f517a7816dc39b41ab85009672eb diff --git a/mindspore/_extends/parallel_compile/tbe_compiler/helper.py b/mindspore/_extends/parallel_compile/tbe_compiler/helper.py index a98c20f095..731bb6284a 100644 --- a/mindspore/_extends/parallel_compile/tbe_compiler/helper.py +++ b/mindspore/_extends/parallel_compile/tbe_compiler/helper.py @@ -114,6 +114,8 @@ def _check_supported(kernel_info): if op_name in ("resize_nearest_neighbor_v2_grad_d", "resize_bilinear_v2_grad"): attrs_args.pop(-1) ret = op_func(*inputs_args, *outputs_args, *attrs_args, kernel_name=kernel_name) + if isinstance(ret, tuple) and len(ret) == 2: + ret = ret[0] except Exception as e: raise TBEException(str(e)) diff --git a/mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_build.cc b/mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_build.cc index aa5b11cb9f..3bc9256c52 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_build.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/tbe/tbe_kernel_build.cc @@ -233,6 +233,7 @@ void TbeKernelJsonCreator::GenValidInputDescJson(const std::shared_ptr input_desc_json[kJShape] = shape; input_desc_json[kJFormat] = format; input_desc_json[kJValid] = value; + input_desc_json[kJAddrType] = 0; input_desc_json[kJParamType] = input_ptr->param_type(); input_desc_json[kJRange] = tbe::TbeDynamicShapeUtil::GetInputDynamicRange(anf_node, real_input_index); input_list->emplace_back(input_desc_json); @@ -463,6 +464,7 @@ void TbeKernelJsonCreator::GenOutputList(const std::shared_ptr &anf_nod output_obj[kJOriFormat] = def_format; output_obj[kJName] = output_ptr->name(); output_obj[kJValid] = true; + output_obj[kJAddrType] = 0; output_obj[kJParamType] = output_ptr->param_type(); output_obj[kJRange] = tbe::TbeDynamicShapeUtil::GetOutputDynamicRange(anf_node, *output_idx); output_list->emplace_back(output_obj); @@ -945,6 +947,7 @@ void TbeKernelBuild::GenDescJson(const std::shared_ptr &anf_ ori_shape.emplace_back(1); } (*output_desc)[kJOriShape] = ori_shape; + (*output_desc)[kJAddrType] = 0; // !! Note: output_index, only node's output use it (*output_desc)[kJOutputIndex] = desc_output_idx; // shape diff --git a/mindspore/ccsrc/cxx_api/CMakeLists.txt b/mindspore/ccsrc/cxx_api/CMakeLists.txt index 47752baf5e..846c59ef25 100644 --- a/mindspore/ccsrc/cxx_api/CMakeLists.txt +++ b/mindspore/ccsrc/cxx_api/CMakeLists.txt @@ -8,8 +8,10 @@ file(GLOB_RECURSE API_OPS_SRC ${CMAKE_CURRENT_SOURCE_DIR} "ops/*.cc") if(ENABLE_D OR ENABLE_ACL) # build 910 and 310 code into one distro, files needed for 310 mode add_compile_definitions(ENABLE_ACL) - include_directories(${CMAKE_SOURCE_DIR}/graphengine/ge) - include_directories(${CMAKE_BINARY_DIR}/proto/ge) + include_directories(${CMAKE_SOURCE_DIR}/graphengine/ge + ${CMAKE_BINARY_DIR}/proto/graphengine_protos + ${CMAKE_BINARY_DIR}/proto/metadef_protos + ) file(GLOB_RECURSE API_ACL_SRC ${CMAKE_CURRENT_SOURCE_DIR} "akg_kernel_register.cc" "model/acl/*.cc" diff --git a/mindspore/ccsrc/runtime/device/CMakeLists.txt b/mindspore/ccsrc/runtime/device/CMakeLists.txt index 6853497000..447486b266 100644 --- a/mindspore/ccsrc/runtime/device/CMakeLists.txt +++ b/mindspore/ccsrc/runtime/device/CMakeLists.txt @@ -82,6 +82,9 @@ add_library(_mindspore_runtime_device_obj OBJECT ${DEVICE_SRC_LIST} ${D_SRC_LIST if(ENABLE_D) file(GLOB_RECURSE GE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ascend/ge_runtime/*.cc") set_property(SOURCE ${GE_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_GE) - target_include_directories(_mindspore_runtime_device_obj PRIVATE ${CMAKE_BINARY_DIR}/proto/ge) + target_include_directories(_mindspore_runtime_device_obj PRIVATE + ${CMAKE_BINARY_DIR}/proto/graphengine_protos + ${CMAKE_BINARY_DIR}/proto/metadef_protos + ) add_dependencies(_mindspore_runtime_device_obj graph) endif() diff --git a/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc b/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc index cee2e1f37f..179f203757 100644 --- a/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc +++ b/mindspore/ccsrc/runtime/device/ascend/kernel_build_ascend.cc @@ -200,10 +200,25 @@ static bool IsAtomicNode(const CNodePtr &kernel_node) { size_t param_num = parameters_indexs.size(); size_t total_num = input_num + workspace_num + output_num; size_t pad_index = param_num; + + if (AnfAlgo::IsDynamicShape(kernel_node)) { + parameters_indexs.pop_back(); + } for (; pad_index < total_num; ++pad_index) { parameters_indexs.emplace_back(0); } // process input + auto op_info = kernel::OpLib::FindOp(AnfAlgo::GetCNodeName(kernel_node), kernel::OpImplyType::kTBE, + AnfAlgo::IsDynamicShape(kernel_node)); + if (op_info != nullptr) { + const auto &ref_infos = op_info->ref_infos(); + for (auto [out, in] : ref_infos) { + if (parameters_indexs[in] == 1) { + parameters_indexs[in] = 0; + parameters_indexs[input_num + workspace_num + out] = 1; + } + } + } for (size_t j = 0; j < input_num; ++j) { if (parameters_indexs.at(j) == 1) { MS_LOG(EXCEPTION) << "Atomic addr clean doesn't support clean input address, input index: " << j; diff --git a/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt b/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt index e42585b745..56ca615137 100644 --- a/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt +++ b/mindspore/ccsrc/runtime/hccl_adapter/CMakeLists.txt @@ -3,7 +3,10 @@ set_property(SOURCE ${HCCL_ADAPTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_HCCL_ADPT) if(ENABLE_D) add_library(_mindspore_runtime_hccl_adapter_obj OBJECT ${HCCL_ADAPTER_SRC_LIST}) - target_include_directories(_mindspore_runtime_hccl_adapter_obj PRIVATE ${CMAKE_BINARY_DIR}/proto/ge) + target_include_directories(_mindspore_runtime_hccl_adapter_obj PRIVATE + ${CMAKE_BINARY_DIR}/proto/graphengine_protos + ${CMAKE_BINARY_DIR}/proto/metadef_protos + ) add_dependencies(_mindspore_runtime_hccl_adapter_obj graph) add_subdirectory(plugin) endif() \ No newline at end of file diff --git a/mindspore/ccsrc/runtime/hccl_adapter/plugin/CMakeLists.txt b/mindspore/ccsrc/runtime/hccl_adapter/plugin/CMakeLists.txt index bb4e203620..da3dc079f1 100644 --- a/mindspore/ccsrc/runtime/hccl_adapter/plugin/CMakeLists.txt +++ b/mindspore/ccsrc/runtime/hccl_adapter/plugin/CMakeLists.txt @@ -1,5 +1,8 @@ add_library(hccl_plugin SHARED hccl_plugin.cc) -target_include_directories(hccl_plugin PRIVATE ${CMAKE_BINARY_DIR}/proto/ge) +target_include_directories(hccl_plugin PRIVATE + ${CMAKE_BINARY_DIR}/proto/graphengine_protos + ${CMAKE_BINARY_DIR}/proto/metadef_protos + ) add_dependencies(hccl_plugin graph) set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/Ascend/nnae/latest/fwkacllib/lib64) diff --git a/mindspore/run_check/_check_version.py b/mindspore/run_check/_check_version.py index eea3919823..e659b015d5 100644 --- a/mindspore/run_check/_check_version.py +++ b/mindspore/run_check/_check_version.py @@ -206,7 +206,7 @@ class AscendEnvChecker(EnvChecker): """ascend environment check""" def __init__(self): - self.version = ["1.78.T13.0.B130"] + self.version = ["1.78.T21.0.B210"] atlas_nnae_version = "/usr/local/Ascend/nnae/latest/fwkacllib/version.info" atlas_toolkit_version = "/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/version.info" hisi_fwk_version = "/usr/local/Ascend/fwkacllib/version.info" diff --git a/tests/ut/cpp/CMakeLists.txt b/tests/ut/cpp/CMakeLists.txt index 962f143ddd..c6a8a41d95 100644 --- a/tests/ut/cpp/CMakeLists.txt +++ b/tests/ut/cpp/CMakeLists.txt @@ -25,7 +25,8 @@ include_directories(${CMAKE_SOURCE_DIR}/mindspore/core/mindrt/src) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/stub/runtime/) include_directories(${CMAKE_BINARY_DIR}) -include_directories(${CMAKE_BINARY_DIR}/proto/ge) +include_directories(${CMAKE_BINARY_DIR}/proto/graphengine_protos) +include_directories(${CMAKE_BINARY_DIR}/proto/metadef_protos) include_directories(${CUDA_INCLUDE_DIRS}) include_directories(${CMAKE_SOURCE_DIR}/mindspore/ccsrc/backend/kernel_compiler/cpu) MESSAGE("check ut_test ${CMAKE_BINARY_DIR}")