frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

https://winwang.blog/posts/bitonic-sort/
92•winwang•8mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•8mo ago
The article covers extremely important CUDA warp-level synchronization/exchange primitives, but it's not what is generally called SIMD in the CUDA land .

Most "CUDA SIMD" intrinsics are designed to process a 32-bit data pack containing 2x 16-bit or 4x 8-bit values (<https://docs.nvidia.com/cuda/cuda-math-api/cuda_math_api/gro...>). That significantly shrinks their applicability in most domains outside of video and string processing. I've had pretty high hopes for DPX on Hopper (<https://developer.nvidia.com/blog/boosting-dynamic-programmi...>) instructions and started integrating them in StringZilla last year, but the gains aren't huge.

winwang•8mo ago
Oh wow, TIL, thanks. I usually call stuff like that SWAR, and every now-and-then I try to think of a way to (fruitfully) use it. The "SIMD" in this case was just an allusion to warp-wide functions looking like how one might use SIMD in CPU code, as opposed to typical SIMT CUDA.

Also, StringZilla looks amazing -- I just became your 1000th Github follower :)

ashvardanian•8mo ago
Thanks, appreciate the gesture :)

Traditional SWAR on GPUs is a fascinating topic. I've begun assembling a set of synthetic benchmarks to compare DP4A vs. DPX (<https://github.com/ashvardanian/less_slow.cpp/pull/35>), but it feels incomplete without SWAR. My working hypothesis is that 64-bit SWAR on properly aligned data could be very useful in GPGPU, though FMA/MIN/MAX operations in that PR might not be the clearest showcase of its strengths. Do you have a better example or use case in mind?

winwang•8mo ago
I don't -- unfortunately not too well-versed in this field! But I was a bit fascinated with SWAR after I randomly thought of how to prefix-sum with int multiplication, later finding out that it is indeed an old trick as I suspected (I'm definitely not on this thread btw): https://mastodon.social/@dougall/109913251096277108

As for 64-bit... well, I mostly avoid using high-end GPUs, but I was of the impression that i64 is just simulated. In fact, I was thinking of using the full warp as a "pipeline" to implement u32 division (mostly as a joke), almost like anti-SWAR. There was some old-ish paper detailing arithmetic latencies in GPUs and division was approximately more than 32x multiplication (...or I could be misremembering).

bobmcnamara•8mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•8mo ago
Interesting stuff. Not sure if I read this right that it‘s 16 und 32 bit values of integers that get sorted. If yes, I‘d love to see if the GPU implementation can beat a competitive Radix sort implementation on a CPU.
winwang•8mo ago
It's 32 32-bit values which get sorted. I don't think a GPU sort would beat a CPU sort at this scale, even if you don't take kernel launch time into account. CPUs are simply too fast for (super-)small data, especially with AVX-512. But if we're talking about a larger amount of data, that would be a different story, i.e. as part of a normal gpu mergesort.
maeln•8mo ago
It is also useful if your data already lives on the GPU memory. For example, when you need to z-sort a bunch of particles in a 3d renderer particle system.
exDM69•8mo ago
A 32 way GPU sorting algorithm might be just what I need for sorting and deduplicating triangle id's in a visibility buffer renderer I am working on.

Thanks for sharing.

winwang•8mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•8mo ago
What are the biggest use cases of GPU accelerated sorting?

Publish on your own site, syndicate elsewhere

https://indieweb.org/POSSE#
839•47thpresident•20h ago•191 comments

X-Clacks-Overhead

https://hleb.dev/post/x-clacks-overhead/
39•hleb_dev•4h ago•12 comments

Trump says Venezuela’s Maduro captured after strikes

https://www.reuters.com/world/americas/loud-noises-heard-venezuela-capital-southern-area-without-...
730•jumpocelot•9h ago•1789 comments

Daft Punk Easter Egg in the BPM Tempo of Harder, Better, Faster, Stronger?

https://www.madebywindmill.com/tempi/blog/hbfs-bpm/
608•simonw•18h ago•99 comments

Of Boot Vectors and Double Glitches: Bypassing RP2350's Secure Boot

https://streaming.media.ccc.de/39c3/relive/2149
111•aberoham•6d ago•11 comments

IPv6 just turned 30 and still hasn't taken over the world

https://www.theregister.com/2025/12/31/ipv6_at_30/
447•Brajeshwar•1d ago•896 comments

A Beginner's Two-Component Crystal-Style Wi-Fi Detector

https://siliconjunction.wordpress.com/2025/12/12/a-beginners-two-component-crystal-style-wi-fi-de...
75•jensgk•3d ago•28 comments

2026 will be my year of the Linux desktop

https://xeiaso.net/notes/2026/year-linux-desktop/
644•todsacerdoti•15h ago•474 comments

Tomasf/Cadova: Swift DSL for parametric 3D modeling

https://github.com/tomasf/Cadova
46•bdcravens•3d ago•6 comments

Profiling with Ctrl-C (2024)

https://yosefk.com/blog/profiling-with-ctrl-c.html
21•hun3•4h ago•2 comments

Clicks Communicator

https://www.clicksphone.com/en/communicator
369•microflash•22h ago•229 comments

Ask HN: Who is hiring? (January 2026)

309•whoishiring•23h ago•193 comments

Ask HN: Expository/Succinct Books on Modern Physics

4•rramadass•9h ago•4 comments

How Smell Guides Our Inner World

https://www.quantamagazine.org/how-smell-guides-our-inner-world-20250703/
26•anarbadalov•5d ago•3 comments

Linux kernel security work

http://www.kroah.com/log/blog/2026/01/02/linux-kernel-security-work/
137•chmaynard•18h ago•59 comments

UK company sends factory with 1,000C furnace into space

https://www.bbc.co.uk/news/articles/c62vx0pgyrgo
88•vekerdyb•3d ago•42 comments

Jank Lang Hit Alpha

https://github.com/jank-lang/jank
205•makemethrowaway•20h ago•27 comments

Show HN: The ASCII Side of the Moon

https://aleyan.com/projects/ascii-side-of-the-moon/?lat=32.72&lon=-117.16&date=2025-12-29T14%3A24Z
17•aleyan•5d ago•1 comments

A Basic Just-In-Time Compiler (2015)

https://nullprogram.com/blog/2015/03/19/
79•ibobev•14h ago•16 comments

Hacking VBA to support native scripting runtime with no COM dependencies

https://github.com/ECP-Solutions/ASF
3•n013•6d ago•0 comments

Show HN: uvx ptn, scan a QR, get a terminal in your phone

https://github.com/lyehe/porterminal
54•yxl448•11h ago•17 comments

IQuest-Coder: A new open-source code model beats Claude Sonnet 4.5 and GPT 5.1 [pdf]

https://github.com/IQuestLab/IQuest-Coder-V1/blob/main/papers/IQuest_Coder_Technical_Report.pdf
117•shenli3514•11h ago•35 comments

Fighting Fire with Fire: Scalable Oral Exams

https://www.behind-the-enemy-lines.com/2025/12/fighting-fire-with-fire-scalable-oral.html
182•sethbannon•21h ago•244 comments

Ask HN: Who wants to be hired? (January 2026)

128•whoishiring•23h ago•240 comments

Adventure 751 (1980)

https://bluerenga.blog/2026/01/01/adventure-751-1980/
40•quuxplusone•13h ago•3 comments

Accounting for Computer Scientists (2011)

https://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html
137•tosh•21h ago•52 comments

Recursive Language Models

https://arxiv.org/abs/2512.24601
6•schmuhblaster•4h ago•0 comments

The rsync algorithm (1996) [pdf]

https://www.andrew.cmu.edu/course/15-749/READINGS/required/cas/tridgell96.pdf
171•vortex_ape•23h ago•26 comments

The Cost of a Closure in C: The Rest

https://thephd.dev/the-cost-of-a-closure-in-c-c2y-followup
56•ingve•3d ago•26 comments

Unix v4 (1973) – Live Terminal

https://unixv4.dev/
159•pjmlp•20h ago•75 comments