Add support for torch 2.10 (#420) #910
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TorchScript tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Check all PR | |
| concurrency: | |
| group: torch-tests-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.os }} / Torch ${{ matrix.torch-version }}${{ matrix.extra-name }} | |
| container: ${{ matrix.container }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| torch-version: "2.3" | |
| python-version: "3.10" | |
| cargo-test-flags: --release | |
| - os: ubuntu-24.04 | |
| torch-version: "2.10" | |
| python-version: "3.13" | |
| cargo-test-flags: --release | |
| do-valgrind: true | |
| # check the build on a stock Ubuntu 22.04, including cmake 3.22 | |
| - os: ubuntu-24.04 | |
| container: ubuntu:22.04 | |
| extra-name: ", cmake 3.22" | |
| torch-version: "2.10" | |
| python-version: "3.13" | |
| cargo-test-flags: "" | |
| cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g | |
| - os: macos-15 | |
| torch-version: "2.10" | |
| python-version: "3.13" | |
| cargo-test-flags: --release | |
| - os: windows-2022 | |
| torch-version: "2.10" | |
| python-version: "3.13" | |
| cargo-test-flags: --release | |
| steps: | |
| - name: install dependencies in container | |
| if: matrix.container == 'ubuntu:22.04' | |
| run: | | |
| apt update | |
| apt install -y software-properties-common | |
| add-apt-repository ppa:deadsnakes/ppa | |
| apt install -y cmake make gcc g++ git curl python3.10 python3.10-venv | |
| update-alternatives --install /usr/local/bin/python python /usr/bin/python3.10 1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure git safe directory | |
| if: matrix.container == 'ubuntu:22.04' | |
| run: git config --global --add safe.directory /__w/featomic/featomic | |
| - name: setup rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| # we get torch from pip to run the C++ test | |
| - name: setup Python | |
| if: matrix.container != 'ubuntu:22.04' | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: install valgrind | |
| if: matrix.do-valgrind | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y valgrind | |
| - name: Setup sccache | |
| uses: mozilla-actions/sccache-action@v0.0.9 | |
| with: | |
| version: "v0.10.0" | |
| - name: Setup sccache environnement variables | |
| run: | | |
| echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | |
| echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | |
| echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV | |
| echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV | |
| - name: run TorchScript C++ tests | |
| run: cargo test --package featomic-torch ${{ matrix.cargo-test-flags }} | |
| env: | |
| # Use the CPU only version of torch when building/running the code | |
| PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
| FEATOMIC_TORCH_TEST_VERSION: ${{ matrix.torch-version }} | |
| CXXFLAGS: ${{ matrix.cxx-flags }} |