Skip to content

Commit 0b7cc5f

Browse files
authored
Cleanup ci (#449)
1 parent 686ccb3 commit 0b7cc5f

File tree

2 files changed

+84
-41
lines changed

2 files changed

+84
-41
lines changed

.github/matrix.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"include": [
3+
{
4+
"runner": "linux.g5.4xlarge.nvidia.gpu",
5+
"python-version": "3.10",
6+
"ref-mode": "none",
7+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
8+
"runtime-version": "cu129",
9+
"container-options": "--gpus all",
10+
"alias": "a10g"
11+
},
12+
{
13+
"runner": "linux.g5.4xlarge.nvidia.gpu",
14+
"python-version": "3.10",
15+
"ref-mode": "ref-eager",
16+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
17+
"runtime-version": "cu129",
18+
"container-options": "--gpus all",
19+
"alias": "a10g-ref-eager"
20+
},
21+
{
22+
"runner": "linux.g5.4xlarge.nvidia.gpu",
23+
"python-version": "3.12",
24+
"ref-mode": "none",
25+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
26+
"runtime-version": "cu129",
27+
"container-options": "--gpus all",
28+
"alias": "a10g"
29+
},
30+
{
31+
"runner": "linux.g5.4xlarge.nvidia.gpu",
32+
"python-version": "3.12",
33+
"ref-mode": "ref-eager",
34+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
35+
"runtime-version": "cu129",
36+
"container-options": "--gpus all",
37+
"alias": "a10g-ref-eager"
38+
},
39+
{
40+
"runner": "linux.aws.h100",
41+
"python-version": "3.12",
42+
"ref-mode": "none",
43+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
44+
"runtime-version": "cu129",
45+
"container-options": "--gpus all",
46+
"alias": "h100"
47+
},
48+
{
49+
"runner": "linux.dgx.b200",
50+
"python-version": "3.12",
51+
"ref-mode": "none",
52+
"image": "nvidia/cuda:12.9.1-devel-ubuntu24.04",
53+
"runtime-version": "cu129",
54+
"container-options": "--gpus all",
55+
"alias": "b200"
56+
}
57+
]
58+
}

.github/workflows/test.yml

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,36 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
test:
16-
name: test-cuda12.9-py${{ matrix.python-version }}-${{ matrix.alias }}
15+
load-matrix:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
matrix: ${{ steps.set-matrix.outputs.matrix }}
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
1722

18-
container:
19-
image: nvidia/cuda:12.9.1-devel-ubuntu24.04
20-
options: --gpus all
23+
- name: Load matrix from file
24+
id: set-matrix
25+
run: |
26+
matrix=$(cat .github/matrix.json | jq -c .)
27+
echo "matrix=$matrix" >> $GITHUB_OUTPUT
28+
29+
test:
30+
needs: load-matrix
2131

2232
strategy:
2333
fail-fast: false
24-
matrix:
25-
include:
26-
# A10g
27-
- python-version: "3.10"
28-
ref-mode: "none"
29-
runner: "linux.g5.4xlarge.nvidia.gpu"
30-
alias: "a10g"
31-
- python-version: "3.12"
32-
ref-mode: "none"
33-
runner: "linux.g5.4xlarge.nvidia.gpu"
34-
alias: "a10g"
35-
- python-version: "3.10"
36-
ref-mode: "ref-eager"
37-
runner: "linux.g5.4xlarge.nvidia.gpu"
38-
alias: "a10g-ref-eager"
39-
- python-version: "3.12"
40-
ref-mode: "ref-eager"
41-
runner: "linux.g5.4xlarge.nvidia.gpu"
42-
alias: "a10g-ref-eager"
43-
# H100
44-
- python-version: "3.12"
45-
ref-mode: "none"
46-
runner: "linux.aws.h100"
47-
alias: "h100"
48-
# B200
49-
- python-version: "3.12"
50-
ref-mode: "none"
51-
runner: "linux.dgx.b200"
52-
alias: "b200"
34+
matrix: ${{ fromJSON(needs.load-matrix.outputs.matrix) }}
35+
36+
name: test-${{ matrix.runtime-version }}-py${{ matrix.python-version }}-${{ matrix.alias }}
37+
38+
container:
39+
image: ${{ matrix.image }}
40+
options: ${{ matrix.container-options }}
5341

5442
runs-on: ${{ matrix.runner }}
5543

44+
5645
defaults:
5746
run:
5847
shell: bash -l {0}
@@ -82,12 +71,12 @@ jobs:
8271
path: |
8372
~/.cache/uv
8473
~/.venv
85-
key: ${{ runner.os }}-deps-${{ matrix.python-version }}-${{ hashFiles('.github/workflows/test.yml', 'requirements.txt') }}-${{ steps.date.outputs.month }}
74+
key: ${{ matrix.python-version }}-${{ matrix.runtime-version }}-${{ hashFiles('.github/workflows/test.yml', 'requirements.txt') }}-${{ steps.date.outputs.month }}
8675

8776
- name: Install PyTorch
8877
run: |
8978
source .venv/bin/activate
90-
uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu129
79+
uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/${{ matrix.runtime-version }}
9180
9281
- name: Install Triton
9382
if: steps.cache.outputs.cache-hit != 'true'
@@ -118,8 +107,4 @@ jobs:
118107
- name: Run Tests
119108
run: |
120109
source .venv/bin/activate
121-
if [[ "${{ matrix.ref-mode }}" == "ref-eager" ]]; then
122-
HELION_INTERPRET=1 pytest
123-
else
124-
pytest
125-
fi
110+
HELION_INTERPRET=$([[ "${{ matrix.ref-mode }}" == "ref-eager" ]] && echo "1") pytest

0 commit comments

Comments
 (0)