-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Closed
Copy link
Labels
module: functionalizationused for issues that are specific to functionalization (AOTAutograd bugs should start w aotdispatch)used for issues that are specific to functionalization (AOTAutograd bugs should start w aotdispatch)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🐛 Describe the bug
On master, make sure the unit test is using functionalization:
diff --git a/test/functorch/test_aotdispatch.py b/test/functorch/test_aotdispatch.py
index c058b3618e..d848068f3c 100644
--- a/test/functorch/test_aotdispatch.py
+++ b/test/functorch/test_aotdispatch.py
@@ -1317,7 +1317,7 @@ class TestEagerFusionOpInfo(AOTTestCase):
@skipIfNoSympy
@patch("functorch.compile.config.use_dynamic_shapes", True)
@patch("functorch.compile.config.use_fake_tensor", True)
- @patch("functorch.compile.config.use_functionalize", False)
+ @patch("functorch.compile.config.use_functionalize", True)
@skipOps('TestEagerFusionOpInfo', 'test_aot_autograd_symbolic_exhaustive',
aot_autograd_failures | symbolic_aot_autograd_failures)
def test_aot_autograd_symbolic_exhaustive(self, device, dtype, op):
and then run this test:
python test/functorch/test_aotdispatch.py -k test_aot_autograd_symbolic_exhaustive_nn_functional_pad_circular_cpu_float32
It fails with a value mismatch error.
If you patch in (from #86427)
diff --git a/tools/autograd/gen_inplace_or_view_type.py b/tools/autograd/gen_inplace_or_view_type.py
index d79212a093..f9334d8c5b 100644
--- a/tools/autograd/gen_inplace_or_view_type.py
+++ b/tools/autograd/gen_inplace_or_view_type.py
@@ -158,7 +158,7 @@ at::_ops::${unambiguous_name}::call(${unpacked_args})"""
SETUP_REPLAY_VIEW_IF_NOT_SUPPORT_AS_STRIDED_OR_VIEW_WITH_METADATA_CHANGE = CodeTemplate(
"""\
std::function<at::Tensor(const at::Tensor&)> func=nullptr;
-if (${is_view_with_metadata_change} || !self.unsafeGetTensorImpl()->support_as_strided()) {
+if (${is_view_with_metadata_change} || !self.unsafeGetTensorImpl()->support_as_strided() || true) {
${replay_view_func}
}
"""
the test starts passing. So it would seem that functionalization is not handling as_strided completely correctly in all cases.
Versions
master
Metadata
Metadata
Assignees
Labels
module: functionalizationused for issues that are specific to functionalization (AOTAutograd bugs should start w aotdispatch)used for issues that are specific to functionalization (AOTAutograd bugs should start w aotdispatch)triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module