PyTorch: add v2.7.0 (#50195)
* PyTorch: add v2.7.0 * py-torchaudio: add v2.7.0 * Fix rpath issues * PyTorch: disable libomp linking and fix rpath issue
This commit is contained in:
parent
d640ce74e0
commit
c633149874
@ -12,6 +12,7 @@ class PySympy(PythonPackage):
|
||||
|
||||
license("BSD-3-Clause")
|
||||
|
||||
version("1.13.3", sha256="b27fd2c6530e0ab39e275fc9b683895367e51d5da91baa8d3d64db2565fec4d9")
|
||||
version("1.13.1", sha256="9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f")
|
||||
version("1.13.0", sha256="3b6af8f4d008b9a1a6a4268b335b984b23835f26d1d60b0526ebc71d48a25f57")
|
||||
version("1.12", sha256="ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8")
|
||||
|
14
var/spack/repos/builtin/packages/py-torch/macos_rpath.patch
Normal file
14
var/spack/repos/builtin/packages/py-torch/macos_rpath.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 61ee9363fc2..db476913d31 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -720,9 +720,6 @@ class build_ext(setuptools.command.build_ext.build_ext):
|
||||
# It's an old-style class in Python 2.7...
|
||||
setuptools.command.build_ext.build_ext.run(self)
|
||||
|
||||
- if IS_DARWIN:
|
||||
- self._embed_libomp()
|
||||
-
|
||||
# Copy the essential export library to compile C++ extensions.
|
||||
if IS_WINDOWS:
|
||||
build_temp = self.build_temp
|
@ -26,6 +26,7 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
tags = ["e4s"]
|
||||
|
||||
version("main", branch="main")
|
||||
version("2.7.0", tag="v2.7.0", commit="134179474539648ba7dee1317959529fbd0e7f89")
|
||||
version("2.6.0", tag="v2.6.0", commit="1eba9b3aa3c43f86f4a2c807ac8e12c4a7767340")
|
||||
version("2.5.1", tag="v2.5.1", commit="a8d6afb511a69687bbb2b7e88a3cf67917e1697e")
|
||||
version("2.5.0", tag="v2.5.0", commit="32f585d9346e316e554c8d9bf7548af9f62141fc")
|
||||
@ -177,7 +178,8 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
depends_on("py-typing-extensions@4.8:", when="@2.2:")
|
||||
depends_on("py-typing-extensions@3.6.2.1:", when="@1.7:")
|
||||
depends_on("py-setuptools")
|
||||
depends_on("py-sympy@1.13.1", when="@2.5:")
|
||||
depends_on("py-sympy@1.13.3:", when="@2.7:")
|
||||
depends_on("py-sympy@1.13.1", when="@2.5:2.6")
|
||||
depends_on("py-sympy", when="@2:")
|
||||
depends_on("py-networkx", when="@2:")
|
||||
depends_on("py-jinja2", when="@2:")
|
||||
@ -196,7 +198,7 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
depends_on("blas")
|
||||
depends_on("lapack")
|
||||
|
||||
# Third party dependencies
|
||||
# third_party
|
||||
depends_on("fp16@2020-05-14", when="@1.6:")
|
||||
depends_on("fxdiv@2020-04-17", when="@1.6:")
|
||||
depends_on("nvtx@3.1.0", when="@2.6:")
|
||||
@ -265,7 +267,8 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
depends_on("py-pybind11@2.10.0:", when="@1.13:1")
|
||||
depends_on("py-pybind11@2.6.2:", when="@1.8:1.12")
|
||||
depends_on("py-pybind11@2.3.0:", when="@:1.7")
|
||||
depends_on("sleef@3.6.0_2024-03-20", when="@2.4:")
|
||||
depends_on("sleef@3.7.0_2024-12-06", when="@2.7:")
|
||||
depends_on("sleef@3.6.0_2024-03-20", when="@2.4:2.6")
|
||||
depends_on("sleef@3.5.1_2020-12-22", when="@1.8:2.3")
|
||||
depends_on("sleef@3.4.0_2019-07-30", when="@1.6:1.7")
|
||||
|
||||
@ -325,6 +328,9 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
|
||||
conflicts("%gcc@:9.3", when="@2.2:", msg="C++17 support required")
|
||||
|
||||
# https://github.com/pytorch/pytorch/issues/151592
|
||||
patch("macos_rpath.patch", when="@2.7:")
|
||||
|
||||
# https://github.com/pytorch/pytorch/issues/151316
|
||||
patch(
|
||||
"https://github.com/pytorch/pytorch/pull/151344.patch?full_index=1",
|
||||
@ -335,10 +341,9 @@ class PyTorch(PythonPackage, CudaPackage, ROCmPackage):
|
||||
|
||||
# https://github.com/pytorch/pytorch/issues/146239
|
||||
patch(
|
||||
"https://github.com/pytorch/pytorch/pull/140275.patch?full_index=1",
|
||||
sha256="65f56305a27d47d7065711d1131c6ac1611fabcb55b129c27ed6beabe4b94fe0",
|
||||
"https://github.com/pytorch/pytorch/pull/146637.patch?full_index=1",
|
||||
sha256="f93aa66e2cf9c0febdbcf72f44213a213e570e5f860186e81c92c8d2af0857c0",
|
||||
when="@2.6:",
|
||||
reverse=True,
|
||||
)
|
||||
|
||||
# https://github.com/pytorch/pytorch/issues/90448
|
||||
@ -563,6 +568,10 @@ def enable_or_disable(variant, keyword="USE", var=None):
|
||||
elif "~" + variant in self.spec:
|
||||
env.set(keyword + "_" + var, "OFF")
|
||||
|
||||
# https://github.com/pytorch/pytorch/issues/151592
|
||||
if self.spec.satisfies("@:2.6"):
|
||||
env.set("PACKAGE_TYPE", "conda")
|
||||
|
||||
# Build in parallel to speed up build times
|
||||
env.set("MAX_JOBS", str(make_jobs))
|
||||
|
||||
|
@ -17,6 +17,7 @@ class PyTorchaudio(PythonPackage):
|
||||
maintainers("adamjstewart")
|
||||
|
||||
version("main", branch="main")
|
||||
version("2.7.0", tag="v2.7.0", commit="654fee8fd17784271be1637eac1293fd834b4e9a")
|
||||
version("2.6.0", tag="v2.6.0", commit="d8831425203385077a03c1d92cfbbe3bf2106008")
|
||||
version("2.5.1", tag="v2.5.1", commit="1661daf10599ca8889f092ec37814fabbe202bb0")
|
||||
version("2.5.0", tag="v2.5.0", commit="56bc006d56a0d4960de6a1e0b6340cba4eda05cd")
|
||||
@ -76,6 +77,7 @@ class PyTorchaudio(PythonPackage):
|
||||
depends_on("python@:3.8", when="@:0.7.0")
|
||||
|
||||
depends_on("py-torch@main", when="@main")
|
||||
depends_on("py-torch@2.7.0", when="@2.7.0")
|
||||
depends_on("py-torch@2.6.0", when="@2.6.0")
|
||||
depends_on("py-torch@2.5.1", when="@2.5.1")
|
||||
depends_on("py-torch@2.5.0", when="@2.5.0")
|
||||
@ -149,13 +151,6 @@ def patch(self):
|
||||
string=True,
|
||||
)
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
# https://github.com/pytorch/vision/issues/8653
|
||||
if name == "ldflags":
|
||||
if self.spec.satisfies("%apple-clang@15:"):
|
||||
flags.append("-Wl,-ld_classic")
|
||||
return (flags, None, None)
|
||||
|
||||
def setup_build_environment(self, env: EnvironmentModifications) -> None:
|
||||
# tools/setup_helpers/extension.py
|
||||
env.set("BUILD_SOX", "0")
|
||||
|
@ -18,6 +18,7 @@ class PyTorchvision(PythonPackage):
|
||||
license("BSD-3-Clause")
|
||||
|
||||
version("main", branch="main")
|
||||
version("0.22.0", sha256="83ed8855cdfb138aba6f116f8fd8da8b83463170dad67a70f60327915ed12014")
|
||||
version("0.21.0", sha256="0a4a967bbb7f9810f792cd0289a07fb98c8fb5d1303fae8b63e3a6b05d720058")
|
||||
version("0.20.1", sha256="7e08c7f56e2c89859310e53d898f72bccc4987cd83e08cfd6303513da15a9e71")
|
||||
version("0.20.0", sha256="b59d9896c5c957c6db0018754bbd17d079c5102b82b9be0b438553b40a7b6029")
|
||||
@ -82,6 +83,7 @@ class PyTorchvision(PythonPackage):
|
||||
|
||||
# https://github.com/pytorch/vision#installation
|
||||
depends_on("py-torch@main", when="@main")
|
||||
depends_on("py-torch@2.7.0", when="@0.22.0")
|
||||
depends_on("py-torch@2.6.0", when="@0.21.0")
|
||||
depends_on("py-torch@2.5.1", when="@0.20.1")
|
||||
depends_on("py-torch@2.5.0", when="@0.20.0")
|
||||
@ -166,13 +168,6 @@ class PyTorchvision(PythonPackage):
|
||||
# Many of the datasets require additional dependencies to use.
|
||||
# These can be installed after the fact.
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
# https://github.com/pytorch/vision/issues/8653
|
||||
if name == "ldflags":
|
||||
if self.spec.satisfies("%apple-clang@15:"):
|
||||
flags.append("-Wl,-ld_classic")
|
||||
return (flags, None, None)
|
||||
|
||||
def setup_build_environment(self, env: EnvironmentModifications) -> None:
|
||||
# The only documentation on building is what is found in setup.py and:
|
||||
# https://github.com/pytorch/vision/blob/main/CONTRIBUTING.md#development-installation
|
||||
|
@ -17,9 +17,12 @@ class Sleef(CMakePackage):
|
||||
license("BSL-1.0")
|
||||
|
||||
version("master", branch="master")
|
||||
version("3.7.0_2024-12-06", commit="56e1f79cb140fb9326d612d0be06b5250565cade") # py-torch@2.7:
|
||||
version("3.7.0", commit="c5494730bf601599a55f4e77f357b51ba590585e", preferred=True)
|
||||
version("3.6.1", commit="6ee14bcae5fe92c2ff8b000d5a01102dab08d774")
|
||||
version("3.6.0_2024-03-20", commit="60e76d2bce17d278b439d9da17177c8f957a9e9b") # py-torch@2.4:
|
||||
version(
|
||||
"3.6.0_2024-03-20", commit="60e76d2bce17d278b439d9da17177c8f957a9e9b"
|
||||
) # py-torch@2.4:2.6
|
||||
version("3.6.0", commit="a99491afee2bae0b11e9ffbf3211349f43a5fd10")
|
||||
version(
|
||||
"3.5.1_2020-12-22", commit="e0a003ee838b75d11763aa9c3ef17bf71a725bff"
|
||||
|
Loading…
Reference in New Issue
Block a user