Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for PyTorch 2.5.1. #906

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tch"
version = "0.18.0"
version = "0.18.1"
authors = ["Laurent Mazare <lmazare@gmail.com>"]
edition = "2021"
build = "build.rs"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions examples/python-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
6 changes: 3 additions & 3 deletions pyo3-tch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyo3-tch"
version = "0.18.0"
version = "0.18.1"
authors = ["Laurent Mazare <lmazare@gmail.com>"]
edition = "2021"
build = "build.rs"
Expand All @@ -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"] }
2 changes: 1 addition & 1 deletion torch-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "torch-sys"
version = "0.18.0"
version = "0.18.1"
authors = ["Laurent Mazare <lmazare@gmail.com>"]
edition = "2021"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions torch-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading