[NNVM] Bug fix Prevent fusing convolution with injective op #1608
Merged
tqchen merged 4 commits intoapache:masterfrom Aug 17, 2018
Merged
[NNVM] Bug fix Prevent fusing convolution with injective op #1608tqchen merged 4 commits intoapache:masterfrom
tqchen merged 4 commits intoapache:masterfrom
Conversation
Member
|
@merrymercy can you also review this? |
tqchen
requested changes
Aug 17, 2018
| bool parent_injective = false; | ||
| for (const auto& e : inode.inputs) { | ||
| TOpPattern pt = pattern_vec[e.node_id]; | ||
| if (pt == kOutEWiseFusable) parent_out_ewise = true; |
Member
There was a problem hiding this comment.
style, multiline if always enclose with {}
tqchen
approved these changes
Aug 17, 2018
Member
|
Thanks @masahi , this is now merged |
Contributor
|
The below script fails after this commit. This kind of graph pattern can be found, for example, in NASNet. import nnvm
from nnvm import symbol as sym
ch = 3
size = 8
data = sym.Variable(name="data")
concat = sym.concatenate(data, data)
conv = sym.conv2d(data=concat, kernel_size=(1,1), channels=ch*2)
net = sym.elemwise_add(concat, conv)
nnvm.compiler.build(net, "llvm", {"data": (1, ch, size, size)})The result is as follows. @masahi, can you check this out? |
Member
Author
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.
Continuing from #1603.
Modify operator fuser to include following logics.
A test case is included. This test fails without this PR.
I confirmed that this change does not affect compling resnet, mobilenet and vgg.
@tqchen please check if the logic is good.