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•8mo 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•8mo 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?

Antirender: remove the glossy shine on architectural renderings

https://antirender.com/
1617•iambateman•20h ago•398 comments

NASA's WB-57 crash lands at Houston

https://arstechnica.com/space/2026/01/one-of-nasas-three-wb-57-aircraft-just-did-a-belly-landing-...
74•verzali•3d ago•21 comments

We have ipinfo at home or how to geolocate IPs in your CLI using latency

https://blog.globalping.io/we-have-ipinfo-at-home-or-how-to-geolocate-ips-in-your-cli-using-latency/
120•jimaek•7h ago•37 comments

CPython Internals Explained

https://github.com/zpoint/CPython-Internals
25•yufiz•4d ago•0 comments

Guix System First Impressions as a Nix User

https://nemin.hu/guix.html
62•todsacerdoti•5h ago•13 comments

Quaternion Algebras

https://jvoight.github.io/quat.html
51•teleforce•4d ago•19 comments

Show HN: I trained a 9M speech model to fix my Mandarin tones

https://simedw.com/2026/01/31/ear-pronunication-via-ctc/
350•simedw•15h ago•111 comments

Nvidia's 10-year effort to make the Shield TV the most updated Android device

https://arstechnica.com/gadgets/2026/01/inside-nvidias-10-year-effort-to-make-the-shield-tv-the-m...
41•qmr•1h ago•26 comments

My Ridiculously Robust Photo Management System (Immich Edition)

https://jaisenmathai.com/articles/my-ridiculously-robust-photo-management-system-immich-edition/
127•jmathai•3d ago•51 comments

Euro firms must ditch Uncle Sam's clouds and go EU-native

https://www.theregister.com/2026/01/30/euro_firms_must_ditch_us/
504•jamesblonde•6h ago•440 comments

Sumerian Star Map Recorded the Impact of an Asteroid (2024)

https://archaeologyworlds.com/5500-year-old-sumerian-star-map-recorded/
105•griffzhowl•9h ago•35 comments

A Step Behind the Bleeding Edge: A Philosophy on AI in Dev

https://somehowmanage.com/2026/01/22/a-step-behind-the-bleeding-edge-monarchs-philosophy-on-ai-in...
105•Ozzie_osman•2d ago•41 comments

US reportedly investigate claims that Meta can read encrypted WhatsApp messages

https://www.theguardian.com/technology/2026/jan/31/us-authorities-reportedly-investigate-claims-t...
117•echelon_musk•3h ago•96 comments

Insane Growth Goldbridge (YC F25) Is Hiring a Forward Deployed Engineer

https://www.ycombinator.com/companies/goldbridge/jobs/78gGEHh-forward-deployed-engineer
1•alvinsalehi•4h ago

Peerweb: Decentralized website hosting via WebTorrent

https://peerweb.lol/
309•dtj1123•19h ago•107 comments

Moltbook

https://www.moltbook.com/
1587•teej•1d ago•740 comments

"Giving up upstream-ing my patches & feel free to pick them up"

https://mail.openjdk.org/pipermail/hotspot-dev/2026-January/118080.html
22•csmantle•5h ago•9 comments

Implementing the Transcendental Functions in Ivy

https://commandcenter.blogspot.com/2026/01/implementing-transcendental-functions.html
19•chmaynard•5d ago•1 comments

HTTP Cats

https://http.cat/
476•surprisetalk•1d ago•79 comments

Show HN: Phage Explorer

https://phage-explorer.org/
101•eigenvalue•11h ago•22 comments

An anecdote about backward compatibility

https://blog.plover.com/2026/01/26/#wrterm
70•speckx•4d ago•15 comments

Surely the crash of the US economy has to be soon

https://wilsoniumite.com/2026/01/27/surely-it-has-to-be-soon/
434•Wilsoniumite•1d ago•544 comments

Kimi K2.5 Technical Report [pdf]

https://github.com/MoonshotAI/Kimi-K2.5/blob/master/tech_report.pdf
345•vinhnx•23h ago•132 comments

Naples' 1790s civil war was intensified by moral panic over Real Analysis (2023)

https://lareviewofbooks.org/article/foundational-anxieties-modern-mathematics-and-the-political-i...
80•OgsyedIE•12h ago•19 comments

Disrupting the largest residential proxy network

https://cloud.google.com/blog/topics/threat-intelligence/disrupting-largest-residential-proxy-net...
193•cdrnsf•2d ago•186 comments

CERN accepts $1B in private cash towards Future Circular Collider

https://physicsworld.com/a/cern-accepts-1bn-in-private-cash-towards-future-circular-collider/
88•zeristor•6h ago•63 comments

Designing a Passively Safe API

https://www.danealbaugh.com/articles/passively-safe-apis
53•dalbaugh•4d ago•15 comments

Show HN: SF Microclimates

https://github.com/solo-founders/sf-microclimates
44•weisser•5d ago•35 comments

The engineer who invented the Mars rover suspension in his garage [video]

https://www.youtube.com/watch?v=QKSPk_0N4Jc
360•UltraSane•4d ago•54 comments

Archyl – The modern platform for C4 model documentation

https://www.archyl.com/
19•eko•4d ago•5 comments