Skip to content

Commit

Permalink
Update for PyTorch 2.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Apr 14, 2024
1 parent 420e41d commit a4c1432
Show file tree
Hide file tree
Showing 11 changed files with 909 additions and 17 deletions.
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.16.0
### Changed
- PyTorch v2.3 support

## v0.15.0
### Changed
- PyTorch v2.2 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.15.0"
version = "0.16.0"
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.15.0", path = "torch-sys" }
torch-sys = { version = "0.16.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.2.0* to be available on
This crate requires the C++ PyTorch library (libtorch) in version *v2.3.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.2.0 --recurse-submodule https://github.com/pytorch/pytorch.git pytorch-static --depth 1
git clone -b v2.3.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
3 changes: 2 additions & 1 deletion gen/gen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ let excluded_prefixes =
; "_nested_tensor"
; "_fused_adam"
; "sym_"
; "_fused_sgd"
]

let excluded_suffixes = [ "_forward"; "_forward_out" ]
Expand Down Expand Up @@ -878,7 +879,7 @@ let run

let () =
run
~yaml_filename:"third_party/pytorch/Declarations-v2.2.0.yaml"
~yaml_filename:"third_party/pytorch/Declarations-v2.3.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
Loading

0 comments on commit a4c1432

Please sign in to comment.