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

ACM Is Now Open Access

https://www.acm.org/articles/bulletins/2026/january/acm-open-access
159•leglock•1h ago•21 comments

OpenWorkers: Self-Hosted Cloudflare Workers in Rust

https://openworkers.com/introducing-openworkers
100•max_lt•1h ago•22 comments

2025 Letter

https://danwang.co/2025-letter/
50•Amorymeltzer•2h ago•20 comments

Bluetooth Headphone Jacking: A Key to Your Phone [video]

https://media.ccc.de/v/39c3-bluetooth-headphone-jacking-a-key-to-your-phone
256•AndrewDucker•5h ago•83 comments

Implementing HNSW (Hierarchical Navigable Small World) Vector Search in PHP

https://centamori.com/index.php?slug=hierarchical-navigable-small-world-hnsw-php&lang=en
14•centamiv•1h ago•1 comments

Sony PS5 ROM keys leaked – jailbreaking could be made easier with BootROM codes

https://www.tomshardware.com/video-games/playstation/playstation-5-rom-keys-leaked-jailbreaking-c...
55•gloxkiqcza•1h ago•8 comments

Heap Overflow in FFmpeg EXIF

https://bugs.pwno.io/0014
18•retr0reg•1h ago•2 comments

Python Numbers Every Programmer Should Know

https://mkennedy.codes/posts/python-numbers-every-programmer-should-know/
28•WoodenChair•2h ago•16 comments

Common Lisp SDK for the Datastar Hypermedia Framework

https://github.com/fsmunoz/datastar-cl
9•fsmunoz•1h ago•6 comments

iOS allows alternative browser engines in Japan

https://developer.apple.com/support/alternative-browser-engines-jp/
33•eklavya•3h ago•7 comments

2025: The Year in LLMs

https://simonwillison.net/2025/Dec/31/the-year-in-llms/
740•simonw•17h ago•385 comments

BYD Sells 4.6M Vehicles in 2025, Meets Revised Sales Goal

https://www.bloomberg.com/news/articles/2026-01-01/byd-sells-4-6-million-vehicles-in-2025-meets-r...
31•toomuchtodo•1h ago•10 comments

Build a Deep Learning Library

https://zekcrates.quarto.pub/deep-learning-library/
13•butanyways•2h ago•0 comments

DHS Says DHS-Certified Real IDs Too Unreliable to Confirm U.S. Citizenship

https://reason.com/2025/12/31/dhs-says-real-id-which-dhs-certifies-is-too-unreliable-to-confirm-u...
42•xenophonf•45m ago•30 comments

European Space Agency hit again as cybercriminals claim 200 GB data up for sale

https://www.theregister.com/2025/12/31/european_space_agency_hacked/
12•smurda•32m ago•1 comments

Meta made scam ads harder to find instead of removing them

https://sherwood.news/tech/rather-than-fully-cracking-down-on-scam-ads-meta-worked-to-make-them-h...
142•wtcactus•4h ago•34 comments

Easel Turns One One year of building my own IDE in Clojure

https://blog.phronemophobic.com/easel-one-year.html
125•todsacerdoti•5d ago•9 comments

I rebooted my social life

https://takes.jamesomalley.co.uk/p/this-might-be-oversharing
199•edent•5h ago•126 comments

50% of U.S. vinyl buyers don't own a record player

https://lightcapai.medium.com/the-great-return-from-digital-abundance-to-analog-meaning-cfda9e428752
58•ResisBey•1h ago•52 comments

I canceled my book deal

https://austinhenley.com/blog/canceledbookdeal.html
562•azhenley•22h ago•307 comments

A font with built-in TeX syntax highlighting

https://rajeeshknambiar.wordpress.com/2025/12/27/a-font-with-built-in-tex-syntax-highlighting/
19•LorenDB•4d ago•3 comments

Pokémon Team Optimization

https://nchagnet.pages.dev/blog/pokemon-team-optimization/
131•nchagnet•5d ago•53 comments

Beyond the Nat: Cgnat, Bandwidth, and Practical Tunneling

https://blog.rastrian.dev/post/beyond-the-nat-cgnat-bandwidth-and-practical-tunneling
8•rastrian•5d ago•2 comments

Show HN: I created a tool to design and create foamcore inserts for boardgames

https://boxinsertdesigner.com/
31•Rabidgremlin•4d ago•8 comments

A Christmas Present to Myself – Vector Network Analyzer (2014)

https://axotron.se/blog/vector-network-analyzer-a-christmas-present-to-myself/
26•joebig•1w ago•2 comments

Web Browsers have stopped blocking pop-ups

https://www.smokingonabike.com/2025/12/31/web-browsers-have-stopped-blocking-pop-ups/
317•coldpie•23h ago•337 comments

Resistance training load does not determine hypertrophy

https://physoc.onlinelibrary.wiley.com/doi/10.1113/JP289684
197•Luc•18h ago•247 comments

Flow5 released to open source

https://flow5.tech/docs/releasenotes.html
130•picture•13h ago•9 comments

Show HN: BusterMQ, Thread-per-core NATS server in Zig with io_uring

https://bustermq.sh/
124•jbaptiste•16h ago•52 comments

The Mammoth Pirates – In Russia's Arctic north, a new kind of gold rush

https://www.rferl.org/a/the-mammoth-pirates/27939865.html
40•ece20•6d ago•13 comments