Skip to content

kernels: use Metadata from kernels-data #977

kernels: use Metadata from kernels-data

kernels: use Metadata from kernels-data #977

name: "Build and test kernel - Windows"
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
paths-ignore:
- "docs/**"
- "*.md"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ windows-2022 ]
python: [ 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' }
]
name: Build kernel
runs-on: ${{ matrix.os }}
steps:
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
key: cuda-toolkit-v${{ matrix.cuda }}-${{ matrix.os }}
path: |
C:\Program Files\NVIDIA GPU Computing Toolkit
~/.cargo/registry
~/.cargo/git
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# CUDA environment setup
- uses: huggingface/cuda-toolkit@714c97b32958862237b96401fb253a4261453c3b # v0.1.0
id: setup-cuda-toolkit
with:
cuda: ${{ matrix.torch.cuda }} # TODO(mfuntowicz): How can we test multiple CUDA versions than align with torch?
- name: "NVCC checks"
run: nvcc -V
# Rust build environment setup
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
toolchain: stable
profile: minimal
override: true
- name: Build kernel-builder
run: ( cd kernel-builder && cargo build --release )
# Python environment setup
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install PyTorch
run: pip install torch --index-url https://download.pytorch.org/whl/cu${{ matrix.torch.wheel }}
- name: Build cutlass GEMM kernel
run: ( nix-builder\scripts\windows\builder.ps1 -SourceFolder examples/kernels/cutlass-gemm -BuildConfig Release -Backend cuda -Build -Force )
- name: Build relu kernel
run: ( nix-builder\scripts\windows\builder.ps1 -SourceFolder examples/kernels/relu -BuildConfig Release -Backend cuda -Build -Force )
- name: Build relu-backprop-compile kernel
run: ( nix-builder\scripts\windows\builder.ps1 -SourceFolder examples/kernels/relu-backprop-compile -BuildConfig Release -Backend cuda -Build -Force )
- name: Build silu-and-mul kernel
run: ( nix-builder\scripts\windows\builder.ps1 -SourceFolder examples/kernels/silu-and-mul -BuildConfig Release -Backend cuda -Build -Force)