Skip to content

Commit 5c7dd84

Browse files
botantonydaeho-ro
authored andcommitted
pytorch 2.7.0
1 parent ecb4181 commit 5c7dd84

File tree

1 file changed

+37
-18
lines changed

1 file changed

+37
-18
lines changed

Formula/p/pytorch.rb

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ class Pytorch < Formula
33

44
desc "Tensors and dynamic neural networks"
55
homepage "https://pytorch.org/"
6-
url "https://github.com/pytorch/pytorch/releases/download/v2.5.1/pytorch-v2.5.1.tar.gz"
7-
sha256 "740eb5fff95e33cfe699bad43be83523f569c7cc7f9c285c2a255416443dd266"
6+
url "https://github.com/pytorch/pytorch/releases/download/v2.7.0/pytorch-v2.7.0.tar.gz"
7+
sha256 "ecca266fa2de4235a9fd5a18a33299a9de55ab3babb87f8c297c1c9ab8d436bd"
88
license "BSD-3-Clause"
9-
revision 4
109

1110
livecheck do
1211
url :stable
@@ -41,19 +40,29 @@ class Pytorch < Formula
4140
depends_on "libomp"
4241
end
4342

43+
# Fix to FileNotFoundError for `.ci/docker/ci_commit_pins/nccl-cu12.txt`
44+
# This resource is only used to get the `.ci` directory for the release artifact.
45+
# 1. Release artifact is missing `.ci` directory.
46+
# 2. Tag artifact is missing git submodules.
47+
# 3. Pulling tag revision takes too long.
48+
resource "pytorch-ci" do
49+
url "https://github.com/pytorch/pytorch/archive/refs/tags/v2.7.0.tar.gz"
50+
sha256 "994196e9bb12ffd5198e3b0fb3c479e3c6945674c79853f69c3c6330d2e62148"
51+
end
52+
4453
resource "filelock" do
45-
url "https://files.pythonhosted.org/packages/9d/db/3ef5bb276dae18d6ec2124224403d1d67bccdbefc17af4cc8f553e341ab1/filelock-3.16.1.tar.gz"
46-
sha256 "c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"
54+
url "https://files.pythonhosted.org/packages/0a/10/c23352565a6544bdc5353e0b15fc1c563352101f30e24bf500207a54df9a/filelock-3.18.0.tar.gz"
55+
sha256 "adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2"
4756
end
4857

4958
resource "fsspec" do
50-
url "https://files.pythonhosted.org/packages/62/7c/12b0943011daaaa9c35c2a2e22e5eb929ac90002f08f1259d69aedad84de/fsspec-2024.9.0.tar.gz"
51-
sha256 "4b0afb90c2f21832df142f292649035d80b421f60a9e1c027802e5a0da2b04e8"
59+
url "https://files.pythonhosted.org/packages/45/d8/8425e6ba5fcec61a1d16e41b1b71d2bf9344f1fe48012c2b48b9620feae5/fsspec-2025.3.2.tar.gz"
60+
sha256 "e52c77ef398680bbd6a98c0e628fbc469491282981209907bbc8aea76a04fdc6"
5261
end
5362

5463
resource "jinja2" do
55-
url "https://files.pythonhosted.org/packages/ed/55/39036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d/jinja2-3.1.4.tar.gz"
56-
sha256 "4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"
64+
url "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz"
65+
sha256 "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"
5766
end
5867

5968
resource "markupsafe" do
@@ -67,8 +76,8 @@ class Pytorch < Formula
6776
end
6877

6978
resource "networkx" do
70-
url "https://files.pythonhosted.org/packages/36/2b/20ad9eecdda3f1b0dc63fb8f82d2ea99163dbca08bfa392594fc2ed81869/networkx-3.4.1.tar.gz"
71-
sha256 "f9df45e85b78f5bd010993e897b4f1fdb242c11e015b101bd951e5c0e29982d8"
79+
url "https://files.pythonhosted.org/packages/fd/1d/06475e1cd5264c0b870ea2cc6fdb3e37177c1e565c43f56ff17a10e3937f/networkx-3.4.2.tar.gz"
80+
sha256 "307c3669428c5362aab27c8a1260aa8f47c4e91d3891f48be0141738d8d053e1"
7281
end
7382

7483
resource "opt-einsum" do
@@ -82,23 +91,28 @@ class Pytorch < Formula
8291
end
8392

8493
resource "setuptools" do
85-
url "https://files.pythonhosted.org/packages/07/37/b31be7e4b9f13b59cde9dcaeff112d401d49e0dc5b37ed4a9fc8fb12f409/setuptools-75.2.0.tar.gz"
86-
sha256 "753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec"
94+
url "https://files.pythonhosted.org/packages/bb/71/b6365e6325b3290e14957b2c3a804a529968c77a049b2ed40c095f749707/setuptools-79.0.1.tar.gz"
95+
sha256 "128ce7b8f33c3079fd1b067ecbb4051a66e8526e7b65f6cec075dfc650ddfa88"
8796
end
8897

8998
resource "sympy" do
90-
url "https://files.pythonhosted.org/packages/ca/99/5a5b6f19ff9f083671ddf7b9632028436167cd3d33e11015754e41b249a4/sympy-1.13.1.tar.gz"
91-
sha256 "9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f"
99+
url "https://files.pythonhosted.org/packages/11/8a/5a7fd6284fa8caac23a26c9ddf9c30485a48169344b4bd3b0f02fef1890f/sympy-1.13.3.tar.gz"
100+
sha256 "b27fd2c6530e0ab39e275fc9b683895367e51d5da91baa8d3d64db2565fec4d9"
92101
end
93102

94103
resource "typing-extensions" do
95-
url "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz"
96-
sha256 "1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"
104+
url "https://files.pythonhosted.org/packages/f6/37/23083fcd6e35492953e8d2aaaa68b860eb422b34627b13f2ce3eb6106061/typing_extensions-4.13.2.tar.gz"
105+
sha256 "e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"
97106
end
98107

99108
def install
100109
python3 = "python3.13"
101110

111+
# Install `.ci` directory for the release artifact.
112+
resource("pytorch-ci").stage do
113+
buildpath.install Dir[".ci"]
114+
end
115+
102116
# Avoid building AVX512 code
103117
inreplace "cmake/Modules/FindAVX.cmake", /^CHECK_SSE\(CXX "AVX512"/, "#\\0"
104118

@@ -113,6 +127,7 @@ def install
113127
ENV["USE_CCACHE"] = "OFF"
114128
ENV["USE_CUDA"] = "OFF"
115129
ENV["USE_DISTRIBUTED"] = "ON"
130+
ENV["USE_KLEIDIAI"] = "OFF" if Hardware::CPU.arm?
116131
ENV["USE_MKLDNN"] = "OFF"
117132
ENV["USE_NNPACK"] = "OFF"
118133
ENV["USE_OPENMP"] = "ON"
@@ -125,7 +140,11 @@ def install
125140
inreplace "caffe2/core/macros.h.in", "${CMAKE_CXX_COMPILER}", ENV.cxx
126141

127142
venv = virtualenv_create(libexec, python3)
128-
venv.pip_install resources
143+
venv.pip_install resources.reject { |r| r.name == "pytorch-ci" }
144+
145+
# Fix to error: a template argument list is expected after a name prefixed by the template keyword
146+
# [-Wmissing-template-arg-list-after-template-kw], from `third_party/tensorpipe/third_party/libnop`
147+
ENV.append_to_cflags "-Wno-missing-template-arg-list-after-template-kw"
129148
venv.pip_install_and_link(buildpath, build_isolation: false)
130149

131150
# Expose C++ API

0 commit comments

Comments
 (0)