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?

Pokémon Go Scans Trained the Navigation Tech for Military Drones

https://dronexl.co/2026/06/09/pokemon-go-scans-niantic-vantor-military-drone-navigation/
72•vrganj•58m ago•23 comments

AI agent runs amok in Fedora and elsewhere

https://lwn.net/SubscriberLink/1077035/c7e7c14fbd60fae9/
355•tanelpoder•7h ago•119 comments

Cybersecurity researchers aren't happy about the guardrails on Anthropic's Fable

https://techcrunch.com/2026/06/10/cybersecurity-researchers-arent-happy-about-the-guardrails-on-a...
390•speckx•14h ago•349 comments

πFS

https://github.com/philipl/pifs
705•helterskelter•12h ago•161 comments

Macaroni – a single HTML file messenger

https://github.com/vanyapr/makaroshki
15•snowflaxxx•1h ago•6 comments

Anthropic requires 30 day data retention for Fable and Mythos

https://support.claude.com/en/articles/15425996-data-retention-practices-for-mythos-class-models
377•lebovic•1d ago•171 comments

Reverse engineering the Creative Katana soundbar to control it from Linux

https://blog.nns.ee/2026/02/20/katana-v2x-re/
40•theanonymousone•3d ago•2 comments

Starfish by Peter Watts (1999)

https://www.rifters.com/real/STARFISH.htm#prelude
22•zetalyrae•2d ago•5 comments

Sequoyah’s syllabary created a written language for the Cherokee

https://www.smithsonianmag.com/innovation/man-created-written-language-cherokee-did-efficiently-e...
146•grahambargeron•9h ago•91 comments

I'm Eric Ries, author of "The Lean Startup" and new book "Incorruptible" – AMA

634•eries•16h ago•475 comments

Vacuum-Form Signage

https://bethmathews.substack.com/p/the-history-behind-the-signs-lighting
58•benbreen•1d ago•11 comments

The Road to the WASM Component Model 1.0

https://bytecodealliance.org/articles/the-road-to-component-model-1-0
68•emschwartz•2d ago•43 comments

Klondike Solitaire game for curses in 5k of C

https://nanochess.org/klondike_in_c.html
68•nanochess•2d ago•6 comments

PgDog is funded and coming to a database near you

https://pgdog.dev/blog/our-funding-announcement
438•levkk•17h ago•218 comments

How JPL keeps the 13-year-old Curiosity rover doing science

https://spectrum.ieee.org/curiosity-rover-jpl-mars-science
217•pseudolus•14h ago•58 comments

GeoLibre 1.0

https://geolibre.app/
219•jonbaer•14h ago•18 comments

L'Affaire Siloxane

https://mceglowski.substack.com/p/laffaire-siloxane
208•idlewords•2d ago•33 comments

CSS: Unavoidable Bad Parts

https://matklad.github.io/2026/06/04/css-unavoidable-bad-parts.html
62•surprisetalk•1d ago•16 comments

Show HN: Extend UI – open-source UI kit for modern document apps

https://www.extend.ai/ui
201•kbyatnal•15h ago•47 comments

What is it like to be a bat? (1974) [pdf]

https://www.sas.upenn.edu/~cavitch/pdf-library/Nagel_Bat.pdf
83•shadow28•11h ago•89 comments

Are insecure code completions in PyCharm a vulnerability?

https://sethmlarson.dev/are-insecure-code-completions-a-vulnerability
28•12_throw_away•6h ago•12 comments

World Capitals Voronoi

https://www.jasondavies.com/maps/voronoi/capitals/
75•vincnetas•2d ago•35 comments

Who's the smartest corvid?

https://thetyee.ca/Culture/2026/06/05/Whos-the-Smartest-Corvid/
97•NaOH•1d ago•85 comments

The Conductor Rewrite: What They Changed to Make It Fast

https://performance.dev/the-conductor-rewrite
5•Charlieholtz•1d ago•3 comments

Raspberry Pi 5 – 16GB RAM

https://www.adafruit.com/product/6125?src=raspberrypi
241•akman•11h ago•245 comments

Building an HTML-first site doubled our users overnight

https://mohkohn.co.uk/writing/html-first/
1091•edent•18h ago•494 comments

Show HN: HelixDB – A graph database built on object storage

https://github.com/HelixDB/helix-db/tree/main
116•GeorgeCurtis•15h ago•34 comments

Apache Burr: Build reliable AI agents and applications

https://burr.apache.org/
205•anhldbk•16h ago•99 comments

Validation, Docs, tests, and database schemas from one source of truth

https://github.com/justhamade/triadjs
4•justhamade•2h ago•2 comments

Deficient executive control in transformer attention

https://academic.oup.com/pnasnexus/article/5/6/pgag149/8698838
32•derbOac•8h ago•11 comments