From d74b02f59a9722cc46652fe45c3a51a0e935c94e Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Wed, 26 Apr 2023 08:03:47 -0500 Subject: py-tensorflow: add v2.11–2.12 (#36263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repos/builtin/packages/py-keras/package.py | 159 ++++++++++++++++----- .../builtin/packages/py-tensorflow/package.py | 85 ++++++++--- 2 files changed, 186 insertions(+), 58 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-keras/package.py b/var/spack/repos/builtin/packages/py-keras/package.py index 474cde4266..718511e1ca 100644 --- a/var/spack/repos/builtin/packages/py-keras/package.py +++ b/var/spack/repos/builtin/packages/py-keras/package.py @@ -21,6 +21,8 @@ class PyKeras(PythonPackage): git = "https://github.com/keras-team/keras.git" url = "https://github.com/keras-team/keras/archive/refs/tags/v2.7.0.tar.gz" + version("2.12.0", sha256="6336cebb6b2b0a91f7efd3ff3a9db3a94f2abccf07a40323138afb80826aec62") + version("2.11.0", sha256="e7a7c4199ac76ea750d145c1d84ae1b932e68b9bca34e83596bd66b2fc2ad79e") version("2.10.0", sha256="b1d8d9358700f4a585455854a142d88cc987419c1638ef935b440842d593ad04") version("2.9.0", sha256="90226eaa0337573304f3e5ab44d4d9e3a65fe002776c5cbd0f65b738152c1084") version("2.8.0", sha256="5e777b0101d8385d3a90fc9056f1b2f6313f2c830d2e8181828b300c9229ec0c") @@ -39,34 +41,127 @@ class PyKeras(PythonPackage): version("2.2.2", sha256="468d98da104ec5c3dbb10c2ef6bb345ab154f6ca2d722d4c250ef4d6105de17a") version("2.2.1", sha256="0d3cb14260a3fa2f4a5c4c9efa72226ffac3b4c50135ba6edaf2b3d1d23b11ee") version("2.2.0", sha256="5b8499d157af217f1a5ee33589e774127ebc3e266c833c22cb5afbb0ed1734bf") - version("2.1.6", sha256="c14af1081242c25617ade7eb62121d58d01f16e1e744bae9fc4f1f95a417716e") - version("2.1.5", sha256="907ad29add1fff27342a9f4fe3e60003d450d3af41a38f22f629c7736fc8399d") - version("2.1.4", sha256="7ee1fcc79072ac904a4f008d715bcb78c60250ae3cd41d99e268c60ade8d0d3a") - version("2.1.3", sha256="7ca3a381523bad40a6922e88951a316664cb088fd01cea07e5ec8ada3327e3c7") - version("2.1.2", sha256="3ee56fc129d9d00b1916046e50056047836f97ada59df029e5661fb34442d5e8") - version("2.1.1", sha256="f0ca2458c60d9711edf4291230b31795307ad3781cb6232ff4792b53c8f55123") - version("2.1.0", sha256="67a0d66c20fff99312fc280e34c8f6dc3dbb027d4a33c13c79bec3c1173f6909") - version("2.0.9", sha256="6b8572cf1b4a22fd0120b7c23382ba4fa04a6f0397e02af1249be9a7309d1767") - version("2.0.8", sha256="899dc6aaed366f20100b9f80cf1093ea5b43eecc74afd1dc63a4e48dfa776ab9") - version("2.0.7", sha256="a6c72ee2b94be1ffefe7e77b69582b9827211f0c356b2189459711844d3634c0") - version("2.0.6", sha256="0519480abe4ad18b2c2d1bc580eab75edd82c95083d341a1157952f4b00019bb") - version("2.0.5", sha256="cbce24758530e070fe1b403d6d21391cbea78c037b70bf6afc1ca9f1f8269eff") - version("2.0.4", sha256="1cbe62af6821963321b275d5598fd94e63c11feaa1d4deaa79c9eb9ee0e1d68a") - version("2.0.3", sha256="398dbd4a95e9d3ab2b2941d3e0c19362d397a2a6c3a667ab89d3d6aad30997f4") - version("2.0.2", sha256="53fd0a6e9eaca2563e13d2266eac2da478fa25092de3c665aa26e380a8126841") - version("2.0.1", sha256="c5c2727518f76606794363c01430f4992e482b4ab0dc6a8fa137c896855c09a8") - version("2.0.0", sha256="02846dceb36e98368f47ca090d0f5fe6828e22ece10668a07047bea4c92b157f") - version("1.2.2", sha256="d2b18c4336eb9c4f0d03469870257efa7980a9b036c9d46dcf4d49e7f4487e2d") - version("1.2.1", sha256="6adce75b2050608e6683c3046ef938bfdc5bfcd4c6b6c522df5e50d18e0ac7c6") - version("1.2.0", sha256="33d5297cd0c280640dc5c075466995c05911bc1da35c83ae57b2a48188b605e2") - version("1.1.2", sha256="cfde0a424961ead4982a7ebefd77d8ca382810b5a69b566fa64c57d8f340eeb4") - version("1.1.1", sha256="be1b67f62e5119f6f24a239a865dc47e6d9aa93b97b506ba34cab7353dbc23b6") - version("1.1.0", sha256="36d83b027ba9d2c9da8e1eefc28f600ca93dc03423e033b633cbac9061af8a5d") + version( + "2.1.6", + sha256="c14af1081242c25617ade7eb62121d58d01f16e1e744bae9fc4f1f95a417716e", + deprecated=True, + ) + version( + "2.1.5", + sha256="907ad29add1fff27342a9f4fe3e60003d450d3af41a38f22f629c7736fc8399d", + deprecated=True, + ) + version( + "2.1.4", + sha256="7ee1fcc79072ac904a4f008d715bcb78c60250ae3cd41d99e268c60ade8d0d3a", + deprecated=True, + ) + version( + "2.1.3", + sha256="7ca3a381523bad40a6922e88951a316664cb088fd01cea07e5ec8ada3327e3c7", + deprecated=True, + ) + version( + "2.1.2", + sha256="3ee56fc129d9d00b1916046e50056047836f97ada59df029e5661fb34442d5e8", + deprecated=True, + ) + version( + "2.1.1", + sha256="f0ca2458c60d9711edf4291230b31795307ad3781cb6232ff4792b53c8f55123", + deprecated=True, + ) + version( + "2.1.0", + sha256="67a0d66c20fff99312fc280e34c8f6dc3dbb027d4a33c13c79bec3c1173f6909", + deprecated=True, + ) + version( + "2.0.9", + sha256="6b8572cf1b4a22fd0120b7c23382ba4fa04a6f0397e02af1249be9a7309d1767", + deprecated=True, + ) + version( + "2.0.8", + sha256="899dc6aaed366f20100b9f80cf1093ea5b43eecc74afd1dc63a4e48dfa776ab9", + deprecated=True, + ) + version( + "2.0.7", + sha256="a6c72ee2b94be1ffefe7e77b69582b9827211f0c356b2189459711844d3634c0", + deprecated=True, + ) + version( + "2.0.6", + sha256="0519480abe4ad18b2c2d1bc580eab75edd82c95083d341a1157952f4b00019bb", + deprecated=True, + ) + version( + "2.0.5", + sha256="cbce24758530e070fe1b403d6d21391cbea78c037b70bf6afc1ca9f1f8269eff", + deprecated=True, + ) + version( + "2.0.4", + sha256="1cbe62af6821963321b275d5598fd94e63c11feaa1d4deaa79c9eb9ee0e1d68a", + deprecated=True, + ) + version( + "2.0.3", + sha256="398dbd4a95e9d3ab2b2941d3e0c19362d397a2a6c3a667ab89d3d6aad30997f4", + deprecated=True, + ) + version( + "2.0.2", + sha256="53fd0a6e9eaca2563e13d2266eac2da478fa25092de3c665aa26e380a8126841", + deprecated=True, + ) + version( + "2.0.1", + sha256="c5c2727518f76606794363c01430f4992e482b4ab0dc6a8fa137c896855c09a8", + deprecated=True, + ) + version( + "2.0.0", + sha256="02846dceb36e98368f47ca090d0f5fe6828e22ece10668a07047bea4c92b157f", + deprecated=True, + ) + version( + "1.2.2", + sha256="d2b18c4336eb9c4f0d03469870257efa7980a9b036c9d46dcf4d49e7f4487e2d", + deprecated=True, + ) + version( + "1.2.1", + sha256="6adce75b2050608e6683c3046ef938bfdc5bfcd4c6b6c522df5e50d18e0ac7c6", + deprecated=True, + ) + version( + "1.2.0", + sha256="33d5297cd0c280640dc5c075466995c05911bc1da35c83ae57b2a48188b605e2", + deprecated=True, + ) + version( + "1.1.2", + sha256="cfde0a424961ead4982a7ebefd77d8ca382810b5a69b566fa64c57d8f340eeb4", + deprecated=True, + ) + version( + "1.1.1", + sha256="be1b67f62e5119f6f24a239a865dc47e6d9aa93b97b506ba34cab7353dbc23b6", + deprecated=True, + ) + version( + "1.1.0", + sha256="36d83b027ba9d2c9da8e1eefc28f600ca93dc03423e033b633cbac9061af8a5d", + deprecated=True, + ) # Supported Python versions listed in multiple places: # * keras/tools/pip_package/setup.py # * CONTRIBUTING.md # * PKG-INFO + depends_on("python@3.8:", type=("build", "run"), when="@2.12:") depends_on("python@3.7:", type=("build", "run"), when="@2.7:") depends_on("python@3.6:", type=("build", "run"), when="@2.4:") depends_on("py-setuptools", type="build") @@ -74,23 +169,16 @@ class PyKeras(PythonPackage): # Required dependencies listed in multiple places: # * BUILD # * WORKSPACE - # * requirements.txt - # * setup.py - depends_on("pil", type=("build", "run")) depends_on("py-absl-py", type=("build", "run"), when="@2.6:") depends_on("py-h5py", type=("build", "run")) - depends_on("py-numpy@1.21.4:1.21", type=("build", "run"), when="@2.8:") - depends_on("py-numpy@1.19.2:1.19", type=("build", "run"), when="@2.7") - depends_on("py-numpy@1.9.1:", type=("build", "run"), when="@2.0.8:") depends_on("py-numpy", type=("build", "run")) depends_on("py-pandas", type=("build", "run"), when="@2.0.9:") + depends_on("pil", type=("build", "run")) + depends_on("py-portpicker", type=("build", "run"), when="@2.10:") depends_on("py-pydot", type=("build", "run")) - depends_on("py-pyyaml", type=("build", "run")) - depends_on("py-scipy@1.5.2:1.5", type=("build", "run"), when="@2.6:") - depends_on("py-scipy@0.14:", type=("build", "run"), when="@2.0.8:") depends_on("py-scipy", type=("build", "run")) depends_on("py-six", type=("build", "run")) - for minor_ver in range(5, 11): + for minor_ver in range(5, 13): depends_on( "py-tensorflow@2.{}".format(minor_ver), type=("build", "run"), @@ -101,11 +189,10 @@ class PyKeras(PythonPackage): type=("build", "run"), when="@2.{}".format(minor_ver), ) - depends_on("py-theano", type=("build", "run"), when="@:2.0.7") - - # Required dependencies not listed anywhere? + depends_on("py-pyyaml", type=("build", "run")) depends_on("bazel", type="build", when="@2.5:") depends_on("protobuf", type="build", when="@2.5:") + depends_on("py-theano", type=("build", "run"), when="@:2.0.7") def url_for_version(self, version): if version >= Version("2.6"): diff --git a/var/spack/repos/builtin/packages/py-tensorflow/package.py b/var/spack/repos/builtin/packages/py-tensorflow/package.py index 61128029d1..587e656df9 100644 --- a/var/spack/repos/builtin/packages/py-tensorflow/package.py +++ b/var/spack/repos/builtin/packages/py-tensorflow/package.py @@ -30,6 +30,9 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): maintainers("adamjstewart", "aweits") import_modules = ["tensorflow"] + version("2.12.0", sha256="c030cb1905bff1d2446615992aad8d8d85cbe90c4fb625cee458c63bf466bc8e") + version("2.11.1", sha256="624ed1cc170cdcc19e8a15d8cdde989a9a1c6b0534c90b38a6b2f06fb2963e5f") + version("2.11.0", sha256="99c732b92b1b37fc243a559e02f9aef5671771e272758aa4aec7f34dc92dac48") version("2.10.1", sha256="622a92e22e6f3f4300ea43b3025a0b6122f1cc0e2d9233235e4c628c331a94a3") version("2.10.0", sha256="b5a1bb04c84b6fe1538377e5a1f649bb5d5f0b2e3625a3c526ff3a8af88633e8") version("2.9.3", sha256="59d09bd00eef6f07477eea2f50778582edd4b7b2850a396f1fd0c646b357a573") @@ -147,12 +150,19 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): ) extends("python") - depends_on("python@3:", type=("build", "run"), when="@2.1:") - # https://github.com/tensorflow/tensorflow/issues/33374 - depends_on("python@:3.7", type=("build", "run"), when="@:2.1") + + # Python support based on wheel availability + depends_on("python@3.8:3.11", when="@2.12:", type=("build", "run")) + depends_on("python@3.7:3.10", when="@2.8:2.11", type=("build", "run")) + depends_on("python@3.7:3.9", when="@2.7", type=("build", "run")) + depends_on("python@3.6:3.9", when="@2.5:2.6", type=("build", "run")) + depends_on("python@3.6:3.8", when="@2.4", type=("build", "run")) + depends_on("python@3.5:3.8", when="@2.2:2.3", type=("build", "run")) + depends_on("python@2.7,3.5:3.7", when="@:2.1", type=("build", "run")) # See .bazelversion - depends_on("bazel@5.1.1", type="build", when="@2.10:") + depends_on("bazel@5.3.0", type="build", when="@2.11:") + depends_on("bazel@5.1.1", type="build", when="@2.10") # See _TF_MIN_BAZEL_VERSION and _TF_MAX_BAZEL_VERSION in configure.py depends_on("bazel@4.2.2:5.99.0", type="build", when="@2.9") depends_on("bazel@4.2.1:4.99.0", type="build", when="@2.8") @@ -193,7 +203,9 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-flatbuffers@1.12:", type=("build", "run"), when="@2.8") depends_on("py-flatbuffers@1.12:2", type=("build", "run"), when="@2.7") depends_on("py-flatbuffers@1.12", type=("build", "run"), when="@2.4:2.6") - depends_on("py-gast@0.2.1:0.4.0", type=("build", "run"), when="@2.9:") + # Unpin overly strict dependency requirements to ease concretization of TensorFlow + depends_on("py-gast@0.2.1:", type=("build", "run"), when="@2.9:") + # depends_on("py-gast@0.2.1:0.4.0", type=("build", "run"), when="@2.9:") depends_on("py-gast@0.2.1:", type=("build", "run"), when="@2.8") depends_on("py-gast@0.2.1:0.4", type=("build", "run"), when="@2.7") depends_on("py-gast@0.4.0", type=("build", "run"), when="@2.5:2.6") @@ -214,16 +226,11 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-h5py~mpi", type=("build", "run"), when="@1.15.5,2.0.4,2.1.3:~mpi") depends_on("hdf5+mpi", type="build", when="@1.15.5,2.0.4,2.1.3:+mpi") depends_on("hdf5~mpi", type="build", when="@1.15.5,2.0.4,2.1.3:~mpi") - depends_on("py-keras-preprocessing@1.1.1:", type=("build", "run"), when="@2.7:") - depends_on("py-keras-preprocessing@1.1.2:1.1", type=("build", "run"), when="@2.4:2.6") - depends_on("py-keras-preprocessing@1.1.1:1.1", type=("build", "run"), when="@2.3") - depends_on("py-keras-preprocessing@1.1:", type=("build", "run"), when="@2.1.0,2.2") - depends_on("py-keras-preprocessing@1.1.0", type=("build", "run"), when="@2.1.1:2.1") - depends_on("py-keras-preprocessing@1.0.5:", type=("build", "run"), when="@1.12:2.0") - depends_on("py-keras-preprocessing@1.0.3:", type=("build", "run"), when="@1.11") + depends_on("py-jax@0.3.15:", type=("build", "run"), when="@2.12:") depends_on("py-libclang@13:", type=("build", "run"), when="@2.9:") depends_on("py-libclang@9.0.1:", type=("build", "run"), when="@2.7:2.8") - depends_on("py-numpy@1.20:", type=("build", "run"), when="@2.8:") + depends_on("py-numpy@1.22:1.23", type=("build", "run"), when="@2.12:") + depends_on("py-numpy@1.20:", type=("build", "run"), when="@2.8:2.11") depends_on("py-numpy@1.14.5:", type=("build", "run"), when="@2.7") depends_on("py-numpy@1.19.2:1.19", type=("build", "run"), when="@2.4:2.6") # https://github.com/tensorflow/tensorflow/issues/40688 @@ -238,7 +245,8 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-opt-einsum@2.3.2:", type=("build", "run"), when="@1.15:2.3,2.7:") depends_on("py-opt-einsum@3.3", type=("build", "run"), when="@2.4:2.6") depends_on("py-packaging", type=("build", "run"), when="@2.9:") - depends_on("py-protobuf@3.9.2:", type=("build", "run"), when="@2.3:") + depends_on("py-protobuf@3.20.3:4.20,4.21.6:4", type=("build", "run"), when="@2.12:") + depends_on("py-protobuf@3.9.2:", type=("build", "run"), when="@2.3:2.11") depends_on("py-protobuf@3.8.0:", type=("build", "run"), when="@2.1:2.2") depends_on("py-protobuf@3.6.1:", type=("build", "run"), when="@1.12:2.0") depends_on("py-protobuf@3.6.0:", type=("build", "run"), when="@1.10:1.11") @@ -246,13 +254,16 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-protobuf@3.3.0:", type=("build", "run"), when="@1.3:1.4") depends_on("py-protobuf@3.2.0:", type=("build", "run"), when="@1.1:1.2") depends_on("py-protobuf@3.1.0:", type=("build", "run"), when="@:1.0") - depends_on("protobuf@:3.12", when="@:2.4") - depends_on("protobuf@:3.17") # https://github.com/protocolbuffers/protobuf/issues/10051 # https://github.com/tensorflow/tensorflow/issues/56266 - depends_on("py-protobuf@:3.19", type=("build", "run")) - depends_on("protobuf@:3.19", type=("build", "run")) - depends_on("py-setuptools", type="build") + depends_on("py-protobuf@:3.19", type=("build", "run"), when="@:2.11") + depends_on("py-protobuf+cpp", type=("build", "run")) + depends_on("protobuf@:3.21.9", when="@:2.12") + depends_on("protobuf@:3.19", when="@:2.11") + depends_on("protobuf@:3.17", when="@:2.11") + depends_on("protobuf@:3.12", when="@:2.4") + depends_on("protobuf", type=("build", "run")) + depends_on("py-setuptools", type=("build", "run")) depends_on("py-six@1.12:", type=("build", "run"), when="@2.1:2.3,2.7:") depends_on("py-six@1.15", type=("build", "run"), when="@2.4:2.6") depends_on("py-six@1.10:", type=("build", "run"), when="@:2.0") @@ -260,7 +271,8 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-termcolor@1.1", type=("build", "run"), when="@2.4:2.6") depends_on("py-typing-extensions@3.6.6:", type=("build", "run"), when="@2.7:") depends_on("py-typing-extensions@3.7.4:3.7", type=("build", "run"), when="@2.4:2.6") - depends_on("py-wrapt@1.11:", type=("build", "run"), when="@2.7:") + depends_on("py-wrapt@1.11:1.14", type=("build", "run"), when="@2.12:") + depends_on("py-wrapt@1.11:", type=("build", "run"), when="@2.7:2.11") depends_on("py-wrapt@1.12.1:1.12", type=("build", "run"), when="@2.4:2.6") depends_on("py-wrapt@1.11.1:", type=("build", "run"), when="@1.12.1,1.14:2.3") # TODO: add package for this dependency @@ -292,7 +304,7 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): depends_on("py-grpcio@1.32", type=("build", "run"), when="@2.4") depends_on("py-grpcio@1.8.6:", type=("build", "run"), when="@1.6:2.3") - for minor_ver in range(5, 11): + for minor_ver in range(5, 13): depends_on( "py-tensorboard@2.{}".format(minor_ver), type=("build", "run"), @@ -303,12 +315,22 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): # depends_on('py-tensorflow-estimator') # circular dep # depends_on('py-keras') # circular dep + # Undocumented dependencies + depends_on("py-requests", type=("build", "run")) + # No longer a dependency in latest versions depends_on("py-astor@0.6:", type=("build", "run"), when="@1.6:2.1") depends_on("py-backports-weakref@1.0rc1", type=("build", "run"), when="@1.2") depends_on("py-keras-applications@1.0.8:", type=("build", "run"), when="@1.15:2.1") depends_on("py-keras-applications@1.0.6:", type=("build", "run"), when="@1.12:1.14") depends_on("py-keras-applications@1.0.5:", type=("build", "run"), when="@1.11") + depends_on("py-keras-preprocessing@1.1.1:", type=("build", "run"), when="@2.7:2.10") + depends_on("py-keras-preprocessing@1.1.2:1.1", type=("build", "run"), when="@2.4:2.6") + depends_on("py-keras-preprocessing@1.1.1:1.1", type=("build", "run"), when="@2.3") + depends_on("py-keras-preprocessing@1.1:", type=("build", "run"), when="@2.1.0,2.2") + depends_on("py-keras-preprocessing@1.1.0", type=("build", "run"), when="@2.1.1:2.1") + depends_on("py-keras-preprocessing@1.0.5:", type=("build", "run"), when="@1.12:2.0") + depends_on("py-keras-preprocessing@1.0.3:", type=("build", "run"), when="@1.11") depends_on("py-scipy@1.4.1", type=("build", "run"), when="@2.1.0:2.1.1,2.2.0,2.3.0") depends_on("py-wheel@0.32:0", type=("build", "run"), when="@2.7") depends_on("py-wheel@0.35:0", type=("build", "run"), when="@2.4:2.6") @@ -412,6 +434,11 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): conflicts("~rocm", when="@2.7.4-rocm-enhanced") conflicts("+rocm", when="@:2.7.4-a,2.7.4.0:") + # https://www.tensorflow.org/install/source#tested_build_configurations + conflicts("%gcc@:9.3.0", when="@2.9:") + conflicts("%gcc@:7.3.0", when="@1.15:") + conflicts("%gcc@:4.7") + # zlib is vendored and downloaded directly from zlib.org (or mirrors), but # old downloads are removed from that site immediately after a new release. # If the tf mirrors don't work, make sure the fallback is to something existing. @@ -734,7 +761,21 @@ class PyTensorflow(Package, CudaPackage, ROCmPackage, PythonExtension): '"-U_FORTIFY_SOURCE", "-I%s",' % self.spec["protobuf"].prefix.include, "third_party/gpus/crosstool/BUILD.rocm.tpl", ) - if self.spec.satisfies("@2.3.0:"): + if self.spec.satisfies("@2.12:"): + filter_file( + 'genproto_deps.append("@com_google_protobuf//:well_known_types_py_pb2_genproto")', + "pass", + "tensorflow/tsl/platform/default/build_config.bzl", + string=True, + ) + if self.spec.satisfies("@2.11:"): + filter_file( + "deps = protodeps + well_known_proto_libs(),", + "deps = protodeps,", + "tensorflow/tsl/platform/default/build_config.bzl", + string=True, + ) + if self.spec.satisfies("@2.3:2.10"): filter_file( "deps = protodeps + well_known_proto_libs(),", "deps = protodeps,", -- cgit v1.2.3-60-g2f50