Tensorflow v0.12.0 - v0.12.1

De Wiki de Calcul Québec
Aller à : Navigation, rechercher

Helios

Fichier : tensorflow_v0.12.1_helios.sh
#!/bin/bash
module purge -f
module load compilers/gcc/4.8.5 compilers/java/1.8 apps/buildtools cuda/7.5 libs/cuDNN/5 compilers/swig apps/git apps/bazel/0.4.3
 
mkdir -p /tmp/$USER; cd /tmp/$USER
git clone https://github.com/tensorflow/tensorflow.git; cd tensorflow
git checkout 0.12.1
 
GCC_PREFIX=$(dirname $(dirname $(which gcc)))
sed -i "\;linker_flag: \"-B/usr/bin/\";a \ \ linker_flag: \"-Wl,-rpath=$GCC_PREFIX/lib64\"" third_party/gpus/crosstool/CROSSTOOL.tpl
sed -i "\;linker_flag: \"-B/usr/bin/\";a \ \ linker_flag: \"-Wl,-rpath=$GCC_PREFIX/lib\"" third_party/gpus/crosstool/CROSSTOOL.tpl
sed -i "/cmd = 'PATH=' + PREFIX_DIR + ' ' + cmd/s/^/#/" third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl
sed -i 's;zlib-1.2.8.tar.gz;fossils/zlib-1.2.8.tar.gz;g' tensorflow/workspace.bzl # Bug in Zlib for Bazel 0.12.1
sed -i "s;bazel clean; bazel --output_user_root=/tmp/$USER/bazel clean;g" configure
sed -i "s;bazel fetch; bazel --output_user_root=/tmp/$USER/bazel fetch;g" configure
sed -i "s;_VERSION = '0.12.1';_VERSION = '0.12.1+helios';g" tensorflow/tools/pip_package/setup.py
 
module load apps/python/2
virtualenv buildenv
source buildenv/bin/activate
pip install numpy wheel
 
export MALLOC_ARENA_MAX=4
echo -e "\nN\nN\n\nN\nY\n\n7.5\n$CUDA_HOME\n5\n/software-gpu/libs/cuDNN/5_cuda7.5\n3.5,3.7\n" | ./configure
bazel --output_user_root=/tmp/$USER/bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
 
mkdir dist; bazel-bin/tensorflow/tools/pip_package/build_pip_package $PWD/dist
bazel --output_user_root=/tmp/$USER/bazel shutdown


Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Ressources de Calcul Québec
Outils
Partager