Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package Idea: Sorting #134

Open
5 tasks
RianGoossens opened this issue Sep 19, 2024 · 3 comments
Open
5 tasks

Package Idea: Sorting #134

RianGoossens opened this issue Sep 19, 2024 · 3 comments

Comments

@RianGoossens
Copy link
Contributor

RianGoossens commented Sep 19, 2024

Sorting is ubiquitous in software, but kind of tricky to get right on GPU. It would be very useful to have this as a package, for example to write a raytracer.

There's a lot of research out there, a good place to start would be https://developer.nvidia.com/gpugems/gpugems2/part-vi-simulation-and-numerical-algorithms/chapter-46-improved-gpu-sorting

We probably need at least a regular sort and an argsort.

Cubecl traits would be a nice way to implement this, being able to swap out sorting algorithms easily. This would also making testing easier.

  • odd-even transition sort
  • odd-even merge sort
  • bitonic merge sort
  • radix sort
  • other sorting networks?
@nathanielsimard
Copy link
Member

great idea!

@AsherJingkongChen
Copy link
Contributor

AsherJingkongChen commented Sep 26, 2024

How about Radix Sort? It is quite fast for u32 keys.

@RianGoossens
Copy link
Contributor Author

How about Radix Sort? It is quite fast for u32 keys.

Oh I had no idea radix sort was possible on gpu's! I've gotten some algorithm's to work already on cubecl, will check if I can port this too!

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

No branches or pull requests

3 participants