未验证 提交 dd8fc981 编写于 作者: M mapingshuo 提交者: GitHub

add train demo to paddle_build.sh (#19885)

* add train demo to paddle_build.sh

test=develop
test=document_preview

* code cleaning

* test=develop

test=develop

* remove program desc files

test=develop

* add test_train to CI

test=develop
test=document_preview

* make run.sh excutable

test=develop
test=document_preview

* switch with_mkl to off

test=develop
test=document_preview

* switch with_mkl to off

test=develop

* switch with_mkl to on

test=develop

* move test_fluid_lib_train to ci_py35

test=develop

* fix bugs of MKLDNN building

* rm build_train_lib(), test=develop

* restore tensor.h, test=develop
上级 e7a6567b
......@@ -30,6 +30,7 @@ link_directories("${PADDLE_LIB}/third_party/install/zlib/lib")
add_executable(demo_trainer demo_trainer.cc)
if(WITH_MKLDNN)
add_definitions(-DPADDLE_WITH_MKLDNN)
include_directories("${PADDLE_LIB}/third_party/install/mkldnn/include")
if(WIN32)
set(MKLDNN_LIB ${PADDLE_LIB}/third_party/install/mkldnn/lib/mkldnn.lib)
......
set -x
cd `dirname $0`
rm -rf build/
set +x
#!/bin/bash
set -x
PADDLE_ROOT=$1
TURN_ON_MKL=$2 # use MKL or Openblas
# download models
function download() {
wget -q http://paddle-tar.bj.bcebos.com/train_demo/LR/main_program
wget -q http://paddle-tar.bj.bcebos.com/train_demo/LR/startup_program
}
download
# build demo trainer
fluid_install_dir=${PADDLE_ROOT}/build/fluid_install_dir
mkdir -p build
cd build
rm -rf *
cmake .. -DPADDLE_LIB=$fluid_install_dir \
-DWITH_MKLDNN=$TURN_ON_MKL \
-DWITH_MKL=$TURN_ON_MKL
make
cd ..
# run demo trainer
build/demo_trainer
......@@ -296,7 +296,6 @@ function build_base() {
make install -j ${parallel_number}
}
function build() {
mkdir -p ${PADDLE_ROOT}/build
cd ${PADDLE_ROOT}/build
......@@ -952,6 +951,16 @@ EOF
./clean.sh
}
function test_fluid_lib_train() {
cat <<EOF
========================================
Testing fluid library for training ...
========================================
EOF
cd ${PADDLE_ROOT}/paddle/fluid/train/demo
./run.sh ${PADDLE_ROOT} ${WITH_MKL:-ON}
./clean.sh
}
function build_document_preview() {
sh /paddle/tools/document_preview.sh ${PORT}
......@@ -1045,6 +1054,11 @@ function main() {
test_inference)
gen_fluid_lib ${parallel_number}
test_fluid_lib
test_fluid_lib_train
;;
test_train)
gen_fluid_lib ${parallel_number}
test_fluid_lib_train
;;
assert_api_approvals)
assert_api_spec_approvals
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册