Skip to content

Commit bb8e31d

Browse files
authored
Clean up CI & fix caching (#408)
1 parent 4c0f7f3 commit bb8e31d

File tree

2 files changed

+85
-109
lines changed

2 files changed

+85
-109
lines changed

.github/workflows/test-template.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,88 @@ concurrency:
1313

1414
jobs:
1515
test:
16-
uses: ./.github/workflows/test-template.yml
17-
with:
18-
test-name: test
19-
ref-eager: false
20-
21-
test-ref-eager:
22-
uses: ./.github/workflows/test-template.yml
23-
with:
24-
test-name: test-ref-eager
25-
ref-eager: true
16+
name: test-cuda12.6-py${{ matrix.python-version }}-a10g-${{ matrix.ref-mode }}
17+
18+
container:
19+
image: nvidia/cuda:12.6.3-devel-ubuntu24.04
20+
options: --gpus all
21+
22+
runs-on: linux.g5.4xlarge.nvidia.gpu
23+
24+
strategy:
25+
matrix:
26+
python-version: ["3.10", "3.12"]
27+
ref-mode: ["none", "ref-eager"]
28+
29+
defaults:
30+
run:
31+
shell: bash -l {0}
32+
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v4
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v6
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
enable-cache: true
42+
43+
- name: Create virtual environment
44+
run: |
45+
uv venv --python ${{ matrix.python-version }}
46+
47+
- name: Get current month
48+
id: date
49+
run: echo "month=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
50+
51+
- name: Cache dependencies
52+
id: cache
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/.cache/uv
57+
~/.venv
58+
key: ${{ runner.os }}-${{ matrix.ref-mode }}-deps-${{ matrix.python-version }}-${{ hashFiles('.github/workflows/test.yml', 'requirements.txt') }}-${{ steps.date.outputs.month }}
59+
restore-keys: |
60+
${{ runner.os }}-deps-
61+
62+
- name: Install PyTorch
63+
run: |
64+
source .venv/bin/activate
65+
uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
66+
67+
- name: Install Triton
68+
if: steps.cache.outputs.cache-hit != 'true'
69+
run: |
70+
set -x
71+
source .venv/bin/activate
72+
apt-get update
73+
apt-get install -y git
74+
apt-get install -y gcc-13 g++-13 zlib1g-dev
75+
export CC=gcc-13
76+
export CXX=g++-13
77+
mkdir -p /tmp/$USER
78+
cd /tmp/$USER
79+
uv pip uninstall triton pytorch-triton || true
80+
rm -rf triton/ || true
81+
git clone https://github.com/triton-lang/triton.git
82+
cd triton/
83+
uv pip install -r python/requirements.txt
84+
MAX_JOBS=$(nproc) TRITON_PARALLEL_LINK_JOBS=2 uv pip install .
85+
cd /tmp/$USER
86+
rm -rf triton/
87+
88+
- name: Install Requirements
89+
run: |
90+
source .venv/bin/activate
91+
uv pip install -r requirements.txt
92+
93+
- name: Run Tests
94+
run: |
95+
source .venv/bin/activate
96+
if [[ "${{ matrix.ref-mode }}" == "ref-eager" ]]; then
97+
HELION_INTERPRET=1 pytest
98+
else
99+
pytest
100+
fi

0 commit comments

Comments
 (0)