Skip to content

Add forward AD gradcheck#57633

Closed
albanD wants to merge 15 commits intogh/albanD/87/basefrom
gh/albanD/87/head
Closed

Add forward AD gradcheck#57633
albanD wants to merge 15 commits intogh/albanD/87/basefrom
gh/albanD/87/head

Conversation

@albanD
Copy link
Copy Markdown
Collaborator

@albanD albanD commented May 5, 2021

Stack from ghstack:

Differential Revision: D28387765

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented May 5, 2021

💊 CI failures summary and remediations

As of commit 085640e (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

albanD added a commit that referenced this pull request May 5, 2021
ghstack-source-id: 5c5d749
Pull Request resolved: #57633
@albanD albanD requested a review from zou3519 May 5, 2021 14:37
albanD added a commit that referenced this pull request May 5, 2021
ghstack-source-id: 16ed433
Pull Request resolved: #57633
Copy link
Copy Markdown
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall! Added some minor comments.

@soulitzer
Copy link
Copy Markdown
Contributor

In terms of further testing, what if you had a wrapper function that unpacked the returned dual tensor from the original function, perturbs the tangent by some eps, and then does make_dual again before returning?

albanD added a commit that referenced this pull request May 5, 2021
ghstack-source-id: 45471ba
Pull Request resolved: #57633
@albanD
Copy link
Copy Markdown
Collaborator Author

albanD commented May 6, 2021

Sorry for the important update but implementing the OpInfo showed some limitations in the implementation that was here and that it wasn't working for most complex workloads.
This updated version works unchanged when OpInfos are added and won't get any other major modification.
If some edge cases I don't know about are not supported here, they will be added in a follow up PR.

dgl-intel pushed a commit to dgl-intel/pytorch that referenced this pull request May 6, 2021
ghstack-source-id: 9ed86ab
Pull Request resolved: pytorch#57633
@albanD
Copy link
Copy Markdown
Collaborator Author

albanD commented May 7, 2021

This is ready for final review

Copy link
Copy Markdown
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

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

Added a couple more comments. Might be good to make a quick PR testing that CI passes with slow_mode=False if you haven't already.

@albanD
Copy link
Copy Markdown
Collaborator Author

albanD commented May 7, 2021

I tested locally with slow gradcheck flag. How do you do a PR to test with slow? Modify the global setting to False by default and push that? Or there is another way?

dgl-intel pushed a commit to dgl-intel/pytorch that referenced this pull request May 7, 2021
ghstack-source-id: ad301a5
Pull Request resolved: pytorch#57633
@soulitzer
Copy link
Copy Markdown
Contributor

Yeah, that was what I was thinking.
Also @gchanan says that we should allow people to test slow_mode in ci-all

Alternatively though, we can have a new branch prefix specifically for new gradcheck
See #57880

@albanD
Copy link
Copy Markdown
Collaborator Author

albanD commented May 10, 2021

@soulitzer Running the slow gradcheck version in #57952

albanD added a commit that referenced this pull request May 10, 2021
ghstack-source-id: ad301a5
Pull Request resolved: #57633
albanD added a commit to albanD/pytorch that referenced this pull request May 11, 2021
ghstack-source-id: 68f15a0
Pull Request resolved: pytorch#57633
@albanD
Copy link
Copy Markdown
Collaborator Author

albanD commented May 12, 2021

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

@soulitzer soulitzer self-requested a review May 12, 2021 19:45
Copy link
Copy Markdown
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the addition!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@albanD merged this pull request in 647282c.

@mruberry
Copy link
Copy Markdown
Collaborator

Unlanding this stack as it appears to have hit a logical merge conflict and is breaking multiple builds on the HUD. Sample tests broken:

test_forward_mode_AD_narrow_cpu_complex128
test_forward_mode_AD_narrow_cpu_float64
test_forward_mode_AD_acos_cuda_complex128
test_forward_mode_AD_acosh_cuda_complex128
test_forward_mode_AD_narrow_cuda_complex128
test_forward_mode_AD_narrow_cuda_float64

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been reverted by 2d7d692.

@facebook-github-bot facebook-github-bot deleted the gh/albanD/87/head branch May 16, 2021 14:15
krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary: Pull Request resolved: pytorch#57633

Test Plan: Imported from OSS

Reviewed By: agolynski

Differential Revision: D28387765

Pulled By: albanD

fbshipit-source-id: ed15049b5bdacca54f775b50ef166d540ba0b847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants