From: @taoxudonghaha Reviewed-by: @xchu42 Signed-off-by:tags/v1.2.0
@@ -88,10 +88,8 @@ if (ENABLE_OPEN_SRC) | |||
find_module(static_mmpa libmmpa.a ${ASCEND_ATC_DIR}) | |||
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) | |||
if(PLATFORM STREQUAL "train") | |||
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(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR}) | |||
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) | |||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | |||
@@ -101,12 +99,10 @@ if (ENABLE_OPEN_SRC) | |||
elseif(PLATFORM STREQUAL "inference") | |||
find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR}) | |||
find_module(runtime libruntime.so ${ASCEND_ACL_DIR}) | |||
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR}) | |||
find_module(resource libresource.so ${ASCEND_ATC_DIR}) | |||
find_module(runtime_compile libruntime_compile.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_ext libmsprofiler.a ${ASCEND_ACL_DIR}) | |||
#find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) | |||
if(PRODUCT STREQUAL "flr3") | |||
elseif(PRODUCT STREQUAL "flr1") | |||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | |||
@@ -116,17 +112,14 @@ if (ENABLE_OPEN_SRC) | |||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) | |||
endif() | |||
elseif(PLATFORM STREQUAL "all") | |||
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_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(runtime_compile libruntime_compile.so ${ASCEND_ATC_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(adump_server libadump_server.a ${ASCEND_RUNTIME_DIR}) | |||
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) | |||
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR}) | |||
find_module(msprofiler_fwk_ext 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}) | |||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) | |||
find_module(runtime_compile libruntime_compile.so ${ASCEND_ATC_DIR}) | |||
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) | |||
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR}) | |||
else() | |||
message(STATUS "PLATFORM param is invalid, should be train or inference, you choose nothing!") | |||
endif() | |||
@@ -166,14 +166,14 @@ build_graphengine() | |||
echo "execute command: cmake ${CMAKE_ARGS} .. failed." | |||
return 1 | |||
fi | |||
COMMON_TARGET="ge_common engine fmk_parser parser_common _caffe_parser fmk_onnx_parser graph register engine_conf.json optimizer_priority.pbtxt " | |||
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 " | |||
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 fwk_atc.bin ${TARGET}" | |||
TARGET="ge_runner fwk_atc.bin ${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_atc.bin opensrc_ascendcl ${TARGET}" | |||
TARGET="ge_compiler atc_atc.bin opensrc_ascendcl ${TARGET}" | |||
elif [ "X$ENABLE_GE_UT" = "Xon" ] | |||
then | |||
TARGET="ut_libgraph ut_libge_multiparts_utest ut_libge_others_utest ut_libge_kernel_utest ut_libge_distinct_load_utest" | |||
@@ -183,7 +183,7 @@ build_graphengine() | |||
elif [ "x${PLATFORM}" = "xall" ] | |||
then | |||
# build all the target | |||
TARGET="" | |||
TARGET="ge_runner ge_compiler fwk_atc.bin atc_atc.bin opensrc_ascendcl ${TARGET}" | |||
fi | |||
make ${VERBOSE} ${TARGET} -j${THREAD_NUM} && make install | |||
@@ -198,8 +198,6 @@ g++ -v | |||
mk_dir ${OUTPUT_PATH} | |||
build_graphengine || { echo "GraphEngine build failed."; return; } | |||
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}/libgtest*.so | |||
rm -f ${OUTPUT_PATH}/lib*_stub.so | |||
@@ -209,10 +207,6 @@ find ${OUTPUT_PATH} -name "*.so*" -print0 | xargs -0 chmod 500 | |||
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 | |||
cp ${BUILD_PATH}/tests/ut/common/graph/ut_libgraph ${OUTPUT_PATH} | |||
cp ${BUILD_PATH}/tests/ut/ge/ut_libge_multiparts_utest ${OUTPUT_PATH} | |||
@@ -220,9 +214,6 @@ 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_kernel_utest ${OUTPUT_PATH} | |||
# if [[ "X${ENABLE_GE_UT_ONLY_COMPILE}" != "Xon" ]]; then | |||
# 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} | |||
# echo ${LD_LIBRARY_PATH} | |||
${OUTPUT_PATH}/ut_libgraph && | |||
${OUTPUT_PATH}/ut_libge_multiparts_utest && | |||
${OUTPUT_PATH}/ut_libge_distinct_load_utest && | |||
@@ -232,17 +223,14 @@ if [[ "X$ENABLE_GE_UT" = "Xon" || "X$ENABLE_GE_COV" = "Xon" ]]; then | |||
echo "!!! UT FAILED, PLEASE CHECK YOUR CHANGES !!!" | |||
exit 1; | |||
fi | |||
# fi | |||
# if [[ "X$ENABLE_GE_COV" = "Xon" ]]; then | |||
echo "Generating coverage statistics, please wait..." | |||
cd ${BASEPATH} | |||
rm -rf ${BASEPATH}/cov | |||
mkdir ${BASEPATH}/cov | |||
lcov -c -d build/tests/ut/ge -d build/tests/ut/common/graph/ -o cov/tmp.info | |||
lcov -r cov/tmp.info '*/output/*' '*/build/opensrc/*' '*/build/proto/*' '*/third_party/*' '*/tests/*' '/usr/local/*' -o cov/coverage.info | |||
cd ${BASEPATH}/cov | |||
genhtml coverage.info | |||
echo "Generating coverage statistics, please wait..." | |||
cd ${BASEPATH} | |||
rm -rf ${BASEPATH}/cov | |||
mkdir ${BASEPATH}/cov | |||
lcov -c -d build/tests/ut/ge -d build/tests/ut/common/graph/ -o cov/tmp.info | |||
lcov -r cov/tmp.info '*/output/*' '*/build/opensrc/*' '*/build/proto/*' '*/third_party/*' '*/tests/*' '/usr/local/*' -o cov/coverage.info | |||
cd ${BASEPATH}/cov | |||
genhtml coverage.info | |||
fi | |||
# generate output package in tar form, including ut/st libraries/executables | |||
@@ -256,6 +244,8 @@ generate_package() | |||
ATC_PATH="atc/lib64" | |||
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" | |||
OPSKERNEL_PATH="plugin/opskernel" | |||
@@ -277,6 +267,8 @@ generate_package() | |||
mk_dir "${OUTPUT_PATH}/${ACL_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}" | |||
@@ -289,10 +281,10 @@ generate_package() | |||
find ${OUTPUT_PATH}/${GRAPHENGINE_LIB_PATH} -maxdepth 1 -name libengine.so -exec cp -f {} ${OUTPUT_PATH}/${ATC_PATH}/${NNENGINE_PATH}/../ \; | |||
MAX_DEPTH=1 | |||
if [ "x${PLATFORM}" = "xall" ] || [ "x${PLATFORM}" = "xinference" ] | |||
then | |||
MAX_DEPTH=2 | |||
fi | |||
# if [ "x${PLATFORM}" = "xall" ] || [ "x${PLATFORM}" = "xinference" ] | |||
# then | |||
# MAX_DEPTH=2 | |||
# 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} \; | |||
@@ -318,7 +310,15 @@ generate_package() | |||
find ./lib/atclib -name atc.bin -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} \; | |||
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" ] | |||
then | |||
tar -cf graphengine_lib.tar fwkacllib | |||
@@ -339,4 +339,4 @@ then | |||
find ./ -name graphengine_lib.tar -exec rm {} \; | |||
tar -cf graphengine_lib.tar lib | |||
fi | |||
echo "---------------- GraphEngine package archive generated ----------------" | |||
echo "---------------- GraphEngine package archive generated ----------------" |
@@ -77,7 +77,6 @@ target_compile_options(atc_ge_local_engine PRIVATE | |||
) | |||
target_compile_definitions(atc_ge_local_engine PRIVATE | |||
COMPILE_OMG_PACKAGE | |||
google=ascend_private | |||
FUNC_VISIBILITY | |||
) | |||
@@ -70,7 +70,6 @@ target_compile_options(atc_host_cpu_engine PRIVATE | |||
) | |||
target_compile_definitions(atc_host_cpu_engine PRIVATE | |||
COMPILE_OMG_PACKAGE | |||
google=ascend_private | |||
FUNC_VISIBILITY | |||
) | |||
@@ -1 +1 @@ | |||
Subproject commit 848cf412caa9b42ce4e75ab4d0a147ec97dc579b | |||
Subproject commit 2596725889c19c60a03440ab9e4e313070326ec0 |
@@ -1 +1 @@ | |||
Subproject commit 756c64c59e451a955e81b59d957ad55f96c27d89 | |||
Subproject commit 6516132e2eaeea2bf51cc790d52c83709588f5d8 |
@@ -401,7 +401,7 @@ struct OmgContext { | |||
// user-designate input dims | |||
std::vector<std::pair<std::string, std::vector<int64_t>>> user_input_dims; | |||
// global input dims | |||
std::unordered_map<std::string, std::vector<int64_t>> input_dims; | |||
std::map<std::string, std::vector<int64_t>> input_dims; | |||
// solve rename op e.g: Detectionoutput:SsdDetectiontOutput | |||
std::map<std::string, std::string> op_conf_map; | |||
@@ -678,7 +678,7 @@ set(PASS_TEST_FILES | |||
"graph/passes/net_output_pass_unittest.cc" | |||
"graph/passes/no_use_reshape_remove_pass_unittest.cc" | |||
"graph/passes/infershape_pass_unittest.cc" | |||
"graph/passes/multi_batch_clone_pass_unittest.cc" | |||
"graph/passes/multi_batch_clone_pass_unittest.cc" | |||
) | |||
set(KERNEL_TEST_FILES | |||
@@ -34,6 +34,7 @@ class UtestDavinciModel : public testing::Test { | |||
void TearDown() {} | |||
}; | |||
/* | |||
TEST_F(UtestDavinciModel, init_success) { | |||
DavinciModel model(0, nullptr); | |||
ComputeGraphPtr graph = make_shared<ComputeGraph>("default"); | |||
@@ -119,6 +120,7 @@ TEST_F(UtestDavinciModel, init_success) { | |||
ProfilingManager::Instance().is_load_profiling_ = false; | |||
} | |||
*/ | |||
TEST_F(UtestDavinciModel, init_data_op) { | |||
DavinciModel model(0, nullptr); | |||
@@ -746,6 +748,7 @@ TEST_F(UtestDavinciModel, init_data_aipp_input_dims_normal) { | |||
EXPECT_EQ(model.op_list_.size(), 1); | |||
} | |||
/* | |||
// test label_set_task Init | |||
TEST_F(UtestDavinciModel, label_task_success) { | |||
DavinciModel model(0, nullptr); | |||
@@ -833,7 +836,8 @@ TEST_F(UtestDavinciModel, label_task_success) { | |||
EXPECT_EQ(model.output_addrs_list_.size(), 0); | |||
EXPECT_EQ(model.task_list_.size(), 5); | |||
} | |||
*/ | |||
TEST_F(UtestDavinciModel, LoadWithQueue_fail_with_diff_args) { | |||
DavinciModel model(0, nullptr); | |||
model.ge_model_ = make_shared<GeModel>(); | |||
@@ -27,10 +27,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpKernelRegistry { | |||
using CreateFn = HostCpuOp* (*)(); | |||
~OpKernelRegistry(); | |||
static OpKernelRegistry& GetInstance() { | |||
static OpKernelRegistry instance; | |||
return instance; | |||
} | |||
static OpKernelRegistry& GetInstance(); | |||
bool IsRegistered(const std::string &op_type); | |||
@@ -21,6 +21,7 @@ | |||
#include <set> | |||
#include <string> | |||
#include <unordered_map> | |||
#include <map> | |||
#include <vector> | |||
#include "register/register.h" | |||
@@ -88,7 +89,7 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OpRegistry { | |||
std::unordered_map<std::string, FusionParseParamByOpFunc> fusion_parse_params_by_op_fn_map_; | |||
std::unordered_map<std::string, ParseSubgraphFunc> op_types_to_parse_subgraph_post_func_; | |||
std::unordered_map<std::string, std::vector<RemoveInputConfigure>> remove_input_configure_map_; | |||
std::unordered_map<std::string, std::string> origin_type_to_om_type_; | |||
std::map<std::string, std::string> origin_type_to_om_type_; | |||
std::unordered_map<std::string, ParseOpToGraphFunc> parse_op_to_graph_fn_map_; | |||
std::unordered_map<std::string, ParseSubgraphFuncV2> op_types_to_parse_subgraph_post_func_v2_; | |||
}; | |||