diff --git a/CMakeLists.txt b/CMakeLists.txt index 88ce15ff..2b80996f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,10 +52,6 @@ if (ENABLE_OPEN_SRC) include(cmake/FindModule.cmake) include(cmake/intf_pub_linux.cmake) - # for CPU/GPU mode, find c_sec and slog from local prebuild - #if(NOT ENABLE_D AND NOT GE_ONLY) - # set(GE_PREBUILD_PATH ${GE_CODE_DIR}/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR}) - # find_module(slog libslog.so ${GE_PREBUILD_PATH}) # if D_LINK_PATH is set in environment variables, search libraries in given path if(DEFINED ENV{D_LINK_PATH}) # D_LINK_PATH is set @@ -154,7 +150,7 @@ elseif (ENABLE_D OR ENABLE_ACL) include(cmake/intf_pub_linux.cmake) # common libraries - find_module(slog libalog.so ${ASCEND_MS_DRIVER_PATH}) + find_module(slog libalog.so ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(error_manager liberror_manager.so ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(static_mmpa libmmpa.a ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) @@ -174,7 +170,7 @@ elseif(ENABLE_MS_TESTCASES) include(cmake/intf_pub_linux.cmake) # common libraries - find_module(slog libalog.so ${ASCEND_MS_DRIVER_PATH}) + find_module(slog libalog.so ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(error_manager liberror_manager.so ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(static_mmpa libmmpa.a ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) diff --git a/build.sh b/build.sh index b0d1f50f..a3a6f6af 100644 --- a/build.sh +++ b/build.sh @@ -23,7 +23,7 @@ export BUILD_PATH="${BASEPATH}/build/" usage() { echo "Usage:" - echo "sh build.sh [-j[n]] [-h] [-v] [-s] [-t] [-u] [-c] [-S on|off]" + echo "sh build.sh [-j[n]] [-h] [-v] [-s] [-t] [-u] [-c] [-S on|off] [-M]" echo "" echo "Options:" echo " -h Print usage" @@ -35,6 +35,7 @@ usage() echo " -p Build inference or train" echo " -v Display build command" echo " -S Enable enable download cmake compile dependency from gitee , default off" + echo " -M build MindSpore mode" echo "to be continued ..." } @@ -58,30 +59,27 @@ checkopts() ENABLE_GE_UT="off" ENABLE_GE_ST="off" ENABLE_GE_COV="off" - GE_ONLY="on" PLATFORM="" PRODUCT="normal" ENABLE_GITEE="off" + MINDSPORE_MODE="off" # Process the options - while getopts 'ustchj:p:g:vS:' opt + while getopts 'ustchj:p:g:vS:M' opt do OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]') case "${opt}" in u) # ENABLE_GE_UT_ONLY_COMPILE="on" ENABLE_GE_UT="on" - GE_ONLY="off" ;; s) ENABLE_GE_ST="on" ;; t) ENABLE_GE_UT="on" - GE_ONLY="off" ;; c) ENABLE_GE_COV="on" - GE_ONLY="off" ;; h) usage @@ -104,6 +102,9 @@ checkopts() ENABLE_GITEE="$OPTARG" echo "enable download from gitee" ;; + M) + MINDSPORE_MODE="on" + ;; *) echo "Undefined option: ${opt}" usage @@ -132,7 +133,12 @@ build_graphengine() echo "create build directory and build GraphEngine"; mk_dir "${BUILD_PATH}" cd "${BUILD_PATH}" - CMAKE_ARGS="-DBUILD_PATH=$BUILD_PATH -DGE_ONLY=$GE_ONLY" + + if [[ "X$MINDSPORE_MODE" = "Xoff" ]]; then + CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPEN_SRC=True -DCMAKE_INSTALL_PREFIX=${OUTPUT_PATH} -DPLATFORM=${PLATFORM} -DPRODUCT=${PRODUCT}" + else + CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_D=ON -DCMAKE_INSTALL_PREFIX=${OUTPUT_PATH}" + fi if [[ "X$ENABLE_GE_COV" = "Xon" ]]; then CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GE_COV=ON" @@ -169,6 +175,9 @@ build_graphengine() elif [ "X$ENABLE_GE_UT" = "Xon" ] then TARGET="ut_libgraph ut_libge_multiparts_utest ut_libge_others_utest ut_libge_kernel_utest ut_libge_distinct_load_utest" + elif [ "X$MINDSPORE_MODE" = "Xon" ] + then + TARGET="ge_common graph" elif [ "x${PLATFORM}" = "xall" ] then # build all the target @@ -320,7 +329,12 @@ generate_package() fi } -if [[ "X$ENABLE_GE_UT" = "Xoff" ]]; then +if [[ "X$ENABLE_GE_UT" = "Xoff" && "X$MINDSPORE_MODE" = "Xoff" ]]; then generate_package +elif [ "X$MINDSPORE_MODE" = "Xon" ] +then + cd "${OUTPUT_PATH}" + find ./ -name graphengine_lib.tar -exec rm {} \; + tar -cf graphengine_lib.tar lib fi -echo "---------------- GraphEngine package archive generated ----------------" +echo "---------------- GraphEngine package archive generated ----------------" \ No newline at end of file diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index bb08570a..aad85654 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -180,6 +180,7 @@ target_compile_definitions(ge_common PRIVATE FMK_SUPPORT_DUMP OS_CENTOS google=ascend_private + LOG_CPP ) target_compile_options(ge_common PRIVATE diff --git a/ge/ge_runtime/CMakeLists.txt b/ge/ge_runtime/CMakeLists.txt index ce1b89ea..ded8fd39 100644 --- a/ge/ge_runtime/CMakeLists.txt +++ b/ge/ge_runtime/CMakeLists.txt @@ -27,6 +27,7 @@ target_compile_options(ge_runtime PRIVATE target_compile_definitions(ge_runtime PRIVATE PROTOBUF_INLINE_NOT_IN_HEADERS=0 + LOG_CPP ) target_include_directories(ge_runtime PRIVATE diff --git a/ge/ge_runtime/runtime_model.cc b/ge/ge_runtime/runtime_model.cc index 8baa5b05..b30ca1bf 100644 --- a/ge/ge_runtime/runtime_model.cc +++ b/ge/ge_runtime/runtime_model.cc @@ -32,12 +32,12 @@ const int kOffsetUnit = 8; RuntimeModel::~RuntimeModel() { GELOGI("RuntimeModel destructor start"); - // Release task first, hccl task hold stream - task_list_.clear(); - // Unbind rtModel from all task related streams RtModelUnbindStream(); + // Release task first, hccl task hold stream + task_list_.clear(); + // Release all task related streams RtStreamDestory(); diff --git a/metadef b/metadef index 4b54fc3c..4d69fded 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 4b54fc3ce1c961606aadd0e4568598ef1d96e1d7 +Subproject commit 4d69fdedebfad0ecfaacc7955cb87a547d5fbf14 diff --git a/third_party/prebuild/aarch64/libalog.so b/third_party/prebuild/aarch64/libalog.so new file mode 100755 index 00000000..e041ad7e Binary files /dev/null and b/third_party/prebuild/aarch64/libalog.so differ diff --git a/third_party/prebuild/aarch64/libslog.so b/third_party/prebuild/aarch64/libslog.so deleted file mode 100755 index 700fc118..00000000 Binary files a/third_party/prebuild/aarch64/libslog.so and /dev/null differ diff --git a/third_party/prebuild/x86_64/libalog.so b/third_party/prebuild/x86_64/libalog.so new file mode 100755 index 00000000..051f85d9 Binary files /dev/null and b/third_party/prebuild/x86_64/libalog.so differ diff --git a/third_party/prebuild/x86_64/libslog.so b/third_party/prebuild/x86_64/libslog.so deleted file mode 100755 index 01b75e40..00000000 Binary files a/third_party/prebuild/x86_64/libslog.so and /dev/null differ