diff --git a/.github/workflows/accelerate-manylinux.yml b/.github/workflows/accelerate-manylinux.yml index 1b029cce..08aa8040 100644 --- a/.github/workflows/accelerate-manylinux.yml +++ b/.github/workflows/accelerate-manylinux.yml @@ -50,14 +50,21 @@ 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 @@ -65,11 +72,6 @@ jobs: 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/cibuildwheel@v2.22.0 @@ -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/cibuildwheel@v2.22.0 @@ -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: diff --git a/build-manylinux.sh b/build-manylinux.sh index 993a18cb..da2f9b79 100755 --- a/build-manylinux.sh +++ b/build-manylinux.sh @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 9f95e22f..740610b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,4 +95,20 @@ ignore = [ ] [tool.ruff.format] -quote-style = "single" \ No newline at end of file +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"