From c005b36e0d442ae18c48507627aacd8f340cd1d7 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 14:56:16 -0400 Subject: [PATCH 1/6] Add aarch64 cpu tests and CUDA build to nightly workflow --- .github/workflows/tests.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2917b9bb..ead94f1d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,8 +17,14 @@ jobs: build-cpu: strategy: matrix: - os: [ubuntu-22.04, windows-2025] - arch: [x86_64] + os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025] + include: + - os: ubuntu-22.04 + arch: x86_64 + - os: ubuntu-22.04-arm + arch: aarch64 + - os: windows-latest + arch: x86_64 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -44,8 +50,14 @@ jobs: strategy: matrix: cuda_version: ["11.8.0", "12.8.1"] - os: [ubuntu-22.04, windows-2025] - arch: [x86_64] + os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025] + include: + - os: ubuntu-22.04 + arch: x86_64 + - os: ubuntu-22.04-arm + arch: aarch64 + - os: windows-latest + arch: x86_64 runs-on: ${{ matrix.os }} steps: @@ -70,7 +82,7 @@ jobs: run: bash .github/scripts/build-cuda.sh env: build_os: ${{ matrix.os }} - build_arch: x86_64 + build_arch: ${{ matrix.arch }} cuda_version: ${{ matrix.cuda_version }} cuda_targets: "75" @@ -86,9 +98,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2025] - arch: [x86_64] + os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025] torch_version: ["2.7.0"] + include: + - os: ubuntu-22.04 + arch: x86_64 + - os: ubuntu-22.04-arm + arch: aarch64 + - os: windows-2025 + arch: x86_64 runs-on: ${{ matrix.os }} env: BNB_TEST_DEVICE: cpu From 8605e8a4317850aae90d2666ab7ed4f743a7458a Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 15:04:29 -0400 Subject: [PATCH 2/6] aarch64: limit CUDA targets to sm75, sm80, sm90, sm100 --- .github/scripts/build-cuda.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/scripts/build-cuda.sh b/.github/scripts/build-cuda.sh index be8e98704..dad570d13 100644 --- a/.github/scripts/build-cuda.sh +++ b/.github/scripts/build-cuda.sh @@ -8,6 +8,11 @@ set -xeuo pipefail if [[ -v cuda_targets ]]; then build_capability="${cuda_targets}" +elif [ "${build_arch}" = "aarch64" ]; then + build_capability="75;80;90" + + # CUDA 12.8: Add sm100 and sm120 + [[ "${cuda_version}" == 12.8.* ]] && build_capability="75;80;90;100;120" else # By default, target Maxwell through Hopper. build_capability="50;52;60;61;70;75;80;86;89;90" From f8be0f27efeab8fec1747352b4e7daafa64c8f97 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 15:04:43 -0400 Subject: [PATCH 3/6] aarch64: limit CUDA targets to sm75, sm80, sm90, sm100 --- .github/scripts/build-cuda.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build-cuda.sh b/.github/scripts/build-cuda.sh index dad570d13..d8c4ebbe1 100644 --- a/.github/scripts/build-cuda.sh +++ b/.github/scripts/build-cuda.sh @@ -11,8 +11,8 @@ if [[ -v cuda_targets ]]; then elif [ "${build_arch}" = "aarch64" ]; then build_capability="75;80;90" - # CUDA 12.8: Add sm100 and sm120 - [[ "${cuda_version}" == 12.8.* ]] && build_capability="75;80;90;100;120" + # CUDA 12.8: Add sm100 + [[ "${cuda_version}" == 12.8.* ]] && build_capability="75;80;90;100" else # By default, target Maxwell through Hopper. build_capability="50;52;60;61;70;75;80;86;89;90" From 0c1d9fc7c3851e7e266fcd66ecc0ba7b3231f589 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 15:08:59 -0400 Subject: [PATCH 4/6] Update build cpu script --- .github/scripts/build-cpu.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/scripts/build-cpu.sh b/.github/scripts/build-cpu.sh index 6dc6a8ddf..5daeb5ea5 100644 --- a/.github/scripts/build-cpu.sh +++ b/.github/scripts/build-cpu.sh @@ -6,12 +6,7 @@ set -xeuo pipefail pip install cmake==3.28.3 -if [ "${build_os:0:6}" == ubuntu ] && [ "${build_arch}" == aarch64 ]; then - # Allow cross-compile on aarch64 - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu - cmake -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCOMPUTE_BACKEND=cpu . -elif [ "${build_os:0:5}" == macos ] && [ "${build_arch}" == aarch64 ]; then +if [ "${build_os:0:5}" == macos ] && [ "${build_arch}" == aarch64 ]; then cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu . else cmake -DCOMPUTE_BACKEND=cpu . From e8a1f96b62ccc36dfec25c104395f664d72075a4 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 16:23:48 -0400 Subject: [PATCH 5/6] fix --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ead94f1d8..73ab5ce5b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: arch: x86_64 - os: ubuntu-22.04-arm arch: aarch64 - - os: windows-latest + - os: windows-2025 arch: x86_64 runs-on: ${{ matrix.os }} steps: @@ -56,7 +56,7 @@ jobs: arch: x86_64 - os: ubuntu-22.04-arm arch: aarch64 - - os: windows-latest + - os: windows-2025 arch: x86_64 runs-on: ${{ matrix.os }} From a36cb6c6df4093e634ecbb0c6c18863c3febc0b7 Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Fri, 2 May 2025 19:30:56 -0400 Subject: [PATCH 6/6] Update auditwheel for aarch64 --- .github/scripts/auditwheel_show.py | 2 +- .github/workflows/python-package.yml | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/scripts/auditwheel_show.py b/.github/scripts/auditwheel_show.py index c9dd09cc2..3c62ef6f7 100755 --- a/.github/scripts/auditwheel_show.py +++ b/.github/scripts/auditwheel_show.py @@ -22,7 +22,7 @@ def main(): print(audit_wheel_output.stdout) if audit_wheel_output.stderr: - print(f"**Error:**\n```{audit_wheel_output.stderr}```") + print(f"**Error:**\n```\n{audit_wheel_output.stderr}\n```") print("---") diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e31238c00..9d160b505 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -198,16 +198,23 @@ jobs: audit-wheels: needs: build-wheels - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + include: + - os: ubuntu-22.04 + arch: x86_64 + - os: ubuntu-22.04-arm + arch: aarch64 + runs-on: ${{ matrix.os }} env: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - uses: actions/checkout@v4 - - name: Download all wheels + - name: Download wheel uses: actions/download-artifact@v4 with: - merge-multiple: true - pattern: "bdist_wheel_*" + name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }} path: wheels/ - name: Set up Python uses: actions/setup-python@v5