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?

Command and Conquer Generals natively ported to macOS, iPhone, iPad using Fable

https://github.com/ammaarreshi/Generals-Mac-iOS-iPad/tree/main
440•asronline•9h ago•176 comments

If you're a button, you have one job

https://unsung.aresluna.org/if-youre-a-button-you-have-one-job/
59•nozzlegear•3h ago•16 comments

GPT-5.5 Codex reasoning-token clustering may be leading to degraded performance

https://github.com/openai/codex/issues/30364
205•maille•7h ago•70 comments

Google Books (or similar) all book scans – $200k bounty (2025)

https://software.annas-archive.gl/AnnaArchivist/annas-archive/-/work_items/234
395•Cider9986•12h ago•210 comments

Jellyfish can heal wounds in minutes. Scientists want their secrets

https://www.mbl.edu/news/jellyfish-can-heal-wounds-minutes-scientists-want-their-secrets
75•hhs•6h ago•16 comments

Leaking YouTube creators' private videos

https://javoriuski.com/post/youtube
538•javxfps•12h ago•307 comments

Atomic Force Microscope high-speed video, stainless etching, bacteria, and more

https://www.youtube.com/watch?v=DyIQkqBXhS0
34•mhb•2d ago•2 comments

Artful Cats: Feline-Inspired Art and Artifacts

https://www.si.edu/spotlight/art-cats
10•jruohonen•3d ago•0 comments

Explanation of everything you can see in htop/top on Linux (2019)

https://peteris.rocks/blog/htop/
447•theanonymousone•17h ago•55 comments

Better Models: Worse Tools

https://lucumr.pocoo.org/2026/7/4/better-models-worse-tools/
132•leemoore•8h ago•41 comments

Meta's Un-Stable Signature

https://hackerfactor.com/blog/index.php?/archives/1098-Metas-Un-Stable-Signature.html
50•ementally•3d ago•2 comments

Potential session/cache leakage between workspace instances or consumer accounts

https://github.com/anthropics/claude-code/issues/74066
282•chatmasta•15h ago•129 comments

Return of the Nigerian Prince Redux: Beware Book Club and Book Review Scams (2025)

https://writerbeware.blog/2025/09/19/return-of-the-nigerian-prince-redux-beware-book-club-and-boo...
31•Anon84•4h ago•6 comments

Zig: All Package Management Functionality Moved from Compiler to Build System

https://ziglang.org/devlog/2026/#2026-06-30
165•tosh•12h ago•34 comments

"Beyond the limit": Satellites and mirrors in space pose threat to the night sky

https://www.eso.org/public/news/eso2607/
119•Breadmaker•11h ago•208 comments

Record-breaking solo rower Kelsey Pfendler arrives in Hawaii

https://www.hawaiinewsnow.com/2026/07/04/record-breaking-solo-rower-kelsey-pfendler-arrives-hawaii/
15•MaysonL•3h ago•1 comments

Drone Autonomy Crash Course

https://www.cggonzalez.com/blog/index.html
26•cgg1•5h ago•2 comments

President pardons 9 for Clean Air violations for 'fixing their car'

https://www.msn.com/en-us/news/crime/trump-pardons-9-for-clean-air-violations-for-fixing-their-ca...
23•OutOfHere•1h ago•1 comments

The Log Is the Agent

https://arxiv.org/abs/2605.21997
7•iacguy•2h ago•0 comments

Backon – Python retry (zero deps, circuit breaker, async native)

https://github.com/Llucs/backon
5•Llucs•2h ago•0 comments

What ORMs have taught me: just learn SQL (2014)

https://wozniak.ca/blog/2014/08/03/1/index.html
146•ciconia•4d ago•185 comments

University of Oxford Is Older Than the Aztec Empire and Other Facts of History (2013)

https://www.smithsonianmag.com/smart-news/university-oxford-older-than-aztec-empire-other-facts-w...
38•thunderbong•2h ago•9 comments

Efficacy and Safety of Psilocybin in Treatment-Resistant Major Depression

https://jamanetwork.com/journals/jamapsychiatry/fullarticle/2846478
20•cpncrunch•3h ago•5 comments

Drone Physics

https://iahmed.me/post/drone-physics/
99•wrxd•4d ago•29 comments

As downtown Seattle offices empty, city facing years of 'zombie' towers

https://www.seattletimes.com/business/local-business/as-downtown-seattle-offices-empty-city-facin...
94•petethomas•10h ago•127 comments

The Vespa at 80

https://www.cbc.ca/news/world/vespa-italy-postwar-design-9.7252641
154•cf100clunk•3d ago•140 comments

Fable created novel 4D splat format

https://adamraudonis.github.io/splats4D/
140•adamraudonis•13h ago•51 comments

Windows CE Dreamcast Community Edition (wince-dc)

https://github.com/maximqaxd/wince-dc
98•msephton•14h ago•23 comments

Protocol Prying: Vulnerability Research in AirDrop and Quick Share

https://arxiv.org/abs/2606.26967
21•logickkk1•8h ago•1 comments

Reflections on the Guillotine (1957)

https://theanarchistlibrary.org/library/albert-camus-reflections-on-the-guillotine
37•halperter•5h ago•13 comments