From 0b6a0dd7fab055c6590b7d672441917bfeaf19ff Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 22 Jul 2021 09:13:36 -0500 Subject: py-torch: fix build on blue waters (#25026) --- .../repos/builtin/packages/py-torch/package.py | 25 ++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/py-torch/package.py b/var/spack/repos/builtin/packages/py-torch/package.py index 1a7b414af5..468f1100b5 100644 --- a/var/spack/repos/builtin/packages/py-torch/package.py +++ b/var/spack/repos/builtin/packages/py-torch/package.py @@ -50,6 +50,7 @@ class PyTorch(PythonPackage, CudaPackage): # All options are defined in CMakeLists.txt. # Some are listed in setup.py, but not all. variant('caffe2', default=True, description='Build Caffe2') + variant('test', default=False, description='Build C++ test binaries') variant('cuda', default=not is_darwin, description='Use CUDA') variant('rocm', default=False, description='Use ROCm') variant('cudnn', default=not is_darwin, description='Use cuDNN') @@ -131,12 +132,14 @@ class PyTorch(PythonPackage, CudaPackage): # depends_on('cpuinfo@master', when='@master') # depends_on('cpuinfo@2020-12-17', when='@1.8.0:1.9.999') # depends_on('cpuinfo@2020-06-11', when='@1.6.0:1.7.999') - depends_on('sleef@master', when='@master') - depends_on('sleef@3.5.1_2020-12-22', when='@1.8.0:1.9.999') + # https://github.com/shibatch/sleef/issues/427 + # depends_on('sleef@master', when='@master') + # depends_on('sleef@3.5.1_2020-12-22', when='@1.8.0:1.9.999') # https://github.com/pytorch/pytorch/issues/60334 # depends_on('sleef@3.4.0_2019-07-30', when='@1.6.0:1.7.999') - depends_on('fp16@master', when='@master') - depends_on('fp16@2020-05-14', when='@1.6.0:1.9.999') + # https://github.com/Maratyszcza/FP16/issues/18 + # depends_on('fp16@master', when='@master') + # depends_on('fp16@2020-05-14', when='@1.6.0:1.9.999') depends_on('pthreadpool@master', when='@master') depends_on('pthreadpool@2021-04-13', when='@1.9.0:1.9.999') depends_on('pthreadpool@2020-10-05', when='@1.8.0:1.8.999') @@ -145,7 +148,7 @@ class PyTorch(PythonPackage, CudaPackage): depends_on('psimd@2020-05-17', when='@1.6.0:1.9.999') depends_on('fxdiv@master', when='@master') depends_on('fxdiv@2020-04-17', when='@1.6.0:1.9.999') - depends_on('benchmark', when='@1.6:') + depends_on('benchmark', when='@1.6:+test') # Optional dependencies depends_on('cuda@7.5:', when='+cuda', type=('build', 'link', 'run')) @@ -203,7 +206,7 @@ class PyTorch(PythonPackage, CudaPackage): # Fixes fatal error: sleef.h: No such file or directory # https://github.com/pytorch/pytorch/pull/35359 # https://github.com/pytorch/pytorch/issues/26555 - patch('sleef.patch', when='@1.0.0:1.5.999') + # patch('sleef.patch', when='@1.0.0:1.5.999') # Fixes compilation with Clang 9.0.0 and Apple Clang 11.0.3 # https://github.com/pytorch/pytorch/pull/37086 @@ -287,6 +290,9 @@ class PyTorch(PythonPackage, CudaPackage): # Spack logs have trouble handling colored output env.set('COLORIZE_OUTPUT', 'OFF') + if self.spec.satisfies('@0.4:'): + enable_or_disable('test', keyword='BUILD') + if self.spec.satisfies('@1.7:'): enable_or_disable('caffe2', keyword='BUILD') @@ -393,15 +399,16 @@ class PyTorch(PythonPackage, CudaPackage): if self.spec.satisfies('@1.10:'): env.set('USE_SYSTEM_PYBIND11', 'ON') # https://github.com/pytorch/pytorch/issues/60334 - if self.spec.satisfies('@1.8:'): - env.set('USE_SYSTEM_SLEEF', 'ON') + # if self.spec.satisfies('@1.8:'): + # env.set('USE_SYSTEM_SLEEF', 'ON') if self.spec.satisfies('@1.6:'): # env.set('USE_SYSTEM_LIBS', 'ON') # https://github.com/pytorch/pytorch/issues/60329 # env.set('USE_SYSTEM_CPUINFO', 'ON') # https://github.com/pytorch/pytorch/issues/60270 # env.set('USE_SYSTEM_GLOO', 'ON') - env.set('USE_SYSTEM_FP16', 'ON') + # https://github.com/Maratyszcza/FP16/issues/18 + # env.set('USE_SYSTEM_FP16', 'ON') env.set('USE_SYSTEM_PTHREADPOOL', 'ON') env.set('USE_SYSTEM_PSIMD', 'ON') env.set('USE_SYSTEM_FXDIV', 'ON') -- cgit v1.2.3-60-g2f50