-
Notifications
You must be signed in to change notification settings - Fork 184
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
64-bit indexing for DeviceSegmentedReduce #414
Conversation
* Added NumSegmentsT parameter to methods, so now num_segments can be of any integral type * Added OffsetT type resolution in a manner similar to DeviceReduce: set to std::common_type_t of BeginOffsetIterT::value_type and EndOffsetIterT::value_type. (see detail/choose_offset.cuh) * In a manner similar to DeviceReduce, we use static_cast to convert num_segments to OffsetT before dispatching * OffsetT type resolution uses std::common_type_t, std::void_t, and one inline constexpr variable (is_iterator_v).
Hi, should I create an Issue and add it to the description? I originally submitted this PR to the old Cub repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution! I've left a few comments, but before proceeding with the review, we'll need a test case that covers 64-bit problem sizes. Could you please add one? In order to keep moderate memory usage, you could try to rely on counting or constant iterators instead of actually allocating huge inputs.
Thank you for the feedback! Yes, sure thing. I'll write a quick test using some kind of counter iterator- or constant iterator-based approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the contribution, I am so sorry about our support situation
* Removed NumSegmentsT portion * Added catch2 test * Modified previous test slightly to use correct type for num_segments * Made type deduction SFINAE-friendly
@miscco @senior-zero Ready. (I hope.) I walked back 64-bit num_segments. I hope to submit that in a new Pull Request in the near future. For the test, I simply copied the previous test and modified it slightly. |
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
/ok to test |
Whoops! I deleted the offending lines and ran C++11 tests on my end. Everything seems to work now. Getting your code to be compliant with several standards is tricky business. |
/ok to test |
All set? |
Not yet, I have a few comments. Will complete the review soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work! There are a few minor changes that has to be made before we merge this.
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu
Outdated
Show resolved
Hide resolved
* Incorporated suggested changes to cub/test/catch2_test_device_segmented_reduce_iterators_64bit.cu and greatly simplified the test itself. * Ran clang-format of LLVM 16 using cub/.clang-format on modified files
So, did I misuse |
Device reduce 64bit
/ok to test |
@senior-zero I added you as a collaborator on my fork in case you'd like to make more changes. |
/ok to test |
@senior-zero @miscco Thank you both so much for your excellent feedback and for guiding me through the process! I learned a lot from this experience. It's my first time submitting a pull request to a public project like this. And thank you for teaching me about the "forbidden fruit" hidden within |
@jecs thank you for the contribution! |
Description
Checklist