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?

.name Grandfathered

https://neil.fraser.name/news/2026/11/10/
355•p4bl0•2h ago•63 comments

Smart home devices should work without the internet

https://docodethatmatters.com/home-automation-overnight-success/
279•skittleson•3h ago•122 comments

Synaptics patent claims stop work on DisplayLink drivers

https://lwn.net/SubscriberLink/1102549/acbc92e00cee3a3f/
74•speckx•1h ago•29 comments

Starlink Mini 2

https://starlink.com/mini-2
42•robertjfclarke•57m ago•21 comments

Val Town is winding down

https://blog.val.town/winding-down
111•tosh•1h ago•29 comments

AlphaProof Code

https://deepmind.google/blog/introducing-alphaproof-code/
487•ilreb•7h ago•159 comments

AMD's Zen 6 Family: Feeding the Beast

https://chipsandcheese.com/p/amds-zen-6-family-feeding-the-beast
76•pixelpoet•2h ago•28 comments

Show HN: Get your coding agent off ~2019 JavaScript, onto modern web primitives

https://github.com/GoogleChrome/modern-web-guidance
54•paulirish•1h ago•16 comments

Blender 5.3 released with Gaussian Splat support

https://www.blender.org/download/releases/5-3/
287•amlib•3h ago•37 comments

Ableton Live 13

https://www.ableton.com/en/live/
191•phaser•6h ago•224 comments

Process Explorer for macOS

https://github.com/microsoft/Procexp-Mac
42•ingve•20h ago•16 comments

I deleted all my SSH keys

https://blog.infected.systems/posts/2026-11-03-i-deleted-all-my-ssh-keys/
103•speckx•5d ago•34 comments

The Hardest Tarball?

https://stoppels.ch/2026/11/07/the-hardest-tarball.html
124•thatslast•4h ago•19 comments

Show HN: Valencia, Spain in Sim City/Isometric View

https://tinyvalencia.com/
90•leugim•4h ago•25 comments

Amazon saves millions by replacing Sonnet 4.6 with Strands Decider

https://strandsagents.com/blog/amazon-saves-millions-replacing-sonnet-with-strands-decider/
639•aloukissas•13h ago•222 comments

What's new in the .NET 11 runtime

https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-11/runtime
162•stevefan1999•7h ago•109 comments

Twelve things you could build on a live index of internet radio

https://tuneping.com/notes/twelve-things-to-build-on-a-live-radio-index/
6•victorbuilds•3d ago•0 comments

NetBSD 11 desktop on a Raspberry Pi 4

https://neongd.com/articles/netbsd11-rpi4.gmi
103•jaypatelani•2d ago•62 comments

AI usage generates a fragile codebase

https://evanxmerz.com/post/ai-usage-generates-a-fragile-codebase/
193•plun9•8h ago•252 comments

Taking another shot at the cheap IP camera, part 2

https://ericswpark.com/blog/2026/2026-11-09-ip-camera-pt2/
92•ericswpark•1d ago•35 comments

Claude Whiteboards, Claude Sheets, and Claude Data

https://claude.com/resources/articles/sheets-whiteboards-data
9•Yorothegoat•1h ago•2 comments

What constant surveillance is doing to children and parents

https://www.theatlantic.com/magazine/2026/12/location-tracking-apps-parental-surveillance/689031/
135•FinnLobsien•8h ago•129 comments

Queens Public Library under ransomware attack

https://connect.queenslibrary.org/
166•rustyhancock•10h ago•104 comments

M John Harrison becomes first science fiction author to win the Booker

https://www.theguardian.com/books/2026/nov/09/m-john-harrison-the-end-of-everything-wins-2026-boo...
76•sorokod•11h ago•68 comments

The death knell of digital search

https://www.newyorker.com/culture/infinite-scroll/the-death-knell-of-digital-search
48•bookofjoe•4h ago•60 comments

Fossil CO2 emissions decrease in 2026

https://news.exeter.ac.uk/faculty-of-environment-science-and-economy/fossil-co2-emissions-decreas...
143•giuliomagnifico•10h ago•169 comments

Variable-width Bézier curves (2025)

https://luthert.web.illinois.edu/blog/posts/775.html
8•leduyquang753•1d ago•1 comments

Tailscale's DNS IPv6 spells out "Tailscale"

https://www.reddit.com/r/Tailscale/comments/1xsr24r/tailscales_dns_ipv6_spells_out_tailscale_easter/
97•theanonymousone•2h ago•38 comments

Billion Watts in the Speaker [video]

https://www.youtube.com/watch?v=PHOcTXYaMfg
87•Element_•2d ago•48 comments

Work at the Frontier: AI's effect on freelance work

https://openai.com/index/ai-effect-on-freelance-work
17•swolpers•1h ago•9 comments