frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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?

OpenRouter raises $113M Series B

https://openrouter.ai/announcements/series-b
218•freeCandy•3h ago•95 comments

Zig ELF Linker Improvements Devlog

https://ziglang.org/devlog/2026/#2026-05-30
113•kristoff_it•3h ago•14 comments

Show HN: 500 years of Joseon court omens as an observability dashboard

https://ajin.im/is/building/omen.ops/
27•poppypetalmask•1h ago•1 comments

I found a seashell in the middle of the desert

https://github.com/Hawzen/I-found-a-seashell-in-the-middle-of-the-desert
33•Hawzen•1d ago•2 comments

Voxel Space (2017)

https://s-macke.github.io/VoxelSpace/
210•davikr•6h ago•47 comments

Hormuz crisis side effect: a sharp rise in container shipping rates

https://www.lloydslist.com/LL1157327/Hormuz-crisis-side-effect-a-sharp-rise-in-container-shipping...
89•mooreds•2h ago•42 comments

Microcode inside the Intel 8087 floating-point chip: register exchange

https://www.righto.com/2026/05/microcode-inside-intel-8087-floating.html
53•pwg•3h ago•12 comments

Parallel Reconstruction of Lawful TLS Wiretapping

https://remyhax.xyz/posts/reproducing-lawful-tls-wiretapping/
9•jerrythegerbil•43m ago•2 comments

Jef Raskin, the Visionary Behind the Mac (2013)

https://lowendmac.com/2013/jef-raskin-the-visionary-behind-the-mac/
9•tylerdane•48m ago•7 comments

Openrsync: An implementation of rsync, by the OpenBSD team

https://github.com/kristapsdz/openrsync
260•sph•9h ago•118 comments

Pandoc Templates

https://pandoc-templates.org/
323•ankitg12•10h ago•45 comments

EY Canada published a cybersecurity report and most citations were hallucinated

https://gptzero.me/investigations/ey
180•smartmic•1h ago•66 comments

Werner Herzog in conversation with Paul Cronin (2014)

https://fsgworkinprogress.com/2014/09/26/insignificant-bullets-evil-poachers-and-l-a-culture/
51•Michelangelo11•4h ago•17 comments

It Takes Two Neurons to Ride a Bicycle

https://fermatslibrary.com/s/it-takes-two-neurons-to-ride-a-bicycle#email-newsletter
75•malshe•4d ago•26 comments

Navier-Stokes fluid simulation explained with Godot game engine

https://myzopotamia.dev/navier-stokes-fluid-simulation-explained-with-godot
140•myzek•3d ago•22 comments

Downdetector and Speedtest sold to Accenture for $1.2B

https://www.theverge.com/tech/889234/downdetector-ookla-speedtest-sold-accenture
144•Garbage•4h ago•75 comments

IXI's autofocusing lenses are almost ready to replace multifocal glasses

https://www.engadget.com/wearables/ixis-autofocusing-lenses-multifocal-glasses-ces-2026-212608427...
125•amichail•3d ago•57 comments

Zig: Build System Reworked

https://ziglang.org/devlog/2026/#2026-05-26
299•tosh•11h ago•191 comments

We are constantly broadcasting emotional data

https://www.tonyrice.me/emotional-intelligence/
6•tonyrice•2h ago•0 comments

What Happened to the Locusts?

https://explosion-scratch.github.io/locusts/
176•explosion-s•4d ago•40 comments

Show HN: Helios – what plug-in solar could generate for any address in Britain

https://helios.southlondonscientific.com/
93•ruaraidh•9h ago•34 comments

Searching for Birds

https://SearchingForBirds.VisualCinnamon.com/
16•robin_reala•2d ago•1 comments

SQLite is all you need for durable workflows

https://obeli.sk/blog/sqlite-is-all-you-need-for-durable-workflows/
658•tomasol•1d ago•357 comments

Stateless Actors

https://www.massicotte.org/stateless-actors/
15•frizlab•1d ago•5 comments

Testing the WWI concrete ships and WWII concrete barges

https://thecretefleet.com/blog/f/testing-the-wwi-concrete-ships-and-wwii-concrete-barges
34•surprisetalk•1d ago•11 comments

Memory decline after menopause linked to loss of estrogen production in brain

https://news.northwestern.edu/stories/2026/05/memory-decline-after-menopause-linked-to-loss-of-es...
123•gmays•6h ago•57 comments

Thiel moves family to Milei's libertarian Argentina

https://www.ft.com/content/3d7ab893-1842-4c6c-a3d9-26871d79dde4
21•mmarian•1h ago•3 comments

Let's talk about EU Sovereignty (2025)

https://musings.martyn.berlin/lets-talk-about-eu-sovereignty
43•mooreds•2h ago•44 comments

Notes from the Mistral AI Now Summit

https://koenvangilst.nl/lab/mistral-ai-now-summit
447•vnglst•1d ago•196 comments

Macsurf, "modern" web browser for macOS 9

https://github.com/mplsllc/macsurf
104•gattilorenz•13h ago•30 comments