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

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

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

wrongtest-intellif
Copy link
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
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
Contributor Author

@tvm-bot rerun

@wrongtest-intellif
Copy link
Contributor Author

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

@tqchen
Copy link
Member

tqchen commented Apr 4, 2023

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

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
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
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
Member

masahi commented Apr 5, 2023

Need to fix lint.

@masahi
Copy link
Member

masahi commented Apr 6, 2023

@tvm-bot rerun

1 similar comment
@wrongtest-intellif
Copy link
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