Skip to content

Commit

Permalink
ARM runners
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnynunez committed Feb 18, 2025
1 parent 5dfca47 commit d80505f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 19 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/accelerate-manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,28 @@ jobs:
path: accelerate/dist/*

wheels:
name: Build architecture-specific wheels on ${{ matrix.os }}
name: Build architecture-specific wheels on ${{ matrix.os }}-${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest] # Use specific versions for clarity
arch: [x86_64, arm64]
exclude:
- os: ubuntu-latest
arch: arm64
- os: ubuntu-24.04-arm # No need to specify arch, it's already implicit
arch: x86_64 # Exclude x86_64 on ARM
- os: macos-latest # Exclude macOS 14-15 (Sonoma)
arch: x86_64 # Exclude x86_64 explicitly
- os: macos-13 # Exclude macOS 13 (Ventura) - arm64
arch: arm64 # Exclude arm64 on macOS 13
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

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

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

- name: Save wheels
uses: actions/upload-artifact@v4
with:
name: accel-binary-${{ matrix.os }}
name: accel-binary-${{ matrix.os }}-${{ matrix.arch }}
path: accelerate/dist/*.whl

pypi-publish-accel:
Expand Down
19 changes: 14 additions & 5 deletions build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#! /bin/bash
#!/bin/bash

ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
MANYLINUX="manylinux_2_28_x86_64"
elif [ "$ARCH" == "aarch64" ]; then
MANYLINUX="manylinux_2_28_aarch64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi

docker run \
-it \
-v`pwd`:/io \
-ephemeral \
-ePLAT=manylinux2014_x86_64 \
-v "$(pwd)":/io \
-e PLAT="$MANYLINUX" \
--rm \
quay.io/pypa/manylinux2014_x86_64 \
quay.io/pypa/"$MANYLINUX" \
/io/accelerate/_build-manylinux.sh
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,20 @@ ignore = [
]

[tool.ruff.format]
quote-style = "single"
quote-style = "single"

[tool.cibuildwheel]
archs = "native"
# Necessary to see build output from the actual compilation
build-verbosity = 1

# linux images
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"

# Don't test Python 3.8 wheels on macOS/arm64
test-skip="cp38-macosx_*:arm64"

# Needed for full C++17 support
[tool.cibuildwheel.macos.environment]
MACOSX_DEPLOYMENT_TARGET = "10.15"

0 comments on commit d80505f

Please sign in to comment.