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•9mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•9mo ago
What are the biggest use cases of GPU accelerated sorting?

I built Timeframe, our family e-paper dashboard

https://hawksley.org/2026/02/17/timeframe.html
960•saeedesmaili•12h ago•235 comments

The JavaScript Oxidation Compiler

https://oxc.rs/
116•modinfo•4h ago•32 comments

0 A.D. Release 28: Boiorix

https://play0ad.com/new-release-0-a-d-release-28-boiorix/
40•jonbaer•3d ago•14 comments

Show HN: CIA World Factbook Archive (1990–2025), searchable and exportable

https://cia-factbook-archive.fly.dev/
284•MilkMp•10h ago•73 comments

Loops is a federated, open-source TikTok

https://joinloops.org/
372•Gooblebrai•12h ago•216 comments

My journey to the microwave alternate timeline

https://www.lesswrong.com/posts/8m6AM5qtPMjgTkEeD/my-journey-to-the-microwave-alternate-timeline
179•jstanley•4d ago•40 comments

Bitmovin (YC S15) Is Hiring Interns in AI for Summer 2026 in Austria

https://bitmovin.com/careers/8023403002/
1•slederer•34m ago

How to train your program verifier

https://risemsr.github.io/blog/2026-02-16-halleyyoung-a3/
36•matt_d•4d ago•7 comments

Freemediaheckyeah

https://fmhy.net/
150•con•4h ago•43 comments

Google restricting Google AI Pro/Ultra subscribers for using OpenClaw

https://discuss.ai.google.dev/t/account-restricted-without-warning-google-ai-ultra-oauth-via-open...
532•srigi•8h ago•434 comments

Six Math Essentials

https://terrytao.wordpress.com/2026/02/16/six-math-essentials/
190•digital55•12h ago•38 comments

Ask HN: Have you ever cloned a cat?

17•arthurcolle•1h ago•15 comments

Man accidentally gains control of 7k robot vacuums

https://www.popsci.com/technology/robot-vacuum-army/
259•Brajeshwar•16h ago•147 comments

The Musidex: A physical music library for the streaming era

https://hannahilea.com/blog/musidex/
33•zdw•3d ago•9 comments

Fix your tools

https://ochagavia.nl/blog/fix-your-tools/
226•vinhnx•15h ago•77 comments

Show HN: Local-First Linux MicroVMs for macOS

https://shuru.run
163•harshdoesdev•12h ago•48 comments

Rhythms the Compendium: Life aboard an aircraft carrier (2021)

https://thelexicans.wordpress.com/2020/04/05/38223/
15•cwillu•1d ago•1 comments

Aqua: A CLI message tool for AI agents

https://github.com/quailyquaily/aqua
39•lyricat•5h ago•22 comments

Using the new bridges of FreeBSD 15

https://blog.feld.me/posts/2026/02/using-new-bridges-freebsd-15/
77•vermaden•8h ago•21 comments

Hello Worg, the Org-Mode Community

https://orgmode.org/worg/
112•dargscisyhp•13h ago•36 comments

Linuxulator on FreeBSD Feels Like Magic

https://hayzam.com/blog/02-linuxulator-is-awesome/
102•vermaden•12h ago•35 comments

Show HN: A geometric analysis of Chopin's Prelude No. 4 using 3D topology

https://github.com/jimishol/cholidean-harmony-structure/blob/main/docs/03-case-study-chopin-prelu...
32•jimishol•2d ago•7 comments

Emulated Windows 3.11 in the Browser

https://pieter.com/
105•jalev•13h ago•50 comments

How close are we to a vision for 2010?

https://shkspr.mobi/blog/2026/02/how-close-are-we-to-a-vision-for-2010/
9•ColinWright•3h ago•4 comments

Attention Media ≠ Social Networks

https://susam.net/attention-media-vs-social-networks.html
590•susam•18h ago•251 comments

What I learned designing a barebones UI engine

https://madebymohammed.com/miniui
8•teleforce•3h ago•1 comments

Fresh File Explorer – VS Code extension for navigating recent work

https://github.com/FreHu/vscode-fresh-file-explorer
90•frehu•13h ago•25 comments

Git's Magic Files

https://nesbitt.io/2026/02/05/git-magic-files.html
141•chmaynard•17h ago•43 comments

Xweather Live – Interactive global vector weather map

https://live.xweather.com/
155•unstyledcontent•16h ago•34 comments

Ask HN: Chromebook leads for K-8 school in need?

37•techteach00•11h ago•30 comments