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?

Dolly Parton's Imagination Library

https://imaginationlibrary.com/
380•jumploops•7h ago•68 comments

F-Zero X on Nintendo 3DS

https://hypnotize.works/gdx-3ds/postmortem/index.html
39•bpierre•2h ago•23 comments

Overgrown, when plants invade your abandoned tabs

https://charliegerard.dev/blog/overgrown-extension/
134•speckx•3d ago•38 comments

Why I Am a Programmer

https://www.alfie.wtf/programming/why-i-am-a-programmer.html
134•jruohonen•6h ago•49 comments

Attention Is Not What You Need

https://arxiv.org/abs/2512.19428
16•westurner•1h ago•4 comments

What goes into making an animated film?

https://www.disneyanimation.com/process/
87•embedding-shape•5h ago•33 comments

The State of Context Engineering

https://www.dbreunig.com/2026/10/24/the-state-of-context-engineering.html
77•pchristensen•5h ago•22 comments

A 10-year-old CNN outperforms frontier LLMs for skin cancer diagnosis

https://lynchlab.net/llm-skin-cancer
432•sungam•8h ago•206 comments

Making the Buddha Head from Merv Whole Again

https://www.getty.edu/news/buddha-head-of-merv-turkmenistan-conservation/
21•laybak•2d ago•0 comments

OpenAI and Anthropic cut their LLM prices by up to 80% within a few months. Why?

https://minimaxir.com/2026/10/cheap-llms/
145•minimaxir•4h ago•170 comments

Where the Romans Fought (interactive map)

https://iosiflazaridis.github.io/battles-of-the-romans/
49•endorphine•6h ago•15 comments

I refuse to accept a censored Internet. Join Me at FOSDEM 27

https://talkweb.eu/openweb/4558/
386•Tomte•8h ago•192 comments

Oregon Police Are Charging a Local News Outlet $2.5M for Records About One Cop

https://theintercept.com/2026/10/01/oregon-police-misconduct-public-records-cost-fee/
383•tdeck•7h ago•96 comments

Eunice is almost here

https://armincat.com/articles/eunice-is-almost-here
60•armcat•6h ago•55 comments

Lula wins election after final votes tallied

https://www.reuters.com/live/brazil-election-live-lula-bolsonaro-face-off-presidential-runoff-202...
139•laurenth•1h ago•90 comments

We should be more ambitious with the software we build

https://danluu.com/ambitious/
742•ltratt•1d ago•693 comments

Amazon's "digital pacifier" for toddlers

https://oligarchwatch.substack.com/p/amazons-digital-pacifier-for-toddlers
84•jumploops•4d ago•144 comments

Reverse engineering a Beyblade launch tracker

https://blog.simone.computer/reverse-beyblade-launch-tracker
33•syx•2d ago•3 comments

Retired decorator's Pokémon cards sell for £1.5M

https://www.bbc.co.uk/news/articles/cvp8gy1zwxxwo
12•HelloUsername•3d ago•6 comments

Active incident at Dreamhost forcing password reset

https://www.dreamhoststatus.com/
117•greenchair•12h ago•44 comments

Show HN: Hurston-1 open source TTS that speak Southern American and Afro-English

https://huggingface.co/destined/hurston-1
46•Gcarter08•1d ago•23 comments

Proton Flock Camera Map

https://proton.me/flock-camera-map
57•cdrnsf•3h ago•5 comments

The U.S. Power Grid

https://nomagicpill.site/knowledge/powergrid.html
75•surprisetalk•3d ago•23 comments

Chip Builder is a puzzle and strategy game that teaches you chip design

https://chipbuilder.org/
11•laurentiurad•4d ago•1 comments

VCF Southwest 2026, but Edited on Silicon Graphics for '90s TV [video]

https://www.youtube.com/watch?v=46wxttvq9qY
60•zdw•1d ago•12 comments

UTS #39: Unicode Security Mechanisms

https://unicode.org/reports/tr39/
33•robin_reala•9h ago•17 comments

Root shell on Samsung TV

https://twitter.com/log4j/status/2113014142600953868?s=46
769•testing22321•1d ago•584 comments

JetBrains Thinkrail

https://github.com/JetBrains/thinkrail
181•hmokiguess•9h ago•130 comments

Recreate the Apollo Guidance Computer

https://www.raspberrypi.com/news/recreate-the-apollo-guidance-computer/
44•Brajeshwar•3d ago•4 comments

Focused Company Operating Principles

https://focused.io/operating-principles
19•mooreds•5h ago•5 comments