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?

Reverse engineering my Coway air purifier to ditch the cloud

https://scottjg.com/posts/2026-11-11-reverse-engineering-my-coway-air-purifier-to-ditch-the-cloud/
354•scottjg•19h ago•92 comments

"LibreOffice works 365 days a year. Just saying."

https://twitter.com/LibreOffice/status/2121205272479998268
58•mksaunders2•18m ago•3 comments

A technical vision for the Haskell ecosystem

https://discourse.haskell.org/t/a-technical-vision-for-the-haskell-ecosystem/15078
73•cosmic_quanta•2h ago•28 comments

Why Zig over C for Systems Programming

https://www.mtsoukalos.eu/2026/11/why-zig-over-c-for-systems-programming/
151•torutofu•3h ago•99 comments

Jensen Huang resigns

https://apnews.com/article/nvidia-megaspeed-china-singapore-huang-5403f152a601cf82ce939f1d24fffa0f
3899•lldb•1d ago•3341 comments

Doomsday: Friday, 13 November, A.D. 2026 (1960)

https://www.science.org/doi/10.1126/science.132.3436.1291
332•voxleone•5h ago•233 comments

Lonewolf 0.3 – A standalone XMPP server written in Rust

https://github.com/lonewolf-im/lonewolf/releases/tag/v0.3.0
52•ortuman•3h ago•9 comments

Brazil's Caixa insurer breach exposes names and tax IDs of all 7.6M customers

https://filemanager-cdn.mziq.com/published/3972906b-e50b-4f74-ab74-4d0d32125d11/9567a559-d20a-486...
104•dvaplima•1h ago•26 comments

Palmfrets, Minnesota guitarist's invention, strikes a new chord

https://www.echopress.com/business/minnesota-guitarists-invention-strikes-a-new-chord
32•bookofjoe•2h ago•27 comments

IceWM

https://ice-wm.org/
319•inatreecrown2•12h ago•177 comments

Elevated errors on claude.ai, Claude Code, and platform.claude.com

https://status.claude.com/incidents/nn11wk485zfn
432•__vivek•7h ago•352 comments

Rust 1.100

https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/
831•mbStavola•22h ago•300 comments

EU Digital Identity Wallet rollout: every EU state on one board

https://myid.ie/business/eu-digital-wallet-tracker/
70•mooreds•2h ago•30 comments

Brave Search API now accepts agentic payments via the x402 protocol

https://brave.com/blog/search-api-agentic-payments/
219•sjdh76•14h ago•125 comments

Switcher (2004)

https://folklore.org/Switcher.html
132•sammatilda•14h ago•39 comments

Jonathan Blow – If AI Solved Coding, Why Is My Software Still the Same? [video]

https://www.youtube.com/watch?v=IRK8h67ol7Q
86•helloplanets•2h ago•39 comments

Show HN: My $300 embroidery machine needed a subscription, so I built my own app

https://github.com/simpsoka/zigzag
679•simpsoka•1d ago•222 comments

AI Is Destroying the Trust Between Writers and Readers

https://www.theatlantic.com/books/2026/11/ai-literary-scams-amazon/689391/
191•FinnLobsien•6h ago•85 comments

Gemini 4 Hydrogen and Orchestrator

https://antigravity.google/blog/gemini-4-hydrogen-in-google-antigravity/
480•jonbaer•22h ago•158 comments

Former Nvidia CEO Huang had a relationship with a second employee, sources say

https://www.reuters.com/technology/former-nvidia-ceo-huang-had-relationship-with-second-employee-...
406•jbredeche•21h ago•436 comments

Why is Google cutting off Search from AI-free schools? Here are some theories

https://text.npr.org/nx-s1-6029408
64•kamaraju•1h ago•47 comments

Dwarf planet candidate appears which takes roughly 280 years to orbit our sun

https://www.smithsonianmag.com/smart-news/astronomers-found-a-mysterious-object-orbiting-far-beyo...
372•cybermango•22h ago•160 comments

Arm boss Rene Haas approached in Nvidia CEO search

https://www.ft.com/content/2a64f698-46dd-4178-a3f4-4c5f4c0a0926
7•bazzmt•18m ago•3 comments

Edge0-145B: Frontier AI Capabilities on Your Own Computer

https://edge0.ai/blog/introducing-edge0-145b-frontier-ai-capabilities-on-your-own-computer
315•sroussey•18h ago•94 comments

US test reactor cleared for operations

https://www.world-nuclear-news.org/articles/us-test-reactor-cleared-for-operations
51•PaulHoule•3h ago•16 comments

North Korean hackers used fake video calls in $400M crypto hack, says FBI

https://www.bbc.com/news/articles/cqdj1ellpd70o
11•saikiran91•38m ago•0 comments

I'm making LLMs work on small and old devices

https://github.com/hyperionaidev/smolmaxxing/
450•mrashad74•1d ago•171 comments

Service degradation on Microsoft 365

https://status.cloud.microsoft/
1105•dkpk•23h ago•937 comments

U.S. October PPI Rises 6.5% YoY, Highest in Nearly Four Years

143•moonypto•2h ago•123 comments

The 42-Year Journey to Bring 'Neuromancer' to the Screen

https://www.wired.com/story/exclusive-apple-tv-neuromancer-creator-interviews/
83•Brajeshwar•3h ago•58 comments