Compare commits

...

104 Commits

Author SHA1 Message Date
mindspore-ci-bot 49aa7bb17b !920 bug fix
4 years ago
lianghao 82c1afa937 bug
4 years ago
mindspore-ci-bot ab5ec6dc22 !919 unknownflag
4 years ago
lianghao 77b56c0c08 unknownflag
4 years ago
mindspore-ci-bot 14a7c6a880 !910 _zero_copy_identity_reserved
4 years ago
lianghao 2e67c3d45a _zero_copy_identity_reserved
4 years ago
mindspore-ci-bot 4bbaa371f0 !906 point_gnn
4 years ago
lianghao eb830a57ad point_gnn
4 years ago
mindspore-ci-bot cee0f1b66a !890 update parser submodule
4 years ago
y00500818 4f32ef5b79 update parser submodule
4 years ago
mindspore-ci-bot 793abeabcf !788 for get package
4 years ago
wangxiaotian22 f8bdf04f0b parser submodule update
4 years ago
mindspore-ci-bot b159ab4d03 !729 license update, mentioning usage of tensorflow and caffe code
4 years ago
yanghaoran 82dd040420 license update, mentioning usage of tensorflow and caffe code
4 years ago
mindspore-ci-bot 1bcdf925d1 !780 回退 'Pull Request !770 : AssignMemory2HasRefAttrNode'
4 years ago
王涛 2d31b66f9d 回退 'Pull Request !770 : AssignMemory2HasRefAttrNode'
4 years ago
mindspore-ci-bot 312c394163 !770 AssignMemory2HasRefAttrNode
4 years ago
mindspore-ci-bot ebb409130c !769 Feature:display model info
4 years ago
wangwenhua1@huawei.com 87a6726b2f display model info
4 years ago
wangwenhua1@huawei.com f24291b161 display model info
4 years ago
wangwenhua1@huawei.com 41282db089 display model info
4 years ago
wangwenhua1@huawei.com 0828878bbd display model info
4 years ago
lianghao acafc1b578 AssignMemory2HasRefAttrNode
4 years ago
wangwenhua1@huawei.com 6453e36696 display model info
4 years ago
mindspore-ci-bot 49a014c687 !641 restore code
4 years ago
y00500818 5fe5f712bf restore code
4 years ago
mindspore-ci-bot b8457f7e21 !628 update readme
4 years ago
王涛 eed48a4245 update README_CN.md.
4 years ago
mindspore-ci-bot 78c8adccc8 !627 add validation of fmk type for plugin load.
4 years ago
y00500818 fca7991db2 add validation of fmk type for plugin load.
4 years ago
mindspore-ci-bot 1fcf20a787 !607 update cmakelist for runtimecompile
4 years ago
wqtshg 596515a68b update cmakelist for runtimecompile
4 years ago
mindspore-ci-bot 8c4aef3cef !605 update cmakelist for compile
4 years ago
wqtshg b351f9ee54 update cmakelist for compile
4 years ago
mindspore-ci-bot 4e7301f926 !603 solve master compile
4 years ago
taoxudonghaha 8692ffc23f solve master compile
4 years ago
mindspore-ci-bot 892da7167c !582 ONLY_COMPILE_OPEN_SRC_METADEF
4 years ago
y00500818 a4bab5bc89 ONLY_COMPILE_OPEN_SRC_METADEF
4 years ago
mindspore-ci-bot e7e7f4143a !551 update submodule
4 years ago
y00500818 0f96eff3af update submodule
4 years ago
计晨 05020186f0 !426 update master directory
4 years ago
wqtshg 66f563a97d update master directory
4 years ago
wqtshg 66e9b44b89 update master directory
4 years ago
wqtshg d16cf136c2 update master directory
4 years ago
wqtshg 06e33a7c04 update master directory
4 years ago
wqtshg 3ad7da206e update master directory
4 years ago
wqtshg b409e6a442 update master directory
4 years ago
wqtshg f5e161b876 update build.sh
4 years ago
wqtshg 73e3484b2c update build.sh
4 years ago
wqtshg 5292a506a7 update datatype
4 years ago
w00562650 61f5835f2e Update:The directory must be the same as the dev branch.
4 years ago
w00562650 0cfdcdb096 update submodule
4 years ago
w00562650 cd9185189b update json
4 years ago
w00562650 7c19be97fd update cmake and src
4 years ago
计晨 238d73e2a9 !314 Feature:Concatv2 host cpu kernel support int64
4 years ago
zhaoxinxin 8751d19dd8 modified: src/ge/host_kernels/concat_v2_kernel.cc
4 years ago
mindspore-ci-bot c60bfbe20b !260 update graph cmake
4 years ago
wqtshg 7a1a82437d update graph cmake
4 years ago
mindspore-ci-bot 0ebedf55b1 !258 update fwk_proto cmake
4 years ago
wqtshg 45570c3cae update fwk_adapter.proto cmkae
4 years ago
mindspore-ci-bot 9391fe4cfe !253 compile protobuf
4 years ago
wqtshg cd4eb3384c compile protobuf
4 years ago
mindspore-ci-bot 0e9a7c2ab9 !252 update readme
4 years ago
王涛 15775d3218 update README_CN.md.
4 years ago
mindspore-ci-bot 7f3cf91352 !251 回退 'Pull Request !249 : protobuf test'
4 years ago
王涛 ec18205196 回退 'Pull Request !249 : protobuf test'
4 years ago
王涛 7750ef2efb !249 protobuf test
4 years ago
王涛 fb9144aa36 update README_CN.md.
4 years ago
王涛 fd228c4843 update README_CN.md.
4 years ago
wqtshg d8bfb8056b abi test
4 years ago
mindspore-ci-bot 4112a9addf !220 回退 'Pull Request !208 : fix graphengine compilation'
4 years ago
王涛 6d74596eaf 回退 'Pull Request !208 : fix graphengine compilation'
4 years ago
mindspore-ci-bot 9d79097319 !213 update task.proto
4 years ago
yanghaoran 501e8eda58 add task.proto
4 years ago
mindspore-ci-bot c97bc41186 !208 fix graphengine compilation
4 years ago
yanghaoran 2debb65452 fix compilation
4 years ago
mindspore-ci-bot a5d9a75c85 !204 clangformat modification
4 years ago
wuweikang db4d2a9540 clangformat modification
4 years ago
mindspore-ci-bot 0b2e3dff2f !194 Roll back non-standard merging
4 years ago
lujiale 995cfcac25 update src/common/graph/utils/mem_utils.h.
4 years ago
lujiale 4679646fb5 update src/common/graph/utils/mem_utils.h.
4 years ago
lujiale e0032f656f 回退 'Pull Request !187 : sync src code and update the source folder location'
4 years ago
王涛 adb54f5f9b !187 sync src code and update the source folder location
4 years ago
taoxiangdong 319f4d167f update submodule metadef and parser
4 years ago
taoxiangdong 416127b1f1 sync src code from yellow zone master
4 years ago
taoxiangdong dea1063e80 Merge branch 'master' of https://gitee.com/taoxiangdong/graphengine
4 years ago
yanghaoran 5ac356b3e2 add stub files
4 years ago
zhoufeng c8d6e94441 handle empty label resource
4 years ago
wuweikang 1a651a4e57 sync-from-trunk-to-blue-zone-1009
4 years ago
wuweikang a2ec076850 sync-from-trunk-to-blue-zone-0928
4 years ago
王涛 cd365aa247 !125 add stub files
4 years ago
yanghaoran b25b70c9c2 add stub files
4 years ago
mindspore-ci-bot 575b546b55 !105 speed up third party download via domestic source
4 years ago
yanghaoran 1f4f0a47b1 speed up third party download via domestic source
4 years ago
mindspore-ci-bot 866c61a4e6 !92 Handle empty label resource
4 years ago
zhoufeng 0667dcfa3f handle empty label resource
4 years ago
mindspore-ci-bot 7a75f024d5 !83 sync-from-trunk-to-blue-zone-1009
4 years ago
wuweikang 250465a71f sync-from-trunk-to-blue-zone-1009
4 years ago
mindspore-ci-bot 80dfd25e01 !79 add libadump_server support in ge_lib_path mode
4 years ago
yanghaoran fe038d0ae5 add libadump_server support in ge_lib_path mode
4 years ago
mindspore-ci-bot 88049a688b !77 fix securec download links due to mistakes made by openeuler community
4 years ago
yanghaoran dcc1768c68 fix securec download links due to mistakes made by openeuler community
4 years ago
mindspore-ci-bot 14db109491 !74 sync-from-trunk-to-blue-zone-0928
4 years ago
wuweikang bf316a3eeb sync-from-trunk-to-blue-zone-0928
4 years ago

8
.gitmodules vendored

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

@ -41,6 +41,7 @@ if (ENABLE_OPEN_SRC)
message(FATAL_ERROR "Running on a unsupported architecture: ${SYSTEM_TYPE}, build terminated")
endif()
set(GE_LIB_PATH ${GE_LIB_PATH}/${GE_SYS_ARCH})
set(STATIC_ACL_LIB ${GE_LIB_PATH})
find_module(slog libslog.so ${GE_LIB_PATH})
find_module(mmpa libmmpa.so ${GE_LIB_PATH})
find_module(msprof libmsprof.so ${GE_LIB_PATH})
@ -53,7 +54,6 @@ if (ENABLE_OPEN_SRC)
find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH})
find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH})
find_module(msprofiler libmsprofiler.a ${GE_LIB_PATH})
find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH})
else()
if(DEFINED ENV{ASCEND_CUSTOM_PATH})
set(ASCEND_DIR $ENV{ASCEND_CUSTOM_PATH})
@ -66,6 +66,7 @@ if (ENABLE_OPEN_SRC)
set(ASCEND_RUNTIME_DIR ${ASCEND_DIR}/fwkacllib/lib64)
set(ASCEND_ATC_DIR ${ASCEND_DIR}/atc/lib64)
set(ASCEND_ACL_DIR ${ASCEND_DIR}/acllib/lib64)
set(STATIC_ACL_LIB ${ASCEND_ACL_DIR})
find_module(slog libslog.so ${ASCEND_ATC_DIR})
find_module(mmpa libmmpa.so ${ASCEND_ATC_DIR})
if(PLATFORM STREQUAL "train")
@ -73,7 +74,8 @@ if (ENABLE_OPEN_SRC)
find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR})
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(resource libresource.so ${ASCEND_RUNTIME_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(resource libresource.so ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR})
find_module(msprofiler libmsprofiler.a ${ASCEND_RUNTIME_DIR})
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver)
@ -88,7 +90,6 @@ if (ENABLE_OPEN_SRC)
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")
find_module(msprof libmsprof.so ${ASCEND_DRIVER_SHARE_DIR})
elseif(PRODUCT STREQUAL "flr1")
@ -103,15 +104,14 @@ if (ENABLE_OPEN_SRC)
elseif(PLATFORM STREQUAL "all")
find_module(msprof libmsprof.so ${ASCEND_DRIVER_COMMON_DIR})
find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR})
find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR})
find_module(runtime libruntime.so ${ASCEND_ACL_DIR})
find_module(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR})
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR})
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR})
find_module(resource libresource.so ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR})
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR})
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR})
find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR})
find_module(msprofiler libmsprofiler.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()
message(FATAL_ERROR "PLATFORM param is invalid, should be train or inference, build terminated")
endif()

@ -1,12 +1,12 @@
[View English](./README.md)
图引擎模块(GE)是MindSpore的一个子模块其代码由C++实现位于前端模块ME和底层硬件之间起到承接作用。图引擎模块以ME下发的图作为输入然后进行一系列的深度图优化操作最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点做了特定的优化工作以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成详细的架构图如下所示。
图引擎模块(GE)由C++实现位于前端模块MindSpore/Tensorflow和底层硬件之间起到承接作用。图引擎模块以ME/TF下发的图作为输入然后进行一系列的深度图优化操作最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点做了特定的优化工作以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成详细的架构图如下所示。
![GE_schema](docs/GE_Architecture_CN.png)
- GE API
GE API是连接前端模块ME和GE Core的接口负责GE Core中初始化、Session管理模块的接口支持运行环境初始化Session创建、销毁图添加执行。
GE API是连接前端模块ME/TF和GE Core的接口负责GE Core中初始化、Session管理模块的接口支持运行环境初始化Session创建、销毁图添加执行。
- GE Core
@ -50,11 +50,12 @@
## 安装GE
GE内嵌在MindSpore安装包中MindSpore安装完毕后GE以三个动态库的方式被调用。
GE内嵌在MindSpore/Ascend安装包中MindSpore/Ascend安装完毕后GE以动态库的方式被调用。
## 源码安装
GE也支持由源码编译进行源码编译前首先确保你有昇腾910 AI处理器的环境同时系统满足以下要求
GE也支持由源码编译进行源码编译前首先确保你有昇腾910 AI处理器的环境可通过[昇腾开发者社区](https://ascend.huawei.com
)获取),同时系统满足以下要求:
- GCC >= 7.3.0
- CMake >= 3.14.0
@ -62,7 +63,7 @@ GE也支持由源码编译进行源码编译前首先确保你有昇腾910
- Libtool >= 2.4.6
- Automake >= 1.15.1
编译完成后会生成几个动态库他们会链接到MindSpore中执行无法单独运行。
编译完成后会生成几个动态库他们会链接到MindSpore/Ascend中执行,无法单独运行。
1. 下载GE源码。
@ -102,6 +103,26 @@ bash build.sh
欢迎参与贡献,更多信息详见[Contributor Wiki](https://gitee.com/mindspore/mindspore/blob/master/CONTRIBUTING.md)。
## 路标
以下将展示graphengine近期的计划我们会根据用户的反馈诉求持续调整计划的优先级。
总体而言,我们会努力在以下几个方面不断改进。
1、完备性Cast/ConcatV2算子支持输入数据类型为int64的常量折叠
2、完备性onnx parser支持一对多映射
3、架构优化ATC解耦并迁移至parser
4、易用性提供tensorflow训练的checkpoint文件转pb文件的一键式转化工具
5、易用性提供一键式本地编译环境构建工具
6、可维测ATC转换生成的om模型包含框架信息、cann版本信息和芯片信息等
热忱希望各位在用户社区加入讨论,并贡献您的建议。
## Release Notes
Release Notes请参考[RELEASE](RELEASE.md).

@ -458,3 +458,76 @@ Copyright (c) Facebook Inc. and Microsoft Corporation.
License: MIT License
Please see above.
Software: caffe 1.0
License: BSD 2-Clause License
Open Source Software Licensed Under the BSD 2-Clause License
GraphEngine uses source code files from caffe so as to support model format conversion from caffe model to GraphEngine model.
Please see below for the full list of source code files from caffe that are used by GraphEngine.
The below software in this distribution may have been modified by Huawei Technologies Co., Ltd ("Huawei Modifications"). All Huawei Modifications are Copyright 2019-2020 Huawei Technologies Co., Ltd.
----------------------------------------------------------------------------------------
1. caffe.proto master
All contributions by the University of California:
Copyright (c) 2014-2017 The Regents of the University of California (Regents)
All rights reserved.
Terms of the BSD 2-Clause License:
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Software: tensorflow 1.15.0
License: Apache-2.0 License
Open Source Software Licensed Under the Apache-2.0 License
GraphEngine uses source code files from tensorflow so as to support model format conversion from tensorflow model to GraphEngine model.
Please see below for the full list of source code files from tensorflow that are used by GraphEngine.
The below software in this distribution may have been modified by Huawei Technologies Co., Ltd ("Huawei Modifications"). All Huawei Modifications are Copyright 2019-2020 Huawei Technologies Co., Ltd.
----------------------------------------------------------------------------------------
1. attr_value.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
2. function.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
3. graph.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
4. node_def.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
5. op_def.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
6. resource_handle.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
7. tensor.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
8. tensor_shape.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
9. types.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
10. versions.proto master
Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Terms of the Apache-2.0 License:
Please see above.

@ -23,7 +23,7 @@ export BUILD_PATH="${BASEPATH}/build/"
usage()
{
echo "Usage:"
echo "sh build.sh [-j[n]] [-h] [-v] [-s] [-t] [-u] [-c] [-p]"
echo "sh build.sh [-j[n]] [-h] [-v] [-s] [-t] [-u] [-c] [-S on|off]"
echo ""
echo "Options:"
echo " -h Print usage"
@ -34,9 +34,21 @@ usage()
echo " -c Build ut with coverage tag"
echo " -p Build inference or train"
echo " -v Display build command"
echo " -S Enable enable download cmake compile dependency from gitee , default off"
echo "to be continued ..."
}
# check value of input is 'on' or 'off'
# usage: check_on_off arg_value arg_name
check_on_off()
{
if [[ "X$1" != "Xon" && "X$1" != "Xoff" ]]; then
echo "Invalid value $1 for option -$2"
usage
exit 1
fi
}
# parse and set options
checkopts()
{
@ -47,10 +59,11 @@ checkopts()
ENABLE_GE_ST="off"
ENABLE_GE_COV="off"
GE_ONLY="on"
PLATFORM="inference"
PLATFORM="train"
PRODUCT="normal"
ENABLE_GITEE="off"
# Process the options
while getopts 'ustchj:p:g:v' opt
while getopts 'ustchj:p:g:vS:' opt
do
OPTARG=$(echo ${OPTARG} | tr '[A-Z]' '[a-z]')
case "${opt}" in
@ -86,6 +99,11 @@ checkopts()
g)
PRODUCT=$OPTARG
;;
S)
check_on_off $OPTARG S
ENABLE_GITEE="$OPTARG"
echo "enable download from gitee"
;;
*)
echo "Undefined option: ${opt}"
usage
@ -129,6 +147,9 @@ build_graphengine()
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GE_ST=ON"
fi
if [[ "X$ENABLE_GITEE" = "Xon" ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_GITEE=ON"
fi
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPEN_SRC=True -DCMAKE_INSTALL_PREFIX=${OUTPUT_PATH} -DPLATFORM=${PLATFORM} -DPRODUCT=${PRODUCT}"
echo "${CMAKE_ARGS}"
cmake ${CMAKE_ARGS} ..
@ -141,14 +162,14 @@ build_graphengine()
TARGET=${COMMON_TARGET}
if [ "x${PLATFORM}" = "xtrain" ]
then
TARGET="ge_runner ge_local_engine ge_local_opskernel_builder host_cpu_engine host_cpu_opskernel_builder ${TARGET}"
TARGET="ge_runner ge_local_engine host_cpu_engine ge_compiler atc_ge_local_engine atc_host_cpu_engine atc ${TARGET}"
elif [ "x${PLATFORM}" = "xinference" ]
then
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}"
TARGET="opensrc_ascendcl ${TARGET}"
elif [ "x${PLATFORM}" = "xall" ]
then
# build all the target
TARGET=""
TARGET="ge_runner ge_local_engine host_cpu_engine ge_compiler atc_ge_local_engine atc_host_cpu_engine atc opensrc_ascendcl ${TARGET}"
fi
make ${VERBOSE} ${TARGET} -j${THREAD_NUM} && make install
@ -255,7 +276,7 @@ generate_package()
fi
for lib in "${PLUGIN_OPSKERNEL[@]}";
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 1 -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}/${ATC_PATH}/${OPSKERNEL_PATH} \;
done
@ -280,10 +301,10 @@ generate_package()
if [ "x${PLATFORM}" = "xtrain" ]
then
tar -cf graphengine_lib.tar fwkacllib
tar -cf graphengine_lib.tar fwkacllib atc
elif [ "x${PLATFORM}" = "xinference" ]
then
tar -cf graphengine_lib.tar acllib atc
tar -cf graphengine_lib.tar acllib
elif [ "x${PLATFORM}" = "xall" ]
then
tar -cf graphengine_lib.tar fwkacllib acllib atc

@ -11,8 +11,16 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif()
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/gflags/repository/archive/v2.2.2.tar.gz")
set(MD5 "")
else()
set(REQ_URL "https://github.com/gflags/gflags/archive/v2.2.2.tar.gz")
set(MD5 "")
endif ()
ExternalProject_Add(gflags_build
URL https://github.com/gflags/gflags/archive/v2.2.2.tar.gz
URL ${REQ_URL}
#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
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/gflags <SOURCE_DIR>

@ -5,8 +5,17 @@ endif()
include(ExternalProject)
set(JSON_SRC_DIR ${CMAKE_BINARY_DIR}/opensrc/json/include)
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/JSON-for-Modern-CPP/repository/archive/v3.6.1.zip")
set(MD5 "5bda78ce308e6cfcf614dcf1d5ff27a7")
set(JSON_INCLUDE_DIR "${JSON_SRC_DIR}/include")
else()
set(REQ_URL "https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip")
set(MD5 "0dc903888211db3a0f170304cd9f3a89")
set(JSON_INCLUDE_DIR ${JSON_SRC_DIR})
endif ()
ExternalProject_Add(json_build
URL https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip
URL ${REQ_URL}
#URL /home/txd/workspace/cloud_code/pkg/include.zip
SOURCE_DIR ${JSON_SRC_DIR}
CONFIGURE_COMMAND ""
@ -17,7 +26,7 @@ ExternalProject_Add(json_build
add_library(json INTERFACE)
target_include_directories(json INTERFACE ${JSON_SRC_DIR})
target_include_directories(json INTERFACE ${JSON_INCLUDE_DIR})
add_dependencies(json json_build)
#set(HAVE_JSON TRUE CACHE BOOL "json build add")

@ -6,8 +6,16 @@ set(ONNX_PROTO_DIR ${CMAKE_BINARY_DIR}/onnx)
set(ONNX_PROTO_FILE ${ONNX_PROTO_DIR}/onnx.proto)
file(MAKE_DIRECTORY ${ONNX_PROTO_DIR})
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/ONNX/repository/archive/v1.6.0.tar.gz")
set(MD5 "1bdbcecdd68ea8392630467646776e02")
else()
set(REQ_URL "https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz")
set(MD5 "512f2779d6215d4a36f366b6b9acdf1e")
endif ()
ExternalProject_Add(onnx
URL https://github.com/onnx/onnx/releases/download/v1.6.0/onnx-1.6.0.tar.gz
URL ${REQ_URL}
#URL /home/txd/workspace/cloud_code/pkg/onnx-1.6.0.tar.gz
#URL_HASH SHA256=3b88c3fe521151651a0403c4d131cb2e0311bd28b753ef692020a432a81ce345
#SOURCE_DIR ${ONNX_SRC_DIR}

@ -10,10 +10,19 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
set(CMAKE_INSTALL_PREFIX ${GE_CODE_DIR}/output CACHE STRING "path for install()" FORCE)
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif()
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.8.0.tar.gz")
set(MD5 "eba86ae9f07ba5cfbaf8af3bc4e84236")
else()
set(REQ_URL "https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz")
set(MD5 "3d9e32700639618a4d2d342c99d4507a")
endif ()
set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
ExternalProject_Add(protobuf_build
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
URL ${REQ_URL}
#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
#DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GE_CODE_DIR}/../third_party/protobuf/src/protobuf-3.8.0 <SOURCE_DIR>

@ -8,11 +8,19 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif()
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.8.0.tar.gz")
set(MD5 "eba86ae9f07ba5cfbaf8af3bc4e84236")
else()
set(REQ_URL "https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz")
set(MD5 "3d9e32700639618a4d2d342c99d4507a")
endif ()
set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
set(PROTOBUF_STATIC_PKG_DIR ${CMAKE_INSTALL_PREFIX}/protobuf_static)
ExternalProject_Add(protobuf_static_build
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
URL ${REQ_URL}
#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
CONFIGURE_COMMAND ${CMAKE_COMMAND}

@ -12,10 +12,19 @@ if ((${CMAKE_INSTALL_PREFIX} STREQUAL /usr/local) OR
message(STATUS "No install prefix selected, default to ${CMAKE_INSTALL_PREFIX}.")
endif()
if (ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/protobuf_source/repository/archive/v3.8.0.tar.gz")
set(MD5 "eba86ae9f07ba5cfbaf8af3bc4e84236")
else()
set(REQ_URL "https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz")
set(MD5 "3d9e32700639618a4d2d342c99d4507a")
endif ()
set(protobuf_CXXFLAGS "-Wno-maybe-uninitialized -Wno-unused-parameter -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -D_GLIBCXX_USE_CXX11_ABI=0 -O2")
set(protobuf_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
ExternalProject_Add(protoc_build
URL https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
URL ${REQ_URL}
#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
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

@ -88,7 +88,6 @@ set(TRAIN_SRC_LIST
"graph/load/new_model_manager/model_utils.cc"
"graph/load/new_model_manager/aipp_utils.cc"
"graph/load/new_model_manager/task_info/end_graph_task_info.cc"
"graph/load/new_model_manager/task_info/model_exit_task_info.cc"
"graph/load/new_model_manager/task_info/event_record_task_info.cc"
"graph/load/new_model_manager/task_info/event_wait_task_info.cc"
"graph/load/new_model_manager/task_info/fusion_start_task_info.cc"
@ -140,7 +139,6 @@ set(TRAIN_SRC_LIST
"graph/passes/mark_graph_unknown_status_pass.cc"
"graph/passes/mark_agnostic_pass.cc"
"graph/partition/dynamic_shape_partition.cc"
"graph/partition/stage_partition.cc"
"graph/passes/base_pass.cc"
"graph/passes/bitcast_pass.cc"
"graph/passes/cast_remove_pass.cc"
@ -211,7 +209,6 @@ set(TRAIN_SRC_LIST
"graph/passes/multi_batch_pass.cc"
"graph/passes/multi_batch_clone_pass.cc"
"graph/passes/subexpression_migration_pass.cc"
"graph/passes/subgraph_const_migration_pass.cc"
"graph/passes/unused_args_clean_pass.cc"
"graph/passes/net_output_pass.cc"
"graph/passes/next_iteration_pass.cc"
@ -273,7 +270,6 @@ set(TRAIN_SRC_LIST
"model/ge_root_model.cc"
"omm/csa_interact.cc"
"opskernel_manager/ops_kernel_manager.cc"
"opskernel_manager/ops_kernel_builder_manager.cc"
"session/inner_session.cc"
"session/session_manager.cc"
"single_op/single_op.cc"
@ -388,8 +384,8 @@ target_link_libraries(ge_runner
resource
error_manager
ascend_hal_stub
-Wl,--as-needed
json
-Wl,--as-needed
-lrt
-ldl
)
@ -432,7 +428,6 @@ set(INFER_SRC_LIST
"session/session_manager.cc"
"engine_manager/dnnengine_manager.cc"
"opskernel_manager/ops_kernel_manager.cc"
"opskernel_manager/ops_kernel_builder_manager.cc"
"graph/manager/graph_manager.cc"
"graph/manager/graph_manager_utils.cc"
"graph/manager/graph_context.cc"
@ -448,7 +443,6 @@ set(INFER_SRC_LIST
"graph/partition/engine_place.cc"
"graph/partition/graph_partition.cc"
"graph/partition/dynamic_shape_partition.cc"
"graph/partition/stage_partition.cc"
"generator/ge_generator.cc"
"generator/generator_api.cc"
"graph/manager/graph_var_manager.cc"
@ -563,7 +557,6 @@ set(INFER_SRC_LIST
"graph/passes/multi_batch_pass.cc"
"graph/passes/multi_batch_clone_pass.cc"
"graph/passes/subexpression_migration_pass.cc"
"graph/passes/subgraph_const_migration_pass.cc"
"graph/passes/unused_args_clean_pass.cc"
"graph/passes/next_iteration_pass.cc"
"graph/passes/control_trigger_pass.cc"
@ -624,7 +617,6 @@ set(INFER_SRC_LIST
"graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switchn_task_info.cc"
"graph/load/new_model_manager/task_info/end_graph_task_info.cc"
"graph/load/new_model_manager/task_info/model_exit_task_info.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
"single_op/task/op_task.cc"
@ -719,10 +711,24 @@ target_link_libraries(ge_compiler
############ libascendcl.so ############
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/dummy.c CONTENT "")
add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c)
set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>)
#add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c)
#set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object)
add_library(opensrc_ascendcl SHARED ${DUMMY_OBJ})
if(EXISTS ${STATIC_ACL_LIB}/libascendcl.a)
execute_process(
COMMAND ar x ${STATIC_ACL_LIB}/libascendcl.a
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object
)
file(GLOB OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object/*.o)
else()
set(OBJECT_LIST ${CMAKE_BINARY_DIR}/dummy.c)
endif()
add_library(opensrc_ascendcl SHARED
${OBJECT_LIST}
)
target_compile_options(opensrc_ascendcl PRIVATE
-O2
-fvisibility=hidden
@ -737,7 +743,6 @@ target_link_options(opensrc_ascendcl PRIVATE
target_link_libraries(opensrc_ascendcl PRIVATE
-Wl,--whole-archive
ge_executor
ascendcl_static
ge_common_static
graph_static
protobuf_static

@ -1,5 +1,5 @@
/**
* Copyright 2020 Huawei Technologies Co., Ltd
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,17 +57,15 @@ const std::string kLayout = "layout";
const std::string kResult = "result";
const std::string kOp = "op";
std::map<analyzer::AnalyzeType, std::string> errors_map {
{PARSER, "paser_error"},
std::map<analyzer::AnalyzeType, std::string> errors_map{{PARSER, "paser_error"},
{INFER_SHAPE, "infer_shape_error"},
{CHECKSUPPORT, "check_support_error"},
{GRAPH_OPTIMIZE, "graph_optimize_error"},
{GRAPH_PARTION, "graph_partion_error"},
{GRAPH_BUILDER, "graph_builder_error"}
};
}
{GRAPH_BUILDER, "graph_builder_error"}};
} // namespace
Analyzer* Analyzer::GetInstance() {
Analyzer *Analyzer::GetInstance() {
static Analyzer instance;
return &instance;
}
@ -77,8 +75,9 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
std::lock_guard<std::recursive_mutex> lg(mutex_);
auto iter = graph_infos_.find(session_id);
if (iter == graph_infos_.end()) {
std::shared_ptr<GraphInfo> graph_info(new(std::nothrow) GraphInfo());
GE_CHECK_NOTNULL(graph_info);
auto p = new (std::nothrow) GraphInfo();
GE_CHECK_NOTNULL(p);
std::shared_ptr<GraphInfo> graph_info(p);
std::map<uint64_t, std::shared_ptr<GraphInfo>> graph_map;
graph_map[graph_id] = graph_info;
graph_info->session_id = session_id;
@ -87,8 +86,9 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
} else {
auto iter1 = (iter->second).find(graph_id);
if (iter1 == (iter->second).end()) {
std::shared_ptr<GraphInfo> graph_info(new(std::nothrow) GraphInfo());
GE_CHECK_NOTNULL(graph_info);
auto p = new (std::nothrow) GraphInfo();
GE_CHECK_NOTNULL(p);
std::shared_ptr<GraphInfo> graph_info(p);
graph_info->session_id = session_id;
graph_info->graph_id = graph_id;
(iter->second).insert({graph_id, graph_info});
@ -100,14 +100,7 @@ Status Analyzer::BuildJsonObject(uint64_t session_id, uint64_t graph_id) {
}
ge::Status Analyzer::Initialize() {
// Initialize file
string real_path = RealPath(kFilePath.c_str());
if (real_path.empty()) {
GELOGE(FAILED, "File path is invalid.");
return FAILED;
}
json_file_name_ = real_path + "/" + kAnalyzeFile;
ClearHistoryFile();
return SUCCESS;
}
@ -145,7 +138,6 @@ void Analyzer::DestroyGraphJsonObject(uint64_t session_id, uint64_t graph_id) {
if (iter1 == (iter->second).end()) {
GELOGW("Can not find the graph json object by session_id[%lu] and graph_id[%lu]. Do nothing.", session_id,
graph_id);
return;
}
(iter->second).erase(iter1);
}
@ -182,8 +174,15 @@ ge::Status Analyzer::CreateAnalyzerFile() {
return SUCCESS;
}
GELOGD("start to create analyzer file!");
// Check whether the manifest exists, if not, create it.
string real_path = RealPath(kFilePath.c_str());
if (real_path.empty()) {
GELOGE(FAILED, "File path is invalid.");
return FAILED;
}
std::lock_guard<std::mutex> lg(file_mutex_);
json_file_name_ = real_path + "/" + kAnalyzeFile;
GELOGD("Created analyzer file:[%s]", json_file_name_.c_str());
int fd = open(json_file_name_.c_str(), O_WRONLY | O_CREAT | O_TRUNC, kFileAuthority);
if (fd < 0) {
GELOGE(INTERNAL_ERROR, "Fail to open the file: %s.", json_file_name_.c_str());
@ -199,27 +198,25 @@ ge::Status Analyzer::CreateAnalyzerFile() {
return SUCCESS;
}
ge::Status Analyzer::SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_id) {
ge::Status Analyzer::SaveAnalyzerDataToFile() {
GELOGD("start to save analyze file!");
auto graph_info = GetJsonObject(session_id, graph_id);
GE_CHECK_NOTNULL(graph_info);
if (graph_info->op_info.size() == 0) {
GELOGD("session_id:%lu graph_id:%lu does not owner op info, break it!", session_id, graph_id);
return SUCCESS;
}
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::out);
if (!json_file_.is_open()) {
GELOGE(FAILED, "analyzer file does not exist[%s]", json_file_name_.c_str());
return PARAM_INVALID;
}
std::lock_guard<std::recursive_mutex> lk(mutex_);
for (auto &ele : graph_infos_) {
for (auto &ele2 : ele.second) {
json jsn;
GraphInfoToJson(jsn, *graph_info);
GraphInfoToJson(jsn, *(ele2.second));
json_file_ << jsn.dump(kJsonDumpLevel) << std::endl;
json_file_.close();
}
}
json_file_.close();
return SUCCESS;
}
@ -240,7 +237,13 @@ ge::Status Analyzer::DoAnalyze(DataInfo &data_info) {
return FAILED;
}
// create json file
return CreateAnalyzerFile();
status = CreateAnalyzerFile();
if (status != SUCCESS) {
GELOGE(status, "create analyzer file failed!");
return status;
}
// save data to file
return SaveAnalyzerDataToFile();
}
ge::Status Analyzer::SaveOpInfo(ge::OpDescPtr desc, DataInfo &data_info,
@ -274,13 +277,13 @@ ge::Status Analyzer::SaveOpInfo(ge::OpDescPtr desc, DataInfo &data_info,
return SUCCESS;
}
void Analyzer::TensorInfoToJson(json& j, const TensorInfo &tensor_info) {
void Analyzer::TensorInfoToJson(json &j, const TensorInfo &tensor_info) {
j[kShape] = tensor_info.shape;
j[kDataType] = tensor_info.d_type;
j[kLayout] = tensor_info.layout;
}
void Analyzer::OpInfoToJson(json& j, const OpInfo &op_info) {
void Analyzer::OpInfoToJson(json &j, const OpInfo &op_info) {
j[kErrorType] = op_info.error_type;
j[kOpName] = op_info.op_name;
j[kOpType] = op_info.op_type;
@ -297,7 +300,7 @@ void Analyzer::OpInfoToJson(json& j, const OpInfo &op_info) {
}
}
void Analyzer::GraphInfoToJson(json& j, const GraphInfo &graph_info) {
void Analyzer::GraphInfoToJson(json &j, const GraphInfo &graph_info) {
GELOGD("start to buff graph info!");
j[kSessionId] = graph_info.session_id;
j[kGraphId] = graph_info.graph_id;

@ -1,5 +1,5 @@
/**
* Copyright 2020 Huawei Technologies Co., Ltd
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -66,8 +66,7 @@ struct DataInfo {
DataInfo() = default;
~DataInfo() = default;
DataInfo(uint64_t sess, uint64_t graph, AnalyzeType type,
ge::NodePtr node, std::string error_info) {
DataInfo(uint64_t sess, uint64_t graph, AnalyzeType type, ge::NodePtr node, std::string error_info) {
session_id = sess;
graph_id = graph;
analyze_type = type;
@ -80,10 +79,10 @@ struct DataInfo {
ge::NodePtr node_ptr{nullptr};
std::string reason;
};
}
} // namespace analyzer
class Analyzer {
public:
public:
/**
* @ingroup ge
* @brief: get analyzer instance.
@ -157,33 +156,27 @@ public:
*/
ge::Status DoAnalyze(analyzer::DataInfo &data_info);
/**
* @ingroup ge
* @brief: Buff analyzed data and output to json file
* @param [in]: session id , graph id
* @return: 0: SUCCESS other: FAILED
*/
ge::Status SaveAnalyzerDataToFile(uint64_t session_id, uint64_t graph_id);
Analyzer(const Analyzer &) = delete;
Analyzer& operator=(const Analyzer&) = delete;
Analyzer &operator=(const Analyzer &) = delete;
Analyzer(Analyzer &&) = delete;
Analyzer& operator=(Analyzer &&) = delete;
private:
void TensorInfoToJson(nlohmann::json& j, const analyzer::TensorInfo &tensor_info);
void OpInfoToJson(nlohmann::json& j, const analyzer::OpInfo &op_info);
void GraphInfoToJson(nlohmann::json& j, const analyzer::GraphInfo &graph_info);
Analyzer &operator=(Analyzer &&) = delete;
private:
void TensorInfoToJson(nlohmann::json &j, const analyzer::TensorInfo &tensor_info);
void OpInfoToJson(nlohmann::json &j, const analyzer::OpInfo &op_info);
void GraphInfoToJson(nlohmann::json &j, const analyzer::GraphInfo &graph_info);
ge::Status SaveAnalyzerDataToFile();
ge::Status SaveOpInfo(ge::OpDescPtr desc, analyzer::DataInfo &data_info,
std::shared_ptr<analyzer::GraphInfo> graph_info);
void ClearHistoryFile();
ge::Status CreateAnalyzerFile();
explicit Analyzer() {};
explicit Analyzer(){};
~Analyzer() = default;
private:
private:
std::map<uint64_t, std::map<uint64_t, std::shared_ptr<analyzer::GraphInfo>>> graph_infos_;
std::recursive_mutex mutex_; // protect graph_infos_
std::mutex file_mutex_; // protect json_file_

@ -1,5 +1,5 @@
/**
* Copyright 2020 Huawei Technologies Co., Ltd
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -324,17 +324,10 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) {
return GE_PROF_NOT_INIT;
}
for (uint32_t i = 0; i < profiler_config->config.devNums; i++) {
uint64_t data_type_config;
Status status = ProfGetDataTypeConfig(profiler_config->config.devIdList[i], data_type_config);
if (status != SUCCESS) {
GELOGE(status, "Prof get data type config failed, prof result = %d", status);
return status;
}
if (data_type_config != profiler_config->config.dataTypeConfig) {
GELOGE(FAILED, "data type config verify failed");
return FAILED;
}
Status ret = ProfStopProfiling(&profiler_config->config);
if (ret != SUCCESS) {
GELOGE(ret, "Stop profiling failed, prof result = %d", ret);
return ret;
}
std::vector<string> prof_params;
@ -351,18 +344,12 @@ Status aclgrphProfStop(aclgrphProfConfig *profiler_config) {
command.module_index = profiler_config->config.dataTypeConfig;
GELOGI("Profiling will stop, device nums:%s , deviceID:[%s], data type config: 0x%llx", prof_params[0].c_str(),
prof_params[kDeviceListIndex].c_str(), command.module_index);
Status ret = graph_loader.CommandHandle(command);
ret = graph_loader.CommandHandle(command);
if (ret != SUCCESS) {
GELOGE(ret, "Handle profiling command failed");
return FAILED;
}
ret = ProfStopProfiling(&profiler_config->config);
if (ret != SUCCESS) {
GELOGE(ret, "Stop profiling failed, prof result = %d", ret);
return ret;
}
GELOGI("Successfully execute GraphProfStopProfiling.");
return SUCCESS;
}

@ -70,9 +70,10 @@ LOCAL_SHARED_LIBRARIES := \
libregister \
libge_compiler \
libge_common \
libmsprof
libmsprof \
stub/libascend_hal
LOCAL_STATIC_LIBRARIES := libmsprofiler
LOCAL_LDFLAGS := -lrt -ldl
@ -107,6 +108,7 @@ LOCAL_SHARED_LIBRARIES := \
libge_common \
libmsprof
LOCAL_STATIC_LIBRARIES := libmsprofiler
LOCAL_LDFLAGS := -lrt -ldl
LOCAL_CFLAGS += \

@ -1 +1,104 @@
../../proto/ge_api.proto
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package ge.api_pb;
import "ge_ir.proto";
// GE initialize
message GEInitialize {
map<string, string> options = 1;
};
// initialize response
message GEInitializeResponse {
uint32 status = 1;
uint32 clientId = 2;
};
// GE finalize
message GEFinalize {
bool final = 1;
uint32 clientId = 2;
};
message GEFinalizeResponse {
uint32 status = 1;
};
// GE Session
message CreateSession{
map<string, string> options = 1;
};
message CreateSessionResponse {
uint32 status = 1;
uint64 sessionId = 2;
};
//GE AddGraph
//model serialize :: serializegraph
message SessionAddGraph{
uint32 graphId = 1;
uint64 sessionId = 2;
ge.proto.GraphDef graph = 3;
};
message SessionAddGraphResponse {
uint32 status = 1;
};
//GE SessionRemoveGraph
message SessionRemoveGraph{
uint32 graphId = 1;
uint64 sessionId = 2;
};
message SessionRemoveGraphResponse {
uint32 status = 1;
};
message SessionRunGraph{
uint32 graphId = 1;
uint64 sessionId = 2;
repeated ge.proto.TensorDef tensor = 3;
};
message SessionBuildGraph{
uint32 graphId = 1;
uint64 sessionId = 2;
repeated ge.proto.TensorDef tensor = 3;
string savePath = 4;
};
message SessionRunGraphResponse {
uint32 status = 1;
repeated ge.proto.TensorDef tensor = 2;
};
message SessionBuildGraphResponse {
uint32 status = 1;
};
message DestroySession{
bool final = 1;
uint64 sessionId = 2;
};
message DestroySessionResponse {
uint32 status = 1;
};

@ -1,3 +1,19 @@
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package ge.proto;

@ -1,3 +1,19 @@
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package domi;
@ -45,9 +61,6 @@ message AippOpParams {
// AIPP2AIPPrelated_input_rank1
uint32 related_input_rank = 2;
// related_input_name is optional and the top name of data node which inserts aipp
string related_input_name = 6;
// input_edge_idx>=0
// DataAIPPrelated_input_rankAIPP
// <= Data

@ -1,14 +1,19 @@
/* Copyright (C) 2018. Huawei Technologies Co., Ltd. All rights reserved.
/**
* Copyright 2019-2020 Huawei Technologies Co., Ltd
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the Apache License Version 2.0.You may not use this file except in compliance with the License.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Apache License for more details at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package domi;

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

Loading…
Cancel
Save