-
Notifications
You must be signed in to change notification settings - Fork 915
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
Support Segmented Min/Max Reduction on String Type #10447
Support Segmented Min/Max Reduction on String Type #10447
Conversation
Co-authored-by: Bradley Dice <[email protected]>
…fea/seg_reduction_dec_type
… removed unused functions in `reduction.cuh`. Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
Co-authored-by: Bradley Dice <[email protected]>
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.
Looks good, just a few small suggestions.
@vuule All these are great review comments! I wouldn't consider them as optional :) |
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.
LGTM
Co-authored-by: David Wendt <[email protected]>
rerun tests |
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.
Everything else looks fine to me except one below.
offsets.begin() + 1, | ||
null_handling, | ||
stream, | ||
mr); |
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.
A super minor nit: we can determine if segmented_null_mask
is a temporary memory based on result->null_count()
and choose to use default resource v.s. supplied resource here.
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.
Feel free to ignore or punt to next one @bdice.
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.
We are already using mr
as efficiently (minimally) as possible. If result->null_count() == 0
, we return the mr
-allocated bitmask. Else, we do an inplace_bitmask_and
that alters the mr
-allocated bitmask before returning it.
The use of mr
in inplace_bitmask_and
, which calls inplace_bitmask_binop
, is a little misleading. The allocations there are always temporary and are not part of the return value. I think it may be possible to refactor the inplace
functions to remove mr
as an argument, and require the use of the default memory resource to avoid an implication that it is used for the returned data (it is not, since it acts in-place on bitmasks passed in that were from some other allocator).
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.
When the gather result contains null, its null_mask
is allocated with mr
. The inplace_bitmask_and
uses this as the target null mask, in this situation, the segmented_null_mask
doesn't need to use the supplied mr
because this null mask is acting only as an operand in the inplace_nullmask_and
, not as the result.
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.
Okay, that might be the case. The segmented_null_mask_reduction
could use result->null_count() == 0 ? mr : rmm::mr::get_current_device_resource()
. I'm not sure if I would recommend using a conditional mr
for the sake of clarity, but it seems that it could be done.
@gpucibot merge |
This PR adds support to min/max segmented reduction to fixed point type. Together with #10447, this PR closes #10417 Besides, this PR refactors `segmented_reduce` to accept output iterators instead of allocating the result column from within. Authors: - Michael Wang (https://github.com/isVoid) - Bradley Dice (https://github.com/bdice) Approvers: - Bradley Dice (https://github.com/bdice) - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu) - David Wendt (https://github.com/davidwendt) URL: #10794
This PR adds
min/max
segmented reduction to string type.Part of #10417