Skip to content

Commit 40ca85c

Browse files
HaoZekeLuthaf
authored andcommitted
Add support for torch 2.9
1 parent b027ed1 commit 40ca85c

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

.github/workflows/build-wheels.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15-intel', 'macos-15', 'windows-2022']
3333
arch: ['arm64', 'x86_64']
34-
torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8']
34+
torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9']
3535
exclude:
3636
# remove mismatched arch-os combinations
3737
- {os: macos-15-intel, arch: arm64}
@@ -46,6 +46,7 @@ jobs:
4646
- {os: macos-15-intel, arch: x86_64, torch-version: '2.6'}
4747
- {os: macos-15-intel, arch: x86_64, torch-version: '2.7'}
4848
- {os: macos-15-intel, arch: x86_64, torch-version: '2.8'}
49+
- {os: macos-15-intel, arch: x86_64, torch-version: '2.9'}
4950
include:
5051
# add `cibw-arch` and `rust-target` to the different configurations
5152
- name: x86_64 Linux
@@ -82,6 +83,7 @@ jobs:
8283
- {torch-version: '2.6', cibw-python: 'cp312-*'}
8384
- {torch-version: '2.7', cibw-python: 'cp312-*'}
8485
- {torch-version: '2.8', cibw-python: 'cp312-*'}
86+
- {torch-version: '2.9', cibw-python: 'cp312-*'}
8587
steps:
8688
- uses: actions/checkout@v5
8789
with:
@@ -309,16 +311,16 @@ jobs:
309311
include:
310312
- os: ubuntu-24.04
311313
rust-target: x86_64-unknown-linux-gnu
312-
torch-version: "2.8"
313-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.8.0%2Bcpu.zip
314+
torch-version: "2.9"
315+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.9.0%2Bcpu.zip
314316
- os: macos-15
315317
rust-target: aarch64-apple-darwin
316-
torch-version: "2.8"
317-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.8.0.zip
318+
torch-version: "2.9"
319+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.9.0.zip
318320
- os: windows-2022
319321
rust-target: x86_64-pc-windows-msvc
320-
torch-version: "2.8"
321-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.8.0%2Bcpu.zip
322+
torch-version: "2.9"
323+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.9.0%2Bcpu.zip
322324
steps:
323325
- uses: actions/checkout@v5
324326
with:

.github/workflows/torch-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ jobs:
2323
numpy-version-pin: "<2.0"
2424
- os: ubuntu-24.04
2525
python-version: "3.10"
26-
torch-version: "2.8"
26+
torch-version: "2.9"
2727
- os: ubuntu-24.04
2828
python-version: "3.13"
29-
torch-version: "2.8"
29+
torch-version: "2.9"
3030
- os: macos-15
3131
python-version: "3.13"
32-
torch-version: "2.8"
32+
torch-version: "2.9"
3333
- os: windows-2022
3434
python-version: "3.13"
35-
torch-version: "2.8"
35+
torch-version: "2.9"
3636
steps:
3737
- uses: actions/checkout@v5
3838
with:

metatomic-torch/CHANGELOG.md

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

2424
### Added
2525

26+
- Added support for torch v2.9
2627
- `ModelOutput` now has a `description` field, to carry more information
2728
about a given output.
2829
- the `pick_output` function that can be used by simulation engines to pick the

tox.ini

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ description =
5757
deps =
5858
{[testenv]packaging_deps}
5959
{[testenv]metatensor_deps}
60-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
60+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
6161

6262
commands =
6363
pip wheel python/metatomic_torch {[testenv]build_single_wheel} --wheel-dir {envtmpdir}/dist
@@ -73,7 +73,7 @@ package = skip
7373
deps =
7474
cmake
7575
{[testenv]metatensor_deps}
76-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
76+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
7777

7878
commands =
7979
# configure cmake
@@ -82,7 +82,7 @@ commands =
8282
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
8383
-DCMAKE_PREFIX_PATH={env_site_packages_dir}/metatensor/;\
8484
{env_site_packages_dir}/torch/;\
85-
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.8}/ \
85+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.9}/ \
8686
-DMETATOMIC_TORCH_TESTS=ON
8787

8888
# build code with cmake
@@ -97,7 +97,7 @@ package = skip
9797
deps =
9898
cmake
9999
{[testenv]metatensor_deps}
100-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
100+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
101101

102102
commands =
103103
# configure, build and install metatomic-torch
@@ -106,7 +106,7 @@ commands =
106106
-DCMAKE_INSTALL_PREFIX={env_dir}/usr/ \
107107
-DCMAKE_PREFIX_PATH={env_site_packages_dir}/metatensor/;\
108108
{env_site_packages_dir}/torch/;\
109-
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.8}/ \
109+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.9}/ \
110110
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
111111
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
112112
cmake --build {env_dir}/build-metatomic-torch --config Debug --parallel --target install
@@ -116,7 +116,7 @@ commands =
116116
-DCMAKE_BUILD_TYPE=Debug \
117117
-DCMAKE_PREFIX_PATH={env_site_packages_dir}/metatensor/;\
118118
{env_site_packages_dir}/torch/;\
119-
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.8}/;\
119+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.9}/;\
120120
{env_dir}/usr/ \
121121
-DUSE_CMAKE_SUBDIRECTORY=OFF
122122

@@ -128,7 +128,7 @@ commands =
128128
-DCMAKE_BUILD_TYPE=Debug \
129129
-DCMAKE_PREFIX_PATH={env_site_packages_dir}/metatensor/;\
130130
{env_site_packages_dir}/torch/;\
131-
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.8}/ \
131+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.9}/ \
132132
-DUSE_CMAKE_SUBDIRECTORY=ON
133133

134134
cmake --build {env_dir}/build-subdirectory --config Debug --parallel
@@ -143,7 +143,7 @@ description = Run the tests of the metatomic-torch Python package
143143
deps =
144144
{[testenv]testing_deps}
145145
{[testenv]metatensor_deps}
146-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
146+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
147147
numpy {env:METATOMIC_TESTS_NUMPY_VERSION_PIN}
148148
vesin
149149
ase
@@ -167,7 +167,7 @@ description = Run the doctests defined in any metatomic package
167167
deps =
168168
{[testenv]testing_deps}
169169

170-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
170+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
171171
numpy {env:METATOMIC_TESTS_NUMPY_VERSION_PIN}
172172
vesin
173173
ase
@@ -216,15 +216,15 @@ deps =
216216
sphinx-toggleprompt # hide the prompt (>>>) in python doctests
217217
sphinx-gallery # convert python files into nice documentation
218218
sphinx-sitemap # automatically generates sitemap
219-
pygments # syntax highligthing
219+
pygments # syntax highlighting
220220
breathe # C and C++ => sphinx through doxygen
221221
furo # sphinx theme
222222
myst_parser # include markdown documents in sphinx
223223
sphinx-design # helpers for nicer docs website (tabs, grids, cards, …)
224224
sphinxcontrib-details-directive # hide some information by default in HTML
225225

226226
# required for autodoc
227-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.8}.*
227+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
228228

229229
# required for examples
230230
ase

0 commit comments

Comments
 (0)