-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Relay][Frontend][BugFix] Fixed relay grouped convolution selection #3020
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
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
it is not safe to use
attrs.channelssince this attr is optinoalThere 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.
In that case, the
in_channelsneeds to be exposed to the function. Either by being added to theattrs(defined at nn.h:51), or passing it as an extra argument (such as thetinfosuggestion) by every caller of it in the codebase.Would there ever be any cases when the
in_channelswould be indeterminate when this function is called?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.
in_channelsshould be available from the shape of input / weight after type inferThere 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.
@Wheest As suggested in #3070 (comment), you can get input channels via
outs[0].op.attrs["workload"]. Can you check if this work for you?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.
Thanks for the insight @vinx13, I would never have groked all of the info that
outsstores. I can confirm that settingin_channels = outs[0].op.attrs['workload'][1][1]works forgroups==1andgroups==in_channels. However, interestingly when1<groups<in_channels, it seems thatouts[0].op.attrs.itemsis empty. This suggests that whatever callsschedule_conv2ddoes not setouts[0].op.attrs.itemscorrectly when using grouped convolutions. Am investigating why.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.
Hi @Wheest, I did notice such circumstances in my PR. Please let me know if you have any new discovery :)
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.
@Wheest FYI
workloadis set hereThis is probably because
group_conv2d_nchwis not registered as autotvm templateThere 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.
@vinx13 You might be correct -
depthwise_conv2d_nchwhas been properly registered whilegroup_conv2d_nchwhas not. I'm working on fixing thatThere 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.
Thanks, I'll hold until then. Why would autotvm templates be used in this workflow? I thought that the process is:
As I understand it, you might use autotvm at step 3. to tune and optimise the program. But I thought of it a "separate tool" in the tvm suite, not used in step 1 or 2.
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.
Actually we only need extra attributes when calling schedule. One way is to add attributes needed in topi compute. Autotvm already did this, but we can also register them manually. For the group conv case, we can add an attribute when calling
tvm.compute