Skip to content

Commit 2df9a8d

Browse files
anmyachevpytorchmergebot
authored andcommitted
[Inductor][Tests] Update get_divisible_by_16 function in test_torchinductor.py to work correctly with new Triton (pytorch#147865)
Pull Request resolved: pytorch#147865 Approved by: https://github.com/davidberard98
1 parent 1e894d2 commit 2df9a8d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/inductor/test_torchinductor.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,15 @@ def get_divisible_by_16(cfg):
269269
# attribute was renamed between triton versions, from "divisible_by_16" to "divisibility_16"
270270
if hasattr(cfg, "divisibility_16"):
271271
return cfg.divisibility_16
272-
return cfg.divisible_by_16
272+
elif hasattr(cfg, "divisible_by_16"):
273+
return cfg.divisible_by_16
274+
# `cfg` example:
275+
# {(0,): [['tt.divisibility', 16]], (1,): [['tt.divisibility', 16]], (3,): [['tt.divisibility', 16]]}
276+
return [
277+
key[0]
278+
for key, value in cfg.items()
279+
if len(key) == 1 and value[0] == ["tt.divisibility", 16]
280+
]
273281

274282

275283
class TestCase(InductorTestCase):

0 commit comments

Comments
 (0)