8000 [Inductor] Fix the lowering of squeeze when input is not contiguous · pytorch/pytorch@d65c853 · GitHub
[go: up one dir, main page]

Skip to content

Commit d65c853

Browse files
[Inductor] Fix the lowering of squeeze when input is not contiguous
ghstack-source-id: dd5a327 Pull Request resolved: #146746
1 parent fa0592b commit d65c853

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

test/inductor/test_unbacked_symints.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ def fn(t, start, length):
385385
@skipGPUIf(not HAS_GPU, "requires gpu and triton")
386386
@dynamo_config.patch(capture_dynamic_output_shape_ops=True)
387387
def test_issue_143498(self, device):
388-
if device == "cpu":
389-
raise unittest.SkipTest("CPU Failure")
390-
391388
class Model(torch.nn.Module):
392389
def __init__(self) -> None:
393390
super().__init__()

torch/_inductor/ir.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,7 +2769,9 @@ def fake_reindex(index): # type: ignore[no-untyped-def]
27692769
# TODO: unbacked should not diverge from backed in determining striding
27702770
# Need to require contiguous here instead of realize, see:
27712771
# https://github.com/pytorch/pytorch/issues/145561
2772-
x = ExternKernel.require_contiguous(x)
2772+
x = ExternKernel.require_exact_strides(
2773+
x, FlexibleLayout.contiguous_strides(x.get_size())
2774+
)
27732775

27742776
storage, old_layout = as_storage_and_layout(x, want_contiguous=True)
27752777
new_layout = FixedLayout(

0 commit comments

Comments
 (0)
0