diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index b9567fd79..42340aa70 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -99,23 +99,15 @@ jobs: name: ${{ matrix.name }} (torch v${{ matrix.torch-version }}) strategy: matrix: - torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8'] + torch-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9'] arch: ['arm64', 'x86_64'] - os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15-intel', 'macos-15', 'windows-2022'] + os: ['ubuntu-24.04', 'ubuntu-24.04-arm', 'macos-15', 'windows-2022'] exclude: # remove mismatched arch-os combinations - - {os: macos-15-intel, arch: arm64} - {os: windows-2022, arch: arm64} - {os: ubuntu-24.04, arch: arm64} - {os: macos-15, arch: x86_64} - {os: ubuntu-24.04-arm, arch: x86_64} - # arch x86_64 on macos is only supported for torch <2.3 - - {os: macos-15-intel, arch: x86_64, torch-version: '2.3'} - - {os: macos-15-intel, arch: x86_64, torch-version: '2.4'} - - {os: macos-15-intel, arch: x86_64, torch-version: '2.5'} - - {os: macos-15-intel, arch: x86_64, torch-version: '2.6'} - - {os: macos-15-intel, arch: x86_64, torch-version: '2.7'} - - {os: macos-15-intel, arch: x86_64, torch-version: '2.8'} include: # add `cibw-arch` and `rust-target` to the different configurations - name: x86_64 Linux @@ -128,11 +120,6 @@ jobs: arch: arm64 rust-target: aarch64-unknown-linux-gnu cibw-arch: aarch64 - - name: x86_64 macOS - os: macos-15-intel - arch: x86_64 - rust-target: x86_64-apple-darwin - cibw-arch: x86_64 - name: arm64 macOS os: macos-15 arch: arm64 @@ -144,14 +131,13 @@ jobs: rust-target: x86_64-pc-windows-msvc cibw-arch: AMD64 # add the right python version image for each torch version - - {torch-version: '2.1', cibw-python: 'cp311-*'} - - {torch-version: '2.2', cibw-python: 'cp312-*'} - {torch-version: '2.3', cibw-python: 'cp312-*'} - {torch-version: '2.4', cibw-python: 'cp312-*'} - {torch-version: '2.5', cibw-python: 'cp312-*'} - {torch-version: '2.6', cibw-python: 'cp312-*'} - {torch-version: '2.7', cibw-python: 'cp312-*'} - {torch-version: '2.8', cibw-python: 'cp312-*'} + - {torch-version: '2.9', cibw-python: 'cp312-*'} steps: - uses: actions/checkout@v4 with: @@ -233,9 +219,6 @@ jobs: - name: arm64 Linux os: ubuntu-24.04-arm arch: arm64 - - name: x86_64 macOS - os: macos-15-intel - arch: x86_64 - name: arm64 macOS os: macos-15 arch: arm64 diff --git a/.github/workflows/torch-tests.yml b/.github/workflows/torch-tests.yml index 93fd31c80..4b066b590 100644 --- a/.github/workflows/torch-tests.yml +++ b/.github/workflows/torch-tests.yml @@ -19,12 +19,12 @@ jobs: matrix: include: - os: ubuntu-24.04 - torch-version: "2.1" + torch-version: "2.3" python-version: "3.10" cargo-test-flags: --release - os: ubuntu-24.04 - torch-version: "2.8" + torch-version: "2.9" python-version: "3.13" cargo-test-flags: --release do-valgrind: true @@ -33,18 +33,18 @@ jobs: - os: ubuntu-24.04 container: ubuntu:22.04 extra-name: ", cmake 3.22" - torch-version: "2.8" + torch-version: "2.9" python-version: "3.13" cargo-test-flags: "" cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g - os: macos-15 - torch-version: "2.8" + torch-version: "2.9" python-version: "3.13" cargo-test-flags: --release - os: windows-2022 - torch-version: "2.8" + torch-version: "2.9" python-version: "3.13" cargo-test-flags: --release diff --git a/featomic-torch/CHANGELOG.md b/featomic-torch/CHANGELOG.md index 540aaf67a..ef4ad194c 100644 --- a/featomic-torch/CHANGELOG.md +++ b/featomic-torch/CHANGELOG.md @@ -20,6 +20,7 @@ a changelog](https://keepachangelog.com/en/1.1.0/) format. This project follows ### Changed - We now require Python >= 3.10 +- Added support for torch v2.9, removed support for torch 2.1 and 2.2 ## [Version 0.7.1](https://github.com/metatensor/featomic/releases/tag/featomic-torch-v0.7.1) - 2025-09-17 diff --git a/featomic-torch/CMakeLists.txt b/featomic-torch/CMakeLists.txt index 4eb9237bc..1cc03883f 100644 --- a/featomic-torch/CMakeLists.txt +++ b/featomic-torch/CMakeLists.txt @@ -110,7 +110,7 @@ endif() # fixed version in `cmake/FindCUDNN.cmake` set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}") -find_package(Torch 2.1 REQUIRED) +find_package(Torch 2.3 REQUIRED) # ============================================================================ # # Setup metatensor_torch @@ -122,7 +122,7 @@ find_package(Torch 2.1 REQUIRED) # # When updating METATENSOR_TORCH_FETCH_VERSION, you will also have to update the # SHA256 sum of the file in `FetchContent_Declare`. -set(METATENSOR_TORCH_FETCH_VERSION "0.8.0") +set(METATENSOR_TORCH_FETCH_VERSION "0.8.2") set(REQUIRED_METATENSOR_TORCH_VERSION "0.8") if (FEATOMIC_FETCH_METATENSOR_TORCH) message(STATUS "Fetching metatensor-torch from github") @@ -132,7 +132,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH) FetchContent_Declare( metatensor_torch URL ${URL_ROOT}/metatensor-torch-v${METATENSOR_TORCH_FETCH_VERSION}/metatensor-torch-cxx-${METATENSOR_TORCH_FETCH_VERSION}.tar.gz - URL_HASH SHA256=61d383ce958deafe0e3916088185527680c9118588722b17ec5c39cfbaa6da55 + URL_HASH SHA256=0be618d0cdcfca86cd0c25f47d360b6a2410ebb09ece8d21f153e933ce64bb55 ) FetchContent_MakeAvailable(metatensor_torch) @@ -150,7 +150,7 @@ endif() # # When updating METATOMIC_TORCH_FETCH_VERSION, you will also have to update the # SHA256 sum of the file in `FetchContent_Declare`. -set(METATOMIC_TORCH_FETCH_VERSION "0.1.4") +set(METATOMIC_TORCH_FETCH_VERSION "0.1.7") set(REQUIRED_METATOMIC_TORCH_VERSION "0.1") if (FEATOMIC_FETCH_METATENSOR_TORCH) message(STATUS "Fetching metatomic-torch from github") @@ -160,7 +160,7 @@ if (FEATOMIC_FETCH_METATENSOR_TORCH) FetchContent_Declare( metatomic_torch URL ${URL_ROOT}/metatomic-torch-v${METATOMIC_TORCH_FETCH_VERSION}/metatomic-torch-cxx-${METATOMIC_TORCH_FETCH_VERSION}.tar.gz - URL_HASH SHA256=385ec8b8515d674b6a9f093f724792b2469e7ea2365ca596f574b64e38494f94 + URL_HASH SHA256=726f5711b70c4b8cc80d9bc6c3ce6f3449f31d20acc644ab68dab083aa4ea572 ) FetchContent_MakeAvailable(metatomic_torch) diff --git a/featomic-torch/tests/utils/mod.rs b/featomic-torch/tests/utils/mod.rs index f620e53aa..62d21840a 100644 --- a/featomic-torch/tests/utils/mod.rs +++ b/featomic-torch/tests/utils/mod.rs @@ -84,7 +84,7 @@ pub fn setup_pytorch(build_dir: PathBuf) -> PathBuf { .expect("failed to run python"); assert!(status.success(), "failed to run `python -m pip install --upgrade pip`"); - let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.8.*".into()); + let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.9.*".into()); let status = Command::new(&python) .arg("-m") .arg("pip")