summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Van Essen <vanessen1@llnl.gov>2017-02-13 11:57:46 -0800
committerbecker33 <becker33@llnl.gov>2017-02-13 11:57:46 -0800
commit56952aaf1f1eace70c4a21d82c54f90bfb176cae (patch)
treecfa855239c2810d7136dd9bc473292aeb58df1e5
parente34acd007413970974e81628208c150532feed5f (diff)
downloadspack-56952aaf1f1eace70c4a21d82c54f90bfb176cae.tar.gz
spack-56952aaf1f1eace70c4a21d82c54f90bfb176cae.tar.bz2
spack-56952aaf1f1eace70c4a21d82c54f90bfb176cae.tar.xz
spack-56952aaf1f1eace70c4a21d82c54f90bfb176cae.zip
LBANN (#3049)
* Creating a spack package for LLNL's LBANN (Livermore Big Artificial Neural Network) training toolkit. * Recipe for building LBANN toolkit. Contains limited feature set and is optimized for building with GNU gcc and OpenBLAS. * Removed unnecessary dependencies based on reviewers feedback. * Added support for the int64 data type in the Elemental library. This is required for supporting indices for large matrices. * Added a variant to force a sequential weight matrix initialization. This is slow, but provides an initialization that is independent of model parallelism. * Added a guard to prevent building Elemental with the Intel compiler for versions that have known bugs.
-rw-r--r--var/spack/repos/builtin/packages/elemental/package.py8
-rw-r--r--var/spack/repos/builtin/packages/lbann/package.py83
2 files changed, 91 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py
index 625f0a1e3e..4aae98e3e1 100644
--- a/var/spack/repos/builtin/packages/elemental/package.py
+++ b/var/spack/repos/builtin/packages/elemental/package.py
@@ -23,6 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
+from spack.spec import UnsupportedCompilerError
class Elemental(CMakePackage):
@@ -32,6 +33,7 @@ class Elemental(CMakePackage):
homepage = "http://libelemental.org"
url = "https://github.com/elemental/Elemental/archive/v0.87.6.tar.gz"
+ version('0.87.7', '6c1e7442021c59a36049e37ea69b8075')
version('0.87.6', '9fd29783d45b0a0e27c0df85f548abe9')
variant('debug', default=False,
@@ -94,6 +96,12 @@ class Elemental(CMakePackage):
def cmake_args(self):
spec = self.spec
+
+ if '@:0.87.7' in spec and '%intel@:17.0.2' in spec:
+ raise UnsupportedCompilerError(
+ "Elemental {0} has a known bug with compiler: {1} {2}".format(
+ spec.version, spec.compiler.name, spec.compiler.version))
+
args = [
'-DCMAKE_INSTALL_MESSAGE:STRING=LAZY',
'-DEL_PREFER_OPENBLAS:BOOL=TRUE',
diff --git a/var/spack/repos/builtin/packages/lbann/package.py b/var/spack/repos/builtin/packages/lbann/package.py
new file mode 100644
index 0000000000..341487ca77
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lbann/package.py
@@ -0,0 +1,83 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class Lbann(CMakePackage):
+ """LBANN: Livermore Big Artificial Neural Network Toolkit. A distributed
+ memory, HPC-optimized, model and data parallel training toolkit for deep
+ neural networks."""
+
+ homepage = "http://software.llnl.gov/lbann/"
+ url = "https://github.com/LLNL/lbann/archive/v0.91.tar.gz"
+
+ version('develop', git='https://github.com/LLNL/lbann.git', branch="develop")
+ version('0.91', '83b0ec9cd0b7625d41dfb06d2abd4134')
+
+ variant('debug', default=False, description='Builds a debug version of the libraries')
+ variant('gpu', default=False, description='Builds with support for GPUs via CUDA and cuDNN')
+ variant('opencv', default=True, description='Builds with support for image processing routines with OpenCV')
+ variant('seq_init', default=False, description='Force serial initialization of weight matrices.')
+
+ depends_on('elemental +openmp_blas +scalapack +shared +int64')
+ depends_on('elemental +openmp_blas +scalapack +shared +int64 +debug', when='+debug')
+ depends_on('cuda', when='+gpu')
+ depends_on('mpi')
+ depends_on('opencv@2.4.13', when='+opencv')
+ depends_on('protobuf@3.0.2')
+
+ def build_type(self):
+ if '+debug' in self.spec:
+ return 'Debug'
+ else:
+ return 'Release'
+
+ def cmake_args(self):
+ spec = self.spec
+ # Environment variables
+ CPPFLAGS = []
+ CPPFLAGS.append('-DLBANN_SET_EL_RNG')
+ if '~seq_init' in spec:
+ CPPFLAGS.append('-DLBANN_PARALLEL_RANDOM_MATRICES')
+
+ args = [
+ '-DCMAKE_INSTALL_MESSAGE=LAZY',
+ '-DCMAKE_CXX_FLAGS=%s' % ' '.join(CPPFLAGS),
+ '-DWITH_CUDA:BOOL=%s' % ('+gpu' in spec),
+ '-DWITH_CUDNN:BOOL=%s' % ('+gpu' in spec),
+ '-DWITH_TBINF=OFF',
+ '-DWITH_VTUNE=OFF',
+ '-DElemental_DIR={0}'.format(self.spec['elemental'].prefix),
+ '-DELEMENTAL_MATH_LIBS={0}'.format(
+ self.spec['elemental'].elemental_libs),
+ '-DVERBOSE=0',
+ '-DLBANN_HOME=.',
+ '-DLBANN_VER=spack']
+
+ if '+opencv' in self.spec:
+ args.extend(['-DOpenCV_DIR:STRING={0}'.format(
+ self.spec['opencv'].prefix)])
+
+ return args