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?

Powerless F1 drivers frustrated by Bahrain F1 software glitch

https://www.motorsport.com/f1/news/horrible-totally-unacceptable-powerless-f1-drivers-frustrated-...
25•llm_nerd•30m ago•5 comments

Run Qwen 3.8 Flash Next (125B) on consumer hardware (RTX 4090) at 100T/s

https://github.com/Niko1221/Strata
626•snehesht•13h ago•295 comments

In the wake of closure, a digital archive of animated materials appears online

https://filmstories.co.uk/news/tippett-studios-in-the-wake-of-its-closure-a-digital-archive-of-an...
35•rdmuser•5h ago•3 comments

Infidel goes wild

https://blog.zarfhome.com/2026/10/infidel-goes-wild
82•tobr•1d ago•13 comments

The Tao of Backup

http://www.taobackup.com/index.html
28•vntok•2d ago•5 comments

Turn off Apple Intelligence on macOS 27 and get its disk space back

https://github.com/omlahore/RemoveMacAI
388•privacyisntdead•6h ago•247 comments

A browser-native classic Visual Basic VB6 IDE

https://wieslawsoltes.github.io/VB6/
96•wiso•7h ago•39 comments

Self-hosted HTTP tunnels with SSH and Nginx

https://vincent.bernat.ch/en/blog/2026-http-over-ssh
69•renehsz•3h ago•19 comments

Improper redaction reveals Google Data Center water and electricity usage

https://www.1011now.com/2026/09/30/more-questions-than-answers-about-lincolns-google-data-center-...
256•sensanaty•6h ago•369 comments

Homa: The end of TCP for AI clusters [video]

https://www.youtube.com/watch?v=eZ8WWZzoaR0
58•signa11•6h ago•22 comments

Tell HN: Bob Cringely has died

822•paveworld•1d ago•178 comments

Quantitative Finance with OCaml

https://qcaml.com/index.html
5•leonry•2d ago•0 comments

Xray-core concealed a certificate verification bypass vulnerability

https://github.com/net4people/bbs/issues/672
55•timbill•8h ago•2 comments

Show HN: Glashütte Trash Clock – A 30-minute pendulum clock made from trash

https://niklasroy.com/gtc/
168•r0r0•2d ago•24 comments

How to scale intent, quality, and artistry with AI [video]

https://www.youtube.com/watch?v=GLvFTMtw4Jk
53•simonjgreen•17h ago•16 comments

Results from the ASIC puzzle

https://blog.janestreet.com/asic-puzzle-results/
74•eru•2d ago•37 comments

Incentives in Academic Research

https://www.msoos.org/2026/10/incentives-in-academic-research/
40•zero_k•8h ago•32 comments

A map of every lighthouse

https://mapped.earth/lighthouses/world
163•karakoram•2d ago•74 comments

Show HN: AI search for every photo and every frame of video on macOS

https://github.com/allenv0/SCM
141•allenleee•17h ago•66 comments

What is going on with ceiling fans

https://mcmansionhell.com/post/829127919552151552/what-is-going-on-with-ceiling-fans
224•colinprince•3d ago•186 comments

Bill Draper has died

https://www.nytimes.com/2026/09/30/technology/william-draper-dead.html
83•bookofjoe•14h ago•20 comments

Why don't more developers “use the platform”?

https://nolanlawson.com/2026/10/03/why-dont-more-developers-use-the-platform/
279•vinhnx•22h ago•289 comments

Demystifying Tufte's data-ink ratio

https://tuftesrazor.scienceux.org/
10•s4074433•2d ago•3 comments

Page Table Memory Consumption

https://frn.sh/pagetables/
45•shellpipe•4d ago•9 comments

cp: -r or -R?

https://movq.de/blog/postings/2026-09-30/0/POSTING-en.html
96•zdw•4d ago•101 comments

Surely you have ultra-wideband radios on your bins too?

https://sjg.io/writing/binrange-have-you-actually-put-the-bins-out/
134•simonjgreen•1d ago•73 comments

ArtCraft Apps – open-source Adobe compatible suite written in Rust

https://getartcraft.com/apps
52•aghuang•3h ago•45 comments

Interview with Chicken Scheme Maintainer Sjamaan/Peter Bex

https://alexalejandre.com/interviews/peter-bex/
14•veqq•2d ago•3 comments

Treachery in the Rodin Museum 3D scan verdict

https://cosmowenman.substack.com/p/rodin-museum-3d-scan-verdict
315•CosmoWenman•1d ago•189 comments

'Neanderthals Among Us' review

https://www.historytoday.com/archive/review/neanderthals-among-us-peter-sahlins-review
56•pepys•1d ago•50 comments