Skip to content

Feature/Add radix select based top k kernels - #3079

Open
ndgrigorian wants to merge 1 commit into
masterfrom
feature/implement-radix-select-topk
Open

ndgrigorian wants to merge 1 commit into
masterfrom
feature/implement-radix-select-topk

Conversation

@ndgrigorian

Copy link
Copy Markdown
Collaborator

This PR improves the implementation of top_k in libtensor by adding several kernels that use a radix select approach, instead of a merge sort approach

There are variants to the kernels:

  • Multiple rows processed per work group (best with short rows)
  • One row per work-group
  • Multiple work-groups per row

Local benchmarking shows a significant performance improvement (results TBA)

Also factors a number of radix-based utilities into a separate header file, which can be reused for future implementations such as median and partition functions

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@ndgrigorian ndgrigorian changed the title add radix selection algorithm Feature/Add radix select based top k kernels Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/3079/index.html

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.606% (-0.003%) from 78.609% — feature/implement-radix-select-topk into master

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev16=np2py314h8d9cdd5_10 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@antonwolfy antonwolfy added this to the 0.22.0 release milestone Oct 23, 2026
@ndgrigorian
ndgrigorian marked this pull request as ready for review October 27, 2026 20:45
a few variants: one which handles multiple rows per wg, one which handles one row per wg, one which handles multiple wgs per row
@ndgrigorian
ndgrigorian force-pushed the feature/implement-radix-select-topk branch from d1ebaf8 to a1617ae Compare October 27, 2026 20:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants