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

Fix integer overflow in ANN kmeans #835

Merged
merged 2 commits into from
Sep 21, 2022

Conversation

Nyrio
Copy link
Contributor

@Nyrio Nyrio commented Sep 21, 2022

CUDA block and thread indices are uint32, so the following operation results in an overflow before being cast to uint64:

uint64_t gid = threadIdx.x + (blockDim.x * blockIdx.x);

This PR fixes the error that @tfeher and myself have encountered while benchmarking large datasets:

Incorrect mesocluster size at 0. 625618 vs 625858

cc @achirkin

@Nyrio Nyrio requested a review from a team as a code owner September 21, 2022 15:27
@github-actions github-actions bot added the cpp label Sep 21, 2022
@Nyrio Nyrio added bug Something isn't working non-breaking Non-breaking change labels Sep 21, 2022
Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks for the fix Louis, LGTM!

@cjnolet
Copy link
Member

cjnolet commented Sep 21, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit e394ac2 into rapidsai:branch-22.10 Sep 21, 2022
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 Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants