Skip to content

Commit 524cfb9

Browse files
HaoZekeLuthaf
andauthored
Update to PyTorch v2.10 (#143)
Co-authored-by: Guillaume Fraux <[email protected]>
1 parent 173eb24 commit 524cfb9

File tree

5 files changed

+32
-27
lines changed

5 files changed

+32
-27
lines changed

.github/workflows/build-wheels.yml

Lines changed: 15 additions & 13 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', '2.9']
34+
torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10']
3535
exclude:
3636
# remove mismatched arch-os combinations
3737
- {os: macos-15-intel, arch: arm64}
@@ -47,6 +47,7 @@ jobs:
4747
- {os: macos-15-intel, arch: x86_64, torch-version: '2.7'}
4848
- {os: macos-15-intel, arch: x86_64, torch-version: '2.8'}
4949
- {os: macos-15-intel, arch: x86_64, torch-version: '2.9'}
50+
- {os: macos-15-intel, arch: x86_64, torch-version: '2.10'}
5051
include:
5152
# add `cibw-arch` and `rust-target` to the different configurations
5253
- name: x86_64 Linux
@@ -84,6 +85,7 @@ jobs:
8485
- {torch-version: '2.7', cibw-python: 'cp312-*'}
8586
- {torch-version: '2.8', cibw-python: 'cp312-*'}
8687
- {torch-version: '2.9', cibw-python: 'cp312-*'}
88+
- {torch-version: '2.10', cibw-python: 'cp312-*'}
8789
steps:
8890
- uses: actions/checkout@v6
8991
with:
@@ -311,16 +313,16 @@ jobs:
311313
include:
312314
- os: ubuntu-24.04
313315
rust-target: x86_64-unknown-linux-gnu
314-
torch-version: "2.9"
315-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.9.0%2Bcpu.zip
316+
torch-version: "2.10"
317+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-2.10.0%2Bcpu.zip
316318
- os: macos-15
317319
rust-target: aarch64-apple-darwin
318-
torch-version: "2.9"
319-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.9.0.zip
320+
torch-version: "2.10"
321+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.10.0.zip
320322
- os: windows-2022
321323
rust-target: x86_64-pc-windows-msvc
322-
torch-version: "2.9"
323-
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.9.0%2Bcpu.zip
324+
torch-version: "2.10"
325+
libtorch-url: https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-2.10.0%2Bcpu.zip
324326
steps:
325327
- uses: actions/checkout@v6
326328
with:
@@ -344,9 +346,9 @@ jobs:
344346
345347
- name: setup libmetatensor
346348
run: |
347-
curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.1.17/metatensor-core-cxx-0.1.17.tar.gz
348-
tar xf metatensor-core-cxx-0.1.17.tar.gz
349-
cmake -B build-metatensor -S metatensor-core-cxx-0.1.17 \
349+
curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-core-v0.1.19/metatensor-core-cxx-0.1.19.tar.gz
350+
tar xf metatensor-core-cxx-0.1.19.tar.gz
351+
cmake -B build-metatensor -S metatensor-core-cxx-0.1.19 \
350352
-DMETATENSOR_INSTALL_BOTH_STATIC_SHARED=OFF \
351353
-DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \
352354
-DCMAKE_BUILD_TYPE=Debug
@@ -355,9 +357,9 @@ jobs:
355357
356358
- name: setup libmetatensor-torch
357359
run: |
358-
curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-torch-v0.8.2/metatensor-torch-cxx-0.8.2.tar.gz
359-
tar xf metatensor-torch-cxx-0.8.2.tar.gz
360-
cmake -B build-metatensor-torch -S metatensor-torch-cxx-0.8.2 \
360+
curl -L -O https://github.com/metatensor/metatensor/releases/download/metatensor-torch-v0.8.4/metatensor-torch-cxx-0.8.4.tar.gz
361+
tar xf metatensor-torch-cxx-0.8.4.tar.gz
362+
cmake -B build-metatensor-torch -S metatensor-torch-cxx-0.8.4 \
361363
-DCMAKE_INSTALL_PREFIX=$CMAKE_PREFIX_PATH \
362364
-DCMAKE_BUILD_TYPE=Debug
363365
cmake --build build-metatensor-torch --config Debug

.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.9"
26+
torch-version: "2.10"
2727
- os: ubuntu-24.04
2828
python-version: "3.13"
29-
torch-version: "2.9"
29+
torch-version: "2.10"
3030
- os: macos-15
3131
python-version: "3.13"
32-
torch-version: "2.9"
32+
torch-version: "2.10"
3333
- os: windows-2022
3434
python-version: "3.13"
35-
torch-version: "2.9"
35+
torch-version: "2.10"
3636
steps:
3737
- uses: actions/checkout@v6
3838
with:

metatomic-torch/CHANGELOG.md

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

2727
### Added
2828

29+
- Added support for torch v2.10
2930
- Added support for loading TorchScript extensions from deepmd-kit (#98)
3031

3132
## [Version 0.1.6](https://github.com/metatensor/metatomic/releases/tag/metatomic-torch-v0.1.6) - 2025-11-14

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ filterwarnings = [
6464
"ignore:ast.Str is deprecated and will be removed in Python 3.14:DeprecationWarning",
6565
"ignore:Attribute s is deprecated and will be removed in Python 3.14:DeprecationWarning",
6666
"ignore:ast.NameConstant is deprecated and will be removed in Python 3.14:DeprecationWarning",
67+
"ignore:`torch.jit.script` is deprecated. Please switch to `torch.compile` or `torch.export`:DeprecationWarning",
68+
"ignore:`torch.jit.save` is deprecated. Please switch to `torch.export`:DeprecationWarning",
6769
]
6870

6971
### ======================================================================== ###

tox.ini

Lines changed: 10 additions & 10 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.9}.*
60+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
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.9}.*
76+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
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.9}/ \
85+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.10}/ \
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.9}.*
100+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
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.9}/ \
109+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.10}/ \
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.9}/;\
119+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.10}/;\
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.9}/ \
131+
{env_site_packages_dir}/metatensor/torch/torch-{env:METATOMIC_TESTS_TORCH_VERSION:2.10}/ \
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.9}.*
146+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
147147
numpy {env:METATOMIC_TESTS_NUMPY_VERSION_PIN}
148148
vesin
149149
ase
@@ -170,7 +170,7 @@ description = Run the doctests defined in any metatomic package
170170
deps =
171171
{[testenv]testing_deps}
172172

173-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
173+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
174174
numpy {env:METATOMIC_TESTS_NUMPY_VERSION_PIN}
175175
vesin
176176
ase
@@ -227,7 +227,7 @@ deps =
227227
sphinxcontrib-details-directive # hide some information by default in HTML
228228

229229
# required for autodoc
230-
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.9}.*
230+
torch=={env:METATOMIC_TESTS_TORCH_VERSION:2.10}.*
231231

232232
# required for examples
233233
ase

0 commit comments

Comments
 (0)