Skip to content

Commit 4dc956a

Browse files
PaulZhang12pytorchmergebot
authored andcommitted
[Inductor][Triton] Fix test_autotune_inplace_kernel to work with newer Triton version (pytorch#148595)
For new Triton version 3.3, constexpr are included as part of the signature. Update failing test to reflect this change, additional context in pytorch#145051. Pull Request resolved: pytorch#148595 Approved by: https://github.com/davidberard98
1 parent 1fac477 commit 4dc956a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/inductor/test_cuda_repro.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,15 @@ def test_autotune_inplace_kernel(self):
551551
from torch._C import _cuda_getCurrentRawStream as get_cuda_stream
552552
from torch._inductor.runtime.hints import AttrsDescriptorWrapper, HeuristicType
553553
from torch._inductor.runtime.triton_heuristics import CachingAutotuner, grid
554+
from torch._inductor.utils import triton_version_uses_attrs_dict
554555

555556
def autotune(configs, meta):
556557
def decorator(fn):
558+
if triton_version_uses_attrs_dict():
559+
# Newer versions of Triton puts constexpr in signature
560+
# Ref: https://github.com/pytorch/pytorch/pull/145051
561+
meta["signature"]["XBLOCK"] = "constexpr"
562+
557563
return CachingAutotuner(
558564
# force autotune by setting save_cache_hook to False
559565
fn,

0 commit comments

Comments
 (0)