Skip to content

Commit 511775f

Browse files
authored
Upgraded pytorch to 2.3.0 latest version (#123)
* Upgraded pytorch to 2.3.0 latest version * updates to CI * Update macOS download link * Updated macOS runner * Correct the configure step * Updated minimum cmake requirement to be 3.19 * Remove explicit arch for macOS runner * Updated README poster * Updated torchvision version in Dockerfile
1 parent bc8858c commit 511775f

File tree

41 files changed

+61
-61
lines changed

Some content is hidden

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

41 files changed

+61
-61
lines changed

.github/workflows/build_macos.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ on:
1818

1919
jobs:
2020
build-mac:
21-
name: "Macos 11.7 Xcode (Clang)"
22-
runs-on: macos-11
21+
name: "macOS 14.4.1 arm64 Xcode (Clang)"
22+
runs-on: macos-14
2323
strategy:
2424
matrix:
25-
xcode: [11.7, 12.4, 13.2.1]
25+
xcode: [14.3.1, 15.3]
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
- name: Set up CMake
30-
uses: jwlawson/actions-setup-cmake@v1.13
30+
uses: jwlawson/actions-setup-cmake@v2
3131
with:
32-
cmake-version: '3.14.0'
32+
cmake-version: '3.19.0'
3333
- name: Set up Xcode
3434
uses: maxim-lobanov/setup-xcode@v1
3535
with:

.github/workflows/build_ubuntu.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ on:
1818

1919
jobs:
2020
build-ubuntu:
21-
name: "Ubuntu 20.04 GCC"
22-
runs-on: ubuntu-20.04
21+
name: "Ubuntu 22.04 GCC"
22+
runs-on: ubuntu-22.04
2323
strategy:
2424
matrix:
25-
gcc: [9, 10, 11]
25+
gcc: [11, 12, 13]
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
- name: Set up CMake
30-
uses: jwlawson/actions-setup-cmake@v1.13
30+
uses: jwlawson/actions-setup-cmake@v2
3131
with:
32-
cmake-version: '3.14.0'
32+
cmake-version: '3.19.0'
3333
- name: Set up GCC
3434
uses: egor-tensin/setup-gcc@v1
3535
with:

.github/workflows/build_windows.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- {
2727
name: Windows MSVC 2019,
2828
os: windows-2019,
29-
cmake: '3.14.0'
29+
cmake: '3.19.0'
3030
}
3131
- {
3232
name: Windows MSVC 2022,
@@ -35,9 +35,9 @@ jobs:
3535
}
3636
steps:
3737
- name: Checkout
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
- name: Set up CMake
40-
uses: jwlawson/actions-setup-cmake@v1.13
40+
uses: jwlawson/actions-setup-cmake@v2
4141
with:
4242
cmake-version: ${{ matrix.config.cmake }}
4343
- name: Cpplint

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(pytorch-cpp VERSION 1.0.0 LANGUAGES CXX)
44

@@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
77
option(DOWNLOAD_DATASETS "Automatically download required datasets at build-time." ON)
88
option(CREATE_SCRIPTMODULES "Automatically create all required scriptmodule files at build-time (requires python3)." OFF)
99

10-
set(PYTORCH_VERSION "2.1.1")
10+
set(PYTORCH_VERSION "2.3.0")
1111
set(PYTORCH_MIN_VERSION "1.12.0")
1212

1313
find_package(Torch QUIET PATHS "${CMAKE_SOURCE_DIR}/libtorch")

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ RUN curl --silent --show-error --location --output ~/miniconda.sh https://repo.a
3131

3232
FROM conda AS conda-installs
3333
# Install pytorch for CPU and torchvision.
34-
ARG PYTORCH_VERSION=2.1.1
35-
ARG TORCHVISION_VERSION=0.16.1
34+
ARG PYTORCH_VERSION=2.3.0
35+
ARG TORCHVISION_VERSION=0.18.0
3636
ENV NO_CUDA=1
3737
RUN conda install pytorch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} cpuonly -y -c pytorch && conda clean -ya
3838

README.md

+6-6

cmake/check_files.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(check_files BASE_DIR FILES_TO_CHECK FILE_MD5S MISSING_FILES)
44
foreach(FILE_TO_CHECK ${${FILES_TO_CHECK}})

cmake/copy_torch_dlls.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(copy_torch_dlls TARGET_NAME)
44
# According to https://github.com/pytorch/pytorch/issues/25457

cmake/cpplint.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
find_program(CPPLINT cpplint)
44

cmake/create_torch_dll_hardlinks.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
44

cmake/fetch_cifar10.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_cifar10 DATA_DIR)
44
set(CIFAR_DIR "${DATA_DIR}/cifar10")

cmake/fetch_datasets.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
include(${CMAKE_CURRENT_LIST_DIR}/fetch_mnist.cmake)
44
include(${CMAKE_CURRENT_LIST_DIR}/fetch_cifar10.cmake)

cmake/fetch_flickr8k.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_flickr8k DATA_DIR)
44
set(FLICKR8K_DIR "${DATA_DIR}/flickr_8k")

cmake/fetch_imagenette.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_imagenette DATA_DIR)
44
set(IMAGENETTE_DIR "${DATA_DIR}/imagenette2-160")

cmake/fetch_libtorch.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
include(FetchContent)
44

@@ -33,7 +33,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
3333
message(WARNING "MacOS binaries do not support CUDA, will download CPU version instead.")
3434
set(LIBTORCH_DEVICE "cpu")
3535
endif()
36-
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-macos-${PYTORCH_VERSION}.zip")
36+
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-${PYTORCH_VERSION}.zip")
3737
else()
3838
message(FATAL_ERROR "Unsupported CMake System Name '${CMAKE_SYSTEM_NAME}' (expected 'Windows', 'Linux' or 'Darwin')")
3939
endif()

cmake/fetch_mnist.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_mnist DATA_DIR)
44
set(MNIST_DOWNLOAD_DIR "${DATA_DIR}/mnist/download")

cmake/fetch_neural_style_transfer_images.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_neural_style_transfer_imagers DATA_DIR)
44
set(NEURAL_STYLE_TRANSFER_IMAGES_DIR

cmake/fetch_penntreebank.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
function(fetch_penntreebank DATA_DIR)
44
set(PENNTREEBANK_DIR "${DATA_DIR}/penntreebank")

cmake/find_gz_extractor.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
# Find program that can extract .gz files.
44
# Based on: https://github.com/Amber-MD/cmake-buildscripts/blob/master/gzip.cmake

extern/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(extern VERSION 1.0.0 LANGUAGES CXX)
44

images/pytorch_cpp.jpg

25.8 KB

images/pytorch_cpp.png

-97.9 KB
Binary file not shown.

notebooks/pytorch_cpp_colab_notebook.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@
162162
"!rm -rf deps\n",
163163
"!mkdir deps\n",
164164
"%cd /content/deps\n",
165-
"!wget --no-check-certificate https://www.cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz\n",
166-
"!tar -xvf cmake-3.14.0-Linux-x86_64.tar.gz > /dev/null\n",
167-
"%mv cmake-3.14.0-Linux-x86_64 cmake-install\n",
165+
"!wget --no-check-certificate https://www.cmake.org/files/v3.19/cmake-3.19.0-Linux-x86_64.tar.gz\n",
166+
"!tar -xvf cmake-3.19.0-Linux-x86_64.tar.gz > /dev/null\n",
167+
"%mv cmake-3.19.0-Linux-x86_64 cmake-install\n",
168168
"old_path = %env PATH\n",
169169
"new_path = \"/content/deps/cmake-install:/content/deps/cmake-install/bin:\" + old_path\n",
170170
"%env PATH={new_path}\n",

tutorials/advanced/generative_adversarial_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(generative-adversarial-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/advanced/image_captioning/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(image-captioning VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/advanced/neural_style_transfer/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(neural-style-transfer VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/advanced/variational_autoencoder/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(variational-autoencoder VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/basics/feedforward_neural_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(feedforward-neural-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/basics/linear_regression/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(linear-regression VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/basics/logistic_regression/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(logistic-regression VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/basics/pytorch_basics/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(pytorch-basics VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/intermediate/bidirectional_recurrent_neural_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(bidirectional-recurrent-neural-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/intermediate/convolutional_neural_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(convolutional-neural-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/intermediate/deep_residual_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(deep-residual-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/intermediate/language_model/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(language-model VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/intermediate/recurrent_neural_network/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(recurrent-neural-network VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/popular/blitz/autograd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(autograd VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/popular/blitz/neural_networks/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(neural-networks VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/popular/blitz/tensors/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(tensors VERSION 1.0.0 LANGUAGES CXX)
44

tutorials/popular/blitz/training_a_classifier/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(training-a-classifier VERSION 1.0.0 LANGUAGES CXX)
44

utils/image_io/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
22

33
project(image-io VERSION 1.0.0 LANGUAGES CXX)
44

0 commit comments

Comments
 (0)