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

Comments

ashvardanian•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•12mo ago
What are the biggest use cases of GPU accelerated sorting?

Ti-84 Evo

https://education.ti.com/en/products/calculators/graphing-calculators/ti-84-evo
311•thatxliner•6h ago•299 comments

Artemis II Photo Timeline

https://artemistimeline.com/#artemis-ii-walkout-nhq202604010003
73•geerlingguy•2d ago•6 comments

New research suggests people can communicate and practice skills while dreaming

https://www.newyorker.com/culture/annals-of-inquiry/its-possible-to-learn-in-our-sleep-should-we
256•XzetaU8•8h ago•137 comments

Good developers learn to program. Most courses teach a language

https://evilgeniuslabs.ca/blog/good-developers-learn-to-program-not-a-language
24•andsoitis•2h ago•19 comments

The smelly baby problem

https://www.worksinprogress.news/p/how-disposable-diapers-conquered
113•dionysou•2d ago•56 comments

A Report on Burnout in Open Source Software Communities (2025) [pdf]

https://mirandaheath.website/static/oss_burnout_report_mh_25.pdf
31•susam•3h ago•7 comments

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

125•proberts•11h ago•189 comments

Direct electrochemical black coffee quality appraisal using cyclic voltammetry

https://www.nature.com/articles/s41467-026-71526-5
11•bookofjoe•2d ago•3 comments

Lib0xc: A set of C standard library-adjacent APIs for safer systems programming

https://github.com/microsoft/lib0xc
79•wooster•7h ago•25 comments

Ask HN: Who is hiring? (May 2026)

228•whoishiring•11h ago•258 comments

Eka’s robotic claw feels like we're approaching a ChatGPT moment

https://www.wired.com/story/when-robots-have-their-chatgpt-moment-remember-these-pincers/
98•zdw•2d ago•119 comments

Whohas – Command-line utility for cross-distro, cross-repository package search

https://github.com/whohas/whohas
126•peter_d_sherman•11h ago•30 comments

Whimsical Animations Course Open House

https://courses.joshwcomeau.com/wham/open-house/00-introduction
71•SpyCoder77•6h ago•9 comments

Show HN: WhatCable, a tiny menu bar app for inspecting USB-C cables

https://github.com/darrylmorley/whatcable
426•sleepingNomad•17h ago•129 comments

SpaceX rocket set for unintentional moon landing – well, a piece of it anyway

https://www.theregister.com/2026/05/01/spacex_debris_landing/
52•beardyw•14h ago•35 comments

City Learns Flock Accessed Cameras in Children's Gymnastics Room as a Sales Demo

https://www.404media.co/city-learns-flock-accessed-cameras-in-childrens-gymnastics-room-as-a-sale...
314•joshcsimmons•7h ago•92 comments

Apocalypse Early Warning System

https://ews.kylemcdonald.net/
121•carlsborg•10h ago•71 comments

Show HN: AI CAD Harness

https://fusion.adam.new/install
66•zachdive•8h ago•69 comments

The gay jailbreak technique

https://github.com/Exocija/ZetaLib/blob/main/The%20Gay%20Jailbreak/The%20Gay%20Jailbreak.md
395•bobsmooth•9h ago•155 comments

Visual Studio 2026 still ships the form designer Alan Cooper drew in 1987

https://evilgeniuslabs.ca/blog/winforms-still-ships-in-visual-studio-2026
20•jordand•2h ago•7 comments

Credit cards are vulnerable to brute force kind attacks

https://metin.nextc.org/posts/Credit_Cards_Are_Vulnerable_To_Brute_Force_Kind_Attacks.html
191•kodbraker•6h ago•157 comments

Understand Anything

https://github.com/Lum1104/Understand-Anything
108•taubek•9h ago•31 comments

Ask HN: Who wants to be hired? (May 2026)

120•whoishiring•11h ago•248 comments

Artemis II fault tolerance

https://alearningaday.blog/2026/05/01/artemis-ii-fault-tolerance/
63•speckx•8h ago•33 comments

AI uses less water than the public thinks

https://californiawaterblog.com/2026/04/26/ai-water-use-distractions-and-lessons-for-california/
343•hirpslop•9h ago•306 comments

Spotify adds 'Verified' badges to distinguish human artists from AI

https://www.bbc.com/news/articles/c5yerr4m1yno
205•reconnecting•9h ago•236 comments

Tvheadend: Self-Hosted IPTV Server

https://tvheadend.org
7•hyperific•2d ago•4 comments

Running Adobe's 1991 PostScript Interpreter in the Browser

https://www.pagetable.com/?p=1854
123•ingve•14h ago•29 comments

Historic Tennessee hotel is also home to the greatest duck tradition (2016)

https://www.audubon.org/magazine/tennessees-most-historic-hotel-also-home-greatest-duck-tradition
28•NaOH•2d ago•2 comments

Sally McKee, who coined the term "the memory wall", has died

https://www.online-tribute.com/SallyMcKee
107•deater•11h ago•26 comments