Skip to content

Commit

Permalink
[TOPI] Improve get_valid_count and nms performance for CUDA (apache#5339
Browse files Browse the repository at this point in the history
)

* get_valid_count updated to have correct results

* speedup nms

* update nms

* revert back nms

* recover one test for get_valid_count
  • Loading branch information
Laurawly authored and zhiics committed Apr 17, 2020
1 parent 379d5dd commit ce95a82
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 295 deletions.
1 change: 0 additions & 1 deletion python/tvm/relay/frontend/mxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ def _mx_smooth_l1(inputs, attrs):

def _mx_deformable_convolution(inputs, attrs):
new_attrs = {}
assert attrs.get_bool("no_bias")
new_attrs["kernel_size"] = attrs.get_int_tuple("kernel")
new_attrs["strides"] = attrs.get_int_tuple("stride")
new_attrs["padding"] = attrs.get_int_tuple("pad")
Expand Down
3 changes: 3 additions & 0 deletions tests/python/relay/test_op_level5.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ def verify_get_valid_counts(dshape, score_threshold, id_index, score_index):
intrp = relay.create_executor("debug", ctx=ctx, target=target)
out = intrp.evaluate(func)(np_data)
tvm.testing.assert_allclose(out[0].asnumpy(), np_out1, rtol=1e-3, atol=1e-04)
# get_valid_count for cuda doesn't do data rearrangement
if target == 'cuda':
return
tvm.testing.assert_allclose(out[1].asnumpy(), np_out2, rtol=1e-3, atol=1e-04)

verify_get_valid_counts((1, 2500, 6), 0, 0, 1)
Expand Down
Loading

0 comments on commit ce95a82

Please sign in to comment.