robtaylor-chipflow commited on
Commit
dd92cff
·
1 Parent(s): 3e008a3

Add Metal CI and point kernel-builder to ChipFlow fork

Browse files

- Add GitHub Actions workflow for Metal kernel CI (macOS 15 + 26)
- Point flake.nix to ChipFlow/kernels metal-stack branch for
macOS 15 toolchain detection support

Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)

Files changed (3) hide show
  1. .github/workflows/test_metal.yaml +39 -0
  2. flake.lock +31 -8
  3. flake.nix +1 -1
.github/workflows/test_metal.yaml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Build and test (Metal)"
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+ branches: [main]
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ test:
11
+ name: Build and test (${{ matrix.os }})
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ - os: macos-15-xlarge
18
+ xcode: "/Applications/Xcode_16.2.app"
19
+ - os: macos-26-xlarge
20
+ xcode: "/Applications/Xcode_26.0.app"
21
+ steps:
22
+ - name: "Select Xcode"
23
+ run: sudo xcrun xcode-select -s ${{ matrix.xcode }}
24
+ - name: "Install Metal Toolchain"
25
+ if: matrix.os == 'macos-26-xlarge'
26
+ run: xcodebuild -downloadComponent metalToolchain
27
+ - uses: actions/checkout@v6
28
+ - uses: cachix/install-nix-action@v31
29
+ with:
30
+ extra_nix_config: |
31
+ sandbox = relaxed
32
+ - uses: cachix/cachix-action@v16
33
+ with:
34
+ name: huggingface
35
+
36
+ - name: Build kernel
37
+ run: nix build .#redistributable.torch29-metal-aarch64-darwin -L
38
+ - name: Test kernel
39
+ run: nix develop .#test --command pytest tests/ -v
flake.lock CHANGED
@@ -37,19 +37,21 @@
37
  "inputs": {
38
  "flake-compat": "flake-compat",
39
  "flake-utils": "flake-utils",
40
- "nixpkgs": "nixpkgs"
 
41
  },
42
  "locked": {
43
- "lastModified": 1769448133,
44
- "narHash": "sha256-XOp8+8u7fmXn1f63mJ40dPj/OHPMKtL9o4q7y0CUZFU=",
45
- "owner": "huggingface",
46
- "repo": "kernel-builder",
47
- "rev": "078351df6e0fddb4a1a41ba3ffb8b804f58c4c6a",
48
  "type": "github"
49
  },
50
  "original": {
51
- "owner": "huggingface",
52
- "repo": "kernel-builder",
 
53
  "type": "github"
54
  }
55
  },
@@ -74,6 +76,27 @@
74
  "kernel-builder": "kernel-builder"
75
  }
76
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  "systems": {
78
  "locked": {
79
  "lastModified": 1681028828,
 
37
  "inputs": {
38
  "flake-compat": "flake-compat",
39
  "flake-utils": "flake-utils",
40
+ "nixpkgs": "nixpkgs",
41
+ "rust-overlay": "rust-overlay"
42
  },
43
  "locked": {
44
+ "lastModified": 1772650055,
45
+ "narHash": "sha256-6R8dJEPH+uHJyvr3nZPZ/xFwULzR4UCsLQGSjLRsxQE=",
46
+ "owner": "ChipFlow",
47
+ "repo": "kernels",
48
+ "rev": "f85b1d195c115acdb3f92c061a0dafcc0f9bfe79",
49
  "type": "github"
50
  },
51
  "original": {
52
+ "owner": "ChipFlow",
53
+ "ref": "metal-stack",
54
+ "repo": "kernels",
55
  "type": "github"
56
  }
57
  },
 
76
  "kernel-builder": "kernel-builder"
77
  }
78
  },
79
+ "rust-overlay": {
80
+ "inputs": {
81
+ "nixpkgs": [
82
+ "kernel-builder",
83
+ "nixpkgs"
84
+ ]
85
+ },
86
+ "locked": {
87
+ "lastModified": 1769050281,
88
+ "narHash": "sha256-1H8DN4UZgEUqPUA5ecHOufLZMscJ4IlcGaEftaPtpBY=",
89
+ "owner": "oxalica",
90
+ "repo": "rust-overlay",
91
+ "rev": "6deef0585c52d9e70f96b6121207e1496d4b0c49",
92
+ "type": "github"
93
+ },
94
+ "original": {
95
+ "owner": "oxalica",
96
+ "repo": "rust-overlay",
97
+ "type": "github"
98
+ }
99
+ },
100
  "systems": {
101
  "locked": {
102
  "lastModified": 1681028828,
flake.nix CHANGED
@@ -2,7 +2,7 @@
2
  description = "Flake for rotary embedding kernel";
3
 
4
  inputs = {
5
- kernel-builder.url = "github:huggingface/kernel-builder";
6
  };
7
 
8
  outputs =
 
2
  description = "Flake for rotary embedding kernel";
3
 
4
  inputs = {
5
+ kernel-builder.url = "github:ChipFlow/kernels/metal-stack";
6
  };
7
 
8
  outputs =