!901 adapting mindspore to latest graphengine form

From: @nicholas_yhr
Reviewed-by: @wqtshg,@liujunzhu
Signed-off-by: @liujunzhu
pull/901/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 341eb10886

@ -52,10 +52,6 @@ if (ENABLE_OPEN_SRC)
include(cmake/FindModule.cmake) include(cmake/FindModule.cmake)
include(cmake/intf_pub_linux.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 D_LINK_PATH is set in environment variables, search libraries in given path
if(DEFINED ENV{D_LINK_PATH}) if(DEFINED ENV{D_LINK_PATH})
# D_LINK_PATH is set # D_LINK_PATH is set
@ -154,7 +150,7 @@ elseif (ENABLE_D OR ENABLE_ACL)
include(cmake/intf_pub_linux.cmake) include(cmake/intf_pub_linux.cmake)
# common libraries # 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(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}) 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) include(cmake/intf_pub_linux.cmake)
# common libraries # 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(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}) find_module(static_mmpa libmmpa.a ${ASCEND_MS_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH})

@ -23,7 +23,7 @@ export BUILD_PATH="${BASEPATH}/build/"
usage() usage()
{ {
echo "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 ""
echo "Options:" echo "Options:"
echo " -h Print usage" echo " -h Print usage"
@ -35,6 +35,7 @@ usage()
echo " -p Build inference or train" echo " -p Build inference or train"
echo " -v Display build command" echo " -v Display build command"
echo " -S Enable enable download cmake compile dependency from gitee , default off" echo " -S Enable enable download cmake compile dependency from gitee , default off"
echo " -M build MindSpore mode"
echo "to be continued ..." echo "to be continued ..."
} }
@ -58,30 +59,27 @@ checkopts()
ENABLE_GE_UT="off" ENABLE_GE_UT="off"
ENABLE_GE_ST="off" ENABLE_GE_ST="off"
ENABLE_GE_COV="off" ENABLE_GE_COV="off"
GE_ONLY="on"
PLATFORM="" PLATFORM=""
PRODUCT="normal" PRODUCT="normal"
ENABLE_GITEE="off" ENABLE_GITEE="off"
MINDSPORE_MODE="off"
# Process the options # Process the options
while getopts 'ustchj:p:g:vS:' opt while getopts 'ustchj:p:g:vS:M' opt
do do
OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]') OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]')
case "${opt}" in case "${opt}" in
u) u)
# ENABLE_GE_UT_ONLY_COMPILE="on" # ENABLE_GE_UT_ONLY_COMPILE="on"
ENABLE_GE_UT="on" ENABLE_GE_UT="on"
GE_ONLY="off"
;; ;;
s) s)
ENABLE_GE_ST="on" ENABLE_GE_ST="on"
;; ;;
t) t)
ENABLE_GE_UT="on" ENABLE_GE_UT="on"
GE_ONLY="off"
;; ;;
c) c)
ENABLE_GE_COV="on" ENABLE_GE_COV="on"
GE_ONLY="off"
;; ;;
h) h)
usage usage
@ -104,6 +102,9 @@ checkopts()
ENABLE_GITEE="$OPTARG" ENABLE_GITEE="$OPTARG"
echo "enable download from gitee" echo "enable download from gitee"
;; ;;
M)
MINDSPORE_MODE="on"
;;
*) *)
echo "Undefined option: ${opt}" echo "Undefined option: ${opt}"
usage usage
@ -132,7 +133,12 @@ build_graphengine()
echo "create build directory and build GraphEngine"; echo "create build directory and build GraphEngine";
mk_dir "${BUILD_PATH}" mk_dir "${BUILD_PATH}"
cd "${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 if [[ "X$ENABLE_GE_COV" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GE_COV=ON" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GE_COV=ON"
@ -169,6 +175,9 @@ build_graphengine()
elif [ "X$ENABLE_GE_UT" = "Xon" ] elif [ "X$ENABLE_GE_UT" = "Xon" ]
then then
TARGET="ut_libgraph ut_libge_multiparts_utest ut_libge_others_utest ut_libge_kernel_utest ut_libge_distinct_load_utest" 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" ] elif [ "x${PLATFORM}" = "xall" ]
then then
# build all the target # build all the target
@ -320,7 +329,12 @@ generate_package()
fi fi
} }
if [[ "X$ENABLE_GE_UT" = "Xoff" ]]; then if [[ "X$ENABLE_GE_UT" = "Xoff" && "X$MINDSPORE_MODE" = "Xoff" ]]; then
generate_package 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 fi
echo "---------------- GraphEngine package archive generated ----------------" echo "---------------- GraphEngine package archive generated ----------------"

@ -180,6 +180,7 @@ target_compile_definitions(ge_common PRIVATE
FMK_SUPPORT_DUMP FMK_SUPPORT_DUMP
OS_CENTOS OS_CENTOS
google=ascend_private google=ascend_private
LOG_CPP
) )
target_compile_options(ge_common PRIVATE target_compile_options(ge_common PRIVATE

@ -27,6 +27,7 @@ target_compile_options(ge_runtime PRIVATE
target_compile_definitions(ge_runtime PRIVATE target_compile_definitions(ge_runtime PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0 PROTOBUF_INLINE_NOT_IN_HEADERS=0
LOG_CPP
) )
target_include_directories(ge_runtime PRIVATE target_include_directories(ge_runtime PRIVATE

@ -32,12 +32,12 @@ const int kOffsetUnit = 8;
RuntimeModel::~RuntimeModel() { RuntimeModel::~RuntimeModel() {
GELOGI("RuntimeModel destructor start"); GELOGI("RuntimeModel destructor start");
// Release task first, hccl task hold stream
task_list_.clear();
// Unbind rtModel from all task related streams // Unbind rtModel from all task related streams
RtModelUnbindStream(); RtModelUnbindStream();
// Release task first, hccl task hold stream
task_list_.clear();
// Release all task related streams // Release all task related streams
RtStreamDestory(); RtStreamDestory();

@ -1 +1 @@
Subproject commit 4b54fc3ce1c961606aadd0e4568598ef1d96e1d7 Subproject commit 4d69fdedebfad0ecfaacc7955cb87a547d5fbf14

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save