Skip to content

[TOPI] Fix data race of batch multibox detection#14343

Merged
masahi merged 4 commits intoapache:mainfrom
wrongtest-intellif:fix_batch_multibox_datarace
Apr 7, 2023
Merged

[TOPI] Fix data race of batch multibox detection#14343
masahi merged 4 commits intoapache:mainfrom
wrongtest-intellif:fix_batch_multibox_datarace

Conversation

@wrongtest-intellif
Copy link
Copy Markdown
Contributor

@wrongtest-intellif wrongtest-intellif commented Mar 20, 2023

  • For cpu, currently the buffer space of box_coord and pred_coord is shared across parallel batch like
for i in parallel(batch_size):
    # ...
                for l in range(4):
                    box_coord[l] = anchor[0, j, l]
                    pred_coord[l] = loc_pred[i, j * 4 + l]
  • For cuda, fix two index usage error of batch idx.

@tvm-bot
Copy link
Copy Markdown
Collaborator

tvm-bot commented Mar 20, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: topi See #10317 for details

Generated by tvm-bot

@wrongtest-intellif
Copy link
Copy Markdown
Contributor Author

@tvm-bot rerun

@wrongtest-intellif
Copy link
Copy Markdown
Contributor Author

cc @kevinthesun @Laurawly @tqchen Hi~ could you kindly take a look at it, thanks!

@tqchen
Copy link
Copy Markdown
Member

tqchen commented Apr 4, 2023

cc @masahi , can you help to take a look at this?

Comment thread python/tvm/topi/vision/ssd/multibox.py Outdated
box_coord[l] = anchor[0, j, l]
pred_coord[l] = loc_pred[i, j * 4 + l]
out_coord = _hybridy_transform_loc(box_coord, pred_coord, variances, clip)
box_coord[i, l] = anchor[0, j, l]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems box_coord is the same in all threads. How about passing anchor, j, and l to _hybridy_transform_loc instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good idea~ updated as suggested.

@masahi
Copy link
Copy Markdown
Member

masahi commented Apr 5, 2023

Need to fix lint.

@masahi
Copy link
Copy Markdown
Member

masahi commented Apr 6, 2023

@tvm-bot rerun

1 similar comment
@wrongtest-intellif
Copy link
Copy Markdown
Contributor Author

@tvm-bot rerun

@masahi masahi merged commit e1b49c8 into apache:main Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants