Skip to content

Commit dd2d0c6

Browse files
Andrew Gupytorchmergebot
Andrew Gu
authored andcommitted
[FSDP2] Gate PT2 code for torch deploy (pytorch#142456)
See diff for internal details Differential Revision: [D67003832](https://our.internmc.facebook.com/intern/diff/D67003832) Pull Request resolved: pytorch#142456 Approved by: https://github.com/yf225, https://github.com/weifengpy, https://github.com/fegin
1 parent ff05958 commit dd2d0c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torch/distributed/fsdp/_fully_shard/_fsdp_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ def copy__functionalize(tensor, data):
136136
torch.ops.fsdp.copy_.default(tensor_inner, data_inner)
137137

138138

139-
torch.fx.node.has_side_effect(torch.ops.fsdp.copy_.default)
139+
if not torch._running_with_deploy():
140+
torch.fx.node.has_side_effect(torch.ops.fsdp.copy_.default)
140141

141142

142143
class ShardedState(Enum):

0 commit comments

Comments
 (0)