Repository navigation
Generate group labels from offsets - #10945
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Here is the new benchmark, which does not have overhead but just measures the run time of the labeling methods. Sorry that I can't run Old method (
|
|
So starting from around |
|
Rerun tests. |
Signed-off-by: Nghia Truong <[email protected]>
|
Rerun tests. |
This reverts commit 15d036a.
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
Signed-off-by: Nghia Truong <[email protected]>
|
@gpucibot merge |
Given an array of integer values which may be the labels of some list elements, we want to generate an array of offsets so we can create a lists column from these offsets. For example: ``` input_labels = [ 0, 0, 0, 0, 1, 1, 4, 4, 4, 4 ] output = [ 0, 4, 6, 6, 6, 10 ] ``` This is basically the reverse operation of #10945. Closes #10955. Authors: - Nghia Truong (https://github.com/ttnghia) Approvers: - Devavret Makkar (https://github.com/devavret) - Jake Hemstad (https://github.com/jrhemstad) URL: #11017
This PR adds the following APIs for set operations: * `lists::have_overlap` * `lists::intersect_distinct` * `lists::union_distinct` * `lists::difference_distinct` ### Name Convention Except for the first API (`lists::have_overlap`) that returns a boolean column, the suffix `_distinct` of the rest APIs denotes that their results will be lists columns in which all list rows have been post-processed to remove duplicates. As such, their results are actually "set" columns in which each row is a "set" of distinct elements. --- Depends on: * #10945 * #11017 * NVIDIA/cuCollections#175 * #11052 * #11118 * #11100 * #11149 Closes #10409. Authors: - Nghia Truong (https://github.com/ttnghia) - Yunsong Wang (https://github.com/PointKernel) Approvers: - Michael Wang (https://github.com/isVoid) - AJ Schmidt (https://github.com/ajschmidt8) - Bradley Dice (https://github.com/bdice) - Yunsong Wang (https://github.com/PointKernel) URL: #11043
This PR adds a small (detail) API that generates group labels from a given offset array
offsets. The output will be an array containing consecutive groups of identical labels, the number of elements in each groupiis defined byoffsets[i+1] - offsets[i].Examples:
Note that the label values always start from
0. We can in fact add a parameter to allow specifying any starting value but we don't need it in now.Several places in cudf have been updated to adopt the new API immediately. These places have been tested extensively thus no unit tests for the new API is needed. In addition, I ran a benchmark for groupby aggregations and found no performance difference after adopting this.
Closes #10905 and unblocks #10409.