Skip to content

Commit 65e5363

Browse files
committed
Drop torch <2.3 and add support for torch 2.9
1 parent 95fb774 commit 65e5363

5 files changed

Lines changed: 15 additions & 31 deletions

File tree

.github/workflows/build-wheels.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,15 @@ jobs:
9999
name: ${{ matrix.name }} (torch v${{ matrix.torch-version }})
100100
strategy:
101101
matrix:
102-
torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8']
102+
torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9']
103103
arch: ['arm64', 'x86_64']
104-
os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15-intel', 'macos-15', 'windows-2022']
104+
os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15', 'windows-2022']
105105
exclude:
106106
# remove mismatched arch-os combinations
107-
- {os: macos-15-intel, arch: arm64}
108107
- {os: windows-2022, arch: arm64}
109108
- {os: ubuntu-24.04, arch: arm64}
110109
- {os: macos-15, arch: x86_64}
111110
- {os: ubuntu-24.04-arm, arch: x86_64}
112-
# arch x86_64 on macos is only supported for torch <2.3
113-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.3'}
114-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.4'}
115-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.5'}
116-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.6'}
117-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.7'}
118-
- {os: macos-15-intel, arch: x86_64, torch-version: '2.8'}
119111
include:
120112
# add `cibw-arch` and `rust-target` to the different configurations
121113
- name: x86_64 Linux
@@ -128,11 +120,6 @@ jobs:
128120
arch: arm64
129121
rust-target: aarch64-unknown-linux-gnu
130122
cibw-arch: aarch64
131-
- name: x86_64 macOS
132-
os: macos-15-intel
133-
arch: x86_64
134-
rust-target: x86_64-apple-darwin
135-
cibw-arch: x86_64
136123
- name: arm64 macOS
137124
os: macos-15
138125
arch: arm64
@@ -144,14 +131,13 @@ jobs:
144131
rust-target: x86_64-pc-windows-msvc
145132
cibw-arch: AMD64
146133
# add the right python version image for each torch version
147-
- {torch-version: '2.1', cibw-python: 'cp311-*'}
148-
- {torch-version: '2.2', cibw-python: 'cp312-*'}
149134
- {torch-version: '2.3', cibw-python: 'cp312-*'}
150135
- {torch-version: '2.4', cibw-python: 'cp312-*'}
151136
- {torch-version: '2.5', cibw-python: 'cp312-*'}
152137
- {torch-version: '2.6', cibw-python: 'cp312-*'}
153138
- {torch-version: '2.7', cibw-python: 'cp312-*'}
154139
- {torch-version: '2.8', cibw-python: 'cp312-*'}
140+
- {torch-version: '2.9', cibw-python: 'cp312-*'}
155141
steps:
156142
- uses: actions/checkout@v4
157143
with:
@@ -233,9 +219,6 @@ jobs:
233219
- name: arm64 Linux
234220
os: ubuntu-24.04-arm
235221
arch: arm64
236-
- name: x86_64 macOS
237-
os: macos-15-intel
238-
arch: x86_64
239222
- name: arm64 macOS
240223
os: macos-15
241224
arch: arm64

.github/workflows/torch-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
matrix:
2020
include:
2121
- os: ubuntu-24.04
22-
torch-version: "2.1"
22+
torch-version: "2.3"
2323
python-version: "3.10"
2424
cargo-test-flags: --release
2525

2626
- os: ubuntu-24.04
27-
torch-version: "2.8"
27+
torch-version: "2.9"
2828
python-version: "3.13"
2929
cargo-test-flags: --release
3030
do-valgrind: true
@@ -33,18 +33,18 @@ jobs:
3333
- os: ubuntu-24.04
3434
container: ubuntu:22.04
3535
extra-name: ", cmake 3.22"
36-
torch-version: "2.8"
36+
torch-version: "2.9"
3737
python-version: "3.13"
3838
cargo-test-flags: ""
3939
cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g
4040

4141
- os: macos-15
42-
torch-version: "2.8"
42+
torch-version: "2.9"
4343
python-version: "3.13"
4444
cargo-test-flags: --release
4545

4646
- os: windows-2022
47-
torch-version: "2.8"
47+
torch-version: "2.9"
4848
python-version: "3.13"
4949
cargo-test-flags: --release
5050

featomic-torch/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows
2020
### Changed
2121

2222
- We now require Python >= 3.10
23+
- Added support for torch v2.9, removed support for torch 2.1 and 2.2
2324

2425
## [Version 0.7.1](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.1) - 2025-09-17
2526

featomic-torch/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ endif()
110110
# fixed version in `cmake/FindCUDNN.cmake`
111111
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
112112

113-
find_package(Torch 2.1 REQUIRED)
113+
find_package(Torch 2.3 REQUIRED)
114114

115115
# ============================================================================ #
116116
# Setup metatensor_torch
@@ -122,7 +122,7 @@ find_package(Torch 2.1 REQUIRED)
122122
#
123123
# When updating METATENSOR_TORCH_FETCH_VERSION, you will also have to update the
124124
# SHA256 sum of the file in `FetchContent_Declare`.
125-
set(METATENSOR_TORCH_FETCH_VERSION "0.8.0")
125+
set(METATENSOR_TORCH_FETCH_VERSION "0.8.2")
126126
set(REQUIRED_METATENSOR_TORCH_VERSION "0.8")
127127
if (FEATOMIC_FETCH_METATENSOR_TORCH)
128128
message(STATUS "Fetching metatensor-torch from github")
@@ -132,7 +132,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
132132
FetchContent_Declare(
133133
metatensor_torch
134134
URL ${URL_ROOT}/metatensor-torch-v${METATENSOR_TORCH_FETCH_VERSION}/metatensor-torch-cxx-${METATENSOR_TORCH_FETCH_VERSION}.tar.gz
135-
URL_HASH SHA256=61d383ce958deafe0e3916088185527680c9118588722b17ec5c39cfbaa6da55
135+
URL_HASH SHA256=0be618d0cdcfca86cd0c25f47d360b6a2410ebb09ece8d21f153e933ce64bb55
136136
)
137137

138138
FetchContent_MakeAvailable(metatensor_torch)
@@ -150,7 +150,7 @@ endif()
150150
#
151151
# When updating METATOMIC_TORCH_FETCH_VERSION, you will also have to update the
152152
# SHA256 sum of the file in `FetchContent_Declare`.
153-
set(METATOMIC_TORCH_FETCH_VERSION "0.1.4")
153+
set(METATOMIC_TORCH_FETCH_VERSION "0.1.7")
154154
set(REQUIRED_METATOMIC_TORCH_VERSION "0.1")
155155
if (FEATOMIC_FETCH_METATENSOR_TORCH)
156156
message(STATUS "Fetching metatomic-torch from github")
@@ -160,7 +160,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH)
160160
FetchContent_Declare(
161161
metatomic_torch
162162
URL ${URL_ROOT}/metatomic-torch-v${METATOMIC_TORCH_FETCH_VERSION}/metatomic-torch-cxx-${METATOMIC_TORCH_FETCH_VERSION}.tar.gz
163-
URL_HASH SHA256=385ec8b8515d674b6a9f093f724792b2469e7ea2365ca596f574b64e38494f94
163+
URL_HASH SHA256=726f5711b70c4b8cc80d9bc6c3ce6f3449f31d20acc644ab68dab083aa4ea572
164164
)
165165

166166
FetchContent_MakeAvailable(metatomic_torch)

featomic-torch/tests/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn setup_pytorch(build_dir: PathBuf) -> PathBuf {
8484
.expect("failed to run python");
8585
assert!(status.success(), "failed to run `python -m pip install --upgrade pip`");
8686

87-
let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.8.*".into());
87+
let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.9.*".into());
8888
let status = Command::new(&python)
8989
.arg("-m")
9090
.arg("pip")

0 commit comments

Comments
 (0)