[ci] don't trigger heavy builds for doc changes. #453
Workflow file for this run
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.9.0", "2.10.0"] | |
| env: | |
| UV_PYTHON_PREFERENCE: only-managed | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the project | |
| working-directory: ./kernels | |
| run: uv sync --all-extras --dev | |
| - name: Install Torch version | |
| working-directory: ./kernels | |
| run: uv pip install "torch==${{ matrix.torch-version }}" | |
| - 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: Run staging tests | |
| working-directory: ./kernels | |
| env: | |
| HF_HUB_DOWNLOAD_TIMEOUT: 60 | |
| HF_TOKEN: ${{ secrets.HF_STAGING_TOKEN }} | |
| run: | | |
| HUGGINGFACE_CO_STAGING=true uv run pytest --token -m "is_staging_test" tests/ | |
| if: matrix.python_version == '3.10' && matrix.torch-version == '2.9.0' | |
| - name: Check README generation | |
| working-directory: ./kernels | |
| # For now, just checks that generation doesn't fail. | |
| run: | | |
| uv run kernels generate-readme kernels-community/triton-layer-norm | |
| - 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 |