8000 [ca][dynamo] always run eager checkpoint region's recomputation in eager by xmfan · Pull Request #153300 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[ca][dynamo] always run eager checkpoint region's recomputation in eager #153300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update
[ghstack-poisoned]
  • Loading branch information
xmfan committed May 12, 2025
commit 13b2f3dca5fda9171c9b2cea09f7b5da58a2342c
4 changes: 2 additions & 2 deletions torch/utils/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,6 @@ def pack_hook(x):
frame.x_metadatas.append(frame.metadata_fn(x))
return holder

# See Note: [compiled autograd and checkpoint unpack hook]
@torch._disable_dynamo
def unpack_hook(holder):
gid = torch._C._current_graph_task_id()
if gid == -1:
Expand Down Expand Up @@ -1494,6 +1492,8 @@ def _checkpoint_without_reentrant_generator(
had_device_in_fwd = True
fwd_devices, fwd_device_states = get_device_states(*args)

# See Note: [compiled autograd and checkpoint unpack hook]
@torch._disable_dynamo
def recompute_fn(*inputs):
kwargs, *args = inputs
# This will be called later during recomputation. This wrapping enables
Expand Down
Loading
0