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?

Borland Turbo Basic

https://dosdays.co.uk/topics/Software/borland_turbo_basic.php
73•sssilver•1h ago•37 comments

Web Search API

https://developers.cloudflare.com/changelog/post/2026-10-02-introducing-web-search-api/
263•tosh•6h ago•129 comments

Making a GTK application in Haskell, part 1

https://floreal.tech/blog/2026/making-a-gtk-app-in-haskell-part-1/
48•Vosporos•2h ago•3 comments

Denmark Data Breach Exposes 8.8M People's Personal Data

https://www.cpr.dk/cpr-nyt/nyhedsarkiv/2026/okt/omfattende-uautoriseret-adgang-til-borgeres-cpr-o...
359•clan•8h ago•262 comments

Mold Linker Version 3.0.0 Release – Rewritten in Rust

https://github.com/rui314/mold/releases/tag/v3.0.0
103•roflcopter69•5h ago•42 comments

The technology to eradicate mosquito-borne disease exists

https://worksinprogress.co/issue/mosquitoes-are-a-choice/
135•benbreen•23h ago•106 comments

The future of independence is interdependence

https://onlys.ky/independence-is-interdependence/
17•eustoria•1h ago•9 comments

Pixel 11 doesn't yet meet the GrapheneOS security standards and may be skipped

https://discuss.grapheneos.org/d/41564-pixel-11-doesnt-yet-meet-the-grapheneos-security-standards...
283•finnlab•4h ago•154 comments

Huawei and Qualcomm Announce Broad Patent License Agreement

https://www.huawei.com/en/news/2026/10/qualcomm-broad-patent-agreement
131•0xedb•9h ago•79 comments

Type Safe Generic Data Structures in C

https://danielchasehooper.com/posts/typechecked-generic-c-data-structures/
104•AlexeyBrin•2d ago•60 comments

Differences Between `Foldl` and `Foldr`

https://blog.haskell.org/foldl-and-foldr/
87•signa11•4d ago•15 comments

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

https://github.com/Niko1221/Strata
892•snehesht•1d ago•402 comments

Beating the Compiler

https://www.mattkeeter.com/blog/2024-07-12-interpreter/
23•andsoitis•4d ago•11 comments

Martian chaos terrain

https://en.wikipedia.org/wiki/Martian_chaos_terrain
51•tiagod•3d ago•10 comments

In the wake of Tippett Studios’ closure, a digital archive appears online

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

Germany’s RobCo hits $1B valuation

https://techfundingnews.com/europes-new-robotics-unicorn-germanys-robco-hits-1b-valuation/
296•dachworker•5h ago•276 comments

Picard 3.0

https://blog.metabrainz.org/2026/10/04/picard-3-0-released/
52•Tomte•3h ago•26 comments

2026 Nobel Prize in Physiology or Medicine: Deisseroth, Hegemann, Nagel

https://www.nobelprize.org/prizes/medicine/2026/summary/
30•lode•7h ago•29 comments

We ported the original Doom to SQL

https://cedardb.com/blog/sqldoom/
257•Vaslo•1d ago•39 comments

Mystery Function

https://codeset.ai/function
26•andre15silva•3d ago•2 comments

A browser-native classic Visual Basic VB6 IDE

https://wieslawsoltes.github.io/VB6/
353•wiso•22h ago•117 comments

ExplainDB: A Database System Built for Understandability

https://github.com/explaindb/explaindb
57•pykello•3d ago•5 comments

The Tao of Backup

http://www.taobackup.com/index.html
227•vntok•3d ago•89 comments

Show HN: Minigraf – An embedded, bi-temporal graph database in Rust

https://github.com/project-minigraf/minigraf
21•adityamukho•5h ago•5 comments

Our approach to EU text provenance rules

https://openai.com/index/eu-text-provenance/
6•tosh•1h ago•0 comments

The Era of Software Quality, or the Era of Ostriches?

https://blogs.gnome.org/mcatanzaro/2026/10/02/the-era-of-software-quality-or-the-era-of-ostriches/
59•birdculture•4h ago•36 comments

The Philadelphia Inquirer built Scrape, an AI tool to surface hyperlocal news

https://www.lenfestinstitute.org/solutions-resources/philadelphia-inquirer-scrape-ai-hyperlocal-n...
63•giuliomagnifico•3d ago•23 comments

Infidel goes wild

https://blog.zarfhome.com/2026/10/infidel-goes-wild
169•tobr•2d ago•36 comments

Apple and a Hacker's Future

https://stratechery.com/2026/apple-and-a-hackers-future/
150•maguay•7h ago•143 comments

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

https://github.com/omlahore/RemoveMacAI
715•privacyisntdead•21h ago•476 comments