Skip to content

Commit 575a44e

Browse files
authored
* Upgrade presets for PyTorch 2.2.1 (pull #1466)
1 parent 5ad9ea5 commit 575a44e

File tree

1,477 files changed

+7646
-5903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,477 files changed

+7646
-5903
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
* Upgrade presets for PyTorch 2.2.1 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466))
3+
24
### January 29, 2024 version 1.5.10
35
* Introduce `macosx-arm64` builds for PyTorch ([pull #1463](https://github.com/bytedeco/javacpp-presets/pull/1463))
46
* Reenable `linux-arm64` builds for CPython and NumPy ([pull #1386](https://github.com/bytedeco/javacpp-presets/pull/1386))

platform/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@
292292
<dependency>
293293
<groupId>org.bytedeco</groupId>
294294
<artifactId>pytorch-platform</artifactId>
295-
<version>2.1.2-${project.version}</version>
295+
<version>2.2.1-${project.version}</version>
296296
</dependency>
297297
<dependency>
298298
<groupId>org.bytedeco</groupId>

pytorch/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Introduction
99
------------
1010
This directory contains the JavaCPP Presets module for:
1111

12-
* PyTorch 2.1.2 https://pytorch.org/
12+
* PyTorch 2.2.1 https://pytorch.org/
1313

1414
Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.
1515

@@ -40,36 +40,36 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
4040
<modelVersion>4.0.0</modelVersion>
4141
<groupId>org.bytedeco.pytorch</groupId>
4242
<artifactId>simplemnist</artifactId>
43-
<version>1.5.10</version>
43+
<version>1.5.11-SNAPSHOT</version>
4444
<properties>
4545
<exec.mainClass>SimpleMNIST</exec.mainClass>
4646
</properties>
4747
<dependencies>
4848
<dependency>
4949
<groupId>org.bytedeco</groupId>
5050
<artifactId>pytorch-platform</artifactId>
51-
<version>2.1.2-1.5.10</version>
51+
<version>2.2.1-1.5.11-SNAPSHOT</version>
5252
</dependency>
5353

5454
<!-- Additional dependencies required to use CUDA, cuDNN, and NCCL -->
5555
<dependency>
5656
<groupId>org.bytedeco</groupId>
5757
<artifactId>pytorch-platform-gpu</artifactId>
58-
<version>2.1.2-1.5.10</version>
58+
<version>2.2.1-1.5.11-SNAPSHOT</version>
5959
</dependency>
6060

6161
<!-- Additional dependencies to use bundled CUDA, cuDNN, and NCCL -->
6262
<dependency>
6363
<groupId>org.bytedeco</groupId>
6464
<artifactId>cuda-platform-redist</artifactId>
65-
<version>12.3-8.9-1.5.10</version>
65+
<version>12.3-8.9-1.5.11-SNAPSHOT</version>
6666
</dependency>
6767

6868
<!-- Additional dependencies to use bundled full version of MKL -->
6969
<dependency>
7070
<groupId>org.bytedeco</groupId>
7171
<artifactId>mkl-platform-redist</artifactId>
72-
<version>2024.0-1.5.10</version>
72+
<version>2024.0-1.5.11-SNAPSHOT</version>
7373
</dependency>
7474
</dependencies>
7575
<build>

pytorch/cppbuild.sh

+5-17
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [[ $PLATFORM == windows* ]]; then
3535
export PYTHON_BIN_PATH=$(which python.exe)
3636
fi
3737

38-
PYTORCH_VERSION=2.1.2
38+
PYTORCH_VERSION=2.2.1
3939

4040
export PYTORCH_BUILD_VERSION="$PYTORCH_VERSION"
4141
export PYTORCH_BUILD_NUMBER=1
@@ -53,8 +53,9 @@ git checkout v$PYTORCH_VERSION
5353
git submodule update --init --recursive
5454
git submodule foreach --recursive 'git reset --hard'
5555

56-
# https://github.com/pytorch/pytorch/pull/66219
57-
#patch -Np1 < ../../../pytorch.patch
56+
# Fix version of this submodule to allow compilation on windows.
57+
# Probably could be removed when we upgrade to next version of PyTorch.
58+
(cd third_party/pocketfft; git checkout 9d3ab05a7fffbc71a492bc6a17be034e83e8f0fe)
5859

5960
CPYTHON_HOST_PATH="$INSTALL_PATH/../../../cpython/cppbuild/$PLATFORM/host/"
6061
CPYTHON_PATH="$INSTALL_PATH/../../../cpython/cppbuild/$PLATFORM/"
@@ -165,24 +166,11 @@ sedinplace 's/ build_deps()/ build_deps(); sys.exit()/g' setup.py
165166
sedinplace 's/AND NOT DEFINED ENV{CUDAHOSTCXX}//g' cmake/public/cuda.cmake
166167
sedinplace 's/CMAKE_CUDA_FLAGS "/CMAKE_CUDA_FLAGS " --use-local-env /g' CMakeLists.txt
167168

168-
# work around some compiler bugs
169-
sedinplace 's/!defined(__INTEL_COMPILER))/!defined(__INTEL_COMPILER) \&\& (__GNUC__ < 11))/g' third_party/XNNPACK/src/xnnpack/intrinsics-polyfill.h
170169
sedinplace 's/using ExpandingArrayDouble/public: using ExpandingArrayDouble/g' ./torch/csrc/api/include/torch/nn/options/pooling.h
171-
sedinplace 's/typedef c10::variant/public: typedef c10::variant/g' ./torch/csrc/api/include/torch/nn/options/upsampling.h
172-
sedinplace 's/std::copysign/copysignf/g' aten/src/ATen/native/cuda/*.cu
173-
sedinplace 's/std::trunc/truncf/g' aten/src/ATen/native/cuda/*.cu
174-
sedinplace 's/std::floor/floorf/g' aten/src/ATen/native/cuda/*.cu
175-
sedinplace 's/std::ceil/ceilf/g' aten/src/ATen/native/cuda/*.cu
176-
sedinplace 's/round(/roundf(/g' aten/src/ATen/native/cuda/*.cu
177-
sedinplace 's/floor(/floorf(/g' aten/src/ATen/native/cuda/*.cu
178-
sedinplace 's/ceil(/ceilf(/g' aten/src/ATen/native/cuda/*.cu
179-
sedinplace '/#include <thrust\/device_vector.h>/a\
180-
#include <thrust\/host_vector.h>\
181-
' caffe2/utils/math_gpu.cu
182170

183171
# allow setting the build directory and passing CUDA options
184172
sedinplace "s/BUILD_DIR = .build./BUILD_DIR = os.environ['BUILD_DIR'] if 'BUILD_DIR' in os.environ else 'build'/g" tools/setup_helpers/env.py
185-
sedinplace "s/var.startswith(('BUILD_', 'USE_', 'CMAKE_'))/var.startswith(('BUILD_', 'USE_', 'CMAKE_', 'CUDA_'))/g" tools/setup_helpers/cmake.py
173+
sedinplace 's/var.startswith(("BUILD_", "USE_", "CMAKE_"))/var.startswith(("BUILD_", "USE_", "CMAKE_", "CUDA_"))/g' tools/setup_helpers/cmake.py
186174

187175
# allow resizing std::vector<at::indexing::TensorIndex>
188176
sedinplace 's/TensorIndex(c10::nullopt_t)/TensorIndex(c10::nullopt_t none = None)/g' aten/src/ATen/TensorIndexing.h

pytorch/include_list.pl

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ sub go {
5252

5353
chdir "cppbuild/linux-x86_64-gpu/pytorch/torch/include";
5454

55+
# Doesn't compile on Windows. Waiting for 2.2.1.
56+
#go('torch/csrc/api/include/torch/torch.h', 'torch/script.h', 'torch/csrc/inductor/aoti_model_container_runner.h');
5557
go('torch/csrc/api/include/torch/torch.h', 'torch/script.h');
5658

5759
print <<EOF;
@@ -62,4 +64,6 @@ sub go {
6264
// c10/cuda/CUDAGuard.h
6365
EOF
6466

67+
# Doesn't compile on Windows. Waiting for 2.2.1.
68+
#go('ATen/cudnn/Descriptors.h', 'ATen/cudnn/Types.h', 'c10/cuda/CUDAGuard.h', '-I/opt/cuda/targets/x86_64-linux/include/', 'torch/csrc/inductor/aoti_model_container_runner_cuda.h');
6569
go('ATen/cudnn/Descriptors.h', 'ATen/cudnn/Types.h', 'c10/cuda/CUDAGuard.h', '-I/opt/cuda/targets/x86_64-linux/include/');

pytorch/platform/gpu/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>org.bytedeco</groupId>
1414
<artifactId>pytorch-platform-gpu</artifactId>
15-
<version>2.1.2-${project.parent.version}</version>
15+
<version>2.2.1-${project.parent.version}</version>
1616
<name>JavaCPP Presets Platform GPU for PyTorch</name>
1717

1818
<properties>

pytorch/platform/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<groupId>org.bytedeco</groupId>
1414
<artifactId>pytorch-platform</artifactId>
15-
<version>2.1.2-${project.parent.version}</version>
15+
<version>2.2.1-${project.parent.version}</version>
1616
<name>JavaCPP Presets Platform for PyTorch</name>
1717

1818
<properties>

pytorch/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<groupId>org.bytedeco</groupId>
1313
<artifactId>pytorch</artifactId>
14-
<version>2.1.2-${project.parent.version}</version>
14+
<version>2.2.1-${project.parent.version}</version>
1515
<name>JavaCPP Presets for PyTorch</name>
1616

1717
<dependencies>

0 commit comments

Comments
 (0)