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?

Vercel says internal systems hit in breach

https://decipher.sc/2026/04/19/vercel-says-internal-systems-hit-in-breach/
357•whiteyford•4h ago•98 comments

Archive of BYTE magazine, starting with issue #1 in 1975

https://archive.org/details/byte-magazine-1975-09
468•DamnInteresting•2d ago•115 comments

The Bromine Chokepoint: How Strife Could Halt Production of World’s Memory Chips

https://warontherocks.com/cogs-of-war/the-bromine-chokepoint-how-strife-in-the-middle-east-could-...
38•crescit_eundo•2h ago•10 comments

Show HN: Faceoff – A terminal UI for following NHL games

https://www.vincentgregoire.com/faceoff/
39•vcf•2h ago•17 comments

I wrote a CHIP-8 emulator in my own programming language

https://github.com/navid-m/chip8emu
7•pizza_man•35m ago•1 comments

Notion leaks email addresses of all editors of any public page

https://twitter.com/weezerOSINT/status/2045849358462222720
220•Tiberium•4h ago•68 comments

The seven programming ur-languages (2022)

https://madhadron.com/programming/seven_ur_languages.html
213•helloplanets•12h ago•84 comments

KTaO3-Based Supercurrent Diode

https://pubs.acs.org/doi/10.1021/acs.nanolett.5c05590
17•PaulHoule•3d ago•1 comments

Game devs explain the tricks involved with letting you pause a game

https://kotaku.com/video-game-devs-explain-how-pausing-works-and-sometimes-it-gets-weird-2000686339
359•speckx•3d ago•196 comments

Nanopass Framework: Clean Compiler Creation Language

https://nanopass.org/
93•NordStreamYacht•4d ago•21 comments

I learned Unity the wrong way

https://darkounity.com/blog/how-i-learned-unity-the-wrong-way
10•lelanthran•3d ago•3 comments

SPEAKE(a)R: Turn Speakers to Microphones for Fun and Profit [pdf] (2017)

https://www.usenix.org/system/files/conference/woot17/woot17-paper-guri.pdf
139•Eridanus2•11h ago•63 comments

Show HN: Shader Lab, like Photoshop but for shaders

https://eng.basement.studio/tools/shader-lab
113•ragojose•3d ago•32 comments

What are skiplists good for?

https://antithesis.com/blog/2026/skiptrees/
233•mfiguiere•2d ago•49 comments

Reverse Engineering ME2's USB with a Heat Gun and a Knife

https://github.com/coremaze/ME2-Writeup
26•Bawoosette•1d ago•1 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
428•gnabgib•1d ago•393 comments

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
400•rbanffy•23h ago•178 comments

Show HN: Prompt-to-Excalidraw demo with Gemma 4 E2B in the browser (3.1GB)

https://teamchong.github.io/turboquant-wasm/draw.html
65•teamchong•8h ago•30 comments

Reading Input from an USB RFID Card Reader

https://kevwe.com/blog/usb-rfid-reader
20•kevwedotse•2d ago•4 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
593•anabranch•1d ago•557 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
399•NelsonMinar•1d ago•101 comments

MAGA Is Winning Its War Against U.S. Science

https://paulkrugman.substack.com/p/maga-is-winning-its-war-against-us
31•devonnull•20m ago•2 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
524•RickJWagner•1d ago•485 comments

When moving fast, talking is the first thing to break

https://daverupert.com/2026/04/more-talk-less-grok/
86•Brajeshwar•5h ago•40 comments

The world in which IPv6 was a good design (2017)

https://apenwarr.ca/log/20170810
177•signa11•17h ago•74 comments

Ask HN: How did you land your first projects as a solo engineer/consultant?

219•modelcroissant•10h ago•100 comments

Turtle WoW classic server announces shutdown after Blizzard wins injunction

https://www.pcgamer.com/games/world-of-warcraft/turtle-wow-classic-server-announces-shutdown-afte...
95•Brajeshwar•4h ago•70 comments

Binary GCD

https://en.algorithmica.org/hpc/algorithms/gcd/#binary-gcd
70•tosh•11h ago•1 comments

Minimal Viable Programs (2014)

https://joearms.github.io/published/2014-06-25-minimal-viable-program.html
33•bachmeier•4d ago•6 comments

It's cool to care (2025)

https://alexwlchan.net/2025/cool-to-care/
77•surprisetalk•4d ago•37 comments