Skip to content

Commit

Permalink
Build sphericart wheels for macos (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf authored Jan 10, 2025
1 parent 89d6d68 commit eb0ce6c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build-jax-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
arch: ["x86_64"]
python-version: ["39", "310", "311", "312", "313"]
arch: ["arm64", "x86_64"]
os: ["ubuntu-22.04", "macos-14"]
exclude:
# remove mismatched arch/os pairs
- {os: macos-14, arch: x86_64}
- {os: ubuntu-22.04, arch: arm64}

name: "Py${{matrix.python-version}} ${{matrix.os}} ${{matrix.arch}}"

Expand All @@ -27,6 +31,7 @@ jobs:
uses: actions/checkout@v4

- name: Build custom manylinux Docker Image with CUDA
if: matrix.os == 'ubuntu-22.04'
run: |
docker build --no-cache \
-t sphericart_manylinux2014_"${{ matrix.arch }}" \
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/build-torch-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: ["x86_64"]
pytorch-version: ["2.4", "2.5"]
arch: ["arm64", "x86_64"]
os: ["ubuntu-22.04", "macos-14"]
exclude:
# remove mismatched arch/os pairs
- {os: macos-14, arch: x86_64}
- {os: ubuntu-22.04, arch: arm64}

name: "Torch ${{matrix.pytorch-version}} ${{matrix.os}} ${{matrix.arch}}"

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build custom manylinux Docker Image with CUDA
if: matrix.os == 'ubuntu-22.04'
run: |
docker build --no-cache \
-t sphericart_manylinux2014_"${{ matrix.arch }}" \
Expand Down Expand Up @@ -55,6 +61,10 @@ jobs:
--exclude libtorch_cuda.so \
--exclude libc10_cuda.so \
-w {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
delocate-wheel --ignore-missing-dependencies \
--require-archs {delocate_archs} \
-w {dest_dir} -v {wheel}
CIBW_ENVIRONMENT: >
SPHERICART_ARCH_NATIVE=OFF
SPHERICART_NO_LOCAL_DEPS=1
Expand All @@ -68,14 +78,17 @@ jobs:

merge-torch-wheels:
needs: build-torch-wheels
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
name: merge wheels for ${{ matrix.name }}
strategy:
matrix:
include:
- name: x86_64 Linux
os: ubuntu-22.04
arch: x86_64
- name: arm64 macOS
os: macos-14
arch: arm64
steps:
- uses: actions/checkout@v4

Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@ concurrency:
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
name: ${{matrix.name}}
strategy:
matrix:
os: [ubuntu-24.04]
arch: ["x86_64"]

name: "${{matrix.os}} ${{matrix.arch}}"
include:
- name: x86_64 Linux
os: ubuntu-22.04
arch: x86_64
- name: x86_64 macOS
os: macos-13
arch: x86_64
- name: arm64 macOS
os: macos-14
arch: arm64

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build custom manylinux Docker Image with CUDA
if: matrix.os == 'ubuntu-22.04'
run: |
docker build --no-cache \
-t sphericart_manylinux2014_"${{ matrix.arch }}" \
Expand All @@ -50,6 +58,7 @@ jobs:
CIBW_ENVIRONMENT: >
SPHERICART_ARCH_NATIVE=OFF
SPHERICART_NO_LOCAL_DEPS=1
MACOSX_DEPLOYMENT_TARGET=11.0
- uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit eb0ce6c

Please sign in to comment.