frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Faster sorting with SIMD CUDA intrinsics (2024)

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

Comments

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

Iroh 1.0

https://www.iroh.computer/blog/v1
167•chadfowler•56m ago•44 comments

CrankGPT

https://crankgpt.com
323•rishikeshs•2h ago•135 comments

Copper transport drug restores memory and clears toxic Alzheimer's proteins

https://www.monash.edu/news/articles/copper-drug-restores-memory-and-clears-toxic-alzheimers-prot...
39•bookofjoe•1h ago•7 comments

My Homelab AI Dev Platform

https://rsgm.dev/post/ai-dev-platform/
11•rsgm•59m ago•1 comments

Show HN: Exploiting Slack's video embeds to achieve E2EE communication

https://v1c.rocks/log/exploiting-slack-video/
6•victorio•26m ago•1 comments

Hetzner increased dedicated server prices 3-4x

180•enescakir•1h ago•122 comments

Apple Foundation Models

https://platform.claude.com/docs/en/cli-sdks-libraries/libraries/apple-foundation-models
360•MehrdadKhnzd•11h ago•164 comments

Your ePub Is fine

https://andreklein.net/your-epub-is-fine-kobo-disagrees-blame-adobe/
798•sohkamyung•17h ago•270 comments

Show HN: Can Europe train a frontier AI model on the compute it owns?

https://github.com/sammysltd/euromesh
41•smashini•2h ago•31 comments

Salesforce to Acquire Fin (formerly Intercom) for $3.6BN

https://www.salesforce.com/news/press-releases/2026/06/15/salesforce-signs-definitive-agreement-t...
195•colesantiago•4h ago•151 comments

Fox Is Buying Roku

https://www.fastcompany.com/91559558/fox-corp-buying-roku-stock-prices-fall-on-tv-streaming-merger
53•simonebrunozzi•1h ago•3 comments

Show HN: I wrote a C++ ray tracer from scratch without AI

https://github.com/themartiano/luz
114•martiano•6h ago•45 comments

Making glass-to-metal seals for home­made vacuum tubes

https://maurycyz.com/projects/glass/1/
12•zdw•1d ago•3 comments

Openrouter Fusion API

https://openrouter.ai/openrouter/fusion
148•tdchaitanya•8h ago•56 comments

Even more batteries included with Emacs

https://karthinks.com/software/even-more-batteries-included-with-emacs/
298•signa11•13h ago•95 comments

Teenagers Stayed Overnight at Their School and Found Hidden Ancient Roman Ruins

https://www.smithsonianmag.com/smart-news/these-italian-teenagers-stayed-overnight-at-their-schoo...
90•thunderbong•4d ago•38 comments

Google Flight Simulator

https://developers.google.com/maps/documentation/earth/flight-simulator
79•bookofjoe•2h ago•29 comments

Show HN: Kage – Shadow any website to a single binary for offline viewing

https://github.com/tamnd/kage
637•tamnd•22h ago•123 comments

Ported my C game to WASM, here's everybug that I hit

http://ernesernesto.github.io/writes/portingmatchmorphosistowasm/
73•birdculture•2d ago•55 comments

Successful Psilocybin Treatment of Alzheimer

https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2026.1813281/full
104•cl3misch•9h ago•76 comments

Firewood Splitting Simulator

https://screen.toys/firewood/
931•memalign•5d ago•267 comments

Asciline – real-time ASCII video rendering engine

https://github.com/YusufB5/ASCILINE
37•godot•3d ago•13 comments

There Is(Ǝ) – Such That (∋)

https://www.fractalkitty.com/there-is-3-such-that/
84•evakhoury•4d ago•24 comments

Dalus (YC W25) Is Hiring a Senior Software Engineer in Germany

https://www.ycombinator.com/companies/dalus/jobs/5IDmKJt-senior-software-frontend-engineer-german...
1•sebastianvoelkl•9h ago

Curl will not accept vulnerability reports during July 2026

https://daniel.haxx.se/blog/2026/06/15/curl-summer-of-bliss/
649•secret-noun•10h ago•269 comments

Bitsy

https://bitsy.org/
258•tosh•3d ago•8 comments

Stdx, Rust's extended standard library

https://kerkour.com/stdx
23•manyatoms•3d ago•12 comments

21 years and counting of 'eight fallacies of distributed computing' (2025)

https://blog.apnic.net/2025/12/08/21-years-and-counting-of-eight-fallacies-of-distributed-computing/
124•teleforce•16h ago•43 comments

Exploring building a tiny FUSE filesystem

https://www.shayon.dev/post/2026/161/building-a-tiny-fuse-filesystem/
61•shayonj•2d ago•8 comments

Rio de Janeiro's "homegrown" LLM appears to be a merge of an existing model

https://github.com/nex-agi/Nex-N2/issues/4
381•unrvl22•1d ago•201 comments