Skip to content

pytorch 2.7.0 torchvision 0.22.0 #221347

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: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
55 changes: 37 additions & 18 deletions Formula/p/pytorch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

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.0/pytorch-v2.7.0.tar.gz"
sha256 "ecca266fa2de4235a9fd5a18a33299a9de55ab3babb87f8c297c1c9ab8d436bd"
license "BSD-3-Clause"
revision 4

livecheck do
url :stable
Expand Down Expand Up @@ -41,19 +40,29 @@
depends_on "libomp"
end

# Fix to FileNotFoundError for `.ci/docker/ci_commit_pins/nccl-cu12.txt`
# This resource is only used to get the `.ci` directory for the release artifact.
# 1. Release artifact is missing `.ci` directory.
# 2. Tag artifact is missing git submodules.
# 3. Pulling tag revision takes too long.
resource "pytorch-ci" do
url "https://github.com/pytorch/pytorch/archive/refs/tags/v2.7.0.tar.gz"
sha256 "994196e9bb12ffd5198e3b0fb3c479e3c6945674c79853f69c3c6330d2e62148"
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/45/d8/8425e6ba5fcec61a1d16e41b1b71d2bf9344f1fe48012c2b48b9620feae5/fsspec-2025.3.2.tar.gz"
sha256 "e52c77ef398680bbd6a98c0e628fbc469491282981209907bbc8aea76a04fdc6"
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 @@ -67,8 +76,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/fd/1d/06475e1cd5264c0b870ea2cc6fdb3e37177c1e565c43f56ff17a10e3937f/networkx-3.4.2.tar.gz"
sha256 "307c3669428c5362aab27c8a1260aa8f47c4e91d3891f48be0141738d8d053e1"
end

resource "opt-einsum" do
Expand All @@ -82,23 +91,28 @@
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/bb/71/b6365e6325b3290e14957b2c3a804a529968c77a049b2ed40c095f749707/setuptools-79.0.1.tar.gz"
sha256 "128ce7b8f33c3079fd1b067ecbb4051a66e8526e7b65f6cec075dfc650ddfa88"
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/11/8a/5a7fd6284fa8caac23a26c9ddf9c30485a48169344b4bd3b0f02fef1890f/sympy-1.13.3.tar.gz"
sha256 "b27fd2c6530e0ab39e275fc9b683895367e51d5da91baa8d3d64db2565fec4d9"
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/f6/37/23083fcd6e35492953e8d2aaaa68b860eb422b34627b13f2ce3eb6106061/typing_extensions-4.13.2.tar.gz"
sha256 "e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"
end

def install
python3 = "python3.13"

# Install `.ci` directory for the release artifact.
resource("pytorch-ci").stage do
buildpath.install ".ci"
end

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

Expand All @@ -113,6 +127,7 @@
ENV["USE_CCACHE"] = "OFF"
ENV["USE_CUDA"] = "OFF"
ENV["USE_DISTRIBUTED"] = "ON"
ENV["USE_KLEIDIAI"] = "OFF" if Hardware::CPU.arm?
ENV["USE_MKLDNN"] = "OFF"
ENV["USE_NNPACK"] = "OFF"
ENV["USE_OPENMP"] = "ON"
Expand All @@ -125,7 +140,11 @@
inreplace "caffe2/core/macros.h.in", "${CMAKE_CXX_COMPILER}", ENV.cxx

venv = virtualenv_create(libexec, python3)
venv.pip_install resources
venv.pip_install resources.reject { |r| r.name == "pytorch-ci" }

# Fix to error: a template argument list is expected after a name prefixed by the template keyword
# [-Wmissing-template-arg-list-after-template-kw], from `third_party/tensorpipe/third_party/libnop`
ENV.append_to_cflags "-Wno-missing-template-arg-list-after-template-kw"
venv.pip_install_and_link(buildpath, build_isolation: false)

# Expose C++ API
Expand All @@ -135,7 +154,7 @@
(share/"cmake").install_symlink (torch/"share/cmake").children
end

test do

Check failure on line 157 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>'

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

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

`brew test --verbose pytorch` failed on macOS Ventura (13)!

/usr/local/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
5 changes: 2 additions & 3 deletions Formula/t/torchvision.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

desc "Datasets, transforms, and models for computer vision"
homepage "https://pytorch.org/vision/stable/index.html"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.20.1.tar.gz"
sha256 "7e08c7f56e2c89859310e53d898f72bccc4987cd83e08cfd6303513da15a9e71"
url "https://github.com/pytorch/vision/archive/refs/tags/v0.22.0.tar.gz"
sha256 "83ed8855cdfb138aba6f116f8fd8da8b83463170dad67a70f60327915ed12014"
license "BSD-3-Clause"
revision 3

livecheck do
url :stable
Expand All @@ -32,7 +31,7 @@
depends_on "pillow"
depends_on "pytorch"

def install

Check failure on line 34 in Formula/t/torchvision.rb

View workflow job for this annotation

GitHub Actions / Linux x86_64

`brew install --verbose --formula --build-bottle torchvision` failed on Linux x86_64!

Running command Preparing metadata (pyproject.toml) WARNING: All log messages before absl::InitializeLog() is called are written to STDERR E0000 00:00:1745771208.400580 48813 descriptor_database.cc:550] Invalid file descriptor data passed to EncodedDescriptorDatabase::Add(). F0000 00:00:1745771208.400607 48813 descriptor.cc:2248] Check failed: GeneratedDatabase()->Add(encoded_file_descriptor, size) *** Check failure stack trace: *** error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: -6 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /home/linuxbrew/.linuxbrew/Cellar/torchvision/0.22.0/libexec/bin/python /home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.13.3/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /var/tmp/tmpsobkbu3p cwd: /var/tmp/torchvision-20250427-48385-pwokd/vision-0.22.0 Preparing metadata (pyproject.toml): finished with status 'error' error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ==> Formula Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/t/torchvision.rb ==> Configuration HOMEBREW_VERSION: 4.4.32-67-g0e7f19f ORIGIN: https://github.com/Homebrew/brew HEAD: 0e7f19f2f1a7ab83f7e9bef77a46be2002cbbafe Last commit: 2 days ago Branch: master Core tap HEAD: b85b2c6cd91e8ad79003d0f7dee8ddd332494b3f Core tap last commit: 2 hours ago Core tap JSON: 27 Apr 14:58 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /github/home/bottles/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.4.3 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.4.3/bin/ruby CPU: quad-core 64-bit zen3 Clang: N/A Git: 2.49.0 => /usr/bin/git Curl: 7.81.0 => /usr/bin/curl Kernel: Linux 6.11.0-1012-azure x86_64 GNU/Linux OS: Ubuntu 22.04.5 LTS Host glibc: 2.35 /usr/bin/gcc: 11.4.0 /usr/bin/ruby: N/A glibc: N/A gcc@11: N/A gcc: 14.2.0_1 xorg: N/A ==> ENV HOMEBREW_CC: gcc-11 HOMEBREW_CXX: g++-11 MAKEFLAGS: -j4 CMAKE_PREFIX_PATH: /home/linuxbrew/.linuxbrew/opt/binutils:/home/linuxbrew/.linuxbrew/opt/berkeley-db@5:/home/linuxbrew/.linuxbrew PKG_CONFIG_PATH: /home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/jpeg-turbo/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/zlib/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libpng/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/gmp/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/isl/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/mpfr/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/lz4/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/xz/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/zstd/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/openblas/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/bzip2/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/freetype/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libimagequant/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/fribidi/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/expat/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/libxcrypt/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/ncurses/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/readline/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/sqlite/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/util-linux/lib/pkgconfig:/home/linuxbrew/.linuxbrew/opt/fontconfig/lib/pkgconfig:/home/linuxbr

Check failure on line 34 in Formula/t/torchvision.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

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

==> python3.13 -m pip --python=/usr/local/Cellar/torchvision/0.22.0/libexec/bin/python install --verbose --no-deps --no-binary=:all: --ignore-installed --no-compile --no-build-isolation /private/tmp/torchvision-20250427-46586-q5tmw1/vision-0.22.0 Using pip 25.0.1 from /usr/local/Cellar/[email protected]/3.13.3/lib/python3.13/site-packages/pip (python 3.13) Processing /private/tmp/torchvision-20250427-46586-q5tmw1/vision-0.22.0 Preparing metadata (pyproject.toml): started Running command Preparing metadata (pyproject.toml) error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: -6 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /usr/local/Cellar/torchvision/0.22.0/libexec/bin/python /usr/local/Cellar/[email protected]/3.13.3/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /private/tmp/tmpc4eoo4my cwd: /private/tmp/torchvision-20250427-46586-q5tmw1/vision-0.22.0 Preparing metadata (pyproject.toml): finished with status 'error' error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ==> Formula Path: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/t/torchvision.rb ==> Configuration HOMEBREW_VERSION: 4.4.32-67-g0e7f19f ORIGIN: https://github.com/Homebrew/brew HEAD: 0e7f19f2f1a7ab83f7e9bef77a46be2002cbbafe Last commit: 2 days ago Branch: master Core tap HEAD: b85b2c6cd91e8ad79003d0f7dee8ddd332494b3f Core tap last commit: 2 hours ago Core tap JSON: 27 Apr 15:00 UTC Core cask tap JSON: 27 Apr 15:00 UTC HOMEBREW_PREFIX: /usr/local HOMEBREW_CACHE: /Users/brew/Library/Caches/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/logs HOMEBREW_MAKE_JOBS: 6 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set HOMEBREW_NO_INSTALL_FROM_API: set HOMEBREW_SORBET_RUNTIME: set HOMEBREW_VERIFY_ATTESTATIONS: set Homebrew Ruby: 3.4.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.4.3/bin/ruby CPU: hexa-core 64-bit penryn Clang: 15.0.0 build 1500 Git: 2.39.3 => /usr/bin/git Curl: 8.7.1 => /usr/bin/curl macOS: 13.7.5-x86_64 CLT: 15.1.0.0.1.1700200546 Xcode: 15.2 ==> ENV HOMEBREW_CC: clang HOMEBREW_CXX: clang++ MAKEFLAGS: -j6 CMAKE_PREFIX_PATH: /usr/local/opt/openblas:/usr/local/opt/icu4c@77:/usr/local/opt/libomp:/usr/local CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries CMAKE_FRAMEWORK_PATH: /usr/local/opt/[email protected]/Frameworks PKG_CONFIG_PATH: /usr/local/opt/[email protected]/lib/pkgconfig:/usr/local/opt/jpeg-turbo/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/gmp/lib/pkgconfig:/usr/local/opt/isl/lib/pkgconfig:/usr/local/opt/mpfr/lib/pkgconfig:/usr/local/opt/lz4/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/zstd/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/libimagequant/lib/pkgconfig:/usr/local/opt/fribidi/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/pcre2/lib/pkgconfig:/usr/local/opt/glib/lib/pkgconfig:/usr/local/opt/libxau/lib/pkgconfig:/usr/local/opt/libxdmcp/lib/pkgconfig:/usr/local/opt/libxcb/lib/pkgconfig:/usr/local/opt/libx11/lib/pkgconfig:/usr/local/opt/libxext/lib/pkgconfig:/usr/local/opt/libxrender/lib/
# Avoid overlinking to `abseil`, `libomp` and `protobuf`
args = OS.mac? ? ["-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-dead_strip_dylibs"] : []

Expand Down
Loading