Skip to content
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

[NNVM] Bugfix operator fusion for residual block with layout transform #1760

Merged
merged 3 commits into from
Sep 25, 2018

Conversation

masahi
Copy link
Member

@masahi masahi commented Sep 22, 2018

This is a fix for the issue found by @kevinthesun.

In #1608, I added a logic to prevent fusing injective ops with convolution or other non-broadcast ops. To do that, we detect a node which has both injective ops and non-broadcast ops as parents, and assigning group and master node ids appropriately.

But I failed to address a case where the detected node has children nodes in the same group. In that case, we need to reassign master node id to children nodes as well, since otherwise they might still be pointing to a master node in a different group.

This issue could arise in a residual block with layout transform. There, layout transform, elemwise add, and relu ops can be fused, but not conv2d because layout transform is an injective op. Before this PR, the correct fusion was happening, but relu op's master id was pointing to a conv2d op, which caused the issue @kevinthesun reported. This is hard to describe in words, but the test case added may clarify a bit.

@kevinthesun @tqchen please review.

@tqchen tqchen merged commit 1de91d0 into apache:master Sep 25, 2018
@tqchen
Copy link
Member

tqchen commented Sep 25, 2018

Thanks @masahi this is now merged

FrozenGene pushed a commit to FrozenGene/tvm that referenced this pull request Dec 27, 2018
apache#1760)

* Bugfix operator fusion for residual block with layout transform

* add a test case

* update error message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants