Metal: stacked patches for MPS lifecycle, CI, and relu-metal-cpp fix #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| - os: macos-15-xlarge | |
| xcode: "/Applications/Xcode_16.2.app" | |
| - os: macos-26-xlarge | |
| xcode: "/Applications/Xcode_26.0.app" | |
| 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 ) |