diff --git a/misc/py-pytorch/Makefile b/misc/py-pytorch/Makefile index fc421739309b..cdf87794c265 100644 --- a/misc/py-pytorch/Makefile +++ b/misc/py-pytorch/Makefile @@ -1,70 +1,69 @@ PORTNAME= pytorch DISTVERSIONPREFIX= v -DISTVERSION= 2.0.1 +DISTVERSION= 2.1.0 CATEGORIES= misc # machine-learning MASTER_SITES= https://github.com/pytorch/pytorch/releases/download/v${DISTVERSION}/ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DIST_SUBDIR= ${PORTNAME} MAINTAINER= yuri@FreeBSD.org COMMENT= PyTorch: Tensors and dynamic neural networks in Python WWW= https://pytorch.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_aarch64= build fails: CMake Error at third_party/QNNPACK/CMakeLists.txt:47 (MESSAGE): Unrecognized CMAKE_SYSTEM_NAME = FreeBSD BROKEN_i386= build fails: DispatchStub.cpp:162:29: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'AVX2'[0m BUILD_DEPENDS= cmake:devel/cmake-core \ gmake:devel/gmake \ pybind11>0:devel/pybind11 \ ${PYNUMPY} \ ${LOCALBASE}/include/fxdiv.h:devel/fxdiv \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} LIB_DEPENDS= libopenblas.so:math/openblas \ libmpi.so:net/openmpi \ libonnx.so:misc/onnx \ libpthreadpool.so:devel/pthreadpool \ libprotobuf.so:devel/protobuf \ libsleef.so:math/sleef RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}filelock>0:sysutils/py-filelock@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}networkx>0:math/py-networkx@${PY_FLAVOR} \ ${PYNUMPY} \ ${PYTHON_PKGNAMEPREFIX}sympy>0:math/py-sympy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}dill>0:devel/py-dill@${PY_FLAVOR} # optional dependency USES= compiler:c++17-lang localbase:ldflags python USE_PYTHON= distutils autoplist MAKE_ENV= USE_NINJA=no # ninja breaks for some reason MAKE_ENV+= BUILD_TEST=0 # ninja breaks for some reason MAKE_ENV+= USE_MKLDNN=0 # disable MKLDNN that doesn't exist, see https://github.com/pytorch/pytorch/issues/100957 MAKE_ENV+= USE_CUDNN=0 LDFLAGS+= -lexecinfo BINARY_ALIAS= make=${GMAKE} POST_PLIST= fix-plist .include .if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400091 || ( ${OSVERSION} >= 1302507 && ${OSVERSION} < 1400000 )) USES+= llvm:max=15 .endif post-install: # strip binaries @${STRIP_CMD} \ ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/bin/torch_shm_manager \ ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/_C${PYTHON_EXT_SUFFIX}.so \ - ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/_C_flatbuffer${PYTHON_EXT_SUFFIX}.so \ ${STAGEDIR}${PYTHON_SITELIBDIR}/functorch/_C${PYTHON_EXT_SUFFIX}.so \ ${STAGEDIR}${PYTHON_SITELIBDIR}/torch/lib/lib*.so fix-plist: # remove the stray %%PYTHON_SITELIBDIR%%/caffe2 file @${REINPLACE_CMD} -e "s|.*/caffe2$$||" ${TMPPLIST} .include diff --git a/misc/py-pytorch/distinfo b/misc/py-pytorch/distinfo index 9731f1012f9c..654de6ea7ac3 100644 --- a/misc/py-pytorch/distinfo +++ b/misc/py-pytorch/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1691477737 -SHA256 (pytorch/pytorch-v2.0.1.tar.gz) = 9c564ca440265c69400ef5fdd48bf15e28af5aa4bed84c95efaad960a6699998 -SIZE (pytorch/pytorch-v2.0.1.tar.gz) = 276717260 +TIMESTAMP = 1697035721 +SHA256 (pytorch/pytorch-v2.1.0.tar.gz) = 631c71f7f7d6174952f35b5ed4a45ec115720a4ef3eb619678de5893af54f403 +SIZE (pytorch/pytorch-v2.1.0.tar.gz) = 283041980 diff --git a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h index 1fb789eebb7b..5923cd93c2cd 100644 --- a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h +++ b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec256_vec256__bfloat16.h @@ -1,11 +1,11 @@ ---- aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h.orig 2023-05-07 16:59:15 UTC +--- aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h.orig 2023-10-12 12:49:42 UTC +++ aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h -@@ -206,7 +206,7 @@ template <> class Vectorized { (public) +@@ -266,7 +266,7 @@ static_assert( (public) } return b; } -- Vectorized map(const __m256 (*const vop)(__m256)) const { -+ Vectorized map(__m256 (*const vop)(__m256)) const { +- Vectorized map(const __m256 (*const vop)(__m256)) const { ++ Vectorized map(__m256 (*const vop)(__m256)) const { __m256 lo, hi; - cvtbf16_fp32(values, lo, hi); + cvt_to_fp32(values, lo, hi); const auto o1 = vop(lo); diff --git a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h index 59081cf2f2b0..80e0b1832434 100644 --- a/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h +++ b/misc/py-pytorch/files/patch-aten_src_ATen_cpu_vec_vec512_vec512__bfloat16.h @@ -1,11 +1,11 @@ ---- aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h.orig 2023-05-07 17:07:36 UTC +--- aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h.orig 2023-10-12 12:54:40 UTC +++ aten/src/ATen/cpu/vec/vec512/vec512_bfloat16.h -@@ -283,7 +283,7 @@ template <> class Vectorized { (public) +@@ -345,7 +345,7 @@ static_assert( (public) } #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wignored-qualifiers" -- Vectorized map(const __m512 (*const vop)(__m512)) const { -+ Vectorized map(__m512 (*const vop)(__m512)) const { +- Vectorized map(const __m512 (*const vop)(__m512)) const { ++ Vectorized map(__m512 (*const vop)(__m512)) const { __m512 lo, hi; - cvtbf16_fp32(values, lo, hi); + cvt_to_fp32(values, lo, hi); const auto o1 = vop(lo); diff --git a/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt b/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt index 2b01f115b89e..059eaaedadcf 100644 --- a/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt +++ b/misc/py-pytorch/files/patch-third__party_cpuinfo_CMakeLists.txt @@ -1,56 +1,56 @@ ---- third_party/cpuinfo/CMakeLists.txt.orig 2023-04-03 19:46:00 UTC +--- third_party/cpuinfo/CMakeLists.txt.orig 2023-10-16 12:32:17 UTC +++ third_party/cpuinfo/CMakeLists.txt -@@ -65,7 +65,7 @@ IF(NOT CMAKE_SYSTEM_PROCESSOR) +@@ -77,7 +77,7 @@ IF(NOT CMAKE_SYSTEM_PROCESSOR) "cpuinfo will compile, but cpuinfo_initialize() will always fail.") SET(CPUINFO_SUPPORTED_PLATFORM FALSE) ENDIF() -ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?|armv[5-8].*|aarch64|arm64|ARM64)$") +ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?|armv[5-8].*|aarch64|arm64|ARM64)$") MESSAGE(WARNING "Target processor architecture \"${CPUINFO_TARGET_PROCESSOR}\" is not supported in cpuinfo. " "cpuinfo will compile, but cpuinfo_initialize() will always fail.") -@@ -77,7 +77,7 @@ IF(NOT CMAKE_SYSTEM_NAME) +@@ -89,7 +89,7 @@ IF(NOT CMAKE_SYSTEM_NAME) "Target operating system is not specified. " "cpuinfo will compile, but cpuinfo_initialize() will always fail.") SET(CPUINFO_SUPPORTED_PLATFORM FALSE) --ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android)$") -+ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|FreeBSD|Android)$") +-ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS|Darwin|Linux|Android)$") ++ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS|Darwin|Linux|FreeBSD|Android)$") IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS") MESSAGE(WARNING "Target operating system \"${CMAKE_SYSTEM_NAME}\" is not supported in cpuinfo. " -@@ -123,7 +123,7 @@ SET(CPUINFO_SRCS +@@ -135,7 +135,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM) src/cache.c) IF(CPUINFO_SUPPORTED_PLATFORM) - IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$")) + IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$")) LIST(APPEND CPUINFO_SRCS src/x86/init.c src/x86/info.c -@@ -324,7 +324,7 @@ ENDIF() +@@ -341,7 +341,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_T # ---[ cpuinfo mock library and mock tests IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) SET(CPUINFO_MOCK_SRCS "${CPUINFO_SRCS}") - IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") + IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") LIST(APPEND CPUINFO_MOCK_SRCS src/x86/mockcpuid.c) ENDIF() IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") -@@ -768,7 +768,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_T +@@ -785,7 +785,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_T ADD_TEST(NAME get-current-test COMMAND get-current-test) ENDIF() - IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") + IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") ADD_EXECUTABLE(brand-string-test test/name/brand-string.cc) CPUINFO_TARGET_ENABLE_CXX11(brand-string-test) CPUINFO_TARGET_RUNTIME_LIBRARY(brand-string-test) -@@ -835,7 +835,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS) +@@ -852,7 +852,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS) CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo-dump) ENDIF() - IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$") + IF(CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|amd64|x86(_64)?)$") ADD_EXECUTABLE(cpuid-dump tools/cpuid-dump.c) CPUINFO_TARGET_ENABLE_C99(cpuid-dump) CPUINFO_TARGET_RUNTIME_LIBRARY(cpuid-dump)