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

Comments

ashvardanian•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo 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•7mo ago
What are the biggest use cases of GPU accelerated sorting?

Netflix to Acquire Warner Bros

https://about.netflix.com/en/news/netflix-to-acquire-warner-bros
1034•meetpateltech•6h ago•849 comments

Shingles vaccination prevented or delayed dementia

https://www.cell.com/cell/fulltext/S0092-8674(25)01256-5
94•Archelaos•1h ago•34 comments

I'm Peter Roberts, immigration attorney who does work for YC and startups. AMA

84•proberts•2h ago•72 comments

Cloudflare outage on December 5, 2025

https://blog.cloudflare.com/5-december-2025-outage/
311•meetpateltech•3h ago•193 comments

Synadia and TigerBeetle Pledge $512,000 to the Zig Software Foundation

https://tigerbeetle.com/blog/2025-10-25-synadia-and-tigerbeetle-pledge-512k-to-the-zig-software-f...
35•cratermoon•2h ago•13 comments

Making RSS More Fun

https://matduggan.com/making-rss-more-fun/
125•salmon•5h ago•66 comments

Patterns for Defensive Programming in Rust

https://corrode.dev/blog/defensive-programming/
39•PaulHoule•2h ago•5 comments

Framework Laptop 13 gets ARM processor with 12 cores via upgrade kit

https://www.notebookcheck.net/Framework-Laptop-13-gets-ARM-processor-with-12-cores-via-upgrade-ki...
173•woodrowbarlow•3h ago•79 comments

UniFi 5G

https://blog.ui.com/article/introducing-unifi-5g
293•janandonly•11h ago•232 comments

Onlook (YC W25) the Cursor for Designers Is Hiring a Founding Fullstack Engineer

1•D_R_Farrell•1h ago

Show HN: SerpApi MCP Server

https://github.com/serpapi/serpapi-mcp
4•thefoolofdaath•23m ago•1 comments

We Built Lightpanda in Zig

https://lightpanda.io/blog/posts/why-we-built-lightpanda-in-zig
4•ashvardanian•24m ago•0 comments

The Forgotten Roman Ruins of the ‘Pompeii of the Middle East’

https://news.artnet.com/art-world/huge-jerash-jordan-pompeii-middle-easy-2708480
18•pseudolus•6d ago•0 comments

Building a Copying GC for the Plush Programming Language

https://pointersgonewild.com/2025-11-29-building-a-copying-gc-for-the-plush-programming-language/
6•ibobev•4d ago•0 comments

Netflix’s AV1 Journey: From Android to TVs and Beyond

https://netflixtechblog.com/av1-now-powering-30-of-netflix-streaming-02f592242d80
468•CharlesW•18h ago•241 comments

Gemini 3 Pro: the frontier of vision AI

https://blog.google/technology/developers/gemini-3-pro-vision/
15•xnx•2h ago•2 comments

Most technical problems are people problems

https://blog.joeschrag.com/2023/11/most-technical-problems-are-really.html
212•mooreds•5h ago•191 comments

BMW PHEV: Safety fuse replacement is extremely expensive

https://evclinic.eu/2025/12/04/2021-phev-bmw-ibmucp-21f37e-post-crash-recovery-when-eu-engineerin...
388•mikelabatt•17h ago•414 comments

Wall Street races to protect itself from AI bubble

https://rollingout.com/2025/12/05/wall-street-protects-itself-ai-bubble/
20•zerosizedweasle•32m ago•7 comments

I have been writing a niche history blog for 15 years

https://resobscura.substack.com/p/why-i-have-been-writing-a-niche-history
225•benbreen•1d ago•41 comments

Show HN: Pbnj – A minimal, self-hosted pastebin you can deploy in 60 seconds

https://pbnj.sh/
35•bhavnicksm•5h ago•9 comments

Jony Ive's OpenAI Device Barred from Using 'Io' Name

https://www.macrumors.com/2025/12/05/openai-device-barred-from-io-name/
46•thm•2h ago•17 comments

Nimony (Nim 3.0) Design Principles

https://nim-lang.org/araq/nimony.html
101•andsoitis•3d ago•60 comments

WikiFlix: Full Movies Hosted on Wikimedia Commons

https://commons.wikimedia.org/wiki/User:Spinster/WikiFlix
14•netule•45m ago•1 comments

Show HN: Kraa – Writing App for Everything

https://kraa.io/about
80•levmiseri•1d ago•49 comments

New 3D scan reveals a hidden network of moai carvers on Easter Island

https://www.sciencedaily.com/releases/2025/11/251130050717.htm
27•saikatsg•4d ago•4 comments

Trick users and bypass warnings – Modern SVG Clickjacking attacks

https://lyra.horse/blog/2025/12/svg-clickjacking/
303•spartanatreyu•18h ago•41 comments

After 40 years of adventure games, Ron Gilbert pivots to outrunning Death

https://arstechnica.com/gaming/2025/12/after-40-years-of-adventure-games-ron-gilbert-pivots-to-ou...
171•mikhael•4d ago•68 comments

The AI Backlash Is Here: Why Public Patience with Tech Giants Is Running Out

https://www.newsweek.com/ai-backlash-openai-meta-friend-10807425
75•zerosizedweasle•1h ago•82 comments

Kenyan court declares law banning seed sharing unconstitutional

https://apnews.com/article/kenya-seed-sharing-law-ruling-ad4df5a364299b3a9f8515c0f52d5f80
256•thunderbong•9h ago•75 comments