-
Notifications
You must be signed in to change notification settings - Fork 52
107 lines (89 loc) · 2.98 KB
/
test_kernels.yaml
File metadata and controls
107 lines (89 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Test kernels
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
styling-and-lints:
uses: ./.github/workflows/lint.yml
build:
needs: [styling-and-lints]
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: Run command-line tools without Torch
working-directory: ./kernels
run: |
uv run kernels check kernels-community/activation
uv run kernels versions kernels-community/activation