8000 Hack AC to not clear recomputed activations · pytorch/pytorch@1a10572 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a10572

Browse files
committed
Hack AC to not clear recomputed activations
ghstack-source-id: f9c5294 Pull Request resolved: #146318
1 parent cc1c9f1 commit 1a10572

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/utils/checkpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def pack_hook(x):
11081108
return holder
11091109

11101110
def unpack_hook(holder):
1111-
gid = torch._C._current_graph_task_id()
1111+
gid = 0 # torch._C._current_graph_task_id()
11121112
if gid == -1:
11131113
# generate a temporary id if we trigger unpack outside of a backward call
11141114
gid = int(uuid.uuid4())
@@ -1137,7 +1137,7 @@ def unpack_hook(holder):
11371137
)
11381138
_internal_assert(holder.handles[gid] in frame.recomputed[gid])
11391139
ret = frame.recomputed[gid][holder.handles[gid]]
1140-
holder.handles[gid] = None
1140+
# holder.handles[gid] = None
11411141
return ret
11421142

11431143
if frame.unpack_error_cb is not None:

0 commit comments

Comments
 (0)
0