Compare commits

..

106 Commits

Author SHA1 Message Date
mindspore-ci-bot 59361d83a9 !1470 LinkToPotentialPrecedenceNode c76
4 years ago
lianghao 1993675125 LinkToPotentialPrecedenceNode
4 years ago
mindspore-ci-bot a205af43fc !1324 Fix bug of single_op ageing.
4 years ago
unknown 63e8d1e291 Fix bug of single_op ageing.
4 years ago
mindspore-ci-bot 5d094c7f72 !1289 modify static depends
4 years ago
wxl 11b77d9daf modify static depends
4 years ago
mindspore-ci-bot a8c137e5eb !1058 kTaskNumPerHcclNode
4 years ago
lianghao 3dd23c428e kTaskNumPerHcclNode
4 years ago
mindspore-ci-bot d98d77371e !1045 move end_task after assignadd on iterator_loop case
4 years ago
wangxiaotian22 2b0464ad81 move end_task before active stream when bpfp set by env
4 years ago
mindspore-ci-bot 145d6a97d6 !1011 move end_task after assignadd on iterator_loop case
4 years ago
wangxiaotian22 c72ba8ad66 parser update
4 years ago
wangxiaotian22 d8db67d06f add metadef update
4 years ago
wangxiaotian22 9712b297b7 move end_task after assignadd on iterator_loop case
4 years ago
mindspore-ci-bot 885b3a6b7f !951 gensessionid add pid prefix
4 years ago
wangxiaotian22 ee5c71962d gensessionid add pid prefix
4 years ago
mindspore-ci-bot c14c6a87cb !947 change mult batch to switchn
4 years ago
wjm 81cd9527aa fix error
4 years ago
wjm d3515b1624 change mult batch to switchn
4 years ago
mindspore-ci-bot cb019693b1 !945 Add cc_task task_info log.
4 years ago
mindspore-ci-bot 6529491d90 !943 Add keep_dtype attribute
4 years ago
unknown 4318596b9a Add cc_task task_info log.
4 years ago
lwx897429 970745eedf Add keep_dtype attribute
4 years ago
mindspore-ci-bot 89cccaeb3c !907 modify dump task proto in c76
4 years ago
zhou_chao1993 7f341ab53a modify dump_task proto in c76
4 years ago
mindspore-ci-bot ae91b07e6a !917 Migration subgraph Const Node
4 years ago
mindspore-ci-bot 267ddd9801 !916 Bugfix: check pricision loss when cast from int64 to bool
4 years ago
wjm 5bc603e52d fix error
4 years ago
zhaoxinxin a608eee4e2 modified: ge/graph/common/transop_util.cc
4 years ago
mindspore-ci-bot 1218a757c5 !898 Add submodelId in dynamic shape
4 years ago
taoxiangdong fadd5d1874 Add submodelId in dyanamic shape
4 years ago
mindspore-ci-bot 1cd83211d6 !891 fix l2 buffer error
4 years ago
mindspore-ci-bot 3eeb8a9c97 !893 remove interface aclgrphInfershapeAndType
4 years ago
mindspore-ci-bot 0126007d89 !888 add SwitchDeadBranchElimination & MergePass in graph prepare
4 years ago
wxl a69806eee1 remove interface aclgrphInfershapeAndType
4 years ago
wjm aac7897a44 fix l2 buffer error
4 years ago
chenyemeng 2b90729519 add SwitchDeadBranchElimination & MergePass in graph prepare
4 years ago
mindspore-ci-bot d5c6e8146b !872 Log macro error in windows
4 years ago
taoxiangdong 850f6efb29 Log print macro error
4 years ago
mindspore-ci-bot 65509ee0f0 !853 add whole graph optimize
4 years ago
gengchao4@huawei.com 8ad6d4b463 add whole graph optimize
4 years ago
mindspore-ci-bot 103aa22616 !839 fixed issue of repeated profile subscription
4 years ago
mindspore-ci-bot 11b6f47be6 !811 modify p2p addr assigner bug in c76
4 years ago
mindspore-ci-bot 501e184095 !828 Free mem before return
4 years ago
taoxiangdong c8cc205f33 Free memory before return
4 years ago
lwx897429 d30dd18e09 fixed issue of repeated profile subscription
4 years ago
mindspore-ci-bot 63cc95c5e5 !837 Feature: delete compress_weight_conf para of aclgrphParse interface
4 years ago
l00444296 b6aa9c0e4d Feature: delete compress_weight_conf para of aclgrphParse interface
4 years ago
mindspore-ci-bot 032f9d1f07 !795 Parse traing trace switch in profstart func
4 years ago
mindspore-ci-bot dfd2314793 !782 Feature: delete compress_weight_conf para of aclgrphParse interface
4 years ago
mindspore-ci-bot 69e7d5bf64 !789 fix question that release all loaded model memory when memory is not enough
4 years ago
mindspore-ci-bot c451c30026 !797 fix dynamic aipp error
4 years ago
mindspore-ci-bot 61b2de9c38 !786 dump
4 years ago
mindspore-ci-bot a552edfd11 !779 Feature: delete is_load_profiling_ reset to false
4 years ago
wjm ba745a12d3 fix
4 years ago
zhou_chao1993 0554dd5942 modify p2p addr assigner bug
4 years ago
weiyang 628162c7b0 dump
4 years ago
wjm a9b4cf400a fix dynamic aipp error
4 years ago
taoxiangdong 5e85506711 Parse training trace on profstart
4 years ago
mindspore-ci-bot 5a8206cf7d !793 license update, mentioning usage of tensorflow and caffe code
4 years ago
yanghaoran fba4643a47 license update, mentioning usage of tensorflow and caffe code
4 years ago
wxl 2504b6b7b9 bugfix
4 years ago
l00444296 50fdb59274 Feature: delete compress_weight_conf para of aclgrphParse interface
4 years ago
l00444296 d1eb560616 Feature: delete is_load_profiling_ reset to false
4 years ago
mindspore-ci-bot 72eef81746 !767 for perfmance
4 years ago
mindspore-ci-bot 856fb4419a !724 Feature: repair dynamic_stitch_kernel folding bug
4 years ago
mindspore-ci-bot b3cfade65e !771 op_compiler_cache_dir
4 years ago
mindspore-ci-bot 35983c7c38 !761 Check aicpu op type
4 years ago
mindspore-ci-bot 4fe214984d !755 errorcode
4 years ago
lianghao bb6de73c97 op_compiler_cache_dir
4 years ago
weiyang 43c1e02265 perf
4 years ago
taoxiangdong 546e9f7cf9 Check aicpu op type
4 years ago
mindspore-ci-bot c2fb4adbce !760 device os log missing
4 years ago
taoxiangdong c485a99932 device os log missing
4 years ago
mindspore-ci-bot 5de4cd5479 !733 decrease om size
4 years ago
mindspore-ci-bot 30000dd4e7 !747 fix case plugin error
4 years ago
mindspore-ci-bot 60ceda422f !752 Fix storage bug.
4 years ago
weiyang 48585c78f0 errorcode
4 years ago
mindspore-ci-bot 51314c970b !751 Fix bug of modify output shape to -2.
4 years ago
unknown 17428ef7a8 Fix storage bug.
4 years ago
unknown 4a315e1d4f Fix bug of modify output shape to -2.
4 years ago
wjm c694a907e2 fix case flugin
4 years ago
mindspore-ci-bot 8bb847b429 !746 delete invalid comment
4 years ago
wqtshg acae7cfaea delete invalid comment
4 years ago
mindspore-ci-bot 3efd05e1c4 !744 update c76 code
4 years ago
wqtshg 7f542c2b68 update c76 code ut
4 years ago
wqtshg 0b6354215a update c76 ut
4 years ago
wqtshg 8a8a42cf03 update c76 code ut
4 years ago
wqtshg 8e87e4b7a5 update ge ut
4 years ago
wqtshg ea477de6eb update test
4 years ago
wqtshg 0f36063e8c update ut
4 years ago
wqtshg 1ac3bff4af update c76 submodule
4 years ago
lianghao 2898b2d83c decrease om size
4 years ago
wqtshg 455f21252f update c76 log_cpp
4 years ago
l00444296 48973d4ea1 Feature: repair dynamic_stitch_kernel folding bug
4 years ago
wqtshg 4ac0f69204 add c76 LOG_CPP
4 years ago
wqtshg d662b5e84e update c76 submodule
4 years ago
wqtshg e38e5e06a2 update c76 cmake
4 years ago
wqtshg eea696c45b update c76 code
4 years ago
wqtshg eaeaec68ff update slog to alog
4 years ago
wqtshg 86bb779cee update c76 submodule
4 years ago
计晨 fe5db33358 !712 update c76 code
4 years ago
wqtshg 5cc51efc74 update c76 code and submodule
4 years ago
计晨 ca855a5bf7 !707 update c76 code
4 years ago
wqtshg 16758ee2b1 update c76 code
4 years ago
wqtshg 5d043adbca update c76 code
4 years ago

1
.gitignore vendored

@ -2,7 +2,6 @@
/build /build
/output /output
/prebuilts /prebuilts
/cov
*.ir *.ir
*.out *.out

4
.gitmodules vendored

@ -1,8 +1,8 @@
[submodule "parser"] [submodule "parser"]
path = parser path = parser
url = https://gitee.com/ascend/parser.git url = https://gitee.com/ascend/parser.git
branch = master branch = r1.2.0
[submodule "metadef"] [submodule "metadef"]
path = metadef path = metadef
url = https://gitee.com/ascend/metadef.git url = https://gitee.com/ascend/metadef.git
branch = master branch = r1.2.0

@ -52,6 +52,10 @@ 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 alog 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 libalog.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
@ -70,24 +74,30 @@ if (ENABLE_OPEN_SRC)
set(STATIC_ACL_LIB ${GE_LIB_PATH}) set(STATIC_ACL_LIB ${GE_LIB_PATH})
find_module(slog libalog.so ${GE_LIB_PATH}) find_module(slog libalog.so ${GE_LIB_PATH})
find_module(static_mmpa libmmpa.a ${GE_LIB_PATH}) find_module(static_mmpa libmmpa.a ${GE_LIB_PATH})
find_module(msprofiler_ext libmsprofiler.a ${GE_LIB_PATH}) find_module(msprofiler libmsprofiler.a ${GE_LIB_PATH})
find_module(hccl libhccl.so ${GE_LIB_PATH}) find_module(hccl libhccl.so ${GE_LIB_PATH})
find_module(adump_server libadump_server.a ${GE_LIB_PATH}) find_module(adump_server libadump_server.a ${GE_LIB_PATH})
find_module(runtime libruntime.so ${GE_LIB_PATH}) find_module(runtime libruntime.so ${GE_LIB_PATH})
find_module(runtime_compile libruntime_compile.so ${GE_LIB_PATH}) find_module(runtime_compile libruntime_compile.so ${GE_LIB_PATH})
find_module(resource libresource.so ${GE_LIB_PATH}) find_module(resource libresource.so ${GE_LIB_PATH})
find_module(error_manager liberror_manager.so ${GE_LIB_PATH})
find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH}) find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH})
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${GE_LIB_PATH}) find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH})
find_module(msprofiler_fwk libmsprofiler_fwk.a ${GE_LIB_PATH})
#find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH})
elseif(ENABLE_GE_COV OR ENABLE_GE_UT) elseif(ENABLE_GE_COV OR ENABLE_GE_UT)
add_subdirectory(tests) add_subdirectory(tests)
else() else()
find_module(slog libalog.so ${ASCEND_ATC_DIR}) find_module(slog libalog.so ${ASCEND_ATC_DIR})
find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR})
if(PLATFORM STREQUAL "train") if(PLATFORM STREQUAL "train")
find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR})
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) find_module(resource libresource.so ${ASCEND_RUNTIME_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR})
find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
if(PRODUCT STREQUAL "flr3") if(PRODUCT STREQUAL "flr3")
message(FATAL_ERROR "This platform is not supported in train mode, build terminated") message(FATAL_ERROR "This platform is not supported in train mode, build terminated")
@ -96,7 +106,11 @@ if (ENABLE_OPEN_SRC)
find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR}) find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR})
find_module(runtime libruntime.so ${ASCEND_ACL_DIR}) find_module(runtime libruntime.so ${ASCEND_ACL_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR}) find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR}) find_module(resource libresource.so ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR})
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR})
find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR})
#find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR})
if(PRODUCT STREQUAL "flr3") if(PRODUCT STREQUAL "flr3")
elseif(PRODUCT STREQUAL "flr1") elseif(PRODUCT STREQUAL "flr1")
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
@ -106,12 +120,17 @@ if (ENABLE_OPEN_SRC)
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR})
endif() endif()
elseif(PLATFORM STREQUAL "all") elseif(PLATFORM STREQUAL "all")
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR})
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) find_module(runtime libruntime.so ${ASCEND_ACL_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR}) find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR}) find_module(resource libresource.so ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR})
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR})
find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
#find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR})
else() else()
message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!") message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!")
endif() endif()
@ -135,7 +154,8 @@ 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_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(slog libalog.so ${ASCEND_MS_DRIVER_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})
if (ENABLE_D) if (ENABLE_D)
@ -154,7 +174,8 @@ 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_RUNTIME_PATH} ${ATLAS_MS_RUNTIME_PATH}) find_module(slog libalog.so ${ASCEND_MS_DRIVER_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})
set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef) set(METADEF_DIR ${CMAKE_CURRENT_LIST_DIR}/metadef)

@ -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] [-M]" echo "sh build.sh [-j[n]] [-h] [-v] [-s] [-t] [-u] [-c] [-S on|off]"
echo "" echo ""
echo "Options:" echo "Options:"
echo " -h Print usage" echo " -h Print usage"
@ -35,7 +35,6 @@ 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 ..."
} }
@ -59,27 +58,30 @@ 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:M' opt while getopts 'ustchj:p:g:vS:' 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
@ -102,9 +104,6 @@ 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
@ -133,8 +132,7 @@ 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"
CMAKE_ARGS="-DBUILD_PATH=$BUILD_PATH"
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"
@ -152,13 +150,7 @@ build_graphengine()
if [[ "X$ENABLE_GITEE" = "Xon" ]]; then if [[ "X$ENABLE_GITEE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GITEE=ON" CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GITEE=ON"
fi fi
if [[ "X$MINDSPORE_MODE" = "Xoff" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPEN_SRC=True -DCMAKE_INSTALL_PREFIX=${OUTPUT_PATH} -DPLATFORM=${PLATFORM} -DPRODUCT=${PRODUCT}" 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
echo "${CMAKE_ARGS}" echo "${CMAKE_ARGS}"
cmake ${CMAKE_ARGS} .. cmake ${CMAKE_ARGS} ..
if [ $? -ne 0 ] if [ $? -ne 0 ]
@ -166,24 +158,21 @@ build_graphengine()
echo "execute command: cmake ${CMAKE_ARGS} .. failed." echo "execute command: cmake ${CMAKE_ARGS} .. failed."
return 1 return 1
fi fi
COMMON_TARGET="ge_local_engine ge_local_opskernel_builder host_cpu_engine host_cpu_opskernel_builder ge_common engine fmk_parser parser_common _caffe_parser fmk_onnx_parser graph register engine_conf.json optimizer_priority.pbtxt " COMMON_TARGET="ge_common engine fmk_parser parser_common _caffe_parser fmk_onnx_parser graph register engine_conf.json optimizer_priority.pbtxt "
TARGET=${COMMON_TARGET} TARGET=${COMMON_TARGET}
if [ "x${PLATFORM}" = "xtrain" ] if [ "x${PLATFORM}" = "xtrain" ]
then then
TARGET="ge_runner fwk_atc.bin ${TARGET}" TARGET="ge_runner ge_local_engine ge_local_opskernel_builder host_cpu_engine host_cpu_opskernel_builder ${TARGET}"
elif [ "x${PLATFORM}" = "xinference" ] elif [ "x${PLATFORM}" = "xinference" ]
then then
TARGET="ge_compiler atc_atc.bin opensrc_ascendcl ${TARGET}" TARGET="ge_compiler atc_ge_local_engine atc_ge_local_opskernel_builder atc_host_cpu_engine atc_host_cpu_opskernel_builder atc opensrc_ascendcl ${TARGET}"
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
TARGET="ge_runner ge_compiler fwk_atc.bin atc_atc.bin opensrc_ascendcl ${TARGET}" TARGET=""
fi fi
make ${VERBOSE} ${TARGET} -j${THREAD_NUM} && make install make ${VERBOSE} ${TARGET} -j${THREAD_NUM} && make install
@ -198,6 +187,8 @@ g++ -v
mk_dir ${OUTPUT_PATH} mk_dir ${OUTPUT_PATH}
build_graphengine || { echo "GraphEngine build failed."; return; } build_graphengine || { echo "GraphEngine build failed."; return; }
echo "---------------- GraphEngine build finished ----------------" echo "---------------- GraphEngine build finished ----------------"
#cp -rf "${BUILD_PATH}/graphengine/"*.so "${OUTPUT_PATH}"
#rm -rf "${OUTPUT_PATH}/"libproto*
rm -f ${OUTPUT_PATH}/libgmock*.so rm -f ${OUTPUT_PATH}/libgmock*.so
rm -f ${OUTPUT_PATH}/libgtest*.so rm -f ${OUTPUT_PATH}/libgtest*.so
rm -f ${OUTPUT_PATH}/lib*_stub.so rm -f ${OUTPUT_PATH}/lib*_stub.so
@ -207,6 +198,10 @@ find ${OUTPUT_PATH} -name "*.so*" -print0 | xargs -0 chmod 500
echo "---------------- GraphEngine output generated ----------------" echo "---------------- GraphEngine output generated ----------------"
# if [[ "X$ENABLE_GE_ST" = "Xon" ]]; then
# cp ${BUILD_PATH}/graphengine/tests/st/st_resnet50_train ${OUTPUT_PATH}
# fi
if [[ "X$ENABLE_GE_UT" = "Xon" || "X$ENABLE_GE_COV" = "Xon" ]]; then if [[ "X$ENABLE_GE_UT" = "Xon" || "X$ENABLE_GE_COV" = "Xon" ]]; then
cp ${BUILD_PATH}/tests/ut/common/graph/ut_libgraph ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/common/graph/ut_libgraph ${OUTPUT_PATH}
cp ${BUILD_PATH}/tests/ut/ge/ut_libge_multiparts_utest ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/ge/ut_libge_multiparts_utest ${OUTPUT_PATH}
@ -214,24 +209,27 @@ if [[ "X$ENABLE_GE_UT" = "Xon" || "X$ENABLE_GE_COV" = "Xon" ]]; then
cp ${BUILD_PATH}/tests/ut/ge/ut_libge_others_utest ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/ge/ut_libge_others_utest ${OUTPUT_PATH}
cp ${BUILD_PATH}/tests/ut/ge/ut_libge_kernel_utest ${OUTPUT_PATH} cp ${BUILD_PATH}/tests/ut/ge/ut_libge_kernel_utest ${OUTPUT_PATH}
RUN_TEST_CASE=${OUTPUT_PATH}/ut_libgraph && ${RUN_TEST_CASE} && # if [[ "X${ENABLE_GE_UT_ONLY_COMPILE}" != "Xon" ]]; then
RUN_TEST_CASE=${OUTPUT_PATH}/ut_libge_multiparts_utest && ${RUN_TEST_CASE} && # export LD_LIBRARY_PATH=${D_LINK_PATH}/x86_64/:${BUILD_PATH}../third_party/prebuild/x86_64/:${BUILD_PATH}/graphengine/:/usr/local/HiAI/driver/lib64:/usr/local/HiAI/runtime/lib64:${LD_LIBRARY_PATH}
RUN_TEST_CASE=${OUTPUT_PATH}/ut_libge_distinct_load_utest && ${RUN_TEST_CASE} && # echo ${LD_LIBRARY_PATH}
RUN_TEST_CASE=${OUTPUT_PATH}/ut_libge_others_utest && ${RUN_TEST_CASE} && ${OUTPUT_PATH}/ut_libgraph &&
RUN_TEST_CASE=${OUTPUT_PATH}/ut_libge_kernel_utest && ${RUN_TEST_CASE} ${OUTPUT_PATH}/ut_libge_multiparts_utest &&
${OUTPUT_PATH}/ut_libge_distinct_load_utest &&
${OUTPUT_PATH}/ut_libge_others_utest &&
${OUTPUT_PATH}/ut_libge_kernel_utest
if [[ "$?" -ne 0 ]]; then if [[ "$?" -ne 0 ]]; then
echo "!!! UT FAILED, PLEASE CHECK YOUR CHANGES !!!" echo "!!! UT FAILED, PLEASE CHECK YOUR CHANGES !!!"
echo -e "\033[31m${RUN_TEST_CASE}\033[0m"
exit 1; exit 1;
fi fi
echo "Generating coverage statistics, please wait..." # fi
cd ${BASEPATH}
rm -rf ${BASEPATH}/cov # if [[ "X$ENABLE_GE_COV" = "Xon" ]]; then
mkdir ${BASEPATH}/cov # echo "Generating coverage statistics, please wait..."
lcov -c -d build/tests/ut/ge -d build/tests/ut/common/graph/ -o cov/tmp.info # cd ${BASEPATH}
lcov -r cov/tmp.info '*/output/*' '*/build/opensrc/*' '*/build/proto/*' '*/third_party/*' '*/tests/*' '/usr/local/*' '/usr/include/*' '*/metadef/*' '*/parser/*' -o cov/coverage.info # rm -rf ${BASEPATH}/cov
cd ${BASEPATH}/cov # mkdir ${BASEPATH}/cov
genhtml coverage.info # gcovr -r ./ --exclude 'third_party' --exclude 'build' --exclude 'tests' --exclude 'prebuild' --exclude 'inc' --print-summary --html --html-details -d -o cov/index.html
# fi
fi fi
# generate output package in tar form, including ut/st libraries/executables # generate output package in tar form, including ut/st libraries/executables
@ -244,14 +242,11 @@ generate_package()
FWK_PATH="fwkacllib/lib64" FWK_PATH="fwkacllib/lib64"
ATC_PATH="atc/lib64" ATC_PATH="atc/lib64"
ATC_BIN_PATH="atc/bin" ATC_BIN_PATH="atc/bin"
FWK_BIN_PATH="fwkacllib/bin"
FWK_INCLUDE_PATH="fwkacllib/include"
ATC_INCLUDE_PATH="atc/include"
NNENGINE_PATH="plugin/nnengine/ge_config" NNENGINE_PATH="plugin/nnengine/ge_config"
OPSKERNEL_PATH="plugin/opskernel" OPSKERNEL_PATH="plugin/opskernel"
ATC_LIB=("libc_sec.so" "libge_common.so" "libge_compiler.so" "libgraph.so" "libregister.so" "liberror_manager.so") ATC_LIB=("libc_sec.so" "libge_common.so" "libge_compiler.so" "libgraph.so" "libregister.so")
FWK_LIB=("libge_common.so" "libge_runner.so" "libgraph.so" "libregister.so" "liberror_manager.so") FWK_LIB=("libge_common.so" "libge_runner.so" "libgraph.so" "libregister.so")
PLUGIN_OPSKERNEL=("libge_local_engine.so" "libge_local_opskernel_builder.so" "libhost_cpu_engine.so" "libhost_cpu_opskernel_builder.so" "optimizer_priority.pbtxt") PLUGIN_OPSKERNEL=("libge_local_engine.so" "libge_local_opskernel_builder.so" "libhost_cpu_engine.so" "libhost_cpu_opskernel_builder.so" "optimizer_priority.pbtxt")
PARSER_LIB=("lib_caffe_parser.so" "libfmk_onnx_parser.so" "libfmk_parser.so" "libparser_common.so") PARSER_LIB=("lib_caffe_parser.so" "libfmk_onnx_parser.so" "libfmk_parser.so" "libparser_common.so")
@ -259,7 +254,6 @@ generate_package()
rm -rf ${OUTPUT_PATH:?}/${ACL_PATH}/ rm -rf ${OUTPUT_PATH:?}/${ACL_PATH}/
rm -rf ${OUTPUT_PATH:?}/${ATC_PATH}/ rm -rf ${OUTPUT_PATH:?}/${ATC_PATH}/
rm -rf ${OUTPUT_PATH:?}/${ATC_BIN_PATH}/ rm -rf ${OUTPUT_PATH:?}/${ATC_BIN_PATH}/
rm -rf ${OUTPUT_PATH:?}/${FWK_BIN_PATH}/
mk_dir "${OUTPUT_PATH}/${FWK_PATH}/${NNENGINE_PATH}" mk_dir "${OUTPUT_PATH}/${FWK_PATH}/${NNENGINE_PATH}"
mk_dir "${OUTPUT_PATH}/${FWK_PATH}/${OPSKERNEL_PATH}" mk_dir "${OUTPUT_PATH}/${FWK_PATH}/${OPSKERNEL_PATH}"
@ -267,9 +261,6 @@ generate_package()
mk_dir "${OUTPUT_PATH}/${ATC_PATH}/${OPSKERNEL_PATH}" mk_dir "${OUTPUT_PATH}/${ATC_PATH}/${OPSKERNEL_PATH}"
mk_dir "${OUTPUT_PATH}/${ACL_PATH}" mk_dir "${OUTPUT_PATH}/${ACL_PATH}"
mk_dir "${OUTPUT_PATH}/${ATC_BIN_PATH}" mk_dir "${OUTPUT_PATH}/${ATC_BIN_PATH}"
mk_dir "${OUTPUT_PATH}/${FWK_BIN_PATH}"
mk_dir "${OUTPUT_PATH}/${FWK_INCLUDE_PATH}"
mk_dir "${OUTPUT_PATH}/${ATC_INCLUDE_PATH}"
cd "${OUTPUT_PATH}" cd "${OUTPUT_PATH}"
@ -282,10 +273,10 @@ generate_package()
find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name libengine.so -exec cp -f {} ${OUTPUT_PATH}/${ATC_PATH}/${NNENGINE_PATH}/../ \; find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name libengine.so -exec cp -f {} ${OUTPUT_PATH}/${ATC_PATH}/${NNENGINE_PATH}/../ \;
MAX_DEPTH=1 MAX_DEPTH=1
# if [ "x${PLATFORM}" = "xall" ] || [ "x${PLATFORM}" = "xinference" ] if [ "x${PLATFORM}" = "xall" ] || [ "x${PLATFORM}" = "xinference" ]
# then then
# MAX_DEPTH=2 MAX_DEPTH=2
# fi fi
for lib in "${PLUGIN_OPSKERNEL[@]}"; for lib in "${PLUGIN_OPSKERNEL[@]}";
do do
find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth ${MAX_DEPTH} -name "$lib" -exec cp -f {} ${OUTPUT_PATH}/${FWK_PATH}/${OPSKERNEL_PATH} \; find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth ${MAX_DEPTH} -name "$lib" -exec cp -f {} ${OUTPUT_PATH}/${FWK_PATH}/${OPSKERNEL_PATH} \;
@ -308,18 +299,9 @@ generate_package()
find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name "$lib" -exec cp -f {} ${OUTPUT_PATH}/${ATC_PATH} \; find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name "$lib" -exec cp -f {} ${OUTPUT_PATH}/${ATC_PATH} \;
done done
find ./lib/atclib -name atc.bin -exec cp {} "${OUTPUT_PATH}/${ATC_BIN_PATH}" \; find ./bin -name atc -exec cp {} "${OUTPUT_PATH}/${ATC_BIN_PATH}" \;
find ./lib/fwkacl -name atc.bin -exec cp {} "${OUTPUT_PATH}/${FWK_BIN_PATH}" \;
find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name "libascendcl.so" -exec cp -f {} ${OUTPUT_PATH}/${ACL_PATH} \; find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name "libascendcl.so" -exec cp -f {} ${OUTPUT_PATH}/${ACL_PATH} \;
cp -r ${OUTPUT_PATH}/../metadef/inc/external/* ${ATC_INCLUDE_PATH}
cp -r ${OUTPUT_PATH}/../parser/inc/external/* ${ATC_INCLUDE_PATH}
cp -r ${OUTPUT_PATH}/../inc/external/* ${ATC_INCLUDE_PATH}
cp -r ${OUTPUT_PATH}/../metadef/inc/external/* ${FWK_INCLUDE_PATH}
cp -r ${OUTPUT_PATH}/../parser/inc/external/* ${FWK_INCLUDE_PATH}
cp -r ${OUTPUT_PATH}/../inc/external/* ${FWK_INCLUDE_PATH}
if [ "x${PLATFORM}" = "xtrain" ] if [ "x${PLATFORM}" = "xtrain" ]
then then
tar -cf graphengine_lib.tar fwkacllib tar -cf graphengine_lib.tar fwkacllib
@ -332,12 +314,7 @@ generate_package()
fi fi
} }
if [[ "X$ENABLE_GE_UT" = "Xoff" && "X$MINDSPORE_MODE" = "Xoff" ]]; then if [[ "X$ENABLE_GE_UT" = "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 ----------------"

@ -1,5 +0,0 @@
[graphengine]
ge
inc
metadef
parser

@ -23,7 +23,6 @@ ExternalProject_Add(gflags_build
URL ${REQ_URL} URL ${REQ_URL}
#URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz #URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz
#SOURCE_DIR ${GE_CODE_DIR}/../../third_party/gflags/src/gflags-2.2.2 #SOURCE_DIR ${GE_CODE_DIR}/../../third_party/gflags/src/gflags-2.2.2
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=${gflags_CXXFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gflags <SOURCE_DIR> CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=${gflags_CXXFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gflags <SOURCE_DIR>
BUILD_COMMAND $(MAKE) BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install INSTALL_COMMAND $(MAKE) install

@ -10,14 +10,11 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif() endif()
if (GE_PB_PKG) if (ENABLE_GITEE)
set(REQ_URL "${GE_PB_PKG}/libs/ge_gtest/release-1.8.1.tar.gz") set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.0.tar.gz")
set(MD5 "")
elseif (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/googletest/repository/archive/release-1.8.1.tar.gz")
set(MD5 "") set(MD5 "")
else() else()
set(REQ_URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz") set(REQ_URL "https://github.com/google/googletest/archive/release-1.8.0.tar.gz")
set(MD5 "") set(MD5 "")
endif () endif ()
@ -25,9 +22,8 @@ set (gtest_CXXFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 -D_FORTIFY_SOURCE=2 -O2 -fstack-
set (gtest_CFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack") set (gtest_CFLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
ExternalProject_Add(gtest_build ExternalProject_Add(gtest_build
URL ${REQ_URL} URL ${REQ_URL}
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=${gtest_CXXFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gtest <SOURCE_DIR> CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=${gtest_CXXFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gtest <SOURCE_DIR>
-DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE -Dgtest_disable_pthreads=ON
BUILD_COMMAND $(MAKE) BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install INSTALL_COMMAND $(MAKE) install
EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_ALL TRUE
@ -52,27 +48,10 @@ set_target_properties(gtest_main PROPERTIES
target_include_directories(gtest INTERFACE ${GTEST_PKG_DIR}/include) target_include_directories(gtest INTERFACE ${GTEST_PKG_DIR}/include)
target_include_directories(gtest_main INTERFACE ${GTEST_PKG_DIR}/include) target_include_directories(gtest_main INTERFACE ${GTEST_PKG_DIR}/include)
add_library(gmock SHARED IMPORTED)
set_target_properties(gmock PROPERTIES
IMPORTED_LOCATION ${GTEST_PKG_DIR}/lib/libgmock.so
)
add_library(gmock_main SHARED IMPORTED)
set_target_properties(gmock_main PROPERTIES
IMPORTED_LOCATION ${GTEST_PKG_DIR}/lib/libgmock_main.so
)
target_include_directories(gmock INTERFACE ${GTEST_PKG_DIR}/include)
target_include_directories(gmock_main INTERFACE ${GTEST_PKG_DIR}/include)
set(INSTALL_BASE_DIR "") set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib) set(INSTALL_LIBRARY_DIR lib)
install(FILES ${GTEST_PKG_DIR}/lib/libgtest.so ${GTEST_PKG_DIR}/lib/libgtest_main.so ${GTEST_PKG_DIR}/lib/libgmock.so ${GTEST_PKG_DIR}/lib/libgmock_main.so OPTIONAL install(FILES ${GTEST_PKG_DIR}/lib/libgtest.so ${GTEST_PKG_DIR}/lib/libgtest_main.so OPTIONAL
DESTINATION ${INSTALL_LIBRARY_DIR}) DESTINATION ${INSTALL_LIBRARY_DIR})
add_dependencies(gtest gtest_build) add_dependencies(gtest gtest_build)

@ -5,24 +5,19 @@ endif()
include(ExternalProject) include(ExternalProject)
set(JSON_SRC_DIR ${CMAKE_BINARY_DIR}/opensrc/json/include) set(JSON_SRC_DIR ${CMAKE_BINARY_DIR}/opensrc/json/include)
if (GE_PB_PKG) #if (ENABLE_GITEE)
set(REQ_URL "${GE_PB_PKG}/libs/ge_nlohmann_json/include.zip")
set(MD5 "0dc903888211db3a0f170304cd9f3a89")
set(JSON_INCLUDE_DIR ${JSON_SRC_DIR})
#elseif (ENABLE_GITEE)
# set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip") # set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip")
# set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7") # set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7")
# set(JSON_INCLUDE_DIR "${JSON_SRC_DIR}/include") # set(JSON_INCLUDE_DIR "${JSON_SRC_DIR}/include")
else() #else()
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip") set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip")
set(MD5 "0dc903888211db3a0f170304cd9f3a89") set(MD5 "0dc903888211db3a0f170304cd9f3a89")
set(JSON_INCLUDE_DIR ${JSON_SRC_DIR}) set(JSON_INCLUDE_DIR ${JSON_SRC_DIR})
endif () #endif ()
ExternalProject_Add(json_build ExternalProject_Add(json_build
URL ${REQ_URL} URL ${REQ_URL}
#URL /home/txd/workspace/cloud_code/pkg/include.zip #URL /home/txd/workspace/cloud_code/pkg/include.zip
SOURCE_DIR ${JSON_SRC_DIR} SOURCE_DIR ${JSON_SRC_DIR}
TLS_VERIFY OFF
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" INSTALL_COMMAND ""

@ -6,10 +6,7 @@ set(ONNX_PROTO_DIR ${CMAKE_BINARY_DIR}/onnx)
set(ONNX_PROTO_FILE ${ONNX_PROTO_DIR}/onnx.proto) set(ONNX_PROTO_FILE ${ONNX_PROTO_DIR}/onnx.proto)
file(MAKE_DIRECTORY ${ONNX_PROTO_DIR}) file(MAKE_DIRECTORY ${ONNX_PROTO_DIR})
if (GE_PB_PKG) if (ENABLE_GITEE)
set(REQ_URL "${GE_PB_PKG}/libs/onnx/onnx-1.6.0.tar.gz")
set(MD5 "512f2779d6215d4a36f366b6b9acdf1e")
elseif (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/ONNX/repository/archive/v1.6.0.tar.gz") set(REQ_URL "https://gitee.com/mirrors/ONNX/repository/archive/v1.6.0.tar.gz")
set(MD5 "1bdbcecdd68ea8392630467646776e02") set(MD5 "1bdbcecdd68ea8392630467646776e02")
else() else()
@ -22,7 +19,6 @@ ExternalProject_Add(onnx
#URL /home/txd/workspace/cloud_code/pkg/onnx-1.6.0.tar.gz #URL /home/txd/workspace/cloud_code/pkg/onnx-1.6.0.tar.gz
#URL_HASH SHA256=3b88c3fe521151651a0403c4d131cb2e0311bd28b753ef692020a432a81ce345 #URL_HASH SHA256=3b88c3fe521151651a0403c4d131cb2e0311bd28b753ef692020a432a81ce345
#SOURCE_DIR ${ONNX_SRC_DIR} #SOURCE_DIR ${ONNX_SRC_DIR}
TLS_VERIFY OFF
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
#INSTALL_COMMAND "" #INSTALL_COMMAND ""

@ -26,7 +26,6 @@ set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fst
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
ExternalProject_Add(protobuf_build ExternalProject_Add(protobuf_build
URL ${REQ_URL} URL ${REQ_URL}
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} CONFIGURE_COMMAND ${CMAKE_COMMAND}
-Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_WITH_ZLIB=OFF
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}

@ -31,7 +31,6 @@ ExternalProject_Add(protobuf_static_build
URL ${REQ_URL} URL ${REQ_URL}
#URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz #URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz
#SOURCE_DIR ${METADEF_DIR}/../../third_party/protobuf/src/protobuf-3.8.0 #SOURCE_DIR ${METADEF_DIR}/../../third_party/protobuf/src/protobuf-3.8.0
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}

@ -30,7 +30,6 @@ ExternalProject_Add(protoc_build
URL ${REQ_URL} URL ${REQ_URL}
#URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz #URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz
#SOURCE_DIR ${GE_CODE_DIR}/../third_party/protobuf/src/protobuf-3.8.0 #SOURCE_DIR ${GE_CODE_DIR}/../third_party/protobuf/src/protobuf-3.8.0
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=${protobuf_CXXFLAGS} -DCMAKE_CXX_LDFLAGS=${protobuf_LDFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/protoc <SOURCE_DIR>/cmake CONFIGURE_COMMAND ${CMAKE_COMMAND} -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_FLAGS=${protobuf_CXXFLAGS} -DCMAKE_CXX_LDFLAGS=${protobuf_LDFLAGS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/protoc <SOURCE_DIR>/cmake
BUILD_COMMAND $(MAKE) BUILD_COMMAND $(MAKE)
INSTALL_COMMAND $(MAKE) install INSTALL_COMMAND $(MAKE) install

@ -10,20 +10,11 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.") message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif() endif()
if (GE_PB_PKG)
set(REQ_URL "${GE_PB_PKG}/libs/securec/v1.1.10.tar.gz")
set(MD5 "")
else()
set(REQ_URL "https://gitee.com/openeuler/libboundscheck/repository/archive/v1.1.10.tar.gz")
set(MD5 "")
endif ()
ExternalProject_Add(c_sec_build ExternalProject_Add(c_sec_build
URL ${REQ_URL} URL https://gitee.com/openeuler/libboundscheck/repository/archive/v1.1.10.tar.gz
#URL https://gitee.com/openeuler/libboundscheck/repository/archive/v1.1.10.tar.gz #URL /home/txd/workspace/linux_cmake/pkg/protobuf-3.8.0.tar.gz
#SOURCE_DIR ${GE_CODE_DIR}/../libc_sec #SOURCE_DIR ${GE_CODE_DIR}/../libc_sec
PATCH_COMMAND patch -p1 < ${GE_CODE_DIR}/metadef/third_party/patch/securec/0001-add-securec-cmake-script.patch PATCH_COMMAND patch -p1 < ${GE_CODE_DIR}/metadef/third_party/patch/securec/0001-add-securec-cmake-script.patch
TLS_VERIFY OFF
CONFIGURE_COMMAND ${CMAKE_COMMAND} CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}

File diff suppressed because it is too large Load Diff

@ -103,7 +103,7 @@ ge::Status Analyzer::Initialize() {
// Initialize file // Initialize file
string real_path = RealPath(kFilePath.c_str()); string real_path = RealPath(kFilePath.c_str());
if (real_path.empty()) { if (real_path.empty()) {
GELOGE(FAILED, "[Check][AnalyzeFilePath]File path is empty, Path invalid."); GELOGE(FAILED, "File path is invalid.");
return FAILED; return FAILED;
} }
json_file_name_ = real_path + "/" + kAnalyzeFile; json_file_name_ = real_path + "/" + kAnalyzeFile;
@ -155,12 +155,12 @@ std::shared_ptr<GraphInfo> Analyzer::GetJsonObject(uint64_t session_id, uint64_t
std::lock_guard<std::recursive_mutex> lg(mutex_); std::lock_guard<std::recursive_mutex> lg(mutex_);
auto iter = graph_infos_.find(session_id); auto iter = graph_infos_.find(session_id);
if (iter == graph_infos_.end()) { if (iter == graph_infos_.end()) {
GELOGE(PARAM_INVALID, "[Check][SessionId]session_id:%lu does not exist! graph_id:%lu", session_id, graph_id); GELOGE(PARAM_INVALID, "session_id:%lu does not exist!", session_id);
return nullptr; return nullptr;
} else { } else {
auto iter1 = (iter->second).find(graph_id); auto iter1 = (iter->second).find(graph_id);
if (iter1 == (iter->second).end()) { if (iter1 == (iter->second).end()) {
GELOGE(PARAM_INVALID, "[Check][GraphId]graph_id:%lu does not exist! session_id:%lu.", graph_id, session_id); GELOGE(PARAM_INVALID, "graph_id:%lu does not exist!", graph_id);
return nullptr; return nullptr;
} }
GELOGI("GetJsonObject Success!session_id:%lu graph_id:%lu", session_id, graph_id); GELOGI("GetJsonObject Success!session_id:%lu graph_id:%lu", session_id, graph_id);
@ -186,11 +186,11 @@ ge::Status Analyzer::CreateAnalyzerFile() {
std::lock_guard<std::mutex> lg(file_mutex_); std::lock_guard<std::mutex> lg(file_mutex_);
int fd = open(json_file_name_.c_str(), O_WRONLY | O_CREAT | O_TRUNC, kFileAuthority); int fd = open(json_file_name_.c_str(), O_WRONLY | O_CREAT | O_TRUNC, kFileAuthority);
if (fd < 0) { if (fd < 0) {
GELOGE(INTERNAL_ERROR, "[FileOpen][AnalyzeFile]Fail to open the analyze file: %s.", json_file_name_.c_str()); GELOGE(INTERNAL_ERROR, "Fail to open the file: %s.", json_file_name_.c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
if (close(fd) != 0) { if (close(fd) != 0) {
GELOGE(INTERNAL_ERROR, "[FileClose][AnalyzeFile]Fail to close the analyze file: %s.", json_file_name_.c_str()); GELOGE(INTERNAL_ERROR, "Fail to close the file: %s.", json_file_name_.c_str());
return INTERNAL_ERROR; return INTERNAL_ERROR;
} }
is_json_file_create_ = true; is_json_file_create_ = true;
@ -200,7 +200,7 @@ ge::Status Analyzer::CreateAnalyzerFile() {
} }
ge::Status Analyzer::SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_id) { ge::Status Analyzer::SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_id) {
GELOGD("start to save analyze file"); GELOGD("start to save analyze file!");
auto graph_info = GetJsonObject(session_id, graph_id); auto graph_info = GetJsonObject(session_id, graph_id);
GE_CHECK_NOTNULL(graph_info); GE_CHECK_NOTNULL(graph_info);
@ -211,28 +211,20 @@ ge::Status Analyzer::SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_
std::lock_guard<std::mutex> lg(file_mutex_); std::lock_guard<std::mutex> lg(file_mutex_);
json_file_.open(json_file_name_, std::ios::app); json_file_.open(json_file_name_, std::ios::app);
if (!json_file_.is_open()) { if (!json_file_.is_open()) {
GELOGE(FAILED, "[Check][AnalyzeFile]analyze file does not exist[%s]", json_file_name_.c_str()); GELOGE(FAILED, "analyzer file does not exist[%s]", json_file_name_.c_str());
return PARAM_INVALID; return PARAM_INVALID;
} }
json jsn; json jsn;
GraphInfoToJson(jsn, *graph_info); GraphInfoToJson(jsn, *graph_info);
bool ret_failed = false;
try {
json_file_ << jsn.dump(kJsonDumpLevel) << std::endl; json_file_ << jsn.dump(kJsonDumpLevel) << std::endl;
} catch (nlohmann::detail::type_error &e) {
GELOGE(FAILED,
"[Json.dump][GraphInfo]json.dump to analyze file [%s] failed because [%s],"
"session_id:%lu, graph_id:%lu",
json_file_name_.c_str(), e.what(), session_id, graph_id);
ret_failed = true;
}
json_file_.close(); json_file_.close();
return ret_failed ? FAILED : SUCCESS;
return SUCCESS;
} }
ge::Status Analyzer::DoAnalyze(DataInfo &data_info) { ge::Status Analyzer::DoAnalyze(DataInfo &data_info) {
GELOGD("start to do analyzer process"); GELOGD("start to do analyzer!");
auto pnode = data_info.node_ptr; auto pnode = data_info.node_ptr;
GE_CHECK_NOTNULL(pnode); GE_CHECK_NOTNULL(pnode);
@ -244,9 +236,7 @@ ge::Status Analyzer::DoAnalyze(DataInfo &data_info) {
GE_CHECK_NOTNULL(graph_info); GE_CHECK_NOTNULL(graph_info);
auto status = SaveOpInfo(desc, data_info, graph_info); auto status = SaveOpInfo(desc, data_info, graph_info);
if (status != SUCCESS) { if (status != SUCCESS) {
GELOGE(status, GELOGE(status, "save op info failed!");
"[Check][SaveOpInfo]save op info: desc_name [%s] desc_type [%s] failed!",
desc->GetName().c_str(), desc->GetType().c_str());
return FAILED; return FAILED;
} }
// create json file // create json file

File diff suppressed because it is too large Load Diff

@ -30,7 +30,6 @@ enum DataType
DT_RESOURCE = 23; // resource type DT_RESOURCE = 23; // resource type
DT_STRING_REF = 24; // string_ref type DT_STRING_REF = 24; // string_ref type
DT_DUAL = 25; /**< dual output type */ DT_DUAL = 25; /**< dual output type */
DT_VARIANT = 26; // variant type
} }
message AttrDef message AttrDef

@ -88,7 +88,6 @@ message AippOpParams {
int32 right_padding_size = 69; int32 right_padding_size = 69;
int32 top_padding_size = 70; int32 top_padding_size = 70;
int32 bottom_padding_size = 71; int32 bottom_padding_size = 71;
float padding_value = 72;
int32 mean_chn_0 = 10; int32 mean_chn_0 = 10;
int32 mean_chn_1 = 11; int32 mean_chn_1 = 11;

@ -57,7 +57,6 @@ message TaskDef {
LabelSetDef label_set = 37; LabelSetDef label_set = 37;
LabelGotoExDef label_goto_ex = 38; LabelGotoExDef label_goto_ex = 38;
LabelSwitchByIndexDef label_switch_by_index = 39; LabelSwitchByIndexDef label_switch_by_index = 39;
KernelDefWithHandle kernel_with_handle = 40;
} }
message KernelDef { message KernelDef {
@ -75,19 +74,6 @@ message KernelDef {
uint32 kernel_ext_info_size = 19; uint32 kernel_ext_info_size = 19;
} }
message KernelDefWithHandle {
KernelContext context = 1;
uint64 handle = 10;
string dev_func = 11;
uint32 block_dim = 12;
uint32 args_size = 13;
bytes args = 14;
bytes sm_desc = 15;
string original_kernel_key = 16;
string node_info = 17;
}
message KernelContext { message KernelContext {
uint32 kernel_type = 1; uint32 kernel_type = 1;
uint32 op_id = 2; // OP type in CCE uint32 op_id = 2; // OP type in CCE

@ -16,7 +16,6 @@ set(PROTO_LIST
) )
protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
protobuf_generate(ge_static PROTO_STATIC_SRCS PROTO_STATIC_HDRS ${PROTO_LIST})
set(SRC_LIST set(SRC_LIST
"context/ctx.cc" "context/ctx.cc"
@ -55,7 +54,7 @@ set(SRC_LIST
"util.cc" "util.cc"
"properties_manager.cc" "properties_manager.cc"
"types.cc" "types.cc"
"model_parser/model_parser.cc" "model_parser/base.cc"
"kernel_store.cc" "kernel_store.cc"
"tbe_kernel_store.cc" "tbe_kernel_store.cc"
"cust_aicpu_kernel_store.cc" "cust_aicpu_kernel_store.cc"
@ -74,7 +73,6 @@ target_compile_definitions(ge_common PRIVATE
FMK_SUPPORT_DUMP FMK_SUPPORT_DUMP
OS_CENTOS OS_CENTOS
google=ascend_private google=ascend_private
FUNC_VISIBILITY
) )
target_compile_options(ge_common PRIVATE target_compile_options(ge_common PRIVATE
@ -82,7 +80,6 @@ target_compile_options(ge_common PRIVATE
-O2 -O2
-Werror -Werror
-Wno-deprecated-declarations -Wno-deprecated-declarations
-fno-common
) )
target_include_directories(ge_common PRIVATE target_include_directories(ge_common PRIVATE
@ -107,10 +104,6 @@ target_include_directories(ge_common PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_common PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_common PRIVATE target_link_libraries(ge_common PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
static_mmpa static_mmpa
@ -128,7 +121,7 @@ target_link_libraries(ge_common PRIVATE
) )
############ libge_common.a ############ ############ libge_common.a ############
add_library(ge_common_static STATIC ${SRC_LIST} ${PROTO_STATIC_HDRS}) add_library(ge_common_static STATIC ${SRC_LIST} ${PROTO_HDRS})
target_compile_definitions(ge_common_static PRIVATE target_compile_definitions(ge_common_static PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0 PROTOBUF_INLINE_NOT_IN_HEADERS=0
HOST_VISIBILITY HOST_VISIBILITY
@ -138,11 +131,10 @@ target_compile_definitions(ge_common_static PRIVATE
$<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0> $<IF:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,OS_TYPE=WIN,OS_TYPE=0>
$<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX> $<$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>:SECUREC_USING_STD_SECURE_LIB=0 NOMINMAX>
LOG_CPP LOG_CPP
FUNC_VISIBILITY
) )
target_compile_options(ge_common_static PRIVATE target_compile_options(ge_common_static PRIVATE
$<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations -fno-common> $<$<OR:$<STREQUAL:${TARGET_SYSTEM_NAME},Linux>,$<STREQUAL:${TARGET_SYSTEM_NAME},Android>>:-fvisibility=hidden -O2 -Werror -Wno-deprecated-declarations>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd> $<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Debug>>:/MTd>
$<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT> $<$<AND:$<STREQUAL:${TARGET_SYSTEM_NAME},Windows>,$<STREQUAL:${CMAKE_CONFIGURATION_TYPES},Release>>:/MT>
) )
@ -159,7 +151,7 @@ target_include_directories(ge_common_static PRIVATE
${METADEF_DIR}/inc/external/graph ${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph ${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge_static ${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone #### #### yellow zone ####
${GE_DEPEND_DIR}/inc ${GE_DEPEND_DIR}/inc
${GE_DEPEND_DIR}/inc/cce ${GE_DEPEND_DIR}/inc/cce
@ -187,16 +179,12 @@ target_compile_definitions(ge_common PRIVATE
FMK_SUPPORT_DUMP FMK_SUPPORT_DUMP
OS_CENTOS OS_CENTOS
google=ascend_private google=ascend_private
LOG_CPP
FUNC_VISIBILITY
) )
target_compile_options(ge_common PRIVATE target_compile_options(ge_common PRIVATE
-fvisibility=hidden -fvisibility=hidden
-O2 -O2
-Werror -Werror
-Wno-deprecated-declarations
-fno-common
) )
target_include_directories(ge_common PRIVATE target_include_directories(ge_common PRIVATE
@ -216,10 +204,6 @@ target_include_directories(ge_common PRIVATE
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
) )
target_link_options(ge_common PRIVATE
-Wl,-Bsymbolic
)
target_link_libraries(ge_common PRIVATE target_link_libraries(ge_common PRIVATE
$<BUILD_INTERFACE:intf_pub> $<BUILD_INTERFACE:intf_pub>
ascend_protobuf_static ascend_protobuf_static

File diff suppressed because it is too large Load Diff

@ -80,12 +80,7 @@ class FileSaver {
static Status SaveToBuffWithFileHeader(const ModelFileHeader &file_header, static Status SaveToBuffWithFileHeader(const ModelFileHeader &file_header,
ModelPartitionTable &model_partition_table, ModelPartitionTable &model_partition_table,
const std::vector<ModelPartition> &partition_datas, const std::vector<ModelPartition> &partitionDatas,
ge::ModelBufferData& model);
static Status SaveToBuffWithFileHeader(const ModelFileHeader &file_header,
const std::vector<ModelPartitionTable *> &model_partition_tables,
const std::vector<std::vector<ModelPartition>> &all_partition_datas,
ge::ModelBufferData& model); ge::ModelBufferData& model);
static Status SaveToFile(const string &file_path, const void *data, int len); static Status SaveToFile(const string &file_path, const void *data, int len);
@ -118,8 +113,8 @@ class FileSaver {
ModelPartitionTable &model_partition_table, ModelPartitionTable &model_partition_table,
const std::vector<ModelPartition> &partition_datas); const std::vector<ModelPartition> &partition_datas);
static Status SaveWithFileHeader(const std::string &file_path, const ModelFileHeader &file_header, static Status SaveWithFileHeader(const std::string &file_path, const ModelFileHeader &file_header,
std::vector<ModelPartitionTable *> &model_partition_tables, vector<ModelPartitionTable *> &model_partition_tables,
const std::vector<std::vector<ModelPartition>> &all_partition_datas); const vector<vector<ModelPartition>> &all_partition_datas);
}; };
} // namespace ge } // namespace ge
#endif // GE_COMMON_AUTH_FILE_SAVER_H_ #endif // GE_COMMON_AUTH_FILE_SAVER_H_

@ -25,7 +25,7 @@ void CustAICPUKernelStore::AddCustAICPUKernel(const CustAICPUKernelPtr &kernel)
} }
void CustAICPUKernelStore::LoadCustAICPUKernelBinToOpDesc(const std::shared_ptr<ge::OpDesc> &op_desc) const { void CustAICPUKernelStore::LoadCustAICPUKernelBinToOpDesc(const std::shared_ptr<ge::OpDesc> &op_desc) const {
GELOGD("LoadCustAICPUKernelBinToOpDesc in."); GELOGD("LoadCustAICPUKernelBinToOpDesc in");
if (op_desc != nullptr) { if (op_desc != nullptr) {
auto kernel_bin = FindKernel(op_desc->GetName()); auto kernel_bin = FindKernel(op_desc->GetName());
if (kernel_bin != nullptr) { if (kernel_bin != nullptr) {
@ -34,6 +34,6 @@ void CustAICPUKernelStore::LoadCustAICPUKernelBinToOpDesc(const std::shared_ptr<
GELOGI("Load cust aicpu kernel:%s, %zu", kernel_bin->GetName().c_str(), kernel_bin->GetBinDataSize()); GELOGI("Load cust aicpu kernel:%s, %zu", kernel_bin->GetName().c_str(), kernel_bin->GetBinDataSize());
} }
} }
GELOGD("LoadCustAICPUKernelBinToOpDesc success."); GELOGD("LoadCustAICPUKernelBinToOpDesc success");
} }
} // namespace ge } // namespace ge

@ -41,16 +41,14 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile
GE_CHECK_NOTNULL(filename); GE_CHECK_NOTNULL(filename);
GE_CHECK_NOTNULL(data); GE_CHECK_NOTNULL(data);
if (len == 0) { if (len == 0) {
GELOGE(FAILED, "[Check][Param]Failed, data length is 0."); GELOGE(FAILED, "len is 0.");
REPORT_INNER_ERROR("E19999", "Check param failed, data length is 0.");
return PARAM_INVALID; return PARAM_INVALID;
} }
// Open the file // Open the file
int fd = OpenFile(filename); int fd = OpenFile(filename);
if (fd == kInvalidFd) { if (fd == kInvalidFd) {
GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename); GELOGE(FAILED, "Open file failed.");
REPORT_INNER_ERROR("E19999", "Opne file failed, filename:%s.", filename);
return FAILED; return FAILED;
} }
@ -59,15 +57,13 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile
int32_t mmpa_ret = mmWrite(fd, data, len); int32_t mmpa_ret = mmWrite(fd, data, len);
// mmWrite return -1:Failed to write data to filereturn -2:Invalid parameter // mmWrite return -1:Failed to write data to filereturn -2:Invalid parameter
if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) { if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) {
GELOGE(FAILED, "[Write][Data]Failed, errno = %d, error:%s", mmpa_ret, strerror(errno)); GELOGE(FAILED, "Write to file failed. errno = %d, %s", mmpa_ret, strerror(errno));
REPORT_INNER_ERROR("E19999", "Write data failed, errno = %d, error:%s.", mmpa_ret, strerror(errno));
ret = FAILED; ret = FAILED;
} }
// Close the file // Close the file
if (mmClose(fd) != EN_OK) { // mmClose return 0: success if (mmClose(fd) != EN_OK) { // mmClose return 0: success
GELOGE(FAILED, "[Close][File]Failed, error_code:%u, filename:%s.", ret, filename); GELOGE(FAILED, "Close file failed.");
REPORT_INNER_ERROR("E19999", "Close file failed, error_code:%u, filename:%s.", ret, filename);
ret = FAILED; ret = FAILED;
} }
@ -93,8 +89,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::Open(const
fd_ = OpenFile(filename); fd_ = OpenFile(filename);
if (fd_ == kInvalidFd) { if (fd_ == kInvalidFd) {
GELOGE(FAILED, "[Open][File]Failed, filename:%s.", filename); GELOGE(FAILED, "Open %s failed.", filename);
REPORT_INNER_ERROR("E19999", "Open file:%s failed.", filename);
return FAILED; return FAILED;
} }
@ -109,8 +104,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::Dump(void
int32_t mmpa_ret = mmWrite(fd_, data, len); int32_t mmpa_ret = mmWrite(fd_, data, len);
// mmWrite return -1:failed to write data to filereturn -2:invalid parameter // mmWrite return -1:failed to write data to filereturn -2:invalid parameter
if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) { if (mmpa_ret == EN_ERROR || mmpa_ret == EN_INVALID_PARAM) {
GELOGE(FAILED, "[Write][Data]Failed, errno = %d, error:%s", mmpa_ret, strerror(errno)); GELOGE(FAILED, "Write to file failed. errno = %d, %s", mmpa_ret, strerror(errno));
REPORT_INNER_ERROR("E19999", "Write data to file failed, errno = %d, error:%s.", mmpa_ret, strerror(errno));
return FAILED; return FAILED;
} }
@ -163,8 +157,7 @@ int MemoryDumper::OpenFile(const char *filename) {
int32_t fd = mmOpen2(real_path.c_str(), M_RDWR | M_CREAT | O_TRUNC, mode); int32_t fd = mmOpen2(real_path.c_str(), M_RDWR | M_CREAT | O_TRUNC, mode);
if (fd == EN_ERROR || fd == EN_INVALID_PARAM) { if (fd == EN_ERROR || fd == EN_INVALID_PARAM) {
GELOGE(kInvalidFd, "[Open][File]Failed. errno = %d, error:%s, filename:%s.", GELOGE(kInvalidFd, "open file failed. errno = %d, %s", fd, strerror(errno));
fd, strerror(errno), filename);
return kInvalidFd; return kInvalidFd;
} }
return fd; return fd;

@ -22,7 +22,6 @@ namespace {
const char *const kDumpOFF = "OFF"; const char *const kDumpOFF = "OFF";
const char *const kDumpoff = "off"; const char *const kDumpoff = "off";
const char *const kDumpOn = "on"; const char *const kDumpOn = "on";
const uint64_t kInferSessionId = 0;
} // namespace } // namespace
namespace ge { namespace ge {
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpManager &DumpManager::GetInstance() { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpManager &DumpManager::GetInstance() {
@ -31,14 +30,15 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpManager &DumpManager::GetIn
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf(const DumpConfig &dump_config) { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf(const DumpConfig &dump_config) {
DumpProperties dump_properties; std::lock_guard<std::mutex> lock(mutex_);
dump_properties_.ClearDumpPropertyValue();
dump_properties_.ClearDumpInfo();
std::string dump_status; std::string dump_status;
std::string dump_path; std::string dump_path;
std::string dump_mode; std::string dump_mode;
std::string dump_op_switch; std::string dump_op_switch;
if (dump_config.dump_status.empty()) { if (dump_config.dump_status.empty()) {
dump_properties_map_.emplace(kInferSessionId, dump_properties);
GELOGI("Dump does not open"); GELOGI("Dump does not open");
return SUCCESS; return SUCCESS;
} }
@ -46,16 +46,14 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf
dump_status = dump_config.dump_status; dump_status = dump_config.dump_status;
GELOGI("Dump status is %s", dump_status.c_str()); GELOGI("Dump status is %s", dump_status.c_str());
if (dump_config.dump_status == kDumpoff || dump_config.dump_status == kDumpOFF) { if (dump_config.dump_status == kDumpoff || dump_config.dump_status == kDumpOFF) {
dump_properties.ClearDumpPropertyValue(); dump_properties_.ClearDumpPropertyValue();
dump_properties_map_.emplace(kInferSessionId, dump_properties);
return SUCCESS; return SUCCESS;
} }
dump_properties.SetDumpStatus(dump_status); dump_properties_.SetDumpStatus(dump_status);
dump_op_switch = dump_config.dump_op_switch; dump_op_switch = dump_config.dump_op_switch;
dump_properties.SetDumpOpSwitch(dump_op_switch); dump_properties_.SetDumpOpSwitch(dump_op_switch);
if (dump_op_switch == kDumpoff && dump_config.dump_list.empty()) { if (dump_op_switch == kDumpoff && dump_config.dump_list.empty()) {
dump_properties_map_.emplace(kInferSessionId, dump_properties);
GELOGE(PARAM_INVALID, "Dump list is invalid,dump_op_switch is %s", dump_op_switch.c_str()); GELOGE(PARAM_INVALID, "Dump list is invalid,dump_op_switch is %s", dump_op_switch.c_str());
return PARAM_INVALID; return PARAM_INVALID;
} }
@ -69,15 +67,15 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf
GELOGI("Dump layer is %s in model", layer.c_str()); GELOGI("Dump layer is %s in model", layer.c_str());
dump_layers.insert(layer); dump_layers.insert(layer);
} }
dump_properties.AddPropertyValue(model_name, dump_layers); dump_properties_.AddPropertyValue(model_name, dump_layers);
} }
if (dump_op_switch == kDumpOn) { if (dump_op_switch == kDumpOn) {
GELOGI("Start to dump model and single op,dump op switch is %s", dump_op_switch.c_str()); GELOGI("Start to dump model and single op,dumo op switch is %s", dump_op_switch.c_str());
} else { } else {
GELOGI("Only dump model,dump op switch is %s", dump_op_switch.c_str()); GELOGI("Only dump model,dump op switch is %s", dump_op_switch.c_str());
} }
} else { } else {
GELOGI("Only dump single op,dump op switch is %s", dump_op_switch.c_str()); GELOGI("Only dump single op,dumo op switch is %s", dump_op_switch.c_str());
} }
dump_path = dump_config.dump_path; dump_path = dump_config.dump_path;
@ -91,39 +89,27 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf
} }
dump_path = dump_path + CurrentTimeInStr() + "/"; dump_path = dump_path + CurrentTimeInStr() + "/";
GELOGI("Dump path is %s", dump_path.c_str()); GELOGI("Dump path is %s", dump_path.c_str());
dump_properties.SetDumpPath(dump_path); dump_properties_.SetDumpPath(dump_path);
dump_mode = dump_config.dump_mode; dump_mode = dump_config.dump_mode;
GELOGI("Dump mode is %s", dump_mode.c_str()); GELOGI("Dump mode is %s", dump_mode.c_str());
dump_properties.SetDumpMode(dump_mode); dump_properties_.SetDumpMode(dump_mode);
dump_properties_map_[kInferSessionId] = dump_properties;
return SUCCESS; return SUCCESS;
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const DumpProperties &DumpManager::GetDumpProperties( FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const DumpProperties &DumpManager::GetDumpProperties() {
uint64_t session_id) {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
auto iter = dump_properties_map_.find(session_id); return dump_properties_;
if (iter != dump_properties_map_.end()) {
return iter->second;
}
static DumpProperties default_properties;
return default_properties;
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpManager::AddDumpProperties( FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpManager::SetModelName(const std::string &model_name) {
uint64_t session_id, const DumpProperties &dump_properties) {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
dump_properties_map_.emplace(session_id, dump_properties); model_name_ = model_name;
} }
FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpManager::RemoveDumpProperties(uint64_t session_id) { FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpManager::GetModelName() {
std::lock_guard<std::mutex> lock(mutex_); std::lock_guard<std::mutex> lock(mutex_);
auto iter = dump_properties_map_.find(session_id); return model_name_;
if (iter != dump_properties_map_.end()) {
dump_properties_map_.erase(iter);
} }
}
} // namespace ge } // namespace ge

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save