adapting mindspore to latest graphengine form

pull/901/head
yanghaoran 4 years ago
parent 48aceb17bc
commit d94d07a295

@ -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})

@ -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 ----------------"

@ -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

@ -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

@ -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();

@ -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