Skip to content

Commit

Permalink
Update for PyTorch 2.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Oct 17, 2024
1 parent c3e0116 commit 37298ee
Show file tree
Hide file tree
Showing 13 changed files with 557 additions and 111 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Changed

## v0.16.0
## v0.18.0
### Changed
- PyTorch v2.5 support

## v0.17.0
### Changed
- PyTorch v2.4 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.17.0"
version = "0.18.0"
authors = ["Laurent Mazare <[email protected]>"]
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.17.0", path = "torch-sys" }
torch-sys = { version = "0.18.0", 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.4.1* to be available on
This crate requires the C++ PyTorch library (libtorch) in version *v2.5.0* 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.4.1 --recurse-submodule https://github.com/pytorch/pytorch.git pytorch-static --depth 1
git clone -b v2.5.0 --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.17.0" }
tch = { path = "../..", features = ["python-extension"], version = "0.17.0" }
torch-sys = { path = "../../torch-sys", features = ["python-extension"], version = "0.17.0" }
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" }
2 changes: 1 addition & 1 deletion gen/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ let run

let () =
run
~yaml_filename:"third_party/pytorch/Declarations-v2.4.0.yaml"
~yaml_filename:"third_party/pytorch/Declarations-v2.5.0.yaml"
~cpp_filename:"torch-sys/libtch/torch_api_generated"
~ffi_filename:"torch-sys/src/c_generated.rs"
~wrapper_filename:"src/wrappers/tensor_generated.rs"
Expand Down
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.17.0"
version = "0.18.0"
authors = ["Laurent Mazare <[email protected]>"]
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.17.0" }
torch-sys = { path = "../torch-sys", features = ["python-extension"], version = "0.17.0" }
tch = { path = "..", features = ["python-extension"], version = "0.18.0" }
torch-sys = { path = "../torch-sys", features = ["python-extension"], version = "0.18.0" }
pyo3 = { version = "0.21", features = ["extension-module"] }
Loading

0 comments on commit 37298ee

Please sign in to comment.