- update to 2.3.1 with following summarized highlights:

* from 2.0.x:
    - torch.compile is the main API for PyTorch 2.0, which wraps your model and
      returns a compiled model. It is a fully additive (and optional) feature
      and hence 2.0 is 100% backward compatible by definition
    - Accelerated Transformers introduce high-performance support for training
      and inference using a custom kernel architecture for scaled dot product
      attention (SPDA). The API is integrated with torch.compile() and model
      developers may also use the scaled dot product attention kernels directly
      by calling the new scaled_dot_product_attention() operato
  * from 2.1.x:
    - automatic dynamic shape support in torch.compile,
      torch.distributed.checkpoint for saving/loading distributed training jobs
      on multiple ranks in parallel, and torch.compile support for the NumPy
      API.
    - In addition, this release offers numerous performance improvements (e.g.
      CPU inductor improvements, AVX512 support, scaled-dot-product-attention
      support) as well as a prototype release of torch.export, a sound
      full-graph capture mechanism, and torch.export-based quantization.
  * from 2.2.x:
    - 2x performance improvements to scaled_dot_product_attention via
      FlashAttention-v2 integration, as well as AOTInductor, a new
      ahead-of-time compilation and deployment tool built for non-python
      server-side deployments.
  * from 2.3.x:
    - support for user-defined Triton kernels in torch.compile, allowing for
      users to migrate their own Triton kernels from eager without
      experiencing performance complications or graph breaks. As well, Tensor
      Parallelism improves the experience for training Large Language Models
      using native PyTorch functions, which has been validated on training

OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-torch?expand=0&rev=32
This commit is contained in:
Christian Goll 2024-07-19 12:15:19 +00:00 committed by Git OBS Bridge
parent 73b1680af3
commit 9c8ce17a59
37 changed files with 307 additions and 253 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9fb642251296dad566b69c056948fd31daafae9c914ce6c9ee45ffc304dc09f1
size 2833072

3
XNNPACK-fcbf55a.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:96b2800652a605f0bd289faa09865792d139cadde89f681c79e1b2a08a7e0498
size 11561561

View File

@ -1,3 +1,4 @@
<multibuild>
<package>standard</package>
<package>openmpi4</package>
</multibuild>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3c16d5d393d6d1fa6b6ed8621dd0a535552df9bc88cbba739375dde38a93142
size 3496223

3
cpuinfo-d6860c4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c195420a4dafb64ea25f0ef8af894fb0d866a41406d595af6d1e68796f492b53
size 3516672

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d87f6737be1b544c299340b64b9303c1d6ec0447b49b3aaf6642838b4f8280d7
size 398104

View File

@ -1,10 +0,0 @@
--- pytorch-1.9.0/caffe2/opt/onnxifi_op.h.orig 2021-07-22 14:16:51.417995412 +0000
+++ pytorch-1.9.0/caffe2/opt/onnxifi_op.h 2021-07-22 14:17:51.616490492 +0000
@@ -313,7 +313,6 @@ class OnnxifiOp final : public Operator<
weight_descs.size(),
weight_descs.data(),
&graph,
- static_cast<uint32_t>(max_seq_size_),
defered_blob_reader);
if (ret != ONNXIFI_STATUS_SUCCESS) {
if (ret == ONNXIFI_STATUS_FATAL_ERROR) {

39
fix-setup.patch Normal file
View File

@ -0,0 +1,39 @@
From 65b21aea6c04d8e8760aa79e06de31a35e05c954 Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.com>
Date: Wed, 10 Jul 2024 16:08:39 +0200
Subject: [PATCH] fix setup
Signed-off-by: Christian Goll <cgoll@suse.com>
---
cmake/Dependencies.cmake | 1 -
setup.py | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index a96075245ae..f0c29dacfb8 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1403,7 +1403,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
set(TP_USE_CUDA ON CACHE BOOL "" FORCE)
set(TP_ENABLE_CUDA_IPC ON CACHE BOOL "" FORCE)
endif()
- set(TP_BUILD_LIBUV ON CACHE BOOL "" FORCE)
add_compile_options(-DTORCH_USE_LIBUV)
include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/tensorpipe/third_party/libuv/include)
set(TP_STATIC_OR_SHARED STATIC CACHE STRING "" FORCE)
diff --git a/setup.py b/setup.py
index 8d1aaff5668..c8b9a4fb507 100644
--- a/setup.py
+++ b/setup.py
@@ -591,7 +591,7 @@ class build_ext(setuptools.command.build_ext.build_ext):
def run(self):
# Report build options. This is run after the build completes so # `CMakeCache.txt` exists and we can get an
# accurate report on what is used and what is not.
- cmake_cache_vars = defaultdict(lambda: False, cmake.get_cmake_cache_variables())
+ cmake_cache_vars = defaultdict(lambda: "False", cmake.get_cmake_cache_variables())
if cmake_cache_vars["USE_NUMPY"]:
report("-- Building with NumPy bindings")
else:
--
2.43.0

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a1f2a116b49a1aaa3563c3d9e3baf6ea256eebf57c7bc144a2d28aa73deba7b
size 2199457

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:de0ec6be9ec3c4da10ff5b0f19cc22f3501c0d563c5cf82d62663a3a68dd0852
size 753304

3
fmt-e69e5f9.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1723f27eed50e751037f49dcdf73e33b17658f1178ea1c1f829a30bb02335745
size 855053

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ca8cd06abc4ab0f02299af44ecf01bcb3545e190cfe688685b822b47cd5aedf6
size 28938

3
foxi-c278588.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:52665aae3c7352a1fa68d017a87c825559c514072409e30753f36aa6eb0c7b4d
size 28960

3
gloo-5354032.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5759a06e6c8863c58e8ceadeb56f7c701fec89b2559ba33a103a447207bf69c7
size 259857

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b4418cfd6795ff527940e7911b291b63c66009c3e4f041cbebd1701bde6f6aff
size 247554

3
kineto-3f30237.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c06d28bdba5400f461812f3d0793007f7925720fd0c9c2bdb6711f32cb859c85
size 8239233

3
libnop-910b558.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ec3604671f8ea11aed9588825f9098057ebfef7a8908e97459835150eea9f63a
size 124143

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5ea74a3e1bbe0c858729a4d1790ab152b60bb844398da70560b1eb1d346f448d
size 9303388

3
onnx-990217f.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be2f16e58f1470f49b725a5ea023940ba8a4a5b493241e54d339d9057dda2450
size 12417926

3
pocketfft-9d3ab05.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28fca6494e7f28f3ddfe08c53afec9e5f873f7924d9ac0ea7b3b9f90405b137b
size 26923

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e8fb6a8ce03616b84f773d7b50ebe0ea2fe3af5b7df6c6f96fa6b3f049a3303
size 59634

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db5c281f6cd873670e2fef919ab398e4e0587f5265ddc9e014f17cb8e3449611
size 49011

3
pybind11-3e9dfa2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a7d245f405f470798b9d2a48912cc97230658024775299eac203f7c9c9ae37c
size 771508

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:53cd43ce8ade975225c2fd99325c2d3e42190b317fcabd6e13c6406972427bd0
size 648390

View File

@ -1,3 +1,49 @@
-------------------------------------------------------------------
Thu Jul 11 09:37:17 UTC 2024 - Christian Goll <cgoll@suse.com>
- update to 2.3.1 with following summarized highlights:
* from 2.0.x:
- torch.compile is the main API for PyTorch 2.0, which wraps your model and
returns a compiled model. It is a fully additive (and optional) feature
and hence 2.0 is 100% backward compatible by definition
- Accelerated Transformers introduce high-performance support for training
and inference using a custom kernel architecture for scaled dot product
attention (SPDA). The API is integrated with torch.compile() and model
developers may also use the scaled dot product attention kernels directly
by calling the new scaled_dot_product_attention() operato
* from 2.1.x:
- automatic dynamic shape support in torch.compile,
torch.distributed.checkpoint for saving/loading distributed training jobs
on multiple ranks in parallel, and torch.compile support for the NumPy
API.
- In addition, this release offers numerous performance improvements (e.g.
CPU inductor improvements, AVX512 support, scaled-dot-product-attention
support) as well as a prototype release of torch.export, a sound
full-graph capture mechanism, and torch.export-based quantization.
* from 2.2.x:
- 2x performance improvements to scaled_dot_product_attention via
FlashAttention-v2 integration, as well as AOTInductor, a new
ahead-of-time compilation and deployment tool built for non-python
server-side deployments.
* from 2.3.x:
- support for user-defined Triton kernels in torch.compile, allowing for
users to migrate their own Triton kernels from eager without
experiencing performance complications or graph breaks. As well, Tensor
Parallelism improves the experience for training Large Language Models
using native PyTorch functions, which has been validated on training
runs for 100B parameter models.
- added seperate openmpi4 build
- added sepetate vulcan build, although this functions isn't exposed to python
abi
- For the obs build all the vendored sources follow the pattern
NAME-7digitcommit.tar.gz and not the NAME-COMMIT.tar.gz
- added following patches:
* skip-third-party-check.patch
* fix-setup.patch
- removed patches:
* pytorch-rm-some-gitmodules.patch
* fix-call-of-onnxInitGraph.patch
-------------------------------------------------------------------
Thu Jul 22 14:40:45 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -17,8 +17,6 @@
%define srcname pytorch
%define skip_python2 1
%define skip_python36 1
%define pname torch
%global flavor @BUILD_FLAVOR@%{nil}
@ -31,24 +29,55 @@
%bcond_without cuda
%define cudaver 10-2
%endif
%define gloo_version 6f7095f6e9860ce4fd682a7894042e6eba0996f1
%define cpuinfo_version 5916273f79a21551890fd3d56fc5375a78d1598d
%define sleef_version e0a003ee838b75d11763aa9c3ef17bf71a725bff
%define pybind11_version 8de7772cc72daca8e947b79b83fea46214931604
%define onnx_version 54c38e6eaf557b844e70cebc00f39ced3321e9ad
%define pthreadpool_version a134dd5d4cee80cce15db81a72e7f929d71dd413
%define FXdiv_version b408327ac2a15ec3e43352421954f5b1967701d1
%define psimd_version 072586a71b55b7f8c584153d223e95687148a900
%define FP16_version 4dfe081cf6bcd15db339cf2680b9281b8451eeb3
%define gemmlowp_version 3fb5c176c17c765a3492cd2f0321b0dab712f350
%define foxi_version bd6feb6d0d3fc903df42b4feb82a602a5fcb1fd5
%define QNNPACK_version 7d2a4e9931a82adc3814275b6219a03e24e36b4c
%define XNNPACK_version 55d53a4e7079d38e90acd75dd9e4f9e781d2da35
%define cub_version d106ddb991a56c3df1b6d51b2409e36ba8181ce4
%define fmt_version cd4af11efc9c622896a3e4cb599fa28668ca3d05
Name: python-torch
Version: 1.9.0
%bcond_with mpi
%if "%{flavor}" == "openmpi4"
%bcond_without mpi
%bcond_without openmpi4
%global mpi_flavor openmpi
%define mpi_ext 4
%endif
%if "%{flavor}" == "vulkan"
%bcond_without vulkan
%global pkg_suffix -vulkan
%endif
%if %{with mpi}
%global pkg_suffix %{?mpi_flavor:-%{mpi_flavor}%{?mpi_ext}}
%define pkg_prefix %{_libdir}/mpi/gcc/%{mpi_flavor}%{?mpi_ext}
%define pkg_bindir %{pkg_prefix}/bin/
%define pkg_libdir %{pkg_prefix}/%{_lib}/
%define pkg_incdir %{pkg_prefix}/include/
%define pkg_datadir %{pkg_prefix}/share/
%define pkg_sysconfdir %{pkg_prefix}/etc/
%define pkg_skeldir %{pkg_prefix}/etc/skel/
%define package_name %{pname}%{?pkg_suffix}
%endif
%define FP16_version 4dfe081
%define FXdiv_version b408327
%define QNNPACK_version 7d2a4e9
%define XNNPACK_version fcbf55a
%define cpuinfo_version d6860c4
%define flatbuffers 01834de
%define foxi_version c278588
%define fmt_version e69e5f9
%define gemmlowp_version 3fb5c
%define gloo_version 5354032
%define kineto 3f30237
%define libnop 910b558
%define onnx_version 990217f
%define pocketfft 9d3ab05
%define psimd_version 072586a
%define pthreadpool_version 4fe0e1e
%define pybind11_version 3e9dfa2
%define sleef_version e0a003e
%define tensorpipe 52791a2
Name: python-torch%{?pkg_suffix}
Version: 2.3.1
Release: 0
Summary: Deep learning framework aka pytorch/Caffe2
License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT AND Zlib AND BSL-1.0
@ -82,14 +111,23 @@ Source21: https://github.com/houseroad/foxi/archive/%{foxi_version}.tar.gz
Source22: https://github.com/pytorch/QNNPACK/archive/%{QNNPACK_version}.tar.gz#/QNNPACK-%{QNNPACK_version}.tar.gz
# License23: BSD-3-Clause
Source23: https://github.com/google/XNNPACK/archive/%{XNNPACK_version}.tar.gz#/XNNPACK-%{XNNPACK_version}.tar.gz
# License24: BSD-3-Clause
Source24: https://github.com/NVlabs/cub/archive/%{cub_version}.tar.gz#/cub-%{cub_version}.tar.gz
# License 25: MIT
Source25: https://github.com/fmtlib/fmt/archive/%{fmt_version}.tar.gz#/fmt-%{fmt_version}.tar.gz
# License 26: BSD-3-Clause
Source26: https://github.com/mreineck/pocketfft/archive/%{pocketfft}.tar.gz#/pocketfft-%{pocketfft}.tar.gz
# License 27: BSD-3-Clause
Source27: https://github.com/pytorch/kineto/archive/%{kineto}.tar.gz#/kineto-%{kineto}.tar.gz
# License 28: Apache-2.0
Source28: https://github.com/google/flatbuffers/archive/%{flatbuffers}.tar.gz#/flatbuffers-%{flatbuffers}.tar.gz
# License 29: BSD-3-Clause
Source29: https://github.com/pytorch/tensorpipe/archive/%{tensorpipe}.tar.gz#/tensorpipe-%{tensorpipe}.tar.gz
# License 30: Apache-2.0
Source30: https://github.com/google/libnop/archive/%{libnop}.tar.gz#/libnop-%{libnop}.tar.gz
Patch1: skip-third-party-check.patch
Patch2: fix-setup.patch
Patch1: pytorch-rm-some-gitmodules.patch
Patch2: skip-third-party-check.patch
# Patch3: fix-call-of-onnxInitGraph.patch #Make the build to fail on Leap/SLE
# A python call to cmake fails with a return code of 1 on this arch, disable it for now.
# and 32-bit arm is not supported
ExcludeArch: %ix86 %{arm}
@ -98,13 +136,13 @@ BuildRequires: %{python_module Gloo}
%ifarch x86_64
BuildRequires: %{python_module PeachPy}
%endif
BuildRequires: %{python_module py-cpuinfo}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module future}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module leveldb}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module opcodes}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module protobuf}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module setuptools}
@ -122,23 +160,18 @@ BuildRequires: gcc8-c++
BuildRequires: cmake >= 3.5
BuildRequires: eigen3-devel
BuildRequires: fdupes
%ifarch x86_64
%if 0%{?suse_version} > 1500
# Use GCC10 until fixed - https://github.com/google/XNNPACK/issues/1550
BuildRequires: gcc10
BuildRequires: gcc10-c++
%endif
%endif
BuildRequires: gcc-c++
BuildRequires: glog-devel
BuildRequires: gtest
BuildRequires: leveldb-devel
BuildRequires: libnuma-devel
BuildRequires: libuv-devel
BuildRequires: libopenblas_pthreads-devel
BuildRequires: lmdb-devel
BuildRequires: ninja
BuildRequires: openblas-devel
BuildRequires: openssl-devel
BuildRequires: opencv-devel
BuildRequires: protobuf-c
BuildRequires: protobuf-devel
BuildRequires: python-rpm-macros
@ -157,11 +190,18 @@ BuildRequires: gcc7-c++
BuildRequires: libcudnn7-devel
BuildRequires: libnccl-devel
%endif
Requires: python-future
Requires: python-leveldb
%if %{with openmpi4}
BuildRequires: openmpi4-devel
%endif
%if %{with vulkan}
BuildRequires: shaderc
BuildRequires: vulkan-devel
BuildRequires: VulkanMemoryAllocator-devel
%endif
Requires: python-numpy
Requires: python-protobuf
Requires: python-six
Requires: python-typing_extensions
Provides: python-caffe2 = %version
Provides: python-pytorch = %version
@ -191,7 +231,7 @@ Although the Python interface is more polished and the primary focus of
development, PyTorch also has a C++ frontend. This package contains the header
to access the C/C++ interface.
%package -n pytorch-converters
%package converters
Summary: Converters for onnx and caffe2
Group: Development/Languages/Python
BuildArch: noarch
@ -200,34 +240,37 @@ Requires: python3-onnx
Requires: python3-pip
Requires: python3-pname
%description -n pytorch-converters
%description converters
Converter from caffe2 to onnx and from caffe2 to onnx formated files.
%package -n pytorch-examples
%package examples
Summary: Examples which can be used for testing
Group: Development/Languages/Python
BuildArch: noarch
Recommends: python3-lmdb
Recommends: python3-networkx
%description -n pytorch-examples
%description examples
This example files can be used to start an own pytorch/caffe2 project.
%package -n libtorch
%package -n libtorch%{?pkg_suffix}
Summary: Library which used by %{name}
Group: Development/Libraries/Python
%description -n libtorch
%description -n libtorch%{?pkg_suffix}
Library which is used by %{name}
%prep
%define make_depend_src() test -e $(basename %1| sed 's/-.*//') && rmdir %{?2}%{!?2:$(basename %1| sed 's/-.*//')}; tar xzf %1; mv $(basename %1 | sed 's/\.tar\.gz//' ) %{?2}%{!?2:$(basename %1| sed 's/-.*//')}
%define make_depend_src() test -e $(basename %1| sed 's/-.*//') && rmdir %{?2}%{!?2:$(basename %1| sed 's/-.*//')}; tar xzf %1; mv $(basename %{1} | sed 's/\.tar\.gz//' )* %{?2}%{!?2:$(basename %1| sed 's/-.*//')}
%define make_depend_src_uppercase() rmdir -p $(basename %1| sed 's/-.*//'| tr '[:upper:]' '[:lower:]'); tar xzf %1; mv $(basename %1 | cut -f 1 -d '.' ) $(basename %1| sed 's/-.*//'| tr '[:upper:]' '[:lower:]')
%setup -q -n %{srcname}-%{version}
%autosetup -p1 -n %{srcname}-%{version}
cp %{S:1} releases.html
%autopatch -p 1
%if %{with vulkan}
sed -i '/-Werror=return-type/d' CMakeLists.txt
%endif
cd third_party
rmdir python-peachpy/
rmdir eigen/
%make_depend_src %{SOURCE10}
%make_depend_src %{SOURCE12}
%make_depend_src %{SOURCE13}
@ -241,8 +284,15 @@ rmdir python-peachpy/
%make_depend_src %{SOURCE21}
%make_depend_src %{SOURCE22}
%make_depend_src %{SOURCE23}
%make_depend_src %{SOURCE24}
%make_depend_src %{SOURCE25}
%make_depend_src %{SOURCE26}
%make_depend_src %{SOURCE27}
%make_depend_src %{SOURCE28}
%make_depend_src %{SOURCE29}
# getting the vendoring of the vendored source working, this is
# insanity at the next level. My onlu exuse is that libnop is header only
rmdir tensorpipe/third_party/libnop
%make_depend_src %{SOURCE30} tensorpipe/third_party/libnop
%build
%define buildvars \
@ -261,12 +311,6 @@ rmdir python-peachpy/
export CXX=g++-7 \
%endif \
%else \
%ifarch x86_64 \
%if 0%{?suse_version} > 1500 \
export CC=gcc-10 \
export CXX=g++-10 \
%endif \
%endif \
%if 0%{?suse_version} <= 1500 \
%ifarch aarch64 \
export CC=gcc-8 \
@ -277,24 +321,39 @@ rmdir python-peachpy/
export USE_CUDNN=OFF \
%endif \
export USE_KINETO=OFF \
export USE_DISTRIBUTED=OFF \
export USE_TEST=OFF \
export USE_LEVELDB=ON \
export USE_LMDB=ON \
export USE_FBGEMM=OFF \
export USE_SYSTEM_BENCHMARK=ON \
export USE_SYSTEM_EIGEN_INSTALL=ON \
export USE_OPENCV=ON \
export USE_TBB=OFF \
export USE_MKLDNN=OFF \
export USE_KINETO=OFF \
export USE_DISTRIBUTED=ON \
export TP_BUILD_LIBUV=OFF \
export USE_NCCL=OFF \
%if %{with mpi} \
export USE_MPI=ON \
export MPIEXEC_EXECUTABLE="%{pkg_bindir}/mpiexec" \
%else \
export USE_GLOO=ON \
%endif \
export BLAS=OpenBLAS \
export BUILD_CUSTOM_PROTOBUF=OFF \
export BUILD_TEST=OFF \
export MAX_JOBS=%{?jobs} \
%if %{with vulkan} \
export USE_VULKAN=ON \
export CXXFLAGS="-I /usr/ -Wno-error=return-type" \
%endif \
%buildvars
%python_build
%install
%buildvars
%python_install
%python_install -q
%python_expand %fdupes %{buildroot}%{$python_sitearch}
@ -312,46 +371,47 @@ install -m 644 -D %{buildroot}%{python_sitearch}/torch/lib/* %{buildroot}/%{_lib
#%check
#export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
#%%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python test/run_test.py
%python_clone -a %{buildroot}%{_bindir}/torchrun
%python_clone -a %{buildroot}%{_bindir}/convert-caffe2-to-onnx
%python_clone -a %{buildroot}%{_bindir}/convert-onnx-to-caffe2
%post -n libtorch -p /sbin/ldconfig
%postun -n libtorch -p /sbin/ldconfig
%post -n libtorch%{?pkg_suffix} -p /sbin/ldconfig
%postun -n libtorch%{?pkg_suffix} -p /sbin/ldconfig
%files %{python_files}
%defattr(-,root,root)
%doc README.md NOTICE releases.html
%license LICENSE
%{python_sitearch}/torch/
%{python_sitearch}/caffe2/
%{python_sitearch}/torch-*.egg-info/
# excluding nearly all headersm except THNN.h and THCUNN.h as they
# are read in by the python init
%{python_sitearch}/torch*
%{python_sitearch}/torchgen/
%{python_sitearch}/functorch/
%exclude %{python_sitearch}/torch/share
%exclude %{python_sitearch}/torch/include/TH
%exclude %{python_sitearch}/torch/include/c10
%exclude %{python_sitearch}/torch/include/ATen
%exclude %{python_sitearch}/torch/include/pybind11
%exclude %{python_sitearch}/torch/include/caffe2
%exclude %{python_sitearch}/torch/include/torch/csrc
%exclude %{python_sitearch}/torch/include/torch/*.h
%exclude %{python_sitearch}/torch/include
%exclude %{python_sitearch}/torch/_inductor/codegen
%exclude %{python_sitearch}/torch/utils/benchmark/utils/
%exclude %{python_sitearch}/torchgen/packaged/ATen/templates
%exclude %{python_sitearch}/torchgen/packaged/autograd/templates
%python_alternative %{_bindir}/torchrun
%files %{python_files devel}
%{python_sitearch}/torch/share
%{python_sitearch}/torch/include/TH/
%{python_sitearch}/torch/include/c10
%{python_sitearch}/torch/include/ATen
%{python_sitearch}/torch/include/pybind11
%{python_sitearch}/torch/include/caffe2
%{python_sitearch}/torch/include/torch/csrc
%{python_sitearch}/torch/include/torch/*.h
%{python_sitearch}/torch/include
%{python_sitearch}/torch/_inductor/codegen
%{python_sitearch}/torch/utils/benchmark/utils/
%{python_sitearch}/torchgen/packaged/ATen/templates
%{python_sitearch}/torchgen/packaged/autograd/templates
%files -n pytorch-converters
%{_bindir}/convert-caffe2-to-onnx
%{_bindir}/convert-onnx-to-caffe2
%files %{python_files converters}
%python_alternative %{_bindir}/convert-caffe2-to-onnx
%python_alternative %{_bindir}/convert-onnx-to-caffe2
%files -n pytorch-examples
%files %{python_files examples}
%{_docdir}/%{name}
%exclude %{_docdir}/%{name}/NOTICE
%exclude %{_docdir}/%{name}/README.md
%exclude %{_docdir}/%{name}/releases.html
%files -n libtorch
%files -n libtorch%{?pkg_suffix}
%{_libdir}/*.so*
%changelog

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:951dc1826c7c90326d32b09600ce2f27035818c0153fa59935122658cf038e6a
size 16772380

3
pytorch-2.3.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:55eebdde369e2dbee02fc83d7cb4b3cb51a1edf937b26cfdf246fad49beecf08
size 117035696

View File

@ -1,118 +0,0 @@
--- pytorch-1.9.0/.gitmodules.orig 2021-07-22 11:52:36.279286034 +0000
+++ pytorch-1.9.0/.gitmodules 2021-07-22 12:40:01.725543111 +0000
@@ -6,30 +6,6 @@
ignore = dirty
path = third_party/cub
url = https://github.com/NVlabs/cub.git
-[submodule "third_party/eigen"]
- ignore = dirty
- path = third_party/eigen
- url = https://github.com/eigenteam/eigen-git-mirror.git
-[submodule "third_party/googletest"]
- ignore = dirty
- path = third_party/googletest
- url = https://github.com/google/googletest.git
-[submodule "third_party/benchmark"]
- ignore = dirty
- path = third_party/benchmark
- url = https://github.com/google/benchmark.git
-[submodule "third_party/protobuf"]
- ignore = dirty
- path = third_party/protobuf
- url = https://github.com/protocolbuffers/protobuf.git
-[submodule "third_party/ios-cmake"]
- ignore = dirty
- path = third_party/ios-cmake
- url = https://github.com/Yangqing/ios-cmake.git
-[submodule "third_party/NNPACK"]
- ignore = dirty
- path = third_party/NNPACK
- url = https://github.com/Maratyszcza/NNPACK.git
[submodule "third_party/gloo"]
ignore = dirty
path = third_party/gloo
@@ -50,46 +26,18 @@
ignore = dirty
path = third_party/psimd
url = https://github.com/Maratyszcza/psimd.git
-[submodule "third_party/zstd"]
- ignore = dirty
- path = third_party/zstd
- url = https://github.com/facebook/zstd.git
[submodule "third_party/cpuinfo"]
ignore = dirty
path = third_party/cpuinfo
url = https://github.com/pytorch/cpuinfo.git
-[submodule "third_party/python-enum"]
- ignore = dirty
- path = third_party/python-enum
- url = https://github.com/PeachPy/enum34.git
-[submodule "third_party/python-peachpy"]
- ignore = dirty
- path = third_party/python-peachpy
- url = https://github.com/Maratyszcza/PeachPy.git
-[submodule "third_party/python-six"]
- ignore = dirty
- path = third_party/python-six
- url = https://github.com/benjaminp/six.git
[submodule "third_party/onnx"]
ignore = dirty
path = third_party/onnx
url = https://github.com/onnx/onnx.git
-[submodule "third_party/onnx-tensorrt"]
- ignore = dirty
- path = third_party/onnx-tensorrt
- url = https://github.com/onnx/onnx-tensorrt
[submodule "third_party/sleef"]
ignore = dirty
path = third_party/sleef
url = https://github.com/shibatch/sleef
-[submodule "third_party/ideep"]
- ignore = dirty
- path = third_party/ideep
- url = https://github.com/intel/ideep
-[submodule "third_party/nccl/nccl"]
- ignore = dirty
- path = third_party/nccl/nccl
- url = https://github.com/NVIDIA/nccl
[submodule "third_party/gemmlowp/gemmlowp"]
ignore = dirty
path = third_party/gemmlowp/gemmlowp
@@ -98,26 +46,10 @@
ignore = dirty
path = third_party/QNNPACK
url = https://github.com/pytorch/QNNPACK
-[submodule "third_party/neon2sse"]
- ignore = dirty
- path = third_party/neon2sse
- url = https://github.com/intel/ARM_NEON_2_x86_SSE.git
-[submodule "third_party/fbgemm"]
- ignore = dirty
- path = third_party/fbgemm
- url = https://github.com/pytorch/fbgemm
[submodule "third_party/foxi"]
ignore = dirty
path = third_party/foxi
url = https://github.com/houseroad/foxi.git
-[submodule "third_party/tbb"]
- path = third_party/tbb
- url = https://github.com/01org/tbb
- branch = tbb_2018
-[submodule "android/libs/fbjni"]
- ignore = dirty
- path = android/libs/fbjni
- url = https://github.com/facebookincubator/fbjni.git
[submodule "third_party/XNNPACK"]
ignore = dirty
path = third_party/XNNPACK
@@ -126,10 +58,3 @@
ignore = dirty
path = third_party/fmt
url = https://github.com/fmtlib/fmt.git
-[submodule "third_party/tensorpipe"]
- ignore = dirty
- path = third_party/tensorpipe
- url = https://github.com/pytorch/tensorpipe.git
-[submodule "third_party/kineto"]
- path = third_party/kineto
- url = https://github.com/pytorch/kineto

View File

@ -1,17 +1,41 @@
--- pytorch-1.9.0/setup.py.orig 2021-07-22 11:29:23.485565837 +0000
+++ pytorch-1.9.0/setup.py 2021-07-22 12:04:17.690981402 +0000
@@ -340,10 +340,10 @@ def check_submodules():
sys.exit(1)
for folder in folders:
check_for_files(folder, ["CMakeLists.txt", "Makefile", "setup.py", "LICENSE"])
- check_for_files(os.path.join(third_party_path, 'fbgemm', 'third_party',
- 'asmjit'), ['CMakeLists.txt'])
- check_for_files(os.path.join(third_party_path, 'onnx', 'third_party',
- 'benchmark'), ['CMakeLists.txt'])
+ #check_for_files(os.path.join(third_party_path, 'fbgemm', 'third_party',
+ #'asmjit'), ['CMakeLists.txt'])
+ #check_for_files(os.path.join(third_party_path, 'onnx', 'third_party',
+ #'benchmark'), ['CMakeLists.txt'])
From 4f4138cfc5a4ea59384b613a4389bf388ebfa7bb Mon Sep 17 00:00:00 2001
From: Christian Goll <cgoll@suse.com>
Date: Fri, 5 Jul 2024 14:53:32 +0200
Subject: [PATCH] skip-third-party-check
Signed-off-by: Christian Goll <cgoll@suse.com>
---
cmake/public/utils.cmake | 3 ++-
setup.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/cmake/public/utils.cmake b/cmake/public/utils.cmake
index 78a90dbc587..172f8ef422c 100644
--- a/cmake/public/utils.cmake
+++ b/cmake/public/utils.cmake
@@ -185,7 +185,8 @@ endfunction()
macro(caffe2_update_option variable value)
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
get_property(__help_string CACHE ${variable} PROPERTY HELPSTRING)
- set(${variable} ${value} CACHE BOOL ${__help_string} FORCE)
+ #set(${variable} ${value} CACHE BOOL ${__help_string} FORCE)
+ set(${variable} ${value})
else()
set(${variable} ${value})
endif()
diff --git a/setup.py b/setup.py
index 6b0860a9ee1..8d1aaff5668 100644
--- a/setup.py
+++ b/setup.py
@@ -458,7 +458,7 @@ def mirror_files_into_torchgen():
def build_deps():
report("-- Building version " + version)
- check_submodules()
+ #check_submodules()
check_pydep("yaml", "pyyaml")
# all the work we need to do _before_ setup runs
build_caffe2(
--
2.43.0

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ff0b84c0623f3360ec7c34b8c4fe02e7f9a87f8fa559c303f9574e44be0bc56
size 259691