Skip to content

[reland 2] Call jit decomp in VariableType to improve forward AD coverage #84976

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 4 commits into from

Conversation

soulitzer
Copy link
Contributor

Reland of #84675

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 14, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/84976

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

✅ No Failures, 1 Pending

As of commit 31dc0c0:
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the release notes: jit release notes category label Sep 14, 2022
@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added oncall: jit Add this issue/PR to JIT oncall triage queue fx labels Sep 14, 2022
@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…rward AD coverage (pytorch#84151)""

This reverts commit acb4a09.

ghstack-source-id: 387eda8
Pull Request resolved: pytorch#84675
@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@soulitzer soulitzer requested a review from zou3519 September 14, 2022 20:11
@soulitzer
Copy link
Contributor Author

Hopefully internal builds should passing now. The issue was that certain builds (e.g. lite_trainer) depended on the VariableType files, but do not depend on the jit. Including all of those additional dependencies to get jit to work on lite trainer will blow up the binary size so I don't think we want that.

Instead, what I'm doing in this updated PR (see latest commit for new changes) is the same thing that is done with VariableHooksInterface, i.e. provide the apis conditionally depending on whether the library depends on jit.

@soulitzer soulitzer added ciflow/trunk Trigger trunk jobs on your pull request ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR labels Sep 14, 2022
Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code and approach looks good to me. Two main comments:

  • There's a question of what we want to do in the long term. Should we take the TorchScript dependency, or should we just invoke the decomposition in Python? Since the TorchScript route is easy to do and proven to work, we should go with this PR for the short-to-medium term.
  • It took me a while to figure out what JitDecompInterface was and why we needed it. We should put a comment with a NOTE somewhere so that folks coming along to read it aren't confused.

@soulitzer soulitzer force-pushed the jvp-decomp branch 2 times, most recently from c292e2f to 32a2fbb Compare September 15, 2022 17:26
@soulitzer
Copy link
Contributor Author

I've confirmed that internal tests are passing now. I've cleaned up this PR a little bit and addressed the comments, so it should be ready for another look!

There's a question of what we want to do in the long term. Should we take the TorchScript dependency, or should we just invoke the decomposition in Python? Since the TorchScript route is easy to do and proven to work, we should go with this PR for the short-to-medium term.

This route makes sense to me as well

@soulitzer soulitzer requested a review from zou3519 September 15, 2022 17:35
Copy link
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor comments

@facebook-github-bot
Copy link
Contributor

@soulitzer has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@soulitzer
Copy link
Contributor Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here.
The merge job was triggered with the green (-g) flag. This means that your change will be merged once all checks on your PR have passed (ETA: 0-4 Hours). If this is not the intended behavior, feel free to use some of the other merge options in the wiki.
Please reach out to the PyTorch DevX Team with feedback or questions!

@github-actions
Copy link
Contributor

Hey @soulitzer.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/trunk Trigger trunk jobs on your pull request cla signed fx Merged oncall: jit Add this issue/PR to JIT oncall triage queue release notes: autograd release notes category topic: improvements topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants