-
Notifications
You must be signed in to change notification settings - Fork 23k
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
Do not modify saved variables in-place for spectral norm during power iteration #62293
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit bb92cc1 (more details on the Dr. CI page):
1 failure not recognized by patterns:
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. |
3d63e9f
to
c0c61ad
Compare
c0c61ad
to
772c8b0
Compare
29836b1
to
a3eec40
Compare
ca15208
to
c2cb316
Compare
As discussed with @albanD offline, since we cannot test with gradcheck with the parametrized spectral norm module as-is, we try to test gradcheck again with This was more complicated that initially thought though because there are many side effects of removing the no_grad. Its very possible we're testing completely different. Anyway, the things changed in linked PR are:
|
A wrapper function should be used to make sure we don't change the "original" u and v in any way I think.
That is surprising... especially ops with a single output should work out of the box. |
This fixed everything. The |
From the linked PR, the test is failing for DP - Not sure if DP is possible when power iteration is done in grad mode because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
@soulitzer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
c2cb316
to
bb92cc1
Compare
@soulitzer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Codecov Report
@@ Coverage Diff @@
## master #62293 +/- ##
==========================================
+ Coverage 67.05% 67.13% +0.08%
==========================================
Files 691 691
Lines 90496 90496
==========================================
+ Hits 60679 60752 +73
+ Misses 29817 29744 -73 |
@soulitzer merged this pull request in 5be17ec. |
Interestingly enough, the original code did have a mechanism that aims to prevent this very issue:
but it performs a clone AFTER modifying u and v in-place.
This wouldn't work though because we can later use the cloned u and v in operations that save for backward, and the next time we execute forward, we modify the same cloned u and v in-place.
So if the idea is that we want to avoid modifying saved variable in-place we should clone it BEFORE the in-place operation.