pytorch icon indicating copy to clipboard operation
pytorch copied to clipboard

[Compiled Autograd] Introduce BackwardState capture

Open jansel opened this issue 1 year ago • 1 comments

Stack from ghstack (oldest at bottom):

  • -> #120382
  • #120163

This adds support for backwards hooks that are both:

  1. Interior to the graph; and
  2. Dynamically generated (e.g. lambdas)

We do this by creating a BackwardState object that is used to register the hooks in the forward, then populated by dynamo after the forwards runs.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @amjames

jansel avatar Feb 22 '24 05:02 jansel

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/120382

Note: Links to docs will display an error until the docs builds have been completed.

:white_check_mark: No Failures

As of commit 99461029c2e13c68c41f70dd49c838c4a6858236 with merge base 6cc7f9a2e6bedff3109ea066278e9805713da4bb (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar Feb 22 '24 05:02 pytorch-bot[bot]

@pytorchbot merge

jansel avatar Feb 28 '24 17:02 jansel

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging Check the merge workflow status here

pytorchmergebot avatar Feb 28 '24 17:02 pytorchmergebot