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?

Gemini 3.7 Flash

https://blog.google/innovation-and-ai/models-and-research/gemini-models/introducing-gemini-3-7-fl...
619•thisisauserid•8h ago•346 comments

Bluesky Protocol Services

https://atproto.com/blog/introducing-bluesky-protocol-services
64•danabramov•1h ago•14 comments

SparrowMap – Cameras that watch government vehicles

https://sparrowmap.com/
37•paulnpace•1h ago•6 comments

Accelerating GPT-5.6 Sol Ultrafast

https://www.cerebras.ai/blog/accelerating-gpt-5-6-sol-ultrafast-with-openai
423•pr337h4m•7h ago•174 comments

NP-Overrated

https://gruhn.me/blog/2026-08-13/
149•theanonymousone•5h ago•91 comments

DeepSeek Harness developer preview

https://deepseek.com/harness/en/
558•bjin•12h ago•243 comments

Understanding is the new bottleneck

https://www.geoffreylitt.com/2026/07/02/understanding-is-the-new-bottleneck
206•sebg•7h ago•112 comments

Mistral OCR 4.1

https://docs.mistral.ai/models/ocr-4-1
252•spelk•8h ago•99 comments

Donkey.bas is 45 Years Old – 131 line of Glory

https://donkeybas.com/
190•jkrauska•8h ago•79 comments

Choose Boring Technology (2015)

https://mcfunley.com/choose-boring-technology
254•tosh•8h ago•136 comments

Spaghettifying DRAM

https://github.com/xoreaxeaxeax/skitter-creek-bath-salts
496•matt_d•11h ago•138 comments

Hello, me. It's been a while

https://themech.net/2026/08/hello-me-its-been-a-while/
22•somesoftdev•7h ago•7 comments

Finite State Machines in Forth (1994)

https://www.forth.org/literature/noble.html
47•ofalkaed•5d ago•1 comments

Where did the old web go? We followed 657,607 links to find out

https://0.mk/blog/link-rot
133•tdx•8h ago•114 comments

How Gödel's Proof Works (2020)

https://www.quantamagazine.org/how-godels-proof-works-20200714/
71•tzury•6h ago•35 comments

How a device finds encrypted DNS by itself

https://blog.dundns.eu/posts/ddr-encrypted-dns-discovery/
15•majorchord•6d ago•4 comments

How Organizations Use AI: Evidence from ChatGPT [pdf]

https://cdn.openai.com/pdf/how-organizations-use-chatgpt.pdf
66•malshe•6h ago•37 comments

How Compaction Works in Pi

https://earendil.com/posts/compaction-in-pi/
106•tosh•7h ago•41 comments

How AI text watermarking works

https://declaude.org/watermarking/
76•padolsey•2h ago•46 comments

Single log line is 49KB+ (ext4) / 110KB+ (btrfs) of systemd-journald disk writes

https://github.com/systemd/systemd/issues/40262
147•ValdikSS•7h ago•95 comments

Nine PBS sues Iron Mountain over blocked access to archival data

https://current.org/2026/08/nine-pbs-sues-iron-mountain-over-blocked-access-to-archival-data/
246•vinayakborkar•12h ago•135 comments

An ambiguity in c89 which will never be fixed

https://sebsite.pw/w/20260810-c89ambiguity.html
31•runningmike•3d ago•6 comments

I want extern "fil-C"

https://domenkozar.com/2026/08/13/i-want-extern-fil-c/
22•domenkozar•8h ago•2 comments

Blog about things you don't understand yet

https://www.seangoedecke.com/blog-about-things-you-dont-understand-yet/
12•gfysfm•2h ago•1 comments

Kubernetes on Oxide: How customer needs shaped our integrations

https://oxide.computer/blog/kubernetes-on-oxide
156•stevehipwell•11h ago•69 comments

Smooth Move: Taming Trajectories with Polynomials

https://nick.zoic.org/art/smooth-move-taming-trajectories-with-polynomials/
22•lioeters•3d ago•1 comments

AI At Home Part 1: A Box Of Scraps

https://jdagostino.github.io/ai-pt1-box-o-scraps/index.html
91•timmmmmmay•9h ago•47 comments

Idol Mahjong Final Romance: A Slideshow Disguised as a Video Game

https://nicole.express/2026/more-like-idle-mahjong.html
40•nicole_express•4d ago•9 comments

Ordinary abundance

https://ordinaryabundance.com/
213•yen223•12h ago•117 comments

Launch HN: Bullet (YC S26) – A Faster Coding Agent

https://www.codewithbullet.com
84•adi1•17h ago•54 comments