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?

The Website Specification

https://specification.website/
94•k1m•1h ago•30 comments

Domain expertise has always been the real moat

https://www.brethorsting.com/blog/2026/05/domain-expertise-has-always-been-the-real-moat/
555•aaronbrethorst•12h ago•322 comments

Show HN: Breathe CLI – Paced resonance breathing in the macOS terminal

https://github.com/marekkowalczyk/breathe-cli
15•marekkowalczyk•12h ago•1 comments

A Gentle Introduction to Lattice-Based Cryptography [pdf]

https://cryptography101.ca/wp-content/uploads/lattice-based-cryptography.pdf
76•jayhoon•2d ago•2 comments

Shantell Sans (2023)

https://shantellsans.com/process
229•aleda145•10h ago•23 comments

Avian Visitors

https://theodore.net/projects/AvianVisitors/
28•fdb•2h ago•1 comments

Associative learning turns DEET from aversive to appetitive in Aedes aegypti

https://journals.biologists.com/jeb/article/229/10/jeb251935/371741/Associative-learning-switches...
31•croes•2d ago•11 comments

Ahoy, DECmate II the little PDP-8 that could

http://oldvcr.blogspot.com/2026/05/ahoy-decmate-ii-little-pdp-8-that-could.html
31•TMWNN•4h ago•3 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#i-found-a-seashell-in-th...
316•Hawzen•2d ago•80 comments

Telli (YC F24) is hiring in engineering, design, and GTM [Berlin, on-site]

https://hi.telli.com/join-us
1•sebselassie•1h ago

One year of Roto, a compiled scripting language for Rust

https://blog.nlnetlabs.nl/one-year-of-roto-the-compiled-scripting-language-for-rust/
18•Hasnep•1d ago•0 comments

A pictorial introduction to differential geometry (2017)

https://arxiv.org/abs/1709.08492
25•ricudis•3h ago•0 comments

The AV2 Video Standard Has Released (Final v1.0 Specification)

https://av2.aomedia.org
182•ksec•11h ago•67 comments

Microsoft Office 2019 and 2021 for Mac view-only conversion

https://consumerrights.wiki/w/Microsoft_Office_2019_and_2021_for_Mac_view-only_conversion_(2026)
827•antipurist•9h ago•293 comments

Accenture to acquire Ookla

https://newsroom.accenture.com/news/2026/accenture-to-acquire-ookla-to-strengthen-network-intelli...
278•Garbage•16h ago•143 comments

Racket v9.2

https://blog.racket-lang.org/2026/05/racket-v9-2.html
106•spdegabrielle•2d ago•14 comments

Please Do Not Vibe Fuck Up This Software

https://github.com/RsyncProject/rsync/issues/929
162•justdotJS•5h ago•68 comments

Mechanical Pencil: An illustrated celebration of the engineering around us

https://mechanical-pencil.com/
68•Muhammad523•8h ago•7 comments

Openrsync: An implementation of rsync, by the OpenBSD team

https://github.com/kristapsdz/openrsync
387•sph•21h ago•151 comments

Voxel Space (2017)

https://s-macke.github.io/VoxelSpace/
283•davikr•18h ago•58 comments

Zig ELF Linker Improvements Devlog

https://ziglang.org/devlog/2026/#2026-05-30
201•kristoff_it•15h ago•67 comments

wolfSSL releases a new product; wolfCOSE a zero alloc C embbedded COSE stack

https://github.com/wolfSSL/wolfCOSE
89•aidangarske•12h ago•17 comments

Jef Raskin, the Visionary Behind the Mac (2013)

https://lowendmac.com/2013/jef-raskin-the-visionary-behind-the-mac/
100•tylerdane•13h ago•45 comments

Cheese Paper: a text editor specifically designed for writing

https://brie.gay/cheese-paper/
102•sohkamyung•9h ago•24 comments

Parallel Reconstruction of Lawful TLS Wiretapping

https://remyhax.xyz/posts/reproducing-lawful-tls-wiretapping/
94•jerrythegerbil•13h ago•41 comments

Show HN: Komi-learn – continuous memory and self-improvement for coding agents

https://github.com/kurikomi-labs/komi-learn
13•rainxchzed•3h ago•2 comments

OpenRouter raises $113M Series B

https://openrouter.ai/announcements/series-b
413•freeCandy•15h ago•198 comments

Pandoc Templates

https://pandoc-templates.org/
392•ankitg12•22h ago•50 comments

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

https://ajin.im/is/building/omen.ops/
117•poppypetalmask•13h ago•22 comments

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

https://www.righto.com/2026/05/microcode-inside-intel-8087-floating.html
113•pwg•15h ago•19 comments