From 7aca328ca04be9b02f8a46d26ce45bdbdc7eed2d Mon Sep 17 00:00:00 2001 From: yanghaoran Date: Fri, 24 Apr 2020 11:00:26 +0800 Subject: [PATCH] GraphEngine now generates a package of libraries and test executables --- .gitignore | 58 +++++++++++++++++++++--------------------- build.sh | 12 ++++++++- tests/st/test_ge_st.py | 8 +++--- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index b2b3fd49..8a4003cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,29 +1,29 @@ -# GraphEngine -/build -/output -/prebuilts -*.ir -*.out - -# Dynamic libraries -# *.so -*.dylib - -# Static libraries -*.la -*.lai -*.a -*.lib - -# Protocol buffers -*_pb2.py -*.pb.h -*.pb.cc - -# Object files -*.o - -# Editor -.vscode -.idea/ -cmake-build-* +# GraphEngine +/build +/output +/prebuilts +*.ir +*.out + +# Dynamic libraries +# *.so +*.dylib + +# Static libraries +*.la +*.lai +*.a +*.lib + +# Protocol buffers +*_pb2.py +*.pb.h +*.pb.cc + +# Object files +*.o + +# Editor +.vscode +.idea/ +cmake-build-* diff --git a/build.sh b/build.sh index 320a19bf..6cbc03d2 100644 --- a/build.sh +++ b/build.sh @@ -135,7 +135,7 @@ rm -f ${OUTPUT_PATH}/lib*_stub.so chmod -R 750 ${OUTPUT_PATH} find ${OUTPUT_PATH} -name "*.so*" -print0 | xargs -0 chmod 500 -echo "---------------- GraphEngine output package generated ----------------" +echo "---------------- GraphEngine output generated ----------------" if [[ "X$ENABLE_GE_ST" = "Xon" ]]; then cp ${BUILD_PATH}/graphengine/tests/st/st_resnet50_train ${OUTPUT_PATH} @@ -170,3 +170,13 @@ if [[ "X$ENABLE_GE_UT" = "Xon" || "X$ENABLE_GE_COV" = "Xon" ]]; then 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 + +# generate output package in tar form, including ut/st libraries/executables +cd ${BASEPATH} +mkdir -p output/plugin/nnengine/ge_config/ +find output/ -name graphengine_lib.tar -exec rm {} \; +cp src/ge/engine_manager/engine_conf.json output/plugin/nnengine/ge_config/ +find output/ -maxdepth 1 -name libengine.so -exec mv {} output/plugin/nnengine/ \; +tar -cf graphengine_lib.tar output/* +mv -f graphengine_lib.tar output +echo "---------------- GraphEngine package archive generated ----------------" diff --git a/tests/st/test_ge_st.py b/tests/st/test_ge_st.py index 9c366364..b5479cfc 100644 --- a/tests/st/test_ge_st.py +++ b/tests/st/test_ge_st.py @@ -39,10 +39,10 @@ def test_resnet50_train(): os.environ['PYTHONPATH']=real_pythonpath print('PYTHONPATH: '+os.environ.get('PYTHONPATH')) - os.environ['ASCEND_OPP_PATH']='/usr/local/HiAI/runtime/ops' - os.environ['ASCEND_ENGINE_PATH']='/usr/local/HiAI/runtime/lib64/plugin/opskernel/libaicpu_ms_engine.so:' \ - '/usr/local/HiAI/runtime/lib64/plugin/opskernel/libfe.so:' \ - '/usr/local/HiAI/runtime/lib64/plugin/opskernel/librts_engine.so:'+ \ + os.environ['ASCEND_OPP_PATH']='/usr/local/Ascend/opp' + os.environ['ASCEND_ENGINE_PATH']='/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/libaicpu_engine.so:' \ + '/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/libfe.so:' \ + '/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/librts_engine.so:'+ \ ge_lib_dir + '/libge_local_engine.so' print('ASCEND_OPP_PATH: '+os.environ.get('ASCEND_OPP_PATH')) print('ASCEND_ENGINE_PATH: '+os.environ.get('ASCEND_ENGINE_PATH'))