Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytorch 2.5.0 torchvision 0.20.0 #194877

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions Formula/p/pytorch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class Pytorch < Formula

desc "Tensors and dynamic neural networks"
homepage "https://pytorch.org/"
url "https://github.com/pytorch/pytorch/releases/download/v2.4.1/pytorch-v2.4.1.tar.gz"
sha256 "39666a43c0c10f5fd46c1a7ca95dc74d3bc39de2678b70066481cbf02e58384f"
url "https://github.com/pytorch/pytorch/releases/download/v2.5.0/pytorch-v2.5.0.tar.gz"
sha256 "91b3ba7db9cd6ac48f672a615872dcf1e4c29783d9c615336b11553915d5298a"
license "BSD-3-Clause"

livecheck do
Expand All @@ -23,7 +23,7 @@ class Pytorch < Formula

depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "python@3.12" => [:build, :test]
depends_on "python@3.13" => [:build, :test]
depends_on xcode: :build
depends_on "abseil"
depends_on "eigen"
Expand Down Expand Up @@ -56,8 +56,8 @@ class Pytorch < Formula
end

resource "markupsafe" do
url "https://files.pythonhosted.org/packages/87/5b/aae44c6655f3801e81aa3eef09dbbf012431987ba564d7231722f68df02d/MarkupSafe-2.1.5.tar.gz"
sha256 "d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"
url "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz"
sha256 "ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0"
end

resource "mpmath" do
Expand All @@ -66,19 +66,13 @@ class Pytorch < Formula
end

resource "networkx" do
url "https://files.pythonhosted.org/packages/04/e6/b164f94c869d6b2c605b5128b7b0cfe912795a87fc90e78533920001f3ec/networkx-3.3.tar.gz"
sha256 "0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9"
url "https://files.pythonhosted.org/packages/36/2b/20ad9eecdda3f1b0dc63fb8f82d2ea99163dbca08bfa392594fc2ed81869/networkx-3.4.1.tar.gz"
sha256 "f9df45e85b78f5bd010993e897b4f1fdb242c11e015b101bd951e5c0e29982d8"
end

resource "opt-einsum" do
url "https://files.pythonhosted.org/packages/7d/bf/9257e53a0e7715bc1127e15063e831f076723c6cd60985333a1c18878fb8/opt_einsum-3.3.0.tar.gz"
sha256 "59f6475f77bbc37dcf7cd748519c0ec60722e91e63ca114e68821c0c54a46549"

# Backport ConfigParser fix for Python 3.12 support
patch do
url "https://github.com/dgasmith/opt_einsum/commit/7c8f193f90b6771a6b3065bb5cf6ec2747af8209.patch?full_index=1"
sha256 "7c90ac470278deca8aa9d7ecb4bb2b31a2f79928e1783ae1316fcc3aa81f348a"
end
url "https://files.pythonhosted.org/packages/8c/b9/2ac072041e899a52f20cf9510850ff58295003aa75525e58343591b0cbfb/opt_einsum-3.4.0.tar.gz"
sha256 "96ca72f1b886d148241348783498194c577fa30a8faac108586b14f1ba4473ac"
end

resource "pyyaml" do
Expand All @@ -87,13 +81,13 @@ class Pytorch < Formula
end

resource "setuptools" do
url "https://files.pythonhosted.org/packages/27/b8/f21073fde99492b33ca357876430822e4800cdf522011f18041351dfa74b/setuptools-75.1.0.tar.gz"
sha256 "d59a21b17a275fb872a9c3dae73963160ae079f1049ed956880cd7c09b120538"
url "https://files.pythonhosted.org/packages/07/37/b31be7e4b9f13b59cde9dcaeff112d401d49e0dc5b37ed4a9fc8fb12f409/setuptools-75.2.0.tar.gz"
sha256 "753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec"
end

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

resource "typing-extensions" do
Expand All @@ -102,7 +96,7 @@ class Pytorch < Formula
end

def install
python3 = "python3.12"
python3 = "python3.13"

# Avoid building AVX512 code
inreplace "cmake/Modules/FindAVX.cmake", /^CHECK_SSE\(CXX "AVX512"/, "#\\0"
Expand All @@ -126,11 +120,6 @@ def install
ENV["USE_SYSTEM_SLEEF"] = "ON"
ENV["USE_MPS"] = "ON" if OS.mac?

# Work around superenv removing `-Werror=` but leaving `-Wno-error=` breaking flag detection
if ENV.compiler.to_s.start_with?("gcc")
inreplace "CMakeLists.txt", /^\s*append_cxx_flag_if_supported\(\s*"-Wno-error=inconsistent-missing-[^)]*\)/, ""
end

# Avoid references to Homebrew shims
inreplace "caffe2/core/macros.h.in", "${CMAKE_CXX_COMPILER}", ENV.cxx

Expand Down
12 changes: 6 additions & 6 deletions Formula/t/torchvision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ class Torchvision < Formula

desc "Datasets, transforms, and models for computer vision"
homepage "https://github.com/pytorch/vision"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.19.1.tar.gz"
sha256 "083e75c467285595ec3eb3c7aa8493c19e53d7eb42f13046fb56a07c8897e5a8"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.20.0.tar.gz"
sha256 "b59d9896c5c957c6db0018754bbd17d079c5102b82b9be0b438553b40a7b6029"
license "BSD-3-Clause"

livecheck do
Expand All @@ -23,7 +23,7 @@ class Torchvision < Formula

depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "python@3.12" => [:build, :test]
depends_on "python@3.13" => [:build, :test]
depends_on "abseil"
depends_on "certifi"
depends_on "jpeg-turbo"
Expand All @@ -44,10 +44,10 @@ def install

jpeg = Formula["jpeg-turbo"]
inreplace "setup.py",
"(jpeg_found, jpeg_conda, jpeg_include, jpeg_lib) = find_library(\"jpeglib\", vision_include)",
"(jpeg_found, jpeg_conda, jpeg_include, jpeg_lib) = (True, False, \"#{jpeg.include}\", \"#{jpeg.lib}\")"
'jpeg_found, jpeg_include_dir, jpeg_library_dir = find_library(header="jpeglib.h")',
"jpeg_found, jpeg_include_dir, jpeg_library_dir = True, '#{jpeg.include}', '#{jpeg.lib}'"

python3 = "python3.12"
python3 = "python3.13"
venv = virtualenv_create(libexec, python3)
venv.pip_install resources

Expand Down
Loading