Skip to content

Commit 3ae5790

Browse files
committed
Add macOS CI matrix for macos-14, macos-15, and macos-26
Test Metal kernel builds across multiple macOS versions to verify compatibility with the metal3.1 standard (macOS 14+). Use sandbox=relaxed for Nix to support __noChroot builds that access the host Metal toolchain. The separate Metal toolchain download is only needed on macOS 26+. Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)
1 parent b92aa5e commit 3ae5790

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.github/workflows/build_kernel_macos.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,40 @@ on:
99

1010
jobs:
1111
build:
12-
name: Build kernel
13-
runs-on: macos-26
12+
name: Build and test kernel (${{ matrix.os }})
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- os: macos-14-xlarge
19+
xcode: "/Applications/Xcode_15.4.app"
20+
- os: macos-15-xlarge
21+
xcode: "/Applications/Xcode_16.2.app"
22+
- os: macos-26-xlarge
23+
xcode: "/Applications/Xcode_26.0.app"
1424
steps:
1525
- name: "Select Xcode"
16-
run: sudo xcrun xcode-select -s /Applications/Xcode_26.0.app
26+
run: sudo xcrun xcode-select -s ${{ matrix.xcode }}
1727
- name: "Install Metal Toolchain"
28+
if: matrix.os == 'macos-26-xlarge'
1829
run: xcodebuild -downloadComponent metalToolchain
1930
- uses: actions/checkout@v6
2031
- uses: cachix/install-nix-action@v31
32+
with:
33+
extra_nix_config: |
34+
sandbox = relaxed
2135
- uses: cachix/cachix-action@v16
2236
with:
2337
name: huggingface
2438
#authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
25-
# For now we only test that there are no regressions in building macOS
26-
# kernels. Also run tests once we have a macOS runner.
39+
2740
- name: Build relu kernel
2841
run: ( cd builder/examples/relu && nix build .\#redistributable.torch29-metal-aarch64-darwin -L )
42+
- name: Test relu kernel
43+
run: ( cd builder/examples/relu && nix develop .\#test --command pytest tests/ -v )
2944

3045
- name: Build relu metal cpp kernel
3146
run: ( cd builder/examples/relu-metal-cpp && nix build .\#redistributable.torch29-metal-aarch64-darwin -L )
47+
- name: Test relu metal cpp kernel
48+
run: ( cd builder/examples/relu-metal-cpp && nix develop .\#test --command pytest tests/ -v )

0 commit comments

Comments
 (0)