Skip to content

Commit dbd3327

Browse files
committed
Test and build wheels with Torch 2.6
1 parent cc652ab commit dbd3327

File tree

9 files changed

+57
-32
lines changed

9 files changed

+57
-32
lines changed

.github/workflows/build-wheels.yml

+28-14
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Set up Python
6666
uses: actions/setup-python@v5
6767
with:
68-
python-version: "3.12"
68+
python-version: "3.13"
6969

7070
- name: install dependencies
7171
run: python -m pip install cibuildwheel twine
@@ -99,7 +99,7 @@ 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']
102+
torch-version: ['2.1', '2.2', '2.3', '2.4', '2.5', '2.6']
103103
arch: ['arm64', 'x86_64']
104104
os: ['ubuntu-22.04', 'ubuntu-22.04-arm', 'macos-13', 'macos-14', 'windows-2022']
105105
exclude:
@@ -113,6 +113,7 @@ jobs:
113113
- {os: macos-13, arch: x86_64, torch-version: '2.3'}
114114
- {os: macos-13, arch: x86_64, torch-version: '2.4'}
115115
- {os: macos-13, arch: x86_64, torch-version: '2.5'}
116+
- {os: macos-13, arch: x86_64, torch-version: '2.6'}
116117
include:
117118
# add `cibw-arch` and `rust-target` to the different configurations
118119
- name: x86_64 Linux
@@ -140,12 +141,22 @@ jobs:
140141
arch: x86_64
141142
rust-target: x86_64-pc-windows-msvc
142143
cibw-arch: AMD64
143-
# add the right python version for each torch version
144-
- {torch-version: '2.1', python-version: '3.11', cibw-python: 'cp311-*'}
145-
- {torch-version: '2.2', python-version: '3.12', cibw-python: 'cp312-*'}
146-
- {torch-version: '2.3', python-version: '3.12', cibw-python: 'cp312-*'}
147-
- {torch-version: '2.4', python-version: '3.12', cibw-python: 'cp312-*'}
148-
- {torch-version: '2.5', python-version: '3.12', cibw-python: 'cp312-*'}
144+
# add the right python version image for each torch version
145+
- {torch-version: '2.1', cibw-python: 'cp311-*'}
146+
- {torch-version: '2.2', cibw-python: 'cp312-*'}
147+
- {torch-version: '2.3', cibw-python: 'cp312-*'}
148+
- {torch-version: '2.4', cibw-python: 'cp312-*'}
149+
- {torch-version: '2.5', cibw-python: 'cp312-*'}
150+
- {torch-version: '2.6', cibw-python: 'cp312-*'}
151+
# set the right manylinux image to use
152+
- {torch-version: '2.1', manylinux-version: "2014"}
153+
- {torch-version: '2.2', manylinux-version: "2014"}
154+
- {torch-version: '2.3', manylinux-version: "2014"}
155+
- {torch-version: '2.4', manylinux-version: "2014"}
156+
- {torch-version: '2.5', manylinux-version: "2014"}
157+
# only torch >+ 2.6 on arm64-linux needs the newer manylinux
158+
- {torch-version: '2.6', arch: arm64, manylinux-version: "_2_28"}
159+
- {torch-version: '2.6', arch: x86_64, manylinux-version: "2014"}
149160
steps:
150161
- uses: actions/checkout@v4
151162
with:
@@ -160,14 +171,17 @@ jobs:
160171
- name: Set up Python
161172
uses: actions/setup-python@v5
162173
with:
163-
python-version: ${{ matrix.python-version }}
174+
python-version: "3.13"
164175

165176
- name: install dependencies
166177
run: python -m pip install cibuildwheel
167178

168179
- name: build manylinux with rust docker image
169180
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-22.04-arm'
170-
run: docker buildx build -t rustc-manylinux2014_${{ matrix.cibw-arch }} python/scripts/rustc-manylinux2014_${{ matrix.cibw-arch }}
181+
run: |
182+
docker buildx build \
183+
-t rustc-manylinux${{ matrix.manylinux-version }}_${{ matrix.cibw-arch }} \
184+
python/scripts/rustc-manylinux${{ matrix.manylinux-version }}_${{ matrix.cibw-arch }}
171185
172186
- name: build featomic-torch wheel
173187
run: python -m cibuildwheel python/featomic_torch
@@ -176,8 +190,8 @@ jobs:
176190
CIBW_SKIP: "*musllinux*"
177191
CIBW_ARCHS: ${{ matrix.cibw-arch }}
178192
CIBW_BUILD_VERBOSITY: 1
179-
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux2014_x86_64
180-
CIBW_MANYLINUX_AARCH64_IMAGE: rustc-manylinux2014_aarch64
193+
CIBW_MANYLINUX_X86_64_IMAGE: rustc-manylinux${{ matrix.manylinux-version }}_x86_64
194+
CIBW_MANYLINUX_AARCH64_IMAGE: rustc-manylinux${{ matrix.manylinux-version }}_aarch64
181195
# FEATOMIC_NO_LOCAL_DEPS is set to 1 when building a tag of
182196
# featomic-torch, which will force to use the version of featomic
183197
# already released on PyPI. Otherwise, this will use the version of
@@ -245,7 +259,7 @@ jobs:
245259
- name: Set up Python
246260
uses: actions/setup-python@v5
247261
with:
248-
python-version: "3.12"
262+
python-version: "3.13"
249263

250264
- name: install dependencies
251265
run: python -m pip install twine wheel
@@ -294,7 +308,7 @@ jobs:
294308
- name: Set up Python
295309
uses: actions/setup-python@v5
296310
with:
297-
python-version: "3.12"
311+
python-version: "3.13"
298312

299313
- name: build featomic sdist
300314
run: |

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: setup Python
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.12"
26+
python-version: "3.13"
2727

2828
- name: setup rust
2929
uses: dtolnay/rust-toolchain@master

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: setup Python
3232
uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.13"
3535

3636
- name: install dependencies
3737
run: |

.github/workflows/python-tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
- os: ubuntu-22.04
2222
python-version: "3.9"
2323
- os: ubuntu-22.04
24-
python-version: "3.12"
24+
python-version: "3.13"
2525
- os: macos-14
26-
python-version: "3.12"
26+
python-version: "3.13"
2727
- os: windows-2022
28-
python-version: "3.12"
28+
python-version: "3.13"
2929
steps:
3030
- uses: actions/checkout@v4
3131

@@ -68,7 +68,7 @@ jobs:
6868
name: Python ${{ matrix.python-version }} / check build
6969
strategy:
7070
matrix:
71-
python-version: ['3.9', '3.12']
71+
python-version: ['3.9', '3.13']
7272
os: [ubuntu-22.04]
7373
steps:
7474
- uses: actions/checkout@v4

.github/workflows/rust-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
uses: actions/setup-python@v5
9191
if: "!matrix.container"
9292
with:
93-
python-version: "3.12"
93+
python-version: "3.13"
9494

9595
- name: setup rust
9696
uses: dtolnay/rust-toolchain@master

.github/workflows/torch-tests.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,32 @@ jobs:
1919
matrix:
2020
include:
2121
- os: ubuntu-22.04
22-
torch-version: 1.12.*
22+
torch-version: "1.12"
2323
python-version: "3.9"
2424
cargo-test-flags: --release
2525

2626
- os: ubuntu-22.04
27-
torch-version: 2.3.*
28-
python-version: "3.12"
27+
torch-version: "2.6"
28+
python-version: "3.13"
2929
cargo-test-flags: --release
3030
do-valgrind: true
3131

3232
- os: ubuntu-20.04
3333
container: ubuntu:20.04
3434
extra-name: ", cmake 3.16"
35-
torch-version: 2.5.*
36-
python-version: "3.12"
35+
torch-version: "2.6"
36+
python-version: "3.13"
3737
cargo-test-flags: ""
3838
cxx-flags: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -g
3939

4040
- os: macos-14
41-
torch-version: 2.3.*
42-
python-version: "3.12"
41+
torch-version: "2.6"
42+
python-version: "3.13"
4343
cargo-test-flags: --release
4444

4545
- os: windows-2022
46-
# Torch 2.3.0 is broken on Windows, and 2.2 has https://github.com/pytorch/pytorch/issues/118862
47-
torch-version: 2.1.*
48-
python-version: "3.11"
46+
torch-version: "2.6"
47+
python-version: "3.13"
4948
cargo-test-flags: --release
5049

5150
steps:

featomic-torch/tests/utils/mod.rs

+1-1
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.3.*".into());
87+
let torch_version = std::env::var("FEATOMIC_TORCH_TEST_VERSION").unwrap_or("2.6.*".into());
8888
let status = Command::new(&python)
8989
.arg("-m")
9090
.arg("pip")

featomic-torch/tests/valgrind.supp

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
fun:malloc
2323
...
2424
fun:mkl_serv_malloc
25+
...
2526
fun:mkl_serv_domain_get_max_threads
2627
...
2728
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Use manylinux docker image as a base
2+
FROM quay.io/pypa/manylinux_2_28_aarch64
3+
4+
RUN yum install git -y
5+
RUN git config --global --add safe.directory /code
6+
7+
# Download rustup-init asn install
8+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain 1.75
9+
10+
ENV PATH="/root/.cargo/bin:${PATH}"
11+
ENV RUST_BUILD_TARGET="aarch64-unknown-linux-gnu"

0 commit comments

Comments
 (0)