Skip to content

Conversation

@eleanorTurintech
Copy link
Contributor

There seem to be some small issues with the for-loop indices in bloom filter. This pr aims to fix them.

In particular, there are two issues that this pr fixes:

  1. in cuco::detail::bloom_filter_impl::add(CG const& group, ProbeKey const& key), variable i in the for-loop doesn't seem to be used for indexing word and atom_word. This pr updates the index from rank to i.
  2. in cuco::detail::bloom_filter_impl::clear(CG const& group), the for-loop's terminating condition was not complete. This pr adds i < to the condition to complete it.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 19, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@PointKernel PointKernel added type: bug Something isn't working topic: bloom_filter Issues related to bloom_filter labels Feb 19, 2025
@PointKernel
Copy link
Member

/ok to test

Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

We probably need stricter unit tests for the CG add.

@eleanorTurintech Thanks a lot for catching and fixing those issues!

Copy link
Collaborator

@sleeepyjack sleeepyjack left a comment

Choose a reason for hiding this comment

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

Thank you @eleanorTurintech for this contribution!

I reworked the CG add in #672 a couple of days ago but haven't merged the changes yet. Let me get that merged first and then we can evaluate which of your changes are still relevant.

Comment on lines 155 to 158
auto const word = policy_.word_pattern(hash_value, rank);
auto const word = policy_.word_pattern(hash_value, i);

auto atom_word =
cuda::atomic_ref<word_type, thread_scope>{*(words_ + (idx * words_per_block + rank))};
cuda::atomic_ref<word_type, thread_scope>{*(words_ + (idx * words_per_block + i))};
Copy link
Collaborator

@sleeepyjack sleeepyjack Feb 19, 2025

Choose a reason for hiding this comment

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

Ha, very good catch! 🎣 The bug would have surfaced if we use a CG that is smaller than the optimal CG size.

@sleeepyjack
Copy link
Collaborator

@eleanorTurintech #672 has just been merged. The fix for clear is definitely still needed but the fix for add could be obsolete. I would kindly request your review on the new implementation.

@eleanorTurintech
Copy link
Contributor Author

@eleanorTurintech #672 has just been merged. The fix for clear is definitely still needed but the fix for add could be obsolete. I would kindly request your review on the new implementation.

You are right. The add change is obsolete now. I have synced with the main branch, and only kept the clear change in this pr. Thanks for your comments!

@sleeepyjack
Copy link
Collaborator

/ok to test

@PointKernel PointKernel merged commit 7942e83 into NVIDIA:dev Feb 20, 2025
18 checks passed
@eleanorTurintech eleanorTurintech changed the title [REVIEW] fixed a minor index issue in bloom_filter_impl [REVIEW] fixed an index issue in bloom_filter_impl Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: bloom_filter Issues related to bloom_filter type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants