Skip to content

Commit

Permalink
[inductor] switch assume_aligned_inputs to False
Browse files Browse the repository at this point in the history
ghstack-source-id: 8c5d6c9c965c3310bf61c76afdc7e34c6baa35d9
Pull Request resolved: #124336
  • Loading branch information
davidberard98 committed Apr 18, 2024
1 parent bfd38e4 commit 7c1a602
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,23 @@ detectron2_fasterrcnn_r_101_c4,pass,42



detectron2_fasterrcnn_r_101_dc5,pass,42
detectron2_fasterrcnn_r_101_dc5,pass,43



detectron2_fasterrcnn_r_101_fpn,pass,46



detectron2_fasterrcnn_r_50_c4,pass,42
detectron2_fasterrcnn_r_50_c4,pass,43



detectron2_fasterrcnn_r_50_dc5,pass,42



detectron2_fasterrcnn_r_50_fpn,pass,46
detectron2_fasterrcnn_r_50_fpn,pass,47



Expand All @@ -86,15 +86,15 @@ detectron2_maskrcnn_r_101_c4,fail_accuracy,57



detectron2_maskrcnn_r_101_fpn,pass,64
detectron2_maskrcnn_r_101_fpn,pass,65



detectron2_maskrcnn_r_50_c4,pass,57
detectron2_maskrcnn_r_50_c4,pass,58



detectron2_maskrcnn_r_50_fpn,pass,64
detectron2_maskrcnn_r_50_fpn,pass,65



Expand Down
12 changes: 6 additions & 6 deletions test/inductor/test_cudagraph_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def foo(x, y):
new_id = self.get_manager().new_graph_id().id
self.assertEqual(new_id, 3)

def _test_unaligned_static_input_impl(self):
def _test_unaligned_static_input_impl(self, expected_clones):
def fn(x, y):
return (x + y,)

Expand Down Expand Up @@ -512,21 +512,21 @@ def __torch_dispatch__(self, func, types, args=(), kwargs=None):
for _ in range(3):
with CloneCounterMode() as m:
compiled_f(get_unaligned_inputs())
self.assertEqual(m.count, 2)
self.assertEqual(m.count, expected_clones)

compiled_f(get_aligned_inputs())
self.assertEqual(m.count, 2)
self.assertEqual(m.count, expected_clones)

def test_unaligned_static_input_trees(self):
self._test_unaligned_static_input_impl()
self._test_unaligned_static_input_impl(expected_clones=0)

@torch._inductor.config.patch("triton.cudagraph_trees", False)
def test_unaligned_static_input_non_trees(self):
self._test_unaligned_static_input_impl()
self._test_unaligned_static_input_impl(expected_clones=0)

@torch._inductor.config.patch("triton.cudagraphs", False)
def test_unaligned_static_input_no_cudagraphs(self):
self._test_unaligned_static_input_impl()
self._test_unaligned_static_input_impl(expected_clones=0)

def test_sparsity(self):
def foo(view_6, buf31):
Expand Down
2 changes: 1 addition & 1 deletion torch/_inductor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def decide_compile_threads():
# assume_aligned_inputs means that we assume that inputs will be aligned; we generate
# code using this assumption, and clone tensors before use if they aren't aligned.
# In the common case, most inputs will be aligned.
assume_aligned_inputs: bool = True
assume_aligned_inputs: bool = False


# config specific to codegen/cpp.py
Expand Down

0 comments on commit 7c1a602

Please sign in to comment.