forked from huggingface/kernels
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.87 KB
/
build_kernel_macos.yaml
File metadata and controls
52 lines (49 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: "Build and test kernel (macOS)"
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
workflow_dispatch:
jobs:
build:
name: Build and test kernel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-14-xlarge
xcode: "/Applications/Xcode_15.4.app"
# macOS 14 is best-effort: builds work but MPS tests may OOM
# on runners with limited unified memory.
allow-failure: true
- os: macos-15-xlarge
xcode: "/Applications/Xcode_16.2.app"
- os: macos-26-xlarge
xcode: "/Applications/Xcode_26.0.app"
continue-on-error: ${{ matrix.allow-failure || false }}
steps:
- name: "Select Xcode"
run: sudo xcrun xcode-select -s ${{ matrix.xcode }}
- name: "Install Metal Toolchain"
if: matrix.os == 'macos-26-xlarge'
run: xcodebuild -downloadComponent metalToolchain
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
sandbox = relaxed
- uses: cachix/cachix-action@v16
with:
name: huggingface
#authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build relu kernel
run: ( cd builder/examples/relu && nix build .\#redistributable.torch29-metal-aarch64-darwin -L )
- name: Test relu kernel
run: ( cd builder/examples/relu && nix develop .\#test --command pytest tests/ -v )
- name: Build relu metal cpp kernel
run: ( cd builder/examples/relu-metal-cpp && nix build .\#redistributable.torch29-metal-aarch64-darwin -L )
- name: Test relu metal cpp kernel
run: ( cd builder/examples/relu-metal-cpp && nix develop .\#test --command pytest tests/ -v )