Skip to content

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

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

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?

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 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

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev11=py314ha0e2e8e_8 ran successfully.
Passed: 1376
Failed: 0
Skipped: 6

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.

2 participants