subtle bug in computing nested gradients#558
Merged
jzstark merged 8 commits intoowlbarn:masterfrom Nov 12, 2020
Merged
Conversation
mseri
requested changes
Nov 11, 2020
Member
mseri
left a comment
There was a problem hiding this comment.
Can you add the reproduction case as a test?
Member
Author
|
Good idea! I'll do that |
Member
ryanrhymes
approved these changes
Nov 11, 2020
jzstark
approved these changes
Nov 12, 2020
Collaborator
|
Thanks a lot for finding and fixing this issue Calvin! Also thanks to the suggestion of Marcello. I was thinking that instead of trying to make v1.0.0 a "perfect" release and keep coming back to re-release, maybe it would be cleaner to include them in the next release, say v1.0.1. |
Member
|
Since it is not yet merged and we don’t expect any changes, why not just do it once and for all now? We don’t release that often |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We discovered a bug yesterday when in nested gradient computations. Here's a minimal example that breaks:
The reason that this fails is somewhat subtle, but it boils down to line 1350 in
owl_algodiff_ops.ml:This is a problem because here
bhas either a lower tag thanaor primal values. Instead, the code should beThis is not an issue when we are dealing with vanilla gradients, but can be an issue when we are computing nested gradients as we are effectively unpacking prematurely with
primal b.Please merge #557 before merging this.
In this PR, we fix this issue by making changes to
owl_algodiff_ops_builderso that the users do not need to worry about computing theprimalof the input in building their operations. This will be done automatically under the hood where appropriate.