-
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
Return weak orderings from device_row_comparator
.
#10793
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-22.06 #10793 +/- ##
================================================
- Coverage 86.40% 86.29% -0.11%
================================================
Files 143 143
Lines 22448 22597 +149
================================================
+ Hits 19396 19501 +105
- Misses 3052 3096 +44
Continue to review full report at Codecov.
|
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.
I don't know where or when this precisely needs to be done, but I'd like some words written about the equality
comparator vs this comparator with weak_ordering::equivalent
. The former should always be preferred in operations where you're only concerned with equality (like groupby/join/etc). This is because it will be more efficient than using this comparator with the weak_ordering::equivalent
which would require doing two operator<
vs a single operator==
, which is important for something like strings.
In other words, I don't want us to ever define a:
|
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.
This is surprisingly clean with the use of a parameter pack fold expression. Awesome suggestion @jrhemstad, and nice work implementing it @rwlee.
@rwlee showed me benchmarks offline (which I think he is going to paste here soon) and these changes didn't seem to have any negative performance impact.
With the documentation suggestion below, I approve.
Co-authored-by: Bradley Dice <[email protected]>
Benchmarks were posted above #10793 (comment) -- linking down here so they can be found after the review comment it is resolved. |
device_row_comparator
.
@rwlee I edited the PR title and description to make it clearer what this is doing -- see these previous comments: |
device_row_comparator
.device_row_comparator
.
using less_equivalent_comparator = weak_ordering_comparator_impl<device_row_comparator<Nullate>, | ||
weak_ordering::LESS, | ||
weak_ordering::EQUIVALENT>; | ||
|
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.
It would be useful to have aliases for the remaining comparator too (i.e., >
and >=
).
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.
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.
Then how about less_equivalent_comparator
? We are not using it now, right?
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.
#9452 uses less_equivalent_comparator
.
namespace cudf { | ||
|
||
namespace experimental { |
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.
namespace cudf { | |
namespace experimental { | |
namespace cudf::experimental { |
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.
This file has several layers of nested namespaces. For consistency, I would recommend leaving this unchanged.
@gpucibot merge |
This PR changes the experimental
device_row_comparator
to returnweak_ordering
instead ofbool
.Originally part of PR #9452. Aids PR #10730, which builds strongly-typed two table comparators and should return a
weak_ordering
.