Skip to content

Conversation

@zhiics
Copy link
Member

@zhiics zhiics commented Dec 22, 2018

This PR enables ssd test by attaching the fcompute and fschedule implementations in TOPI to multibox_prior and nms operators.

It also implements the customized multibox_prior and multibox_detection ops in mxnet.py to enable support of conversion from MxNet.

tutorial/nnvm/deploy_ssd.py is used to verify the above changes.

@tqchen @kevinthesun @yzhliu

@zhiics zhiics force-pushed the mxnet branch 2 times, most recently from 24223c0 to c5480d5 Compare December 22, 2018 08:30

TVM_DECLARE_ATTRS(NMSAttrs, "relay.attrs.NMSAttrs") {
TVM_ATTR_FIELD(overlap_threshold).set_default(0.5)
TVM_ATTR_FIELD(nms_threshold).set_default(0.5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this argument name as overlap_threshold, since we don't need nms prefix. It can generate some inconsistency with current topi nms operator, but topi nms argument names will be modified in SSD refactor PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. I intentionally changed them to keep consistent to top. I will change them back.

return [
topi.vision.nms(inputs[0], inputs[1], nms_threshold, force_suppress,
nms_topk)
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed?

Copy link
Member Author

@zhiics zhiics Dec 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed because fcompute needs to receive an Array of Tensor when returning to c++. We can probably refactor the packfunc conversion a little bit to accept both Array and Tensor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NNVM automatically wraps result in Array:
https://github.com/dmlc/tvm/blob/e5d92e1b96c1fbc175be741f522c030f2d91a613/nnvm/src/compiler/packed_func_ext.cc#L99-L103

But Relay does not:
https://github.com/dmlc/tvm/blob/e5d92e1b96c1fbc175be741f522c030f2d91a613/src/relay/ir/op.cc#L129-L135

Relay doc asks for schedule function that returns list. So this is indeed complying with existing Relay interface.

@yzhliu yzhliu merged commit 993fe12 into apache:master Dec 25, 2018
@yzhliu
Copy link
Member

yzhliu commented Dec 25, 2018

Thanks @zhiics @kevinthesun @wweic This is now merged.

@zhiics zhiics deleted the mxnet branch December 25, 2018 18:39
FrozenGene pushed a commit to FrozenGene/tvm that referenced this pull request Dec 27, 2018
…and ssd ops (apache#2322)

* add ssd ops to mxnet.py

* add ssd ops to mxnet.py

* add result check for multibox and nms unit tests

* add result check for multibox and nms unit tests

* address @kevinthesun's comments

* Disable cuda test for nms for now.
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
…and ssd ops (apache#2322)

* add ssd ops to mxnet.py

* add ssd ops to mxnet.py

* add result check for multibox and nms unit tests

* add result check for multibox and nms unit tests

* address @kevinthesun's comments

* Disable cuda test for nms for now.
wweic pushed a commit to neo-ai/tvm that referenced this pull request Feb 20, 2019
…and ssd ops (apache#2322)

* add ssd ops to mxnet.py

* add ssd ops to mxnet.py

* add result check for multibox and nms unit tests

* add result check for multibox and nms unit tests

* address @kevinthesun's comments

* Disable cuda test for nms for now.
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.

5 participants