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

Comments

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

Keep Android Open

https://f-droid.org/2026/02/20/twif.html
1029•LorenDB•7h ago•393 comments

Turn Dependabot Off

https://words.filippo.io/dependabot/
237•todsacerdoti•3h ago•68 comments

CERN rebuilt the original browser from 1989

https://worldwideweb.cern.ch
61•tylerdane•2h ago•17 comments

Facebook is cooked

https://pilk.website/3/facebook-is-absolutely-cooked
682•npilk•6h ago•411 comments

I found a Vulnerability. They found a Lawyer

https://dixken.de/blog/i-found-a-vulnerability-they-found-a-lawyer
318•toomuchtodo•6h ago•151 comments

Ggml.ai joins Hugging Face to ensure the long-term progress of Local AI

https://github.com/ggml-org/llama.cpp/discussions/19759
659•lairv•11h ago•159 comments

Wikipedia deprecates Archive.today, starts removing archive links

https://arstechnica.com/tech-policy/2026/02/wikipedia-bans-archive-today-after-site-executed-ddos...
273•nobody9999•6h ago•150 comments

OpenScan

https://openscan.eu/pages/scan-gallery
86•joebig•4h ago•3 comments

Show HN: Mines.fyi – all the mines in the US in a leaflet visualization

https://mines.fyi/
45•irasigman•3h ago•29 comments

Every company building your AI assistant is now an ad company

https://juno-labs.com/blogs/every-company-building-your-ai-assistant-is-an-ad-company
79•ajuhasz•6h ago•38 comments

The true story behind the Toronto mystery tunnel

https://macleans.ca/society/elton-mcdonald-and-the-incredible-true-story-behind-the-toronto-myste...
23•mhb•3d ago•6 comments

Blue light filters don't work – controlling total luminance is a better bet

https://www.neuroai.science/p/blue-light-filters-dont-work
110•pminimax•7h ago•145 comments

Uncovering insiders and alpha on Polymarket with AI

https://twitter.com/peterjliu/status/2024901585806225723
72•somerandomness•7h ago•37 comments

Trump's global tariffs struck down by US Supreme Court

https://www.bbc.com/news/live/c0l9r67drg7t
1217•blackguardx•9h ago•995 comments

Across the US, people are dismantling and destroying Flock surveillance cameras

https://www.bloodinthemachine.com/p/across-the-us-people-are-dismantling
86•latexr•2h ago•14 comments

The path to ubiquitous AI (17k tokens/sec)

https://taalas.com/the-path-to-ubiquitous-ai/
662•sidnarsipur•14h ago•377 comments

Lil' Fun Langs

https://taylor.town/scrapscript-000
87•surprisetalk•7h ago•11 comments

Building a model that visualizes strategic golf

https://golfcoursewiki.substack.com/p/i-spent-the-last-month-and-a-half
34•scoofy•4d ago•13 comments

Show HN: A native macOS client for Hacker News, built with SwiftUI

https://github.com/IronsideXXVI/Hacker-News
167•IronsideXXVI•11h ago•130 comments

Making frontier cybersecurity capabilities available to defenders

https://www.anthropic.com/news/claude-code-security
93•surprisetalk•7h ago•47 comments

Be Wary of Bluesky

https://kevinak.se/blog/be-wary-of-bluesky
63•kevinak•1h ago•47 comments

Legion Health (YC) Is Hiring Cracked SWEs for Autonomous Mental Health

https://jobs.ashbyhq.com/legionhealth/ffdd2b52-eb21-489e-b124-3c0804231424
1•ympatel•8h ago

How to Review an AUR Package

https://bertptrs.nl/2026/01/30/how-to-review-an-aur-package.html
48•exploraz•3d ago•6 comments

I found a useful Git one liner buried in leaked CIA developer docs

https://spencer.wtf/2026/02/20/cleaning-up-merged-git-branches-a-one-liner-from-the-cias-leaked-d...
597•spencerldixon•11h ago•211 comments

Lexega Turns SQL into Signals

https://lexega.com/blog/how-lexega-turns-sql-into-signals
4•whoami4041•1h ago•1 comments

Untapped Way to Learn a Codebase: Build a Visualizer

https://jimmyhmiller.com/learn-codebase-visualizer
195•andreabergia•16h ago•34 comments

Child's Play: Tech's new generation and the end of thinking

https://harpers.org/archive/2026/03/childs-play-sam-kriss-ai-startup-roy-lee/
337•ramimac•10h ago•208 comments

Don't create .gitkeep files, use .gitignore instead

https://adamj.eu/tech/2023/09/18/git-dont-create-gitkeep/
15•frou_dh•2h ago•8 comments

How were video transfers made? (2011)

https://www.film-tech.com/ubb/f12/t000972.html
8•exvi•5d ago•1 comments

A chatbot's worst enemy is page refresh

https://zknill.io/posts/chatbots-worst-enemy-is-page-refresh/
35•zknill•3d ago•10 comments