Skip to content

Commit d7d0992

Browse files
authored
Reuse nightly build's ccache for release (#3458)
1 parent bdb6ff8 commit d7d0992

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

.github/actions/build-cuda-release/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
run: |
2121
pip install auditwheel "build<=1.4.2" patchelf setuptools
2222
python setup.py clean --all
23-
MLX_DISABLE_SM90A_KERNELS=1 MLX_BUILD_STAGE=2 python -m build -w
23+
MLX_BUILD_STAGE=2 python -m build -w
2424
2525
auditwheel repair dist/mlx_cuda*.whl \
2626
--plat manylinux_2_35_${{ inputs.arch }} \

.github/actions/setup-linux/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ inputs:
1414
description: 'Whether to enable ccache'
1515
required: false
1616
default: 'true'
17+
ccache-key:
18+
required: false
19+
default: 'ccache'
1720

1821
runs:
1922
using: "composite"
@@ -33,7 +36,7 @@ runs:
3336
if: ${{ inputs.use-ccache == 'true' }}
3437
uses: hendrikmuhs/ccache-action@v1.2
3538
with:
36-
key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ inputs.toolkit }}
39+
key: ${{ inputs.ccache-key }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.toolkit }}
3740
max-size: 1GB
3841
# ccache-action bug: running "apt-get update" fails on large arm runner.
3942
update-package-index: false

.github/workflows/nightly.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,24 @@ jobs:
8585

8686
build_cuda_release:
8787
if: github.repository == 'ml-explore/mlx'
88-
runs-on: ubuntu-22-large
88+
strategy:
89+
matrix:
90+
arch: ['x86_64', 'aarch64']
91+
toolkit: ['cuda-12.9', 'cuda-13.0']
92+
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-22-large' || 'ubuntu-22-large-arm' }}
8993
steps:
9094
- uses: actions/checkout@v6
9195
- uses: ./.github/actions/setup-linux
9296
with:
93-
toolkit: 'cuda-12.9'
97+
toolkit: ${{ matrix.toolkit }}
98+
ccache-key: 'ccache-release'
9499
- name: Build Python package
95100
uses: ./.github/actions/build-cuda-release
96101
with:
97-
toolkit: 'cuda-12.9'
98-
arch: 'x86_64'
102+
arch: ${{ matrix.arch }}
99103
- name: Upload artifacts
100104
uses: actions/upload-artifact@v7
101105
with:
102-
name: mlx-cuda
106+
name: mlx-${{ matrix.toolkit }}-${{ matrix.arch }}
103107
path: wheelhouse/mlx_cuda_*.whl
104108
retention-days: 7

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ jobs:
146146
- uses: ./.github/actions/setup-linux
147147
with:
148148
toolkit: ${{ matrix.toolkit }}
149-
use-ccache: false
149+
ccache-key: 'ccache-release'
150150
- name: Build Python package
151151
uses: ./.github/actions/build-cuda-release
152152
with:

mlx/backend/cuda/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ set_target_properties(mlx PROPERTIES CUDA_ARCHITECTURES
168168
"${MLX_CUDA_ARCHITECTURES}")
169169

170170
# Skip Hopper-only kernels when not building for sm90a.
171-
if(NOT DEFINED ENV{MLX_DISABLE_SM90A_KERNELS}
172-
AND (("90a" IN_LIST MLX_CUDA_ARCHITECTURES) OR ("90a-real" IN_LIST
173-
MLX_CUDA_ARCHITECTURES)))
171+
if(("90a" IN_LIST MLX_CUDA_ARCHITECTURES) OR ("90a-real" IN_LIST
172+
MLX_CUDA_ARCHITECTURES))
174173
target_compile_definitions(mlx PRIVATE MLX_CUDA_SM90A_ENABLED)
175174
endif()
176175

0 commit comments

Comments
 (0)