NVIDIA / NVIDIA/cudf

[FEA] Utilize `cudf::top_k` in cudf classic's `nlargest` and `nsmallest`

Open
#19,531 0 comments 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
After https://github.com/rapidsai/cudf/issues/19096, we now have a libcudf API to compute the top k elements in a column. We should utilize this API in cudf classic.

**Describe the solution you'd like**
Use the pylibcudf API `plc.sorting.top_k` in cudf classic implementation https://github.com/rapidsai/cudf/blob/67bc0734626d73b6bf950dbe2296f28c2300c578/python/cudf/cudf/core/indexed_frame.py#L3583-L3642

**Describe alternatives you've considered**
Keep the current implementation, but we should probably at least use `cudf::top_k` as a fast path, since it will automatically get improvements once `cudf::top_k` uses CUB's implementation.

**Additional context**
Equivalent work done for cudf-polars:
- https://github.com/rapidsai/cudf/pull/19431

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.