Skip to content

[FEA] Improve cudf::distinct with cuco reduction map #13157

Description

@PointKernel

Is your feature request related to a problem? Please describe.
#11052 introduces the keep control option into cudf::distinct and makes it possible for users to perform a more efficient hash-based drop_duplicates. The PR uses a single hash map together with thrust algorithms to mimic the behavior of a reduction map. This whole process can be largely simplified once NVIDIA/cuCollections#98 is ready. TODO:

  • Replace static_map + thrust algos with cuco::static_reduction_map + cudf::sort
  • Update Python bindings to use the hash-based algorithm
  • Investigate the performance impact with various map occupancy and sort-based algo v.s. hash-based algo
  • Minimize memory footprint

Describe the solution you'd like
Uses a cuco::static_reduction_map where the key is the row index and the value is the min/max index of equivalent rows (depending on the keep option).

Describe alternatives you've considered
We could also take a pair of row hash value and row index as the key which performs the expensive row hash computation only once for better runtime performance. This requires more memory footprint though. To be evaluated.

Additional context
#11656 may not be required by the new reduction map implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PerformancePerformance related issuefeature requestNew feature or requestlibcudfAffects libcudf (C++/CUDA) code.

    Type

    No type

    Projects

    Status
    Todo
    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions