diff --git a/thunder/executors/nvfuserex_impl.py b/thunder/executors/nvfuserex_impl.py index 571a55adff..70a8add0f3 100644 --- a/thunder/executors/nvfuserex_impl.py +++ b/thunder/executors/nvfuserex_impl.py @@ -2068,8 +2068,7 @@ def copy_( ) -> Any: nvcopy_from = getnv(copy_from, fd, lc_to_nv_map) nvcopy_to = getnv(copy_to, fd, lc_to_nv_map) - alias_output = fd.ops.set(nvcopy_from) - fd.add_output(alias_output, alias_input=nvcopy_to) + fd.add_output(nvcopy_from, alias_input=nvcopy_to) return nvcopy_to diff --git a/thunder/tests/test_inplace_copy.py b/thunder/tests/test_inplace_copy.py index 952df2faf0..feb49fe77a 100644 --- a/thunder/tests/test_inplace_copy.py +++ b/thunder/tests/test_inplace_copy.py @@ -152,29 +152,3 @@ def func3(x, y): match=r"If you are sure you don't want to use this check, it can be disabled by setting `disable_inplace_copy_check=True` in `thunder.jit`.$", ): traced_foo(a, b) - - -@instantiate(executors=(nvFuserExecutor,), dtypes=(thunder.float32,)) -def test_inplace_copy_dst_copy_returned_issue_1109(executor, device, dtype): - def func(T0): - T1 = torch.sin(T0) - T0.copy_(T1) # destination.copy_(source) - T2 = torch.cos(T1) - T0.copy_(T2) - # T1 & T2 should be returned as separate buffer, instead of sharing - # storage with T0 - return T1, T2 - - tdtype = ttorch.to_torch_dtype(dtype) - # This pattern is unsafe in general. Disabling sanity check to silence - # exception for testing - traced_foo = executor.make_callable(func, disable_inplace_copy_check=True) - a = make_tensor((4, 4), device=device, dtype=tdtype) - a_ref = a.clone() - - o_thunder = traced_foo(a) - o_eager = func(a_ref) - - assert_close(a_ref, a) - for o, o_ref in zip(o_thunder, o_eager): - assert_close(o, o_ref) diff --git a/thunder/torch/__init__.py b/thunder/torch/__init__.py index 11196d9fb9..c4716183f1 100644 --- a/thunder/torch/__init__.py +++ b/thunder/torch/__init__.py @@ -1917,11 +1917,6 @@ def copysign_(a, b, /): return prims.copy_(copysign(a, b), a) -@torchsymbol(torch.Tensor.copy_, is_method=True) # , tags=(prims.OpTags.IN_PLACE,)) -def copy_(a, b, /): - return prims.copy_(b, a) - - # TODO Implement div @torchsymbol(torch.div, is_method=True) def div(