lsy643 commented on a change in pull request #6108:
URL: https://github.com/apache/incubator-tvm/pull/6108#discussion_r460478875
##########
File path: topi/python/topi/cuda/nms.py
##########
@@ -93,44 +67,41 @@ def get_valid_counts_ir(data, valid_count, out, out_indices,
valid_count = ib.buffer_ptr(valid_count)
out = ib.buffer_ptr(out)
out_indices = ib.buffer_ptr(out_indices)
- atomic_add_return = ib.allocate(
- valid_count.dtype, (1,), name='atomic_add_return', scope='local')
one_count = tvm.tir.const(1, dtype=valid_count.dtype)
one = tvm.tir.const(1, dtype=out.dtype)
score_threshold = tvm.ir.make_node(
"FloatImm", dtype="float32", value=score_threshold)
id_index = tvm.ir.make_node("IntImm", dtype="int32", value=id_index)
score_index = tvm.ir.make_node("IntImm", dtype="int32", value=score_index)
- max_threads = int(tvm.target.Target.current(
- allow_none=False).max_num_threads)
- nthread_tx = max_threads
- nthread_bx = batch_size * num_anchors // max_threads + 1
Review comment:
It seems that the gpu `get_valid_counts` does not need to moves valid
boxes to the top of input data because of the `argsort` in the `nms`, so using
the original `get_valid_counts_ir` ought to be better. And do you think
`rearrange_indices_out_ir` is the right way to do it?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]