upgrade_ascend_20230207_master

This commit is contained in:
hbhu_bin 2023-02-07 15:39:04 +08:00
parent ea725736a6
commit 2151611a32
67 changed files with 163 additions and 129 deletions

View File

@ -110,17 +110,17 @@ include_directories(${PYTHON_INCLUDE_DIRS})
set(MS_CCSRC_PATH ${CMAKE_SOURCE_DIR}/mindspore/ccsrc) set(MS_CCSRC_PATH ${CMAKE_SOURCE_DIR}/mindspore/ccsrc)
set(MS_CCSRC_BUILD_PATH ${BUILD_PATH}/mindspore/mindspore/ccsrc) set(MS_CCSRC_BUILD_PATH ${BUILD_PATH}/mindspore/mindspore/ccsrc)
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/dependency_graphengine.cmake)
endif()
if(NOT MSVC) if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif() endif()
include(${CMAKE_SOURCE_DIR}/cmake/init.cmake) include(${CMAKE_SOURCE_DIR}/cmake/init.cmake)
add_subdirectory_with_faster_option(mindspore/ccsrc)
add_subdirectory(mindspore/core) add_subdirectory(mindspore/core)
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/dependency_graphengine.cmake)
endif()
add_subdirectory_with_faster_option(mindspore/ccsrc)
if(ENABLE_TESTCASES OR ENABLE_CPP_ST) if(ENABLE_TESTCASES OR ENABLE_CPP_ST)
add_subdirectory(tests) add_subdirectory(tests)

View File

@ -9,14 +9,16 @@ set(ASCEND_DRIVER_HAL_PATH ${ASCEND_PATH}/driver/lib64/driver)
# CANN packages # CANN packages
set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/lib64) set(ASCEND_CANN_RUNTIME_PATH ${ASCEND_PATH}/latest/lib64)
set(ASCEND_CANN_OPP_PATH ${ASCEND_PATH}/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) set(ASCEND_CANN_OPP_PATH ${ASCEND_PATH}/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux)
set(ASCEND_CANN_OPP_PATH_TEMP ${ASCEND_PATH}/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling) set(ASCEND_CANN_OPP_AARCH64_PATH ${ASCEND_CANN_OPP_PATH}/aarch64)
set(ASCEND_CANN_OPP_X86_64_PATH ${ASCEND_CANN_OPP_PATH}/x86_64)
set(ASCEND_CANN_PLUGIN_PATH ${ASCEND_CANN_RUNTIME_PATH}/plugin/opskernel) set(ASCEND_CANN_PLUGIN_PATH ${ASCEND_CANN_RUNTIME_PATH}/plugin/opskernel)
# Ascend-toolkit packages # Ascend-toolkit packages
set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/lib64) set(ASCEND_TOOLKIT_RUNTIME_PATH ${ASCEND_PATH}/ascend-toolkit/latest/lib64)
set(ASCEND_TOOLKIT_OPP_PATH ${ASCEND_PATH}/ascend-toolkit/latest/opp/op_impl/built-in/ai_core/tbe/op_tiling) set(ASCEND_TOOLKIT_OPP_PATH ${ASCEND_PATH}/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux)
set(ASCEND_TOOLKIT_OPP_PATH_TEMP ${ASCEND_PATH}/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling) set(ASCEND_TOOLKIT_OPP_AARCH64_PATH ${ASCEND_TOOLKIT_OPP_PATH}/aarch64)
set(ASCEND_TOOLKIT_OPP_X86_64_PATH ${ASCEND_TOOLKIT_OPP_PATH}/x86_64)
set(ASCEND_TOOLKIT_PLUGIN_PATH ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel) set(ASCEND_TOOLKIT_PLUGIN_PATH ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel)
# nnae packages (for rpath only) # nnae packages (for rpath only)

View File

@ -0,0 +1,14 @@
# path variables for graphengine submodule, it has to be included after mindspore/core
# and minspore/ccsrc to prevent conflict of op headers
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/framework)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/base)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/aicpu)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/toolchain)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external/graph)
endif()

View File

@ -64,18 +64,6 @@ if(ENABLE_GPU AND GPU_BACKEND_CUDA)
endif() endif()
endif() endif()
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/inc/framework)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/aicpu)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/third_party/fwkacllib/inc/toolchain)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external)
include_directories(${CMAKE_SOURCE_DIR}/graphengine/metadef/inc/external/graph)
endif()
if(ENABLE_MINDDATA) if(ENABLE_MINDDATA)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/icu4c.cmake) include(${CMAKE_SOURCE_DIR}/cmake/external_libs/icu4c.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/external_libs/opencv.cmake) include(${CMAKE_SOURCE_DIR}/cmake/external_libs/opencv.cmake)

View File

@ -415,7 +415,8 @@
"TransData ": "support boll", "TransData ": "support boll",
"ScatterNdD ": "Accuracy issues", "ScatterNdD ": "Accuracy issues",
"Trace": "Hadn't adapted tbe implementation", "Trace": "Hadn't adapted tbe implementation",
"AssignAdd": "Frac_nz in pangu not support" "AssignAdd": "Frac_nz in pangu not support",
"Range": "not support dynamic shape with tiling failed"
}, },
"SkipNodes": [ "SkipNodes": [
"BroadcastTo", "BroadcastTo",
@ -444,7 +445,8 @@
"ACos", "ACos",
"TransData", "TransData",
"ScatterNdD", "ScatterNdD",
"AssignAdd" "AssignAdd",
"Range"
], ],
"FallbackOps": { "FallbackOps": {
"DeformableOffsets": [ "DeformableOffsets": [

@ -1 +1 @@
Subproject commit 236001806129e36c0f48b240c4f61b2e1d92c470 Subproject commit f5f74bb7a124f99bbaeaec17b55aa466fdd34285

View File

@ -5,6 +5,10 @@ include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/mindspore/core/mindrt/include) include_directories(${CMAKE_SOURCE_DIR}/mindspore/core/mindrt/include)
include_directories(${CMAKE_SOURCE_DIR}/mindspore/core/mindrt/src) include_directories(${CMAKE_SOURCE_DIR}/mindspore/core/mindrt/src)
# graphengine include directories
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/graphengine_variables.cmake)
endif()
set(SERVER_FLATBUFFER_OUTPUT "${CMAKE_BINARY_DIR}/schema") set(SERVER_FLATBUFFER_OUTPUT "${CMAKE_BINARY_DIR}/schema")

View File

@ -19,6 +19,7 @@
#include "include/transform/graph_ir/utils.h" #include "include/transform/graph_ir/utils.h"
#include "cxx_api/model/model_converter_utils/multi_process.h" #include "cxx_api/model/model_converter_utils/multi_process.h"
#include "graph/model.h" #include "graph/model.h"
#include "graph/utils/graph_utils_ex.h"
#include "acl/acl_rt.h" #include "acl/acl_rt.h"
#include "cxx_api/model/aoe/auto_tune_process.h" #include "cxx_api/model/aoe/auto_tune_process.h"
#include "plugin/device/ascend/optimizer/ge_optimization.h" #include "plugin/device/ascend/optimizer/ge_optimization.h"
@ -194,7 +195,7 @@ Buffer ModelConverter::LoadMindIR(const FuncGraphPtr &func_graph) {
} }
ge::Model model; ge::Model model;
ge::Buffer model_data; ge::Buffer model_data;
model.SetGraph(*df_graph); model.SetGraph(::ge::GraphUtilsEx::GetComputeGraph(*df_graph));
auto ge_ret = model.Save(model_data); auto ge_ret = model.Save(model_data);
if (ge_ret != ge::SUCCESS) { if (ge_ret != ge::SUCCESS) {
MS_LOG(ERROR) << "Save ge model to buffer failed."; MS_LOG(ERROR) << "Save ge model to buffer failed.";
@ -263,7 +264,8 @@ Buffer ModelConverter::LoadAscendIRInner(const Buffer &model_data) {
return Buffer(); return Buffer();
} }
transform::DfGraphPtr df_graph = std::make_shared<transform::DfGraph>(load_model.GetGraph()); transform::DfGraphPtr df_graph =
std::make_shared<transform::DfGraph>(::ge::GraphUtilsEx::CreateGraphFromComputeGraph(load_model.GetGraph()));
if (df_graph == nullptr) { if (df_graph == nullptr) {
MS_LOG(ERROR) << "Convert FuncGraph to AscendIR failed."; MS_LOG(ERROR) << "Convert FuncGraph to AscendIR failed.";
return Buffer(); return Buffer();

View File

@ -6,11 +6,22 @@ include_directories(${CMAKE_SOURCE_DIR}/mindspore/ccsrc/minddata/dataset)
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/nnae/latest/lib64) set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/nnae/latest/lib64)
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64) set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/lib64)
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/latest/lib64) set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/latest/lib64)
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/opp/built-in/op_impl/ai_core/tbe/op_tiling) if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/nnae/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling) set(ASCEND_RPATH
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/nnae/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64)
${ASCEND_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling) set(ASCEND_RPATH
set(ASCEND_RPATH ${ASCEND_RPATH}:/usr/local/Ascend/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling) ${ASCEND_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64)
set(ASCEND_RPATH
${ASCEND_RPATH}:/usr/local/Ascend/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/x86_64)
else()
set(ASCEND_RPATH
${ASCEND_RPATH}:/usr/local/Ascend/nnae/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64)
set(ASCEND_RPATH
${ASCEND_RPATH}:/usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64)
set(ASCEND_RPATH
${ASCEND_RPATH}:/usr/local/Ascend/latest/opp/built-in/op_impl/ai_core/tbe/op_tiling/lib/linux/aarch64)
endif()
### cxx api need file ### ### cxx api need file ###
if(ENABLE_ACL) if(ENABLE_ACL)
@ -87,8 +98,11 @@ if(MODE_ASCEND_ALL)
find_library(PLATFORM platform ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(PLATFORM platform ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(OPT_FEATURE opt_feature ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(OPT_FEATURE opt_feature ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(adump_server libadump_server.a ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(adump_server libadump_server.a ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(OPTILING optiling ${ASCEND_CANN_OPP_PATH} ${ASCEND_TOOLKIT_OPP_PATH} if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
${ASCEND_CANN_OPP_PATH_TEMP} ${ASCEND_TOOLKIT_OPP_PATH_TEMP}) find_library(OPTILING optiling ${ASCEND_CANN_OPP_X86_64_PATH} ${ASCEND_TOOLKIT_OPP_X86_64_PATH})
else()
find_library(OPTILING optiling ${ASCEND_CANN_OPP_AARCH64_PATH} ${ASCEND_TOOLKIT_OPP_AARCH64_PATH})
endif()
find_library(ACL_OP_COMPILER acl_op_compiler ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH}) find_library(ACL_OP_COMPILER acl_op_compiler ${ASCEND_CANN_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
target_link_libraries(mindspore_ascend PRIVATE ${RUNTIME_LIB} ${TSDCLIENT} ${DATATRANSFER} ${ERROR_MANAGER} target_link_libraries(mindspore_ascend PRIVATE ${RUNTIME_LIB} ${TSDCLIENT} ${DATATRANSFER} ${ERROR_MANAGER}

View File

@ -254,7 +254,7 @@ size_t AscendMemAdapter::GetDeviceMemSizeFromContext() const {
uint8_t *AscendMemAdapter::MallocFromRts(size_t size) const { uint8_t *AscendMemAdapter::MallocFromRts(size_t size) const {
uint8_t *ptr = nullptr; uint8_t *ptr = nullptr;
auto ret = rtMalloc(reinterpret_cast<void **>(&ptr), size, RT_MEMORY_HBM); auto ret = rtMalloc(reinterpret_cast<void **>(&ptr), size, RT_MEMORY_HBM, 0);
if (ret != ACL_RT_SUCCESS) { if (ret != ACL_RT_SUCCESS) {
if (ret == ACL_ERROR_RT_MEMORY_ALLOCATION) { if (ret == ACL_ERROR_RT_MEMORY_ALLOCATION) {
auto context_ptr = MsContext::GetInstance(); auto context_ptr = MsContext::GetInstance();

View File

@ -277,12 +277,12 @@ void DataDumper::OpDebugRegister() {
MS_LOG(EXCEPTION) << "[DataDump] Call rt api rtGetRtCapability failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[DataDump] Call rt api rtGetRtCapability failed, ret = " << rt_ret;
} }
auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM; auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM;
rt_ret = rtMalloc(&op_debug_buffer_addr_, kOpDebugHostMemSize, memory_type); rt_ret = rtMalloc(&op_debug_buffer_addr_, kOpDebugHostMemSize, memory_type, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DataDump] Call rt api rtMalloc failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[DataDump] Call rt api rtMalloc failed, ret = " << rt_ret;
} }
rt_ret = rtMalloc(&op_debug_dump_args_, kOpDebugDevMemSize, RT_MEMORY_HBM); rt_ret = rtMalloc(&op_debug_dump_args_, kOpDebugDevMemSize, RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DataDump] Call rtMalloc failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[DataDump] Call rtMalloc failed, ret = " << rt_ret;
} }

View File

@ -101,7 +101,7 @@ void RtLoadDumpData(const aicpu::dump::OpMappingInfo &dump_info, void **ptr) {
return; return;
} }
rtError_t rt_ret = rtMalloc(ptr, proto_size, RT_MEMORY_HBM); rtError_t rt_ret = rtMalloc(ptr, proto_size, RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[DumperBase] Call rtMalloc failed"; MS_LOG(EXCEPTION) << "[DumperBase] Call rtMalloc failed";
} }

View File

@ -184,7 +184,7 @@ void KernelDumper::ExecutorDumpOp(const aicpu::dump::OpMappingInfo &op_mapping_i
} }
std::string proto_json; std::string proto_json;
(void)google::protobuf::util::MessageToJsonString(op_mapping_info, &proto_json); (void)google::protobuf::util::MessageToJsonString(op_mapping_info, &proto_json);
rtError_t rt_ret = rtMalloc(&proto_dev_mem_, proto_size, RT_MEMORY_HBM); rtError_t rt_ret = rtMalloc(&proto_dev_mem_, proto_size, RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(ERROR) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret; MS_LOG(ERROR) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret;
return; return;
@ -196,7 +196,7 @@ void KernelDumper::ExecutorDumpOp(const aicpu::dump::OpMappingInfo &op_mapping_i
return; return;
} }
rt_ret = rtMalloc(&proto_size_dev_mem_, sizeof(size_t), RT_MEMORY_HBM); rt_ret = rtMalloc(&proto_size_dev_mem_, sizeof(size_t), RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(ERROR) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret; MS_LOG(ERROR) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret;
return; return;
@ -372,7 +372,7 @@ void KernelDumper::MallocP2PDebugMem(const void *const op_debug_addr) {
MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtGetRtCapability failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtGetRtCapability failed, ret = " << rt_ret;
} }
auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM; auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM;
rtMalloc(&p2p_debug_addr_, kDebugP2pSize, memory_type); rtMalloc(&p2p_debug_addr_, kDebugP2pSize, memory_type, 0);
rtMemcpy(p2p_debug_addr_, sizeof(uint64_t), &debug_addrs_tmp, sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE); rtMemcpy(p2p_debug_addr_, sizeof(uint64_t), &debug_addrs_tmp, sizeof(uint64_t), RT_MEMCPY_HOST_TO_DEVICE);
} }
@ -416,7 +416,7 @@ void KernelDumper::OpDebugRegisterForStream(const CNodePtr &kernel) {
MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtGetRtCapability failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtGetRtCapability failed, ret = " << rt_ret;
} }
auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM; auto memory_type = (value == static_cast<int64_t>(RT_CAPABILITY_SUPPORT)) ? RT_MEMORY_TS : RT_MEMORY_HBM;
rt_ret = rtMalloc(&op_debug_task->op_debug_addr, kOpDebugMemorySize, memory_type); rt_ret = rtMalloc(&op_debug_task->op_debug_addr, kOpDebugMemorySize, memory_type, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret; MS_LOG(EXCEPTION) << "[KernelDumper] Call rt api rtMalloc failed, ret = " << rt_ret;
} }

View File

@ -91,7 +91,7 @@ void AicpuTask::Distribute() {
sizeof(uint32_t); sizeof(uint32_t);
// Malloc device memory for args // Malloc device memory for args
rtError_t rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); rtError_t rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret; MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret;
} }
@ -165,7 +165,7 @@ void AicpuTask::SetAicpuParamHead(uint32_t args_size, uint32_t io_addrs_num) {
} }
} }
// alloc extinfo address // alloc extinfo address
rtError_t flag = rtMalloc(&ext_info_addr_, ext_info_handler->GetExtInfoLen(), RT_MEMORY_HBM); rtError_t flag = rtMalloc(&ext_info_addr_, ext_info_handler->GetExtInfoLen(), RT_MEMORY_HBM, 0);
if (flag != RT_ERROR_NONE) { if (flag != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << flag; MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << flag;
} }

View File

@ -61,7 +61,7 @@ void LabelGotoTask::Distribute() {
MS_EXCEPTION_IF_NULL(label_info_); MS_EXCEPTION_IF_NULL(label_info_);
if (index_value_ == nullptr) { if (index_value_ == nullptr) {
rtError_t rt_ret = rtMalloc(&index_value_, sizeof(uint64_t), RT_MEMORY_HBM); rtError_t rt_ret = rtMalloc(&index_value_, sizeof(uint64_t), RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret; MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret;
} }

View File

@ -106,7 +106,7 @@ std::shared_ptr<LabelGuard> LabelManager::GetLabelInfo(rtModel_t model, const st
return nullptr; return nullptr;
} }
rt_ret = rtMalloc(&label_info, label_info_size, (value == RT_CAPABILITY_SUPPORT) ? RT_MEMORY_TS : RT_MEMORY_HBM); rt_ret = rtMalloc(&label_info, label_info_size, (value == RT_CAPABILITY_SUPPORT) ? RT_MEMORY_TS : RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(ERROR) << "Call rt api rtMalloc failed, ret: " << rt_ret; MS_LOG(ERROR) << "Call rt api rtMalloc failed, ret: " << rt_ret;
return nullptr; return nullptr;

View File

@ -78,7 +78,7 @@ void TbeTask::Distribute() {
task_info_->workspace_addrs().cend()); task_info_->workspace_addrs().cend());
args_size_ = static_cast<uint32_t>(tensor_device_addrs.size() * sizeof(void *)); args_size_ = static_cast<uint32_t>(tensor_device_addrs.size() * sizeof(void *));
rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM); rt_ret = rtMalloc(&args_, args_size_, RT_MEMORY_HBM, 0);
if (rt_ret != RT_ERROR_NONE) { if (rt_ret != RT_ERROR_NONE) {
MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret << " mem size " << args_size_; MS_LOG(EXCEPTION) << "Call rt api rtMalloc failed, ret: " << rt_ret << " mem size " << args_size_;
} }

View File

@ -31,6 +31,7 @@
#include "plugin/device/ascend/hal/profiler/parallel_strategy_profiling.h" #include "plugin/device/ascend/hal/profiler/parallel_strategy_profiling.h"
#include "plugin/device/ascend/optimizer/enhancer/add_placeholder_for_dynamic_rnn.h" #include "plugin/device/ascend/optimizer/enhancer/add_placeholder_for_dynamic_rnn.h"
#include "cxx_api/graph/acl/acl_env_guard.h" #include "cxx_api/graph/acl/acl_env_guard.h"
#include "graph/utils/graph_utils_ex.h"
using mindspore::abstract::AbstractScalar; using mindspore::abstract::AbstractScalar;
using mindspore::abstract::AbstractTensor; using mindspore::abstract::AbstractTensor;
@ -166,7 +167,7 @@ void AscendDeprecatedInterface::ExportDFGraph(const std::string &file_name, cons
} }
// get model stream // get model stream
::ge::Model model("", ""); ::ge::Model model("", "");
model.SetGraph(*ge_graph); model.SetGraph(::ge::GraphUtilsEx::GetComputeGraph(*ge_graph));
::ge::Buffer model_data; ::ge::Buffer model_data;
auto ge_ret = model.Save(model_data); auto ge_ret = model.Save(model_data);
if (ge_ret != ::ge::SUCCESS) { if (ge_ret != ::ge::SUCCESS) {

View File

@ -224,14 +224,14 @@ bool AicpuOpKernelLoad::CacheBinaryFileToDevice(const uintptr_t &resource_id, st
void *d_aicpu_data = nullptr; void *d_aicpu_data = nullptr;
void *d_so_name = nullptr; void *d_so_name = nullptr;
status = rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM); status = rtMalloc(&d_aicpu_data, aicpu_data_length, RT_MEMORY_HBM, 0);
if (status != RT_ERROR_NONE) { if (status != RT_ERROR_NONE) {
MS_LOG(ERROR) << "Call rtMalloc failed, size:" << aicpu_data_length << ", ret = 0x" << status; MS_LOG(ERROR) << "Call rtMalloc failed, size:" << aicpu_data_length << ", ret = 0x" << status;
return false; return false;
} }
allocated_mem->emplace_back(d_aicpu_data); allocated_mem->emplace_back(d_aicpu_data);
status = rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM); status = rtMalloc(&d_so_name, so_name.size(), RT_MEMORY_HBM, 0);
if (status != RT_ERROR_NONE) { if (status != RT_ERROR_NONE) {
MS_LOG(ERROR) << "Call rtMalloc failed, size:" << so_name.size() << ", ret = 0x" << status; MS_LOG(ERROR) << "Call rtMalloc failed, size:" << so_name.size() << ", ret = 0x" << status;
return false; return false;
@ -267,7 +267,7 @@ bool AicpuOpKernelLoad::CacheBinaryFileToDevice(const uintptr_t &resource_id, st
void *args = nullptr; void *args = nullptr;
uint32_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size(); uint32_t args_size = sizeof(CustAicpuSoBuf) * v_cust_so.size();
status = rtMalloc(&args, args_size, RT_MEMORY_HBM); status = rtMalloc(&args, args_size, RT_MEMORY_HBM, 0);
if (status != RT_ERROR_NONE) { if (status != RT_ERROR_NONE) {
MS_LOG(ERROR) << "Call rtMalloc failed, size:" << args_size << ", ret = 0x" << status; MS_LOG(ERROR) << "Call rtMalloc failed, size:" << args_size << ", ret = 0x" << status;
return false; return false;

View File

@ -78,7 +78,7 @@ const std::map<TypeId, std::string> type_id_str_maps = {
const std::unordered_map<std::string, size_t> type_nbyte_maps = { const std::unordered_map<std::string, size_t> type_nbyte_maps = {
{"float16", sizeof(float) / 2}, {"float32", sizeof(float)}, {"float16", sizeof(float) / 2}, {"float32", sizeof(float)},
{"float64", sizeof(float) * 2}, {"int8", sizeof(int) / 4}, {"float64", sizeof(float) * 2}, {"int8", sizeof(int) / 4},
{"uint1", sizeof(int) / 4}, {"int16", sizeof(int) / 2}, {"int1", sizeof(int) / 8}, {"int16", sizeof(int) / 2},
{"int32", sizeof(int)}, {"int64", sizeof(int) * 2}, {"int32", sizeof(int)}, {"int64", sizeof(int) * 2},
{"uint8", sizeof(int) / 4}, {"uint16", sizeof(int) / 2}, {"uint8", sizeof(int) / 4}, {"uint16", sizeof(int) / 2},
{"uint32", sizeof(int)}, {"uint64", sizeof(int) * 2}, {"uint32", sizeof(int)}, {"uint64", sizeof(int) * 2},

View File

@ -14,6 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
#include "include/common/utils/python_fallback_running.h" #include "include/common/utils/python_fallback_running.h"
#include "ops/tuple_get_item.h"
#include "ops/primitive_c.h"
#include "mindapi/src/helper.h"
namespace mindspore { namespace mindspore {
ScopedFallbackRunning::ScopedFallbackRunning() { on_ = true; } ScopedFallbackRunning::ScopedFallbackRunning() { on_ = true; }

View File

@ -2,6 +2,7 @@ include_directories(${TOP_DIR}/graphengine/metadef/inc/external)
include_directories(${TOP_DIR}/graphengine/inc) include_directories(${TOP_DIR}/graphengine/inc)
include_directories(${TOP_DIR}/graphengine/inc/external) include_directories(${TOP_DIR}/graphengine/inc/external)
include_directories(${TOP_DIR}/graphengine/ge) include_directories(${TOP_DIR}/graphengine/ge)
include_directories(${TOP_DIR}/graphengine/base)
include_directories(${TOP_DIR}/graphengine/metadef/inc) include_directories(${TOP_DIR}/graphengine/metadef/inc)
include_directories(${TOP_DIR}/graphengine/inc/framework) include_directories(${TOP_DIR}/graphengine/inc/framework)
include_directories(${TOP_DIR}/graphengine/third_party/fwkacllib/inc) include_directories(${TOP_DIR}/graphengine/third_party/fwkacllib/inc)

View File

@ -16,7 +16,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType

View File

@ -18,8 +18,8 @@ from __future__ import absolute_import
import te import te
from te import tvm from te import tvm
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
batch_norm_op_info = TBERegOp("BatchNormFoldD") \ batch_norm_op_info = TBERegOp("BatchNormFoldD") \

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -17,9 +17,9 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from te.platform.cce_build import build_config from tbe.common.buildcfg import build_config
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648
@ -101,5 +101,5 @@ def batchnorm_fold2_grad_reduce(dout, x, dout_reduce, dout_x_reduce, kernel_name
return return
from impl.bn_training_reduce import bn_training_reduce_schedule_nd from impl.bn_training_reduce import bn_training_reduce_schedule_nd
sch, tensor_list = bn_training_reduce_schedule_nd(res_list) sch, tensor_list = bn_training_reduce_schedule_nd(res_list)
with build_config: with build_config():
tvm.build(sch, tensor_list, "cce", name=kernel_name) tvm.build(sch, tensor_list, "cce", name=kernel_name)

View File

@ -18,8 +18,8 @@
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
batch_norm_op_info = TBERegOp("BatchNormFoldGradD") \ batch_norm_op_info = TBERegOp("BatchNormFoldGradD") \
.fusion_type("OPAQUE") \ .fusion_type("OPAQUE") \

View File

@ -17,7 +17,7 @@ from __future__ import absolute_import
import logging import logging
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s") logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s")

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -15,7 +15,7 @@
"""dsd back impl""" """dsd back impl"""
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import DataType, TBERegOp, op_info_register from mindspore.ops.op_info_register import DataType, TBERegOp, op_info_register
dsd_grad_info = TBERegOp('DSDGrad') \ dsd_grad_info = TBERegOp('DSDGrad') \

View File

@ -15,7 +15,7 @@
""" dense sparse to densne matmul""" """ dense sparse to densne matmul"""
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import DataType, TBERegOp, op_info_register from mindspore.ops.op_info_register import DataType, TBERegOp, op_info_register
dsd_matmul_info = TBERegOp('DSDMatmul') \ dsd_matmul_info = TBERegOp('DSDMatmul') \

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
fake_learned_scale_quant_perchannel_op_info = TBERegOp("FakeLearnedScaleQuantPerChannel") \ fake_learned_scale_quant_perchannel_op_info = TBERegOp("FakeLearnedScaleQuantPerChannel") \

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
NEG_SCALAR_MIN_FP16 = -(2 ** (-24)) NEG_SCALAR_MIN_FP16 = -(2 ** (-24))

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType

View File

@ -18,8 +18,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
fake_learned_scale_quant_perlayer_op_info = TBERegOp("FakeLearnedScaleQuantPerLayer") \ fake_learned_scale_quant_perlayer_op_info = TBERegOp("FakeLearnedScaleQuantPerLayer") \

View File

@ -19,8 +19,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
NEG_SCALAR_MIN_FP16 = -(2 ** (-24)) NEG_SCALAR_MIN_FP16 = -(2 ** (-24))

View File

@ -19,8 +19,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType

View File

@ -19,8 +19,8 @@ from __future__ import absolute_import
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
fake_quant_perchannel_op_info = TBERegOp("FakeQuantPerChannel") \ fake_quant_perchannel_op_info = TBERegOp("FakeQuantPerChannel") \

View File

@ -19,8 +19,8 @@ from __future__ import absolute_import
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -20,8 +20,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
fake_quant_per_layer_op_info = TBERegOp("FakeQuantPerLayer") \ fake_quant_per_layer_op_info = TBERegOp("FakeQuantPerLayer") \

View File

@ -20,8 +20,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
SHAPE_SIZE_LIMIT = 2147483648 SHAPE_SIZE_LIMIT = 2147483648

View File

@ -16,7 +16,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType

View File

@ -16,7 +16,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
cus_img2col_info = TBERegOp("CusImg2Col") \ cus_img2col_info = TBERegOp("CusImg2Col") \

View File

@ -21,8 +21,8 @@ import te.lang.cce
import te.platform.cce_params as cce import te.platform.cce_params as cce
from te import tik from te import tik
from te import tvm from te import tvm
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape

View File

@ -20,7 +20,7 @@ matmul
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
matmul_cube_dense_right_op_info = TBERegOp("CusMatMulCubeDenseRight") \ matmul_cube_dense_right_op_info = TBERegOp("CusMatMulCubeDenseRight") \

View File

@ -22,7 +22,7 @@ import collections
import te.platform.cce_params as cce import te.platform.cce_params as cce
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape

View File

@ -23,7 +23,7 @@ from collections import namedtuple
import logging import logging
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
# General limitation of the size for input shape: 2**31 # General limitation of the size for input shape: 2**31

View File

@ -22,8 +22,8 @@ from impl.matmul_vector import matmul_vector_cce
import te.platform.cce_params as cce import te.platform.cce_params as cce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape from mindspore.ops._op_impl._custom_op._basic import _shape_check, _get_bias, _get_input_shape

View File

@ -16,7 +16,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
cus_matrix_combine_op_info = TBERegOp("CusMatrixCombine") \ cus_matrix_combine_op_info = TBERegOp("CusMatrixCombine") \

View File

@ -17,8 +17,8 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
minmax_update_perchannel_op_info = TBERegOp("MinMaxUpdatePerChannel") \ minmax_update_perchannel_op_info = TBERegOp("MinMaxUpdatePerChannel") \

View File

@ -18,8 +18,8 @@ from functools import reduce as functools_reduce
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
minmax_update_perlayer_op_info = TBERegOp("MinMaxUpdatePerLayer") \ minmax_update_perlayer_op_info = TBERegOp("MinMaxUpdatePerLayer") \

View File

@ -16,7 +16,7 @@
from __future__ import absolute_import from __future__ import absolute_import
from te import tik from te import tik
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
cus_transpose02314_op_info = TBERegOp("CusTranspose02314") \ cus_transpose02314_op_info = TBERegOp("CusTranspose02314") \

View File

@ -255,7 +255,7 @@ class AscendEnvChecker(EnvChecker):
def __init__(self, library_path): def __init__(self, library_path):
self.library_path = library_path self.library_path = library_path
self.version = ["1.84"] self.version = ["6.3"]
atlas_nnae_version = "/usr/local/Ascend/nnae/latest/compiler/version.info" atlas_nnae_version = "/usr/local/Ascend/nnae/latest/compiler/version.info"
atlas_toolkit_version = "/usr/local/Ascend/ascend-toolkit/latest/compiler/version.info" atlas_toolkit_version = "/usr/local/Ascend/ascend-toolkit/latest/compiler/version.info"
hisi_fwk_version = "/usr/local/Ascend/latest/compiler/version.info" hisi_fwk_version = "/usr/local/Ascend/latest/compiler/version.info"
@ -331,7 +331,7 @@ class AscendEnvChecker(EnvChecker):
def check_deps_version(self): def check_deps_version(self):
""" """
te, topi, hccl wheel package version check te and hccl wheel package version check
in order to update the change of 'LD_LIBRARY_PATH' env, run a sub process in order to update the change of 'LD_LIBRARY_PATH' env, run a sub process
""" """
@ -345,12 +345,6 @@ class AscendEnvChecker(EnvChecker):
attention_warning = True attention_warning = True
logger.warning(f"MindSpore version {mindspore_version} and \"te\" wheel package version {v} does not " logger.warning(f"MindSpore version {mindspore_version} and \"te\" wheel package version {v} does not "
"match, reference to the match info on: https://www.mindspore.cn/install") "match, reference to the match info on: https://www.mindspore.cn/install")
from topi import version as topiver
v = '.'.join(topiver.version.split('.')[0:2])
if v not in supported_version:
attention_warning = True
logger.warning(f"MindSpore version {mindspore_version} and \"topi\" wheel package version {v} does not "
"match, reference to the match info on: https://www.mindspore.cn/install")
from hccl import sys_version as hccl_version from hccl import sys_version as hccl_version
v = '.'.join(hccl_version.__sys_version__.split('.')[0:2]) v = '.'.join(hccl_version.__sys_version__.split('.')[0:2])
if v not in supported_version: if v not in supported_version:
@ -361,7 +355,7 @@ class AscendEnvChecker(EnvChecker):
# pylint: disable=broad-except # pylint: disable=broad-except
except Exception as e: except Exception as e:
logger.error("CheckFailed:", e.args) logger.error("CheckFailed:", e.args)
logger.error("MindSpore relies on the 3 whl packages of \"te\", \"topi\" and \"hccl\" in the \"latest\" " logger.error("MindSpore relies on whl packages of \"te\" and \"hccl\" in the \"latest\" "
"folder of the Ascend AI software package (Ascend Data Center Solution), please check whether" "folder of the Ascend AI software package (Ascend Data Center Solution), please check whether"
" they are installed correctly or not, reference to the match info on: " " they are installed correctly or not, reference to the match info on: "
"https://www.mindspore.cn/install") "https://www.mindspore.cn/install")

View File

@ -8,6 +8,11 @@ include_directories(${CMAKE_SOURCE_DIR}/mindspore/core)
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
include_directories(${CUDA_INCLUDE_DIRS}) include_directories(${CUDA_INCLUDE_DIRS})
# graphengine include directories
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/graphengine_variables.cmake)
endif()
if(ENABLE_ACL) if(ENABLE_ACL)
add_definitions(-D ENABLE_ACL) add_definitions(-D ENABLE_ACL)
endif() endif()

View File

@ -174,7 +174,7 @@ class TimeMonitor(Callback):
self.per_step_mseconds_list.append(epoch_mseconds / self.data_size) self.per_step_mseconds_list.append(epoch_mseconds / self.data_size)
@pytest.mark.level0 @pytest.mark.level1
@pytest.mark.platform_arm_ascend_training @pytest.mark.platform_arm_ascend_training
@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_ascend_training
@pytest.mark.env_onecard @pytest.mark.env_onecard

View File

@ -23,7 +23,7 @@ from mindspore import Tensor
context.set_context(device_target="Ascend") context.set_context(device_target="Ascend")
@pytest.mark.level0 @pytest.mark.level1
@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_ascend_training
@pytest.mark.platform_arm_ascend_training @pytest.mark.platform_arm_ascend_training
@pytest.mark.env_onecard @pytest.mark.env_onecard

View File

@ -59,7 +59,7 @@ class Grad(nn.Cell):
return self.grad(self.network)(x, w, offset, output_grad) return self.grad(self.network)(x, w, offset, output_grad)
@pytest.mark.level0 @pytest.mark.level1
@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_ascend_training
@pytest.mark.platform_arm_ascend_training @pytest.mark.platform_arm_ascend_training
@pytest.mark.env_onecard @pytest.mark.env_onecard

View File

@ -126,7 +126,7 @@ class TestUnsortedSegmentArithmeticNet(nn.Cell):
return self.func(x, segment_ids, self.num_segments) return self.func(x, segment_ids, self.num_segments)
@pytest.mark.level0 @pytest.mark.level1
@pytest.mark.platform_arm_ascend_training @pytest.mark.platform_arm_ascend_training
@pytest.mark.platform_x86_ascend_training @pytest.mark.platform_x86_ascend_training
@pytest.mark.env_onecard @pytest.mark.env_onecard

View File

@ -16,8 +16,8 @@ from __future__ import absolute_import
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
@fusion_manager.register("add3") @fusion_manager.register("add3")

View File

@ -15,9 +15,9 @@
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform import CUBE_MKN from te.platform import CUBE_MKN
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from topi.cce.util import is_v200_version from tbe.tvm.topi.cce.util import is_v200_version
# pylint: disable=R0912,R0913,R0914,R0915,E1101 # pylint: disable=R0912,R0913,R0914,R0915,E1101
# the dim of shape in conv must be 4 # the dim of shape in conv must be 4

View File

@ -17,8 +17,8 @@ from __future__ import absolute_import
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from te.platform.fusion_manager import fusion_manager from te.platform.fusion_manager import fusion_manager
from topi import generic from tbe.tvm.topi import generic
from topi.cce import util from tbe.tvm.topi.cce import util
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType

View File

@ -114,7 +114,7 @@ class TensorSetItem(nn.Cell):
return tensor1, tensor2 return tensor1, tensor2
@pytest.mark.level0 @pytest.mark.level1
@pytest.mark.platform_x86_cpu @pytest.mark.platform_x86_cpu
@pytest.mark.platform_x86_gpu_training @pytest.mark.platform_x86_gpu_training
@pytest.mark.platform_arm_ascend_training @pytest.mark.platform_arm_ascend_training

View File

@ -33,7 +33,7 @@ from mindspore.ops.composite.multitype_ops.zeros_like_impl import zeros_like
def square_with_bias(input_x, output_y, bias=0.0, kernel_name="square_with_bias"): def square_with_bias(input_x, output_y, bias=0.0, kernel_name="square_with_bias"):
import te.lang.cce import te.lang.cce
from te import tvm from te import tvm
from topi.cce import util from tbe.tvm.topi.cce import util
shape = input_x.get("shape") shape = input_x.get("shape")
dtype = input_x.get("dtype").lower() dtype = input_x.get("dtype").lower()

View File

@ -34,6 +34,10 @@ include_directories(${CMAKE_BINARY_DIR}/proto/metadef_protos)
include_directories(${CMAKE_BINARY_DIR}/proto/ge) include_directories(${CMAKE_BINARY_DIR}/proto/ge)
include_directories(${CUDA_INCLUDE_DIRS}) include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR}/mindspore/ccsrc/plugin/device/cpu/kernel) include_directories(${CMAKE_SOURCE_DIR}/mindspore/ccsrc/plugin/device/cpu/kernel)
# graphengine include directories
if(ENABLE_D OR ENABLE_ACL OR ENABLE_TESTCASES)
include(${CMAKE_SOURCE_DIR}/cmake/graphengine_variables.cmake)
endif()
MESSAGE("check ut_test ${CMAKE_BINARY_DIR}") MESSAGE("check ut_test ${CMAKE_BINARY_DIR}")
link_directories(${MS_CCSRC_BUILD_PATH}) link_directories(${MS_CCSRC_BUILD_PATH})

View File

@ -30,7 +30,7 @@ rtError_t rtEventCreateWithFlag(rtEvent_t *event, uint32_t flag) { return RT_ERR
rtError_t rtEventElapsedTime(float *time, rtEvent_t start, rtEvent_t end) { return RT_ERROR_NONE; } rtError_t rtEventElapsedTime(float *time, rtEvent_t start, rtEvent_t end) { return RT_ERROR_NONE; }
rtError_t rtMalloc(void **devPtr, uint64_t size, rtMemType_t type) { return RT_ERROR_NONE; } rtError_t rtMalloc(void **devPtr, uint64_t size, rtMemType_t type, const uint16_t moduleId) { return RT_ERROR_NONE; }
rtError_t rtMemcpy(void *dst, uint64_t destMax, const void *src, uint64_t count, rtMemcpyKind_t kind) { rtError_t rtMemcpy(void *dst, uint64_t destMax, const void *src, uint64_t count, rtMemcpyKind_t kind) {
return RT_ERROR_NONE; return RT_ERROR_NONE;