Skip to content

Commit 971a52a

Browse files
authored
[Tests] Don't run autotuning when running attention tutorial as a test (#6867)
1 parent 629fd50 commit 971a52a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test-unit: all
3737
$(PYTEST) -s -n 8 python/triton_kernels/tests/
3838
TRITON_DISABLE_LINE_INFO=0 $(PYTEST) -s python/test/unit/language/test_line_info.py
3939
# Run attention separately to avoid out of gpu memory
40-
TRITON_PRINT_AUTOTUNING=1 $(PYTEST) -vs python/tutorials/06-fused-attention.py
40+
$(PYTEST) -vs python/tutorials/06-fused-attention.py
4141
TRITON_ALWAYS_COMPILE=1 TRITON_DISABLE_LINE_INFO=0 LLVM_PASS_PLUGIN_PATH=python/triton/instrumentation/libGPUInstrumentationTestLib.so \
4242
$(PYTEST) --capture=tee-sys -rfs -vvv python/test/unit/instrumentation/test_gpuhello.py
4343

python/tutorials/06-fused-attention.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import pytest
1717
import torch
18+
import sys
1819

1920
import triton
2021
import triton.language as tl
@@ -111,6 +112,11 @@ def _host_descriptor_pre_hook(nargs):
111112
for s in NUM_STAGES_OPTIONS \
112113
for w in [4, 8]\
113114
]
115+
if "pytest" in sys.modules:
116+
# Use a single config in testing for reproducibility
117+
configs = [
118+
triton.Config(dict(BLOCK_M=64, BLOCK_N=64), num_stages=4, num_warps=4, pre_hook=_host_descriptor_pre_hook),
119+
]
114120

115121

116122
def keep(conf):

0 commit comments

Comments
 (0)