-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feature/radix sort #1867
base: master
Are you sure you want to change the base?
Feature/radix sort #1867
Conversation
Add common typedef for sort_contig_fn_ptr_t from merge_sort header and radix_sort header files into a new file. Used it in cpp files.
Supported values for kind are "radixsort", "mergesort", "stable". The default is None (same as "stable"). For stable, radix sort is used for bool, (u)int8, (u)int16. Radix sort is supported for integral, boolean and real floating point types.
View rendered docs @ https://intelpython.github.io/dpctl/pulls/1867/index.html |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_145 ran successfully. |
Build with |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_149 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_158 ran successfully. |
This line and the initial
True or not, in |
…eter The intent is to reduce the build time, build memory footprint, and binary size of the sorting_impl module. With this change it stands at 46MB, before it was 72MB.
…x_impl With this change, _tensor_sorting_impl goes back to 17MB, and _tensor_sorting_radix_impl is 30MB. The memory footprint of linking should be greatly reduced, speeding up the building process, reducing the required memory footprint, and providing better parallelisation opportunities for the build job. The build time on my Core i7 reduced from 45 minutes to 33 minutes.
…late-parameter-to-an-argument Change descending from template parameter to an argument
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_174 ran successfully. |
Nit: renaming of |
sort.cpp -> merge_sort.cpp, argsort.cpp -> merge_argsort.cpp Refined exception texts thrown when implementation function pointer is found missing.
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_188 ran successfully. |
@ndgrigorian I have pushed changes to address all the issues highlighted in review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM now, I've run some benchmarks for different array sizes and shapes and run into no problems.
Thank you @oleksandr-pavlyk !
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_189 ran successfully. |
|
||
template <typename argTy, typename IndexTy> | ||
sycl::event | ||
radix_argsort_axis1_contig_impl(sycl::queue &exec_q, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This impl function seems to be unused anywhere. Should it be kept around or removed as dead code?
This PR implements radix sort, and exposes it via new
kind
keyword ofdpt.sort
anddpt.argsort
functions.Supported values of
kind
keyword are"stable"
,"radixsort"
, and"mergesort"
, with the default value beingNone
(same as"stable"
). The"stable"
kind uses radix sort for boolean and short integral types,