Skip to content

Commit d80505f

Browse files
committed
ARM runners
1 parent 5dfca47 commit d80505f

File tree

3 files changed

+48
-19
lines changed

3 files changed

+48
-19
lines changed

.github/workflows/accelerate-manylinux.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,28 @@ jobs:
5050
path: accelerate/dist/*
5151

5252
wheels:
53-
name: Build architecture-specific wheels on ${{ matrix.os }}
53+
name: Build architecture-specific wheels on ${{ matrix.os }}-${{ matrix.arch }}
5454
runs-on: ${{ matrix.os }}
5555
strategy:
5656
matrix:
57-
os:
58-
- ubuntu-latest
59-
- windows-latest
60-
- macOS-latest
57+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest] # Use specific versions for clarity
58+
arch: [x86_64, arm64]
59+
exclude:
60+
- os: ubuntu-latest
61+
arch: arm64
62+
- os: ubuntu-24.04-arm # No need to specify arch, it's already implicit
63+
arch: x86_64 # Exclude x86_64 on ARM
64+
- os: macos-latest # Exclude macOS 14-15 (Sonoma)
65+
arch: x86_64 # Exclude x86_64 explicitly
66+
- os: macos-13 # Exclude macOS 13 (Ventura) - arm64
67+
arch: arm64 # Exclude arm64 on macOS 13
6168
steps:
6269
- name: Check out repository
6370
uses: actions/checkout@v4
6471
- name: Install Python
6572
uses: actions/setup-python@v5
6673
with:
6774
python-version: 3.x
68-
- name: Set up QEMU
69-
if: runner.os == 'Linux'
70-
uses: docker/setup-qemu-action@v2
71-
with:
72-
platforms: all
7375

7476
- name: Build wheels (develop)
7577
uses: pypa/[email protected]
@@ -79,7 +81,8 @@ jobs:
7981
output-dir: "./accelerate/dist"
8082
env:
8183
BUILD_EXTENSION: yes
82-
CIBW_SKIP: "pp*"
84+
CIBW_ARCHS_MACOS: ${{ matrix.os }}-${{ matrix.arch }}
85+
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
8386

8487
- name: Build wheels (master)
8588
uses: pypa/[email protected]
@@ -89,12 +92,13 @@ jobs:
8992
output-dir: "./accelerate/dist"
9093
env:
9194
BUILD_EXTENSION: yes
92-
CIBW_SKIP: "pp*"
95+
CIBW_ARCHS_MACOS: ${{ matrix.arch }}
96+
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*"
9397

9498
- name: Save wheels
9599
uses: actions/upload-artifact@v4
96100
with:
97-
name: accel-binary-${{ matrix.os }}
101+
name: accel-binary-${{ matrix.os }}-${{ matrix.arch }}
98102
path: accelerate/dist/*.whl
99103

100104
pypi-publish-accel:

build-manylinux.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
#! /bin/bash
1+
#!/bin/bash
2+
3+
ARCH=$(uname -m)
4+
if [ "$ARCH" == "x86_64" ]; then
5+
MANYLINUX="manylinux_2_28_x86_64"
6+
elif [ "$ARCH" == "aarch64" ]; then
7+
MANYLINUX="manylinux_2_28_aarch64"
8+
else
9+
echo "Unsupported architecture: $ARCH"
10+
exit 1
11+
fi
212

313
docker run \
414
-it \
5-
-v`pwd`:/io \
6-
-ephemeral \
7-
-ePLAT=manylinux2014_x86_64 \
15+
-v "$(pwd)":/io \
16+
-e PLAT="$MANYLINUX" \
817
--rm \
9-
quay.io/pypa/manylinux2014_x86_64 \
18+
quay.io/pypa/"$MANYLINUX" \
1019
/io/accelerate/_build-manylinux.sh

pyproject.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,20 @@ ignore = [
9595
]
9696

9797
[tool.ruff.format]
98-
quote-style = "single"
98+
quote-style = "single"
99+
100+
[tool.cibuildwheel]
101+
archs = "native"
102+
# Necessary to see build output from the actual compilation
103+
build-verbosity = 1
104+
105+
# linux images
106+
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
107+
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"
108+
109+
# Don't test Python 3.8 wheels on macOS/arm64
110+
test-skip="cp38-macosx_*:arm64"
111+
112+
# Needed for full C++17 support
113+
[tool.cibuildwheel.macos.environment]
114+
MACOSX_DEPLOYMENT_TARGET = "10.15"

0 commit comments

Comments
 (0)