Skip to content

IVF-PQ coarse search: fix integer overflow #999

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

Open
wants to merge 2 commits into
base: branch-25.08
Choose a base branch
from

Conversation

achirkin
Copy link
Contributor

When the IVF-PQ batch size and the number of cluster are big enough, the GEMM output matrix size may exceed the uint32_t limits. This manifests as an illegal memory access popping up in further stages of IVF-PQ (due to everything being as async as possible).

This PR fixes the bug by converting the input arguments to 64-bits before multiplying them.

@achirkin achirkin self-assigned this Jun 10, 2025
@achirkin achirkin requested a review from a team as a code owner June 10, 2025 18:21
@achirkin achirkin added the bug Something isn't working label Jun 10, 2025
@achirkin achirkin added the non-breaking Introduces a non-breaking change label Jun 10, 2025
@github-actions github-actions bot added the cpp label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cpp non-breaking Introduces a non-breaking change
Projects
Development

Successfully merging this pull request may close these issues.

2 participants