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

Comments

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

God Sleeps in the Minerals

https://wchambliss.wordpress.com/2026/03/03/god-sleeps-in-the-minerals/
251•speckx•3h ago•59 comments

Open Source Isn't Dead. Cal.com Just Learned the Wrong Lesson

https://www.strix.ai/blog/cal-com-is-closing-its-code-due-to-ai-threats
100•bearsyankees•1h ago•51 comments

Want to Write a Compiler? Just Read These Two Papers (2008)

https://prog21.dadgum.com/30.html
338•downbad_•7h ago•103 comments

Good Sleep, Good Learning (2012)

https://super-memory.com/articles/sleep.htm
247•downbad_•7h ago•119 comments

The Future of Everything Is Lies, I Guess: New Jobs

https://aphyr.com/posts/419-the-future-of-everything-is-lies-i-guess-new-jobs
158•aphyr•3h ago•95 comments

How do Wake-On-LAN works

https://blog.xaner.dev/post/wake-on-lan/
12•swq115•4d ago•1 comments

Gemini Robotics-ER 1.6

https://deepmind.google/blog/gemini-robotics-er-1-6/
116•markerbrod•2h ago•27 comments

Do you even need a database?

https://www.dbpro.app/blog/do-you-even-need-a-database
66•upmostly•4h ago•108 comments

Forcing an inversion of control on the SaaS stack

https://www.100x.bot/a/client-side-injection-inversion-of-control-saas
16•shardullavekar•4d ago•16 comments

Costasiella kuroshimae – Solar Powered animals, that do indirect photosynthesis

https://en.wikipedia.org/wiki/Costasiella_kuroshimae
108•vinnyglennon•3d ago•43 comments

Wacli – WhatsApp CLI

https://github.com/steipete/wacli
190•dinakars777•9h ago•130 comments

Show HN: Libretto – Making AI browser automations deterministic

https://github.com/saffron-health/libretto
5•muchael•1h ago•0 comments

Fixing a 20-year-old bug in Enlightenment E16

https://iczelia.net/posts/e16-20-year-old-bug/
226•snoofydude•12h ago•125 comments

We ran Doom on a 40 year old printer controller (Agfa Compugraphic 9000PS) [video]

https://www.youtube.com/watch?v=cltnlks2-uU
34•zdw•3d ago•9 comments

Metro stop is Ancient Rome's new attraction

https://www.bbc.com/travel/article/20260408-a-150-metro-ticket-to-ancient-rome
79•Stevvo•5d ago•20 comments

Proliferate (YC S25) Is Hiring Founding Engineers

https://www.ycombinator.com/companies/proliferate/jobs/L3copvK-founding-engineer
1•pablo24602•4h ago

Google Gemma 4 Runs Natively on iPhone with Full Offline AI Inference

https://www.gizmoweek.com/gemma-4-runs-iphone/
214•takumi123•11h ago•133 comments

Anna's Archive loses $322M Spotify piracy case without a fight

https://torrentfreak.com/annas-archive-loses-322-million-spotify-piracy-case-without-a-fight/
106•askl•8h ago•104 comments

Pretty Fish: A better mermaid diagram editor

https://pretty.fish/
73•pastelsky•5d ago•16 comments

Show HN: Every CEO and CFO change at US public companies, live from SEC

https://tracksuccession.com/explore
129•porsche959•4h ago•55 comments

Backpacks got worse on purpose

https://www.worseonpurpose.com/p/your-backpack-got-worse-on-purpose
289•113•6h ago•257 comments

Study: Back-to-basics approach can match or outperform AI in language analysis

https://www.manchester.ac.uk/about/news/back-to-basics-approach-can-match-or-outperform-ai/
21•giuliomagnifico•4h ago•7 comments

US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf]

https://fingfx.thomsonreuters.com/gfx/legaldocs/xmvjyjekkpr/Rakoff%20-%20order%20-%20AI.pdf
71•1vuio0pswjnm7•3h ago•50 comments

Elevated errors on Claude.ai, API, Claude Code

https://claudestatus.com/
200•redm•2h ago•176 comments

AI ruling prompts warnings from US lawyers: Your chats could be used against you

https://www.reuters.com/legal/government/ai-ruling-prompts-warnings-us-lawyers-your-chats-could-b...
88•alephnerd•4h ago•48 comments

H.R.8250 – To require operating system providers to verify the age of any user

https://www.congress.gov/bill/119th-congress/house-bill/8250/all-info
160•cft•18h ago•100 comments

Dependency cooldowns turn you into a free-rider

https://calpaterson.com/deps.html
169•pabs3•14h ago•111 comments

MIT Radiation Laboratory

https://www.ll.mit.edu/about/history/mit-radiation-laboratory
35•stmw•3d ago•8 comments

Not all elementary functions can be expressed with exp-minus-log

https://www.stylewarning.com/posts/not-all-elementary/
123•mmastrac•15h ago•103 comments

A communist Apple II and fourteen years of not knowing what you're testing

https://llama.gs/blog/index.php/2026/04/10/friday-archaeology-a-communist-apple-ii-and-fourteen-y...
219•major4x•4d ago•101 comments