提交 8202253f authored 作者: Simon Lefrancois's avatar Simon Lefrancois

jenkins pr master cache

上级 bc170305
#!/bin/bash
# Builds Theano master cache for Jenkins PR testing
BASECOMPILEDIR=$HOME/cache
# CUDA
export PATH=/usr/local/cuda/bin:$PATH
export CPATH=/usr/local/cuda/include/:$CPATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=/usr/local/cuda/lib64:$LIBRARY_PATH
GPUARRAY_CONFIG="Release"
DEVICE=cuda
LIBDIR=${WORKSPACE}/local
# Make fresh clones of libgpuarray (with no history since we don't need it)
rm -rf libgpuarray
git clone --depth 1 "https://github.com/Theano/libgpuarray.git"
# Clean up previous installs (to make sure no old files are left)
rm -rf $LIBDIR
mkdir $LIBDIR
# Build libgpuarray
mkdir libgpuarray/build
(cd libgpuarray/build && cmake .. -DCMAKE_BUILD_TYPE=${GPUARRAY_CONFIG} -DCMAKE_INSTALL_PREFIX=$LIBDIR && make)
# Finally install
(cd libgpuarray/build && make install)
# Export paths
export CPATH=$CPATH:$LIBDIR/include
export LIBRARY_PATH=$LIBRARY_PATH:$LIBDIR/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBDIR/lib
# Build the pygpu modules
(cd libgpuarray && python setup.py build_ext --inplace -I$LIBDIR/include -L$LIBDIR/lib)
ls $LIBDIR
mkdir $LIBDIR/lib/python
export PYTHONPATH=${PYTHONPATH}:$LIBDIR/lib/python
# Then install
(cd libgpuarray && python setup.py install --home=$LIBDIR)
# Testing theano to build cache
FLAGS="init_gpu_device=$DEVICE,gpuarray.preallocate=1000,mode=FAST_RUN,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800,base_compiledir=$BASECOMPILEDIR"
FLAGS=${FLAGS},magma.enabled=true # Enable magma GPU library
THEANO_FLAGS=${FLAGS} bin/theano-nose theano
...@@ -5,10 +5,14 @@ ...@@ -5,10 +5,14 @@
# Print commands as they are executed # Print commands as they are executed
set -x set -x
# Copy cache from master
BASECOMPILEDIR=$HOME/.theano/pr_theano
rsync -a $HOME/cache/ $HOME/.theano/pr_theano
echo "===== Testing theano core" echo "===== Testing theano core"
# Test theano core # Test theano core
PARTS="theano -e gpuarray" PARTS="theano -e gpuarray"
THEANO_PARAM="${PARTS} --with-timer --timer-top-n 10 --with-xunit --xunit-file=theanocore_tests.xml" THEANO_PARAM="${PARTS} --with-timer --timer-top-n 10 --with-xunit --xunit-file=theanocore_tests.xml"
FLAGS="mode=FAST_RUN,floatX=float32,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800" FLAGS="mode=FAST_RUN,floatX=float32,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800,base_compiledir=$BASECOMPILEDIR"
THEANO_FLAGS=${FLAGS} bin/theano-nose ${THEANO_PARAM} THEANO_FLAGS=${FLAGS} bin/theano-nose ${THEANO_PARAM}
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
# Print commands as they are executed # Print commands as they are executed
set -x set -x
# Copy cache from master
BASECOMPILEDIR=$HOME/.theano/pr_theano
rsync -a $HOME/cache/ $HOME/.theano/pr_theano
# CUDA # CUDA
export PATH=/usr/local/cuda/bin:$PATH export PATH=/usr/local/cuda/bin:$PATH
export CPATH=/usr/local/cuda/include/:$CPATH export CPATH=/usr/local/cuda/include/:$CPATH
...@@ -51,6 +55,6 @@ python -c 'import pygpu; print(pygpu.__file__)' ...@@ -51,6 +55,6 @@ python -c 'import pygpu; print(pygpu.__file__)'
THEANO_GPUARRAY_TESTS="theano/gpuarray/tests \ THEANO_GPUARRAY_TESTS="theano/gpuarray/tests \
theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray \ theano/scan_module/tests/test_scan.py:T_Scan_Gpuarray \
theano/scan_module/tests/test_scan_checkpoints.py:TestScanCheckpoint.test_memory" theano/scan_module/tests/test_scan_checkpoints.py:TestScanCheckpoint.test_memory"
FLAGS="init_gpu_device=$DEVICE,gpuarray.preallocate=1000,mode=FAST_RUN,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800" FLAGS="init_gpu_device=$DEVICE,gpuarray.preallocate=1000,mode=FAST_RUN,on_opt_error=raise,on_shape_error=raise,cmodule.age_thresh_use=604800,base_compiledir=$BASECOMPILEDIR"
FLAGS=${FLAGS},magma.enabled=true # Enable magma GPU library FLAGS=${FLAGS},magma.enabled=true # Enable magma GPU library
THEANO_FLAGS=${FLAGS} time nosetests --with-xunit --xunit-file=theanogpuarray_tests.xml ${THEANO_GPUARRAY_TESTS} THEANO_FLAGS=${FLAGS} time nosetests --with-xunit --xunit-file=theanogpuarray_tests.xml ${THEANO_GPUARRAY_TESTS}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论