From 1c20be015de66ac0b6eb8188b232c3c48edcc850 Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 31 Oct 2024 09:12:10 +0100 Subject: [PATCH] Update for PyTorch 2.5.1. --- CHANGELOG.md | 4 ++++ Cargo.toml | 4 ++-- README.md | 4 ++-- examples/python-extension/Cargo.toml | 6 +++--- pyo3-tch/Cargo.toml | 6 +++--- torch-sys/Cargo.toml | 2 +- torch-sys/build.rs | 4 ++-- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6903d40..7a0d9672 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Changed +## v0.18.1 +### Changed +- PyTorch v2.5.1 support + ## v0.18.0 ### Changed - PyTorch v2.5 support diff --git a/Cargo.toml b/Cargo.toml index 11736027..a9994f53 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tch" -version = "0.18.0" +version = "0.18.1" authors = ["Laurent Mazare "] edition = "2021" build = "build.rs" @@ -22,7 +22,7 @@ libc = "0.2.0" ndarray = "0.15" rand = "0.8" thiserror = "1" -torch-sys = { version = "0.18.0", path = "torch-sys" } +torch-sys = { version = "0.18.1", path = "torch-sys" } zip = "0.6" half = "2" safetensors = "0.3.0" diff --git a/README.md b/README.md index b815dc7e..76869647 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The code generation part for the C api on top of libtorch comes from ## Getting Started -This crate requires the C++ PyTorch library (libtorch) in version *v2.5.0* to be available on +This crate requires the C++ PyTorch library (libtorch) in version *v2.5.1* to be available on your system. You can either: - Use the system-wide libtorch installation (default). @@ -85,7 +85,7 @@ seem to include `libtorch.a` by default so this would have to be compiled manually, e.g. via the following: ```bash -git clone -b v2.5.0 --recurse-submodule /~https://github.com/pytorch/pytorch.git pytorch-static --depth 1 +git clone -b v2.5.1 --recurse-submodule /~https://github.com/pytorch/pytorch.git pytorch-static --depth 1 cd pytorch-static USE_CUDA=OFF BUILD_SHARED_LIBS=OFF python setup.py build # export LIBTORCH to point at the build directory in pytorch-static. diff --git a/examples/python-extension/Cargo.toml b/examples/python-extension/Cargo.toml index 989b71e8..523e1edf 100644 --- a/examples/python-extension/Cargo.toml +++ b/examples/python-extension/Cargo.toml @@ -18,6 +18,6 @@ crate-type = ["cdylib"] [dependencies] pyo3 = { version = "0.21", features = ["extension-module"] } -pyo3-tch = { path = "../../pyo3-tch", version = "0.18.0" } -tch = { path = "../..", features = ["python-extension"], version = "0.18.0" } -torch-sys = { path = "../../torch-sys", features = ["python-extension"], version = "0.18.0" } +pyo3-tch = { path = "../../pyo3-tch", version = "0.18.1" } +tch = { path = "../..", features = ["python-extension"], version = "0.18.1" } +torch-sys = { path = "../../torch-sys", features = ["python-extension"], version = "0.18.1" } diff --git a/pyo3-tch/Cargo.toml b/pyo3-tch/Cargo.toml index 34e24c07..e0c4041e 100644 --- a/pyo3-tch/Cargo.toml +++ b/pyo3-tch/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-tch" -version = "0.18.0" +version = "0.18.1" authors = ["Laurent Mazare "] edition = "2021" build = "build.rs" @@ -12,6 +12,6 @@ categories = ["science"] license = "MIT/Apache-2.0" [dependencies] -tch = { path = "..", features = ["python-extension"], version = "0.18.0" } -torch-sys = { path = "../torch-sys", features = ["python-extension"], version = "0.18.0" } +tch = { path = "..", features = ["python-extension"], version = "0.18.1" } +torch-sys = { path = "../torch-sys", features = ["python-extension"], version = "0.18.1" } pyo3 = { version = "0.21", features = ["extension-module"] } diff --git a/torch-sys/Cargo.toml b/torch-sys/Cargo.toml index ef7f1604..289bf176 100644 --- a/torch-sys/Cargo.toml +++ b/torch-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torch-sys" -version = "0.18.0" +version = "0.18.1" authors = ["Laurent Mazare "] edition = "2021" build = "build.rs" diff --git a/torch-sys/build.rs b/torch-sys/build.rs index dacc5405..c0148505 100644 --- a/torch-sys/build.rs +++ b/torch-sys/build.rs @@ -10,7 +10,7 @@ use anyhow::{Context, Result}; use std::path::{Path, PathBuf}; use std::{env, fs, io}; -const TORCH_VERSION: &str = "2.5.0"; +const TORCH_VERSION: &str = "2.5.1"; const PYTHON_PRINT_PYTORCH_DETAILS: &str = r" import torch from torch.utils import cpp_extension @@ -158,7 +158,7 @@ fn version_check(version: &str) -> Result<()> { return Ok(()); } let version = version.trim(); - // Typical version number is 2.5.0+cpu or 2.5.0+cu121 + // Typical version number is 2.5.1+cpu or 2.5.1+cu121 let version = match version.split_once('+') { None => version, Some((version, _)) => version,