Skip to content

Commit 297f17a

Browse files
authored
Require tests to be faster than 30s (#471)
1 parent fa5e632 commit 297f17a

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ jobs:
103103
run: |
104104
source .venv/bin/activate
105105
uv pip install -r requirements.txt
106+
uv pip install pytest-timeout
106107
107108
- name: Run Tests
108109
run: |
109110
source .venv/bin/activate
110-
HELION_INTERPRET=$([[ "${{ matrix.ref-mode }}" == "ref-eager" ]] && echo "1") pytest
111+
HELION_INTERPRET=$([[ "${{ matrix.ref-mode }}" == "ref-eager" ]] && echo "1") pytest --timeout=30

test/test_autotuner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def add(a, b):
124124
torch.testing.assert_close(add(*args), sum(args))
125125
torch.testing.assert_close(add(*args), sum(args))
126126

127+
@skipIfRocm("too slow on rocm")
127128
def test_random_search(self):
128129
args = (
129130
torch.randn([512, 512], device=DEVICE),
@@ -134,6 +135,7 @@ def test_random_search(self):
134135
fn = bound_kernel.compile_config(best)
135136
torch.testing.assert_close(fn(*args), args[0] @ args[1], rtol=1e-2, atol=1e-1)
136137

138+
@skipIfRocm("too slow on rocm")
137139
def test_differential_evolution_search(self):
138140
args = (
139141
torch.randn([512, 512], device=DEVICE),

test/test_indexing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ def kernel(buf: torch.Tensor, zeros: torch.Tensor) -> torch.Tensor:
628628
torch.testing.assert_close(result, expected)
629629

630630
@skipIfRocm("failure on rocm")
631+
@unittest.skip("takes 5+ minutes to run")
631632
def test_1d_indexed_value_from_slice(self):
632633
"""buf2[i] = buf[:] - Assign slice to indexed value"""
633634

test/test_views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from helion._testing import RefEagerTestBase
1010
from helion._testing import TestCase
1111
from helion._testing import code_and_output
12+
from helion._testing import skipIfRocm
1213
import helion.language as hl
1314

1415

@@ -33,6 +34,7 @@ def softmax(x: torch.Tensor) -> torch.Tensor:
3334
)
3435
self.assertExpectedJournal(code)
3536

37+
@skipIfRocm("too slow on rocm")
3638
def test_softmax_view_reshape(self):
3739
@helion.kernel(config={"block_size": 1})
3840
def softmax(x: torch.Tensor) -> torch.Tensor:

0 commit comments

Comments
 (0)