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

IVF-PQ: Fix illegal memory access with large max_samples #1685

Merged

Conversation

achirkin
Copy link
Contributor

PR #1356 increased the maximum internal batch size of IVF-PQ and, by doing so, exposed a bug of uint32_t integer overflow that resulted in incorrectly allocated intermediate buffers.
This PR fixes the original bug, but also:

  • Proofs the places where max_samples multiplied by something could cause integer overflow
  • Make more careful estimation of the workspace size to avoid out_of_memory errors from the limiting resource adaptor
  • Removes an unused argument from compute_similarity_kernel which has been slipping between code updates for a really long time

@achirkin achirkin added bug Something isn't working 3 - Ready for Review non-breaking Non-breaking change labels Jul 27, 2023
@achirkin achirkin requested a review from a team as a code owner July 27, 2023 15:28
@achirkin achirkin self-assigned this Jul 27, 2023
@github-actions github-actions bot added the cpp label Jul 27, 2023
@achirkin achirkin requested review from cjnolet and tfeher July 27, 2023 15:28
@cjnolet
Copy link
Member

cjnolet commented Jul 27, 2023

/merge

@rapids-bot rapids-bot bot merged commit 4574e9a into rapidsai:branch-23.08 Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review bug Something isn't working cpp non-breaking Non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

2 participants