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?

Marfa Public Radio Puts You to Sleep

https://www.marfapublicradio.org/podcast/marfa-public-radio-puts-you-to-sleep
294•reaperducer•10h ago•78 comments

DLL that was not present in memory despite not being formally unloaded

https://devblogs.microsoft.com/oldnewthing/20260625-00/?p=112467
32•ibobev•2h ago•5 comments

Bashblog – a single bash script to create blogs

https://github.com/cfenollosa/bashblog
70•ludicrousdispla•8h ago•44 comments

AMD Strix Halo RDMA Cluster Setup Guide

https://github.com/kyuz0/amd-strix-halo-vllm-toolboxes/blob/main/rdma_cluster/setup_guide.md
168•jakogut•12h ago•53 comments

Anonymous GitHub account mass-dropping undisclosed 0-days

https://github.com/bikini/exploitarium
852•binyu•22h ago•331 comments

Wayfinder Router: deterministic routing of queries between local and hosted LLM

https://github.com/itsthelore/wayfinder-router
83•handfuloflight•8h ago•34 comments

Show HN: Decomp Academy – Learn to decompile GameCube games into matching C

https://decomp-academy.dev
148•jackpriceburns•11h ago•58 comments

Choosing a Public DNS Resolver

https://evilbit.de/dns-resolver-guide.html
196•pawal•14h ago•75 comments

A stray "j" ruined my evening

https://napkins.mtmn.name/posts/stray-jay.html
30•birdculture•4d ago•14 comments

Kids act would require age checks to get online

https://www.eff.org/deeplinks/2026/06/kids-act-would-require-age-checks-get-online
11•bilsbie•56m ago•3 comments

More evidence of life on Mars but still no life (2025)

https://www.cbc.ca/radio/quirks/more-evidence-of-life-on-mars-but-still-no-life-1.7649645
16•pseudolus•57m ago•6 comments

Engineering for Bounded Cognition

https://shapeofthesystem.com/posts/2026/02/03/bounded-cognition
68•supermatt•2d ago•12 comments

Space Shuttle Endeavour's 20-story vertical display

https://californiasciencecenter.org/about-us/samuel-oschin-air-and-space-center/go-for-stack
73•uticus•2d ago•13 comments

Regular expressions that work “everywhere”

https://www.johndcook.com/blog/2026/06/23/regex-everywhere/
68•ColinWright•3d ago•26 comments

WAL-RUS: a Rust Rewrite of WAL-G for PostgreSQL Backups

https://clickhouse.com/blog/walrus-postgres-backups-in-rust
92•saisrirampur•13h ago•6 comments

From Hallmark to neon signs: A look at Jim Parkinson's career in letter art

https://typographica.org/on-typography/jim-parkinson-1941-2025/
13•whiteblossom•1d ago•0 comments

Turn your site into a place people can bump into each other

https://cauenapier.com/blog/townsquare_release/
261•eustoria•19h ago•113 comments

Guy in his basement creates a drug to treat Alzheimer's disease using AI

https://twitter.com/DouglasYaoDY/status/2070904914050797582
13•binyu•28m ago•9 comments

From Pentagons to Pentagrams

https://johncarlosbaez.wordpress.com/2026/05/29/from-pentagons-to-pentagrams/
16•surprisetalk•2d ago•3 comments

AI learns the “dark art” of RFIC design

https://spectrum.ieee.org/ai-radio-chip-design
247•Brajeshwar•3d ago•160 comments

The case for physical media ownership

https://dervis.de/physical/
455•cemdervis•1d ago•310 comments

OpenRA

https://www.openra.net/
753•tosh•1d ago•141 comments

Turning music into a chore is how I became a musician (2022)

https://the.scapegoat.dev/turning-music-into-a-chore-is-what-made-me-an-artist/
56•herbertl•11h ago•19 comments

Experimenting with Random() in CSS

https://polypane.app/blog/experimenting-with-random-in-css/
21•kilian•4d ago•7 comments

The best response to AI slop and online noise is from Robin Williams

https://jayacunzo.com/blog/your-move-chief
289•herbertl•11h ago•153 comments

Reflecting to optimise

https://magnusross.github.io/posts/reflecting-to-optimise/
29•magni121•1d ago•2 comments

Suspicious Discontinuities (2020)

https://danluu.com/discontinuities/
251•tosh•23h ago•86 comments

Reducing tick density along recreational trails in Ottawa, Canada

https://www.sciencedirect.com/science/article/pii/S1877959X26000476
212•bushwart•3d ago•138 comments

Enhancing x11 Application Security with LXC (2025)

https://dobrowolski.dev/article/enhancing-x11-application-security-with-lxc/
71•shirozuki•15h ago•47 comments

Asian AI startups launch Mythos-like models

https://techcrunch.com/2026/06/27/asian-ai-startups-launch-mythos-like-models-as-anthropics-expor...
250•bogdiyan•23h ago•183 comments