Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Conversation

bdhirsh
Copy link
Contributor

@bdhirsh bdhirsh commented Aug 13, 2021

First pass of the functionalization pass for functorch. Most of the description can be found in the accompanying core-side PR here.

This PR probably needs some cleanup first, but I wanted to put up the functorch-side changes early for completeness.

Stuff that I still need to do:

  • I've only done basic testing of functionalize() so far
  • I need to implement more view ops - only view() is currently implemented

The part worth talking about the most is probably the wrapping/unwrapping logic here, which is kind of similar to the wrapping/unwrapping logic for grad() (and can probably be shared). Main points:

  • functorch needs to do the wrapping/unwrapping, and not core, because core doesn't know what "level" the wrapper should have. That means that the wrapping and unwrapping should happen in the boxed fallback, DynamicLayerBackFallback.
  • It needs to be careful to wrap the outputs of factory functions, but not to wrap any outputs when we're currently printing.

@zou3519
Copy link
Contributor

zou3519 commented Jul 13, 2022

I'm cleaning up old PRs in preparation for the functorch->pytorch merge; we've already landed functionalization in some form so closing this.

@zou3519 zou3519 closed this Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants