[RELAY][GRAD] Fix first-order AD on tuple arguments#6827
Merged
Conversation
jroesch
reviewed
Nov 2, 2020
| } | ||
| return ll->Push(Tuple(updates)); | ||
| } else { | ||
| LOG(FATAL) << "unsupported arg type of operator: " << t; |
Member
There was a problem hiding this comment.
Can we try and do diagnostics here? we could put into improve AD with diagnostics
Contributor
Author
There was a problem hiding this comment.
I agree on this but it will probably need some refactoring, we might as well do it for the whole pass (first-order and higher-order). I think a separate PR will be ideal.
jroesch
approved these changes
Nov 2, 2020
MarisaKirisame
approved these changes
Nov 4, 2020
d3da8f3 to
ae22bce
Compare
ae22bce to
4e3a080
Compare
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 2, 2020
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
Dec 4, 2020
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Dec 4, 2020
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.
The first-order AD currently incorrectly deals with functions with tuple arguments, in particular by trying to add tuples when summing the gradients. Notably, this causes errors in the gradients of functions like
stackwhich take a tuple of tensors. This PR lifts addition to work on the tuples (which was already done by the higher-order AD).However, higher-order AD currently does not support tuples in the top-level function, and I added an xfail test to show this. I'm not sure how hard it is to change the higher-order code to support tuples at the top-level, so maybe someone else can take a look.
cc @MarisaKirisame @t-vi