kernels: use Metadata from kernels-data (#499)
#985
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: Test kernels | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] # trigger on PRs | |
| paths-ignore: | |
| - "docs/**" | |
| - "*.md" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Run kernels tests | |
| runs-on: | |
| group: aws-g6-24xlarge | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| torch-version: ["2.10.0", "2.11.0"] | |
| env: | |
| UV_PYTHON_PREFERENCE: only-managed | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Override kernels-data source to local bindings | |
| working-directory: ./kernels | |
| run: uv add ../kernels-data/bindings/python --no-sync | |
| - name: Override the Torch version | |
| working-directory: ./kernels | |
| run: uv add "torch==${{ matrix.torch-version }}" --no-sync | |
| - name: Install the project | |
| working-directory: ./kernels | |
| run: uv sync --all-extras --dev | |
| - name: Install setuptools for Triton-based test | |
| working-directory: ./kernels | |
| run: uv pip install setuptools | |
| - name: Check typing | |
| working-directory: ./kernels | |
| run: uv run mypy src/kernels | |
| - name: Run tests | |
| working-directory: ./kernels | |
| env: | |
| HF_HUB_DOWNLOAD_TIMEOUT: 60 | |
| run: | | |
| uv run pytest tests | |
| - name: Re-run dependency test with dependencies installed | |
| working-directory: ./kernels | |
| env: | |
| HF_HUB_DOWNLOAD_TIMEOUT: 60 | |
| run: | | |
| uv pip install einops nvidia-cutlass-dsl | |
| uv run pytest tests/test_deps.py | |
| - name: Check kernel check | |
| working-directory: ./kernels | |
| run: | | |
| uv pip install ../kernel-abi-check/bindings/python | |
| uv run kernels check kernels-community/activation | |
| - name: Import check without torch | |
| working-directory: ./kernels | |
| run: | | |
| uv pip uninstall torch | |
| uv run python -c "import kernels" | |
| - name: tvm-ffi check without torch | |
| working-directory: ./kernels | |
| run: | | |
| uv run pytest tests/test_tvm_ffi.py | |
| - name: Run command-line tools without Torch | |
| working-directory: ./kernels | |
| run: | | |
| uv run kernels check kernels-community/activation | |
| uv run kernels versions kernels-community/activation |