8000 Update on "[Inductor] Pattern matcher support for mutable ops with no… · pytorch/pytorch@9f64b01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f64b01

Browse files
committed
Update on "[Inductor] Pattern matcher support for mutable ops with non-view inputs"
Fixes the non-view input use case in #152441. Pull-Request-resolved: #152767 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx ipiszy chenyang78 kadeng muchulee8 amjames chauhang aakhundov [ghstack-poisoned]
1 parent fb2656a commit 9f64b01

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/inductor/test_pattern_matcher.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ def f1_replaced(x):
17301730
self.assertEqual(f1_out, f1_replaced_out)
17311731
self.assertEqual(count, 1)
17321732

1733-
# Case 2: mutates graph input
1733+
# Case 2: mutates graph input (not supported yet)
17341734
@torch.compile(fullgraph=True, backend=custom_backend)
17351735
def f2(x):
17361736
out = torch.zeros_like(x)
@@ -1747,9 +1747,8 @@ def f2_replaced(x):
17471747
f2_replaced_inp = inp.clone().detach()
17481748
f2_out = f2(f2_inp)
17491749
f2_replaced_out = f2_replaced(f2_replaced_inp)
1750-
self.assertEqual(f2_inp, f2_replaced_inp)
1751-
self.assertEqual(f2_out, f2_replaced_out)
1752-
self.assertEqual(count, 1)
1750+
with self.assertRaisesRegex(AssertionError, "Pattern matcher does not yet support mutable ops that mutate graph input"):
1751+
self.assertEqual(f2_out, f2_replaced_out)
17531752

17541753
if __name__ == "__main__":
17551754
if IS_LINUX and HAS_GPU:

0 commit comments

Comments
 (0)
0