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

Add warp-aggregated atomic increment #735

Conversation

ahendriksen
Copy link
Contributor

Implement fast atomic counter increment using warp-aggregated atomics. Useful
for filtering.

Adapted from:
https://developer.nvidia.com/blog/cuda-pro-tip-optimized-filtering-warp-aggregated-atomics/

@ahendriksen ahendriksen requested a review from a team as a code owner July 8, 2022 14:57
@github-actions github-actions bot added the cpp label Jul 8, 2022
@ahendriksen ahendriksen added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change 2 - In Progress Currenty a work in progress labels Jul 8, 2022
@ahendriksen
Copy link
Contributor Author

Moving this functionality from cuml to raft as discussed in rapidsai/cuml#4803

@ahendriksen ahendriksen force-pushed the fea-add-warp-aggregated-atomic-increment branch from 4a76a73 to a001020 Compare July 11, 2022 08:01
@ahendriksen ahendriksen added 3 - Ready for Review and removed 2 - In Progress Currenty a work in progress labels Jul 11, 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.

Looks good. Please add a unit test.

Faster atomic counter increment using warp-aggregated atomics. Useful
for filtering.

Adapted from:
https://developer.nvidia.com/blog/cuda-pro-tip-optimized-filtering-warp-aggregated-atomics/
@ahendriksen ahendriksen force-pushed the fea-add-warp-aggregated-atomic-increment branch from a001020 to 04ea9a7 Compare July 13, 2022 09:54
@ahendriksen ahendriksen requested a review from a team as a code owner July 13, 2022 09:54
@github-actions github-actions bot added the CMake label Jul 13, 2022
@ahendriksen
Copy link
Contributor Author

I have added a unit test.

@ahendriksen ahendriksen changed the title [WIP] atomics: Add warp-aggregated atomic increment [REVIEW] atomics: Add warp-aggregated atomic increment Jul 13, 2022
@ahendriksen ahendriksen requested a review from tfeher July 13, 2022 09:56
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 @ahendriksen for adding the test! The PR looks good to me.

@ahendriksen ahendriksen changed the title [REVIEW] atomics: Add warp-aggregated atomic increment [FEA] atomics: Add warp-aggregated atomic increment Jul 13, 2022
@ahendriksen ahendriksen changed the title [FEA] atomics: Add warp-aggregated atomic increment atomics: Add warp-aggregated atomic increment Jul 14, 2022
@ahendriksen ahendriksen changed the title atomics: Add warp-aggregated atomic increment Add warp-aggregated atomic increment Jul 14, 2022
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

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

LGTM. Just a tiny question / nitpick in the test. Thanks @ahendriksen!

out_device.data());

// Copy data to host
RAFT_CUDA_TRY(cudaMemcpy(out_host.data(),
Copy link
Member

Choose a reason for hiding this comment

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

Can we use raft::copy here?

@cjnolet
Copy link
Member

cjnolet commented Jul 14, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit e35a7d9 into rapidsai:branch-22.08 Jul 14, 2022
@ahendriksen ahendriksen deleted the fea-add-warp-aggregated-atomic-increment branch March 20, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge CMake cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants