diff --git a/.github/workflows/build-pr-mac.yaml b/.github/workflows/build-pr-mac.yaml index 979a6f8..8859bd2 100644 --- a/.github/workflows/build-pr-mac.yaml +++ b/.github/workflows/build-pr-mac.yaml @@ -11,7 +11,7 @@ jobs: build-kernel: runs-on: macos-15 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: DeterminateSystems/nix-installer-action@v20 with: extra-conf: | diff --git a/.github/workflows/build-pr-windows.yaml b/.github/workflows/build-pr-windows.yaml new file mode 100644 index 0000000..2eb11e1 --- /dev/null +++ b/.github/workflows/build-pr-windows.yaml @@ -0,0 +1,97 @@ +name: Build PR (Windows) +on: +# push: +# branches: ['windows-build-*'] + pull_request: + types: [opened, synchronize] + paths-ignore: + - "**/README.md" + + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + build-kernel: + strategy: + matrix: + os: [ windows-2022 ] + python: [ 3.11, 3.12 ] + torch: [ + # { version: '2.9.1', cuda: '12.6.3', wheel: '126' }, + { version: '2.9.1', cuda: '12.8.1', wheel: '128' }, +# { version: '2.9.1', cuda: '13.0.1', wheel: '130' } + ] + + runs-on: windows-2022 + steps: + - uses: actions/checkout@v5 + - name: Validate kernel directory + id: validate + shell: pwsh + run: | + $PR_TITLE = "${{ github.event.pull_request.title }}" + $KERNEL = python .github/workflows/validate-kernel-pr.py "pr" "$PR_TITLE" + if ($LASTEXITCODE -eq 0) { + echo "kernel=$KERNEL" >> $env:GITHUB_OUTPUT + echo "skip=false" >> $env:GITHUB_OUTPUT + } else { + echo "skip=true" >> $env:GITHUB_OUTPUT + } + + - name: Kernel Info + if: steps.validate.outputs.skip == 'false' + shell: pwsh + run: | + $KERNEL = "${{ steps.validate.outputs.kernel }}" + Write-Output "Building Kernel: $KERNEL" + + - uses: Jimver/cuda-toolkit@v0.2.29 + if: steps.validate.outputs.skip == 'false' + id: setup-cuda-toolkit + with: + cuda: ${{ matrix.torch.cuda }} + + - name: Setup Python + if: steps.validate.outputs.skip == 'false' + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install PyTorch + if: steps.validate.outputs.skip == 'false' + run: pip install torch --index-url https://download.pytorch.org/whl/cu${{ matrix.torch.wheel }} + + - name: Checkout kernel-builder + if: steps.validate.outputs.skip == 'false' + id: checkout-kernel-builder + uses: actions/checkout@v5 + with: + repository: huggingface/kernel-builder + ref: 3b6264ec69ef7d336ba7be6d86a137ef238f7e30 # todo(mfuntowicz): remove this when merged in kernel-builder + path: kernel-builder + + - name: Cache Rust build + if: steps.validate.outputs.skip == 'false' + uses: actions/cache@v4 + with: + path: | + kernel-builder/build2cmake/target + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-rust-debug-${{ hashFiles('kernel-builder/build2cmake/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-rust-debug- + + - name: Build build2cmake + if: steps.validate.outputs.skip == 'false' + working-directory: kernel-builder/build2cmake + run: cargo build + + - name: Build kernel + if: steps.validate.outputs.skip == 'false' + shell: pwsh + run: | + $KERNEL = "${{ steps.validate.outputs.kernel }}" + & "$env:GITHUB_WORKSPACE\kernel-builder\scripts\windows\builder.ps1" -Backend cuda -SourceFolder "$KERNEL" -BuildConfig Release -Build diff --git a/.github/workflows/build-pr.yaml b/.github/workflows/build-pr.yaml index 6793080..b419c7b 100644 --- a/.github/workflows/build-pr.yaml +++ b/.github/workflows/build-pr.yaml @@ -12,7 +12,7 @@ jobs: runs-on: group: aws-highmemory-32-plus-nix steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: DeterminateSystems/nix-installer-action@main with: extra-conf: |