summaryrefslogtreecommitdiff
path: root/misc/py-pytorch
diff options
context:
space:
mode:
Diffstat (limited to 'misc/py-pytorch')
-rw-r--r--misc/py-pytorch/Makefile17
-rw-r--r--misc/py-pytorch/distinfo6
-rw-r--r--misc/py-pytorch/files/patch-CMakeLists.txt10
-rw-r--r--misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp10
-rw-r--r--misc/py-pytorch/files/patch-tools_build__pytorch__libs.py15
5 files changed, 29 insertions, 29 deletions
diff --git a/misc/py-pytorch/Makefile b/misc/py-pytorch/Makefile
index 19d73b755f1a..06d9acce8750 100644
--- a/misc/py-pytorch/Makefile
+++ b/misc/py-pytorch/Makefile
@@ -1,7 +1,7 @@
PORTNAME= pytorch
DISTVERSIONPREFIX= v
-DISTVERSION= 2.7.1
-PORTREVISION= 2
+DISTVERSION= 2.8.0
+PORTREVISION= 3
CATEGORIES= misc # machine-learning
MASTER_SITES= https://github.com/pytorch/pytorch/releases/download/v${DISTVERSION}/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -50,6 +50,7 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}astunparse>0:devel/py-astunparse@${PY_FLAVO
USES= compiler:c++17-lang localbase:ldflags python
USE_PYTHON= distutils autoplist
+USE_LDCONFIG= ${PYTHON_SITELIBDIR}/torch/lib
USE_GITHUB= nodefault
GH_TUPLE= pytorch:cpuinfo:1e83a2f:cpuinfo/cpuinfo-with-freebsd-support # https://github.com/pytorch/cpuinfo/pull/230/commits
@@ -71,6 +72,14 @@ POST_PLIST= fix-plist
TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
TEST_WRKSRC= ${WRKSRC}/test
+OPTIONS_DEFINE= VULKAN
+OPTIONS_DEFAULT= VULKAN # VULKAN is experimental in PyTorch and only simple computations work
+
+VULKAN_MAKE_ENV= USE_VULKAN=1 USE_VULKAN_SHADERC_RUNTIME=1 USE_VULKAN_WRAPPER=0 # see https://docs.pytorch.org/tutorials/unstable/vulkan_workflow.html
+VULKAN_BUILD_DEPENDS= glslc:graphics/shaderc \
+ vulkan-headers>0:graphics/vulkan-headers
+VULKAN_LIB_DEPENDS= libvulkan.so:graphics/vulkan-loader
+
.include <bsd.port.options.mk>
.if ${OPSYS} == FreeBSD
@@ -79,9 +88,9 @@ USES+= llvm:max=15
post-patch:
@cd ${WRKSRC} && \
- ${RM} -r third_party/cpuinfo third_party/fbgemm/third_party/cpuinfo && \
+ ${RM} -r third_party/cpuinfo third_party/fbgemm/external/cpuinfo && \
${CP} -r cpuinfo-with-freebsd-support third_party/cpuinfo && \
- ${CP} -r cpuinfo-with-freebsd-support third_party/fbgemm/third_party/cpuinfo
+ ${CP} -r cpuinfo-with-freebsd-support third_party/fbgemm/external/cpuinfo
post-install: # strip binaries
@${STRIP_CMD} \
diff --git a/misc/py-pytorch/distinfo b/misc/py-pytorch/distinfo
index 40aad9e52cc9..83e007ea33e1 100644
--- a/misc/py-pytorch/distinfo
+++ b/misc/py-pytorch/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1749972703
-SHA256 (pytorch/pytorch-v2.7.1.tar.gz) = 5befd2e540fd55ce4782d0ca7610ce5b572d756d7ea38090ef0f3c7c428fb20f
-SIZE (pytorch/pytorch-v2.7.1.tar.gz) = 285998076
+TIMESTAMP = 1755586021
+SHA256 (pytorch/pytorch-v2.8.0.tar.gz) = c70a2c9488f6f6e8af5982a10d1cc2c37b7df5e6506d839daa5d5e250953d7b5
+SIZE (pytorch/pytorch-v2.8.0.tar.gz) = 330943132
SHA256 (pytorch/pytorch-cpuinfo-1e83a2f_GH0.tar.gz) = b8945cf45d4f13054d7f52e8bd9314690ea840d4d0ff21febd95ff04de3c613e
SIZE (pytorch/pytorch-cpuinfo-1e83a2f_GH0.tar.gz) = 3541839
diff --git a/misc/py-pytorch/files/patch-CMakeLists.txt b/misc/py-pytorch/files/patch-CMakeLists.txt
index 2a92cee61cdc..f7b4af5cd8d0 100644
--- a/misc/py-pytorch/files/patch-CMakeLists.txt
+++ b/misc/py-pytorch/files/patch-CMakeLists.txt
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig 2025-04-23 16:19:35 UTC
+--- CMakeLists.txt.orig 2025-08-06 17:08:00 UTC
+++ CMakeLists.txt
-@@ -182,7 +182,7 @@ set(CPU_POWER OFF)
+@@ -173,7 +173,7 @@ set(CPU_POWER OFF)
set(CPU_INTEL OFF)
set(CPU_POWER OFF)
@@ -9,7 +9,7 @@
set(CPU_INTEL ON)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)")
set(CPU_AARCH64 ON)
-@@ -212,7 +212,7 @@ option(BUILD_CUSTOM_PROTOBUF
+@@ -203,7 +203,7 @@ option(BUILD_CUSTOM_PROTOBUF
option(ATEN_NO_TEST "Do not build ATen test binaries" OFF)
option(BUILD_BINARY "Build C++ binaries" OFF)
option(BUILD_CUSTOM_PROTOBUF
@@ -18,7 +18,7 @@
option(BUILD_PYTHON "Build Python binaries" ON)
option(BUILD_LITE_INTERPRETER "Master flag to build Lite Interpreter" OFF)
option(BUILD_SHARED_LIBS "Build libcaffe2.so" ON)
-@@ -263,7 +263,7 @@ option(USE_GLOG "Use GLOG" OFF)
+@@ -254,7 +254,7 @@ option(USE_GLOG "Use GLOG" OFF)
option(USE_FAKELOWP "Use FakeLowp operators" OFF)
option(USE_GFLAGS "Use GFLAGS" OFF)
option(USE_GLOG "Use GLOG" OFF)
@@ -27,7 +27,7 @@
option(USE_MAGMA "Use MAGMA" ON)
option(USE_PYTORCH_METAL "Use Metal for PyTorch iOS build" OFF)
option(USE_PYTORCH_METAL_EXPORT "Export Metal models on MacOSX desktop" OFF)
-@@ -453,15 +453,15 @@ option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo
+@@ -451,15 +451,15 @@ option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo
# USE_SYSTEM_LIBS being "OFF".
option(USE_SYSTEM_LIBS "Use all available system-provided libraries." OFF)
option(USE_SYSTEM_CPUINFO "Use system-provided cpuinfo." OFF)
diff --git a/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp b/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp
deleted file mode 100644
index 09a801db1dfc..000000000000
--- a/misc/py-pytorch/files/patch-third__party_fbgemm_third__party_asmjit_src_asmjit_core_virtmem.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
---- third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp.orig 2022-12-16 00:23:48 UTC
-+++ third_party/fbgemm/third_party/asmjit/src/asmjit/core/virtmem.cpp
-@@ -45,6 +45,7 @@
- #endif
-
- #include <atomic>
-+#include <sys/stat.h>
-
- #if defined(__APPLE__) || defined(__BIONIC__)
- #define ASMJIT_VM_SHM_DETECT 0
diff --git a/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py b/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py
index 2ab33dd899a4..7a421c1bd8e3 100644
--- a/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py
+++ b/misc/py-pytorch/files/patch-tools_build__pytorch__libs.py
@@ -1,11 +1,12 @@
---- tools/build_pytorch_libs.py.orig 2025-04-24 16:28:33 UTC
+--- tools/build_pytorch_libs.py.orig 2025-08-06 17:08:06 UTC
+++ tools/build_pytorch_libs.py
-@@ -119,7 +119,7 @@ def build_pytorch(
- cmake: CMake,
- ) -> None:
- my_env = _create_build_env()
-- checkout_nccl()
-+ #checkout_nccl()
+@@ -91,7 +91,8 @@ def build_pytorch(
+ and not check_negative_env_flag("USE_NCCL")
+ and not check_env_flag("USE_SYSTEM_NCCL")
+ ):
+- checkout_nccl()
++ #checkout_nccl()
++ pass
build_test = not check_negative_env_flag("BUILD_TEST")
cmake.generate(
version, cmake_python_library, build_python, build_test, my_env, rerun_cmake