News for hackers. Stuff that matters.
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by Waterluvian on Wednesday February 15, 2023 @05:31PM (#34811752)
Is sorting one of those things that’s so common that it deserves its own CPU hardware/instructions to aid in performance?

Or does AVX-512 provide a lot of what that would theoretically be?

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by cbsmith on Wednesday February 15, 2023 @05:48PM (#34812003)
Heck yeah. Sorting is a pretty common operation in tons of algorithms, which is why you find some form of a sort function in pretty much every language's standard runtime. Sure, this won't help much for sorting strings, but numerical sorts are still address a significant chunk of problems.
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by ygra on Wednesday February 15, 2023 @05:50PM (#34812030)
AVX-512 is not a dedicated sorting instruction set, but rather instructions dedicated to doing the same computations in parallel over 512 bit wide registers. So you can do the same operation in the same time for 8 doubles, 16 integers, or 64 bytes at once.

Coming up with good usage of those instructions can be tricky. It's not just the typical arithmetic things, but also instructions that shuffle around values in those registers based on values elsewhere and combining all that cleverly then can yield speed-ups for algorithms that deal with lots of data serially.

A while ago while trying to understand all that (for the older instruction sets) I've read this CodeProject article: https://www.codeproject.com/Articles/874396/Crunching-Number... – AVX-512 is basically similar, just wider. Although I've heard it has a few more useful instructions as well that have no counterpart in the older instruction sets.

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by yonifei on Wednesday February 15, 2023 @06:10PM (#34812291)
To add to this:

A really good, digestible talk about using SIMD for sorting: https://www.youtube.com/watch?v=M6HaSvifxwQ

You can also read the author's blog post series, beginning at https://bits.houmus.org/2020-01-28/this-goes-to-eleven-pt1

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by jacquesm on Wednesday February 15, 2023 @06:10PM (#34812293)
It's important enough that there are whole books written about it.

https://www.amazon.com/Art-Computer-Programming-Sorting-Sear...

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by softwaredoug on Wednesday February 15, 2023 @06:27PM (#34812485)
Lots of things are sorted: search results, recommendations, your news feed
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by bee_rider on Wednesday February 15, 2023 @06:44PM (#34812658)
That’s a kind of interesting idea. Better implementations of sorting algorithms will go down to a small-ish base case and then do a linear sort. Maybe with AVX512 sized registers there’s room for a “sort the register” instruction to act as the base case, haha.
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by frankreyes on Wednesday February 15, 2023 @07:06PM (#34812918)
Just to pick a random example: creating an SQL database with an index for faster search requires sorting
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by Someone on Thursday February 16, 2023 @07:35AM (#34817874)
Except for the special case of loading data into an empty table that already has an index, that requires repeatedly inserting items in a sorted ‘list’ (more likely a btree), keeping it sorted.

That’s quite a different thing.

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by frankreyes on Thursday February 16, 2023 @03:00PM (#34824963)
>btree

That's literally a collection of arrays that needs to be sorted. And it's still a traditional sorting.

Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by speed_spread on Wednesday February 15, 2023 @08:07PM (#34813530)
"Ordinateur", which is French for "computer", literally means "sorting machine". So wherever the sorting instructions would go, the computer would follow.
Re:Intel Publishes Fast AVX-512 Sorting Library, 10~17x Fast... by Waterluvian on Wednesday February 15, 2023 @08:16PM (#34813613)
I really should have clarified that I understand that sorting is important. Hence why wondering if it deserves its own instructions. ;)