Skip to content

pytorch 2.7.1 #231018

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
41 changes: 22 additions & 19 deletions Formula/p/pytorch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

desc "Tensors and dynamic neural networks"
homepage "https://pytorch.org/"
url "https://github.com/pytorch/pytorch/releases/download/v2.5.1/pytorch-v2.5.1.tar.gz"
sha256 "740eb5fff95e33cfe699bad43be83523f569c7cc7f9c285c2a255416443dd266"
url "https://github.com/pytorch/pytorch/releases/download/v2.7.1/pytorch-v2.7.1.tar.gz"
sha256 "5befd2e540fd55ce4782d0ca7610ce5b572d756d7ea38090ef0f3c7c428fb20f"
license "BSD-3-Clause"
revision 4

livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end

no_autobump! because: :requires_manual_review

bottle do
sha256 cellar: :any, arm64_sequoia: "ec01ffac0aa0b57f68f549662c25d92a1dad3f2e339f7c3dc854170c17605971"
sha256 cellar: :any, arm64_sonoma: "5014d4b9765a0d095e999622a2d3dd11b86fe35cd3fdbd8326c650899ec9fba8"
Expand Down Expand Up @@ -44,18 +41,18 @@
end

resource "filelock" do
url "https://files.pythonhosted.org/packages/9d/db/3ef5bb276dae18d6ec2124224403d1d67bccdbefc17af4cc8f553e341ab1/filelock-3.16.1.tar.gz"
sha256 "c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"
url "https://files.pythonhosted.org/packages/0a/10/c23352565a6544bdc5353e0b15fc1c563352101f30e24bf500207a54df9a/filelock-3.18.0.tar.gz"
sha256 "adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2"
end

resource "fsspec" do
url "https://files.pythonhosted.org/packages/62/7c/12b0943011daaaa9c35c2a2e22e5eb929ac90002f08f1259d69aedad84de/fsspec-2024.9.0.tar.gz"
sha256 "4b0afb90c2f21832df142f292649035d80b421f60a9e1c027802e5a0da2b04e8"
url "https://files.pythonhosted.org/packages/00/f7/27f15d41f0ed38e8fcc488584b57e902b331da7f7c6dcda53721b15838fc/fsspec-2025.5.1.tar.gz"
sha256 "2e55e47a540b91843b755e83ded97c6e897fa0942b11490113f09e9c443c2475"
end

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

resource "markupsafe" do
Expand All @@ -69,8 +66,8 @@
end

resource "networkx" do
url "https://files.pythonhosted.org/packages/36/2b/20ad9eecdda3f1b0dc63fb8f82d2ea99163dbca08bfa392594fc2ed81869/networkx-3.4.1.tar.gz"
sha256 "f9df45e85b78f5bd010993e897b4f1fdb242c11e015b101bd951e5c0e29982d8"
url "https://files.pythonhosted.org/packages/6c/4f/ccdb8ad3a38e583f214547fd2f7ff1fc160c43a75af88e6aec213404b96a/networkx-3.5.tar.gz"
sha256 "d4c6f9cf81f52d69230866796b82afbccdec3db7ae4fbd1b65ea750feed50037"
end

resource "opt-einsum" do
Expand All @@ -84,26 +81,29 @@
end

resource "setuptools" do
url "https://files.pythonhosted.org/packages/07/37/b31be7e4b9f13b59cde9dcaeff112d401d49e0dc5b37ed4a9fc8fb12f409/setuptools-75.2.0.tar.gz"
sha256 "753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec"
url "https://files.pythonhosted.org/packages/18/5d/3bf57dcd21979b887f014ea83c24ae194cfcd12b9e0fda66b957c69d1fca/setuptools-80.9.0.tar.gz"
sha256 "f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c"
end

resource "sympy" do
url "https://files.pythonhosted.org/packages/ca/99/5a5b6f19ff9f083671ddf7b9632028436167cd3d33e11015754e41b249a4/sympy-1.13.1.tar.gz"
sha256 "9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f"
url "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz"
sha256 "d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517"
end

resource "typing-extensions" do
url "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz"
sha256 "1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"
url "https://files.pythonhosted.org/packages/98/5a/da40306b885cc8c09109dc2e1abd358d5684b1425678151cdaed4731c822/typing_extensions-4.14.1.tar.gz"
sha256 "38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36"
end

def install

Check failure on line 98 in Formula/p/pytorch.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew install --verbose --formula --build-bottle pytorch` failed on macOS Sonoma (14) on Apple Silicon!

Successfully installed setuptools-80.9.0 Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Running command Getting requirements to build wheel /private/tmp/pip-install-7g0zqmy5/setuptools-scm_0114bdef7bb644999f0038cdd4c999c6/src/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning: ERROR: setuptools==8.3.1 is used in combination with setuptools-scm>=8.x Your build configuration is incomplete and previously worked by accident! setuptools-scm requires setuptools>=61 Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools warnings.warn( /private/tmp/pip-build-env-bfsh7z58/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) /private/tmp/pip-build-env-bfsh7z58/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! dist._finalize_license_expression() /private/tmp/pip-build-env-bfsh7z58/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running egg_info writing src/setuptools_scm.egg-info/PKG-INFO writing dependency_links to src/setuptools_scm.egg-info/dependency_links.txt writing entry points to src/setuptools_scm.egg-info/entry_points.txt writing requirements to src/setuptools_scm.egg-info/requires.txt writing top-level names to src/setuptools_scm.egg-info/top_level.txt ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any reading manifest file 'src/setuptools_scm.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching '*.nix'

Check failure on line 98 in Formula/p/pytorch.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew install --verbose --formula --build-bottle pytorch` failed on macOS Ventura (13) on Apple Silicon!

Successfully installed setuptools-80.9.0 Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Running command Getting requirements to build wheel /private/tmp/pip-install-1vu_j5wn/setuptools-scm_fcf6ec987ac64ff4a829836443f573d4/src/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning: ERROR: setuptools==8.3.1 is used in combination with setuptools-scm>=8.x Your build configuration is incomplete and previously worked by accident! setuptools-scm requires setuptools>=61 Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools warnings.warn( /private/tmp/pip-build-env-5m0_qt15/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) /private/tmp/pip-build-env-5m0_qt15/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! dist._finalize_license_expression() /private/tmp/pip-build-env-5m0_qt15/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running egg_info writing src/setuptools_scm.egg-info/PKG-INFO writing dependency_links to src/setuptools_scm.egg-info/dependency_links.txt writing entry points to src/setuptools_scm.egg-info/entry_points.txt writing requirements to src/setuptools_scm.egg-info/requires.txt writing top-level names to src/setuptools_scm.egg-info/top_level.txt ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any reading manifest file 'src/setuptools_scm.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching '*.nix'

Check failure on line 98 in Formula/p/pytorch.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

`brew install --verbose --formula --build-bottle pytorch` failed on macOS Sequoia (15) on Apple Silicon!

Successfully installed setuptools-80.9.0 Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Running command Getting requirements to build wheel /private/tmp/pip-install-qx7kqx5_/setuptools-scm_8699824537cc45cd8b86535f9a7dbf41/src/setuptools_scm/_integration/setuptools.py:31: RuntimeWarning: ERROR: setuptools==8.3.1 is used in combination with setuptools-scm>=8.x Your build configuration is incomplete and previously worked by accident! setuptools-scm requires setuptools>=61 Suggested workaround if applicable: - migrating from the deprecated setup_requires mechanism to pep517/518 and using a pyproject.toml to declare build dependencies which are reliably pre-installed before running the build tools warnings.warn( /private/tmp/pip-build-env-xqhuuyak/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated !! ******************************************************************************** Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0). By 2026-Feb-18, you need to update your project and remove deprecated calls or your builds will no longer be supported. See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! corresp(dist, value, root_dir) /private/tmp/pip-build-env-xqhuuyak/overlay/lib/python3.13/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! dist._finalize_license_expression() /private/tmp/pip-build-env-xqhuuyak/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running egg_info writing src/setuptools_scm.egg-info/PKG-INFO writing dependency_links to src/setuptools_scm.egg-info/dependency_links.txt writing entry points to src/setuptools_scm.egg-info/entry_points.txt writing requirements to src/setuptools_scm.egg-info/requires.txt writing top-level names to src/setuptools_scm.egg-info/top_level.txt ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any reading manifest file 'src/setuptools_scm.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files found matching '*.nix'
python3 = "python3.13"

# Avoid building AVX512 code
inreplace "cmake/Modules/FindAVX.cmake", /^CHECK_SSE\(CXX "AVX512"/, "#\\0"

# avoid checking out disabled submodules
inreplace "tools/build_pytorch_libs.py", " checkout_nccl()", ""

ENV["ATEN_NO_TEST"] = "ON"
ENV["BLAS"] = "OpenBLAS"
ENV["BUILD_CUSTOM_PROTOBUF"] = "OFF"
Expand All @@ -123,6 +123,9 @@
ENV["USE_SYSTEM_SLEEF"] = "ON"
ENV["USE_MPS"] = "ON" if OS.mac?

# cmake 4 build patch for third parties
ENV["CMAKE_POLICY_VERSION_MINIMUM"] = "3.5"

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

Expand All @@ -137,7 +140,7 @@
(share/"cmake").install_symlink (torch/"share/cmake").children
end

test do

Check failure on line 143 in Formula/p/pytorch.rb

View workflow job for this annotation

GitHub Actions / Linux x86_64

`brew test --verbose pytorch` failed on Linux x86_64!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:54:in '<main>'
# test that C++ libraries are available
(testpath/"test.cpp").write <<~CPP
#include <torch/torch.h>
Expand Down
Loading