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

Comments

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

System76 on Age Verification Laws

https://blog.system76.com/post/system76-on-age-verification/
134•LorenDB•2h ago•81 comments

GPT-5.4

https://openai.com/index/introducing-gpt-5-4/
769•mudkipdev•12h ago•636 comments

10% of Firefox crashes are caused by bitflips

https://mas.to/@gabrielesvelto/116171750653898304
466•marvinborner•1d ago•233 comments

Where things stand with the Department of War

https://www.anthropic.com/news/where-stand-department-war
378•surprisetalk•6h ago•380 comments

Nobody ever got fired for using a struct

https://www.feldera.com/blog/nobody-ever-got-fired-for-using-a-struct
88•gz09•3d ago•59 comments

Stardex (YC S21) is hiring customer success engineers

https://www.ycombinator.com/companies/stardex/jobs/lag1C1P-customer-success-engineer-ai-data-migr...
1•sanketc•4m ago

Stop Using Grey Text (2025)

https://catskull.net/stop-using-grey-text.html
77•catskull•7h ago•50 comments

Labor market impacts of AI: A new measure and early evidence

https://www.anthropic.com/research/labor-market-impacts
146•jjwiseman•8h ago•205 comments

The Brand Age

https://paulgraham.com/brandage.html
313•bigwheels•13h ago•251 comments

TeX Live 2026 is available for download now

https://www.tug.org/texlive/acquire.html
32•jithinraj•1h ago•12 comments

Show HN: Swarm – Program a colony of 200 ants using a custom assembly language

https://dev.moment.com/
30•armandhammer10•2h ago•9 comments

Good software knows when to stop

https://ogirardot.writizzy.com/p/good-software-knows-when-to-stop
395•ssaboum•17h ago•209 comments

CBP tapped into the online advertising ecosystem to track peoples’ movements

https://www.404media.co/cbp-tapped-into-the-online-advertising-ecosystem-to-track-peoples-movements/
433•ece•1d ago•178 comments

Wikipedia was in read-only mode following mass admin account compromise

https://www.wikimediastatus.net
941•greyface-•15h ago•326 comments

A standard protocol to handle and discard low-effort, AI-Generated pull requests

https://406.fail/
151•Muhammad523•9h ago•48 comments

A GitHub Issue Title Compromised 4k Developer Machines

https://grith.ai/blog/clinejection-when-your-ai-tool-installs-another
381•edf13•14h ago•95 comments

A ternary plot of citrus geneology

https://www.jlauf.com/writing/citrus/
122•jlauf•2d ago•22 comments

Hardware hotplug events on Linux, the gory details

https://arcanenibble.github.io/hardware-hotplug-events-on-linux-the-gory-details.html
134•todsacerdoti•3d ago•11 comments

Remotely unlocking an encrypted hard disk

https://jyn.dev/remotely-unlocking-an-encrypted-hard-disk/
118•janandonly•12h ago•59 comments

The Mystery of Skype

https://clevcode.org/the-mystery-of-skype/
5•walterbell•5d ago•0 comments

Show HN: Jido 2.0, Elixir Agent Framework

https://jido.run/blog/jido-2-0-is-here
270•mikehostetler•15h ago•57 comments

Judge orders government to begin refunding more than $130B in tariffs

https://www.wsj.com/politics/policy/judge-orders-government-to-begin-refunding-more-than-130-bill...
900•JumpCrisscross•17h ago•658 comments

Show HN: PageAgent, A GUI agent that lives inside your web app

https://alibaba.github.io/page-agent/
89•simon_luv_pho•14h ago•50 comments

Launch HN: Vela (YC W26) – AI for complex scheduling

44•Gobhanu•13h ago•37 comments

Hacking Super Mario 64 using covering spaces

https://happel.ai/posts/covering-spaces-geometries-visualized/
27•nill0•3d ago•4 comments

Data Does Not Speak to You

https://tantaman.com/2026-03-02-data-doesnt-speak.html
5•tantaman•2d ago•3 comments

How to install and start using LineageOS on your phone

https://lockywolf.net/2026-02-19_How-to-install-and-start-using-LineageOS-on-your-phone.d/index.html
32•todsacerdoti•6h ago•12 comments

Breaking Down 50M Pins: A Smarter Way to Design 3D IC Packages

https://www.allaboutcircuits.com/industry-articles/breaking-down-50-million-pins-a-smarter-way-to...
6•WaitWaitWha•3h ago•0 comments

AI and the Ship of Theseus

https://lucumr.pocoo.org/2026/3/5/theseus/
85•pixelmonkey•15h ago•94 comments

Proton Mail Helped FBI Unmask Anonymous 'Stop Cop City' Protester

https://www.404media.co/proton-mail-helped-fbi-unmask-anonymous-stop-cop-city-protestor/
320•sedatk•9h ago•153 comments