From 64c5aae6b3f5c6f5be947ffaa3bd073002cbda4a Mon Sep 17 00:00:00 2001 From: jiaopu Date: Fri, 24 Apr 2020 14:08:51 +0800 Subject: [PATCH] add run demo in CI --- .github/workflows/github-CI.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-CI.yml b/.github/workflows/github-CI.yml index 559560077a..4cd485f0f8 100644 --- a/.github/workflows/github-CI.yml +++ b/.github/workflows/github-CI.yml @@ -6,15 +6,17 @@ on: jobs: build: + env: + NEUWARE_HOME: /usr/local/neuware runs-on: self-hosted steps: - uses: actions/checkout@v2 - name: modity build.sh - run: sed -i 's/DLITE_WITH_PYTHON=ON/DLITE_WITH_PYTHON=OFF/' lite/tools/build_mlu.sh && sed -i 's/WITH_TESTING=OFF/WITH_TESTING=ON/' lite/tools/build_mlu.sh && sed -i 's/-j$NUM_CORES_FOR_COMPILE/-j1/' lite/tools/build_mlu.sh + run: sed -i 's/DLITE_WITH_PYTHON=ON/DLITE_WITH_PYTHON=OFF/' lite/tools/build_mlu.sh && sed -i 's/WITH_TESTING=OFF/WITH_TESTING=ON/' lite/tools/build_mlu.sh && sed -i 's/-j$NUM_CORES_FOR_COMPILE/-j1/' lite/tools/build_mlu.sh && sed -i 's/PRINT_HW_TIME false/PRINT_HW_TIME true/' lite/kernels/mlu/bridges/graph.h - name: build - run: NEUWARE_HOME=/usr/local/neuware ./lite/tools/build_mlu.sh build + run: ./lite/tools/build_mlu.sh build - name: test_act_converter_mlu run: ./build.lite.mlu/lite/kernels/mlu/bridges/test_act_converter_mlu - name: test_batch_norm_converter_mlu @@ -39,3 +41,26 @@ jobs: run: ./build.lite.mlu/lite/kernels/mlu/bridges/test_softmax_converter_mlu - name: test_transpose_converter_mlu run: ./build.lite.mlu/lite/kernels/mlu/bridges/test_transpose_converter_mlu + - name: test_classification + run: | + cd .. + rm -rf Paddle-Lite-models + git clone -b adapt_api git@github.com:Cambricon/Paddle-Lite-models.git + cd Paddle-Lite-models + sed -i 's/\/home\/dingminghui\/paddle/${PWD}\/../' prepare_paddle_env.sh + sed -i 's/\/home\/dingminghui\/paddle\/data/\/opt\/share\/paddle_model\//' classification/classification_demo.cpp + cp /opt/share/datasets/imagenet/val_1000.txt classification/filelist + sed -i 's/^/\/opt\/share\/datasets\/imagenet\//' classification/filelist + LD_LIBRARY_PATH=${PWD}/../Paddle-Lite/build.lite.mlu/third_party/mklml/src/extern_mklml/lib ./prepare_paddle_env.sh 0 + cd classification + LD_LIBRARY_PATH=${PWD}/../../Paddle-Lite/build.lite.mlu/third_party/mklml/src/extern_mklml/lib ./classification_demo 1 &> log + - name: compare_subgraph_num + run: | + [ `awk 'BEGIN {min=65536} /detected.*subgraph/ {if($6b)?"0":"1"}'` -eq 0 ] + tmp=`awk '/top5/ {print $5}' ${PWD}/../Paddle-Lite-models/classification/log` && [ `awk -v a=$tmp -v b=0.9 'BEGIN{print(a>b)?"0":"1"}'` -eq 0 ] -- GitLab