Skip to content

Commit b019ebd

Browse files
authored
Fix test_fp8_attention expected (#355)
This was triggering autotuning and making tests take 10+ minutes
1 parent d593642 commit b019ebd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

helion/_testing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ def check_example(
137137
fn_name: str | None = None,
138138
skip_accuracy: bool = False,
139139
static_shapes: bool | None = None,
140+
atol: float = 1e-1,
141+
rtol: float = 1e-2,
140142
**kwargs: object,
141143
) -> str:
142144
"""Helper used in unit tests to run a single example kernel and check its output."""
@@ -157,8 +159,8 @@ def check_example(
157159
torch.testing.assert_close(
158160
result.to(torch.float32),
159161
expected.to(torch.float32),
160-
atol=1e-1,
161-
rtol=1e-2,
162+
atol=atol,
163+
rtol=rtol,
162164
)
163165
return code
164166

test/test_examples.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ def test_fp8_attention(self):
587587
args = (q_fp8, k_fp8, v_fp8, batch, heads)
588588

589589
# Get expected output from kernel
590-
expected = mod.fp8_attention_kernel(*args)
590+
expected = mod.fp8_attention_pytorch(q, k, v)()
591591

592592
self.assertExpectedJournal(
593593
check_example(
@@ -596,6 +596,8 @@ def test_fp8_attention(self):
596596
expected,
597597
fn_name="fp8_attention_kernel",
598598
block_sizes=[64, 64],
599+
atol=0.2,
600+
rtol=0.1,
599601
)
600602
)
601603

0 commit comments

Comments
 (0)