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?

Wine Ported to OpenBSD

https://marc.info/?l=openbsd-ports&m=179236125692175
180•iamnothere•2h ago•44 comments

Timestral: Mistral release time-series foundation models

https://mistral.ai/news/timestral/
313•groar•6h ago•50 comments

Linux 7.3

https://lwn.net/Articles/1101143/
484•cjd8•8h ago•209 comments

Alternatives to Animal Testing Are Finally Taking Off

https://spectrum.ieee.org/alternatives-to-animal-testing
143•rbanffy•4h ago•41 comments

Let's Encrypt is adding two additional remote perspectives for domain validation

https://community.letsencrypt.org/t/lets-encrypt-is-adding-two-additional-remote-perspectives-for...
143•gslin•5h ago•43 comments

It's still OK to enjoy programming

https://chriskiehl.com/article/it-is-still-ok-to-enjoy-programming
37•goostavos•1d ago•21 comments

Show HN: KiviDB, a faster Redis-compatible memory database and vector cache

https://github.com/kividbio/kividb
31•murtazayusuf•2h ago•10 comments

Launch HN: Laminar (YC S24) – We trained a model to catch silent agent failures

1•skull8888888•1m ago•0 comments

ESA's Hera Will View Asteroid Scars from DART's Strike

https://spectrum.ieee.org/esa-hera-dimorphos-rendezvous
49•rbanffy•4h ago•1 comments

Ontology-Driven Observability: Building an End-to-End Knowledge Graph at Netflix

https://netflixtechblog.com/ontology-driven-observability-building-an-end-to-end-knowledge-graph-...
8•tosh•51m ago•0 comments

A death, a plagiarism scandal and a quest for revenge: the tale of Otto Z

https://www.theguardian.com/news/ng-interactive/2026/oct/08/a-death-a-plagiarism-scandal-and-a-qu...
24•Hooke•2d ago•2 comments

Gdynia and the Dream of a Maritime Poland

https://engelsbergideas.com/notebook/gdynia-and-the-dream-of-a-maritime-poland/
77•lermontov•2d ago•20 comments

Show HN: Qwen3-4B with the AI writing tics trained out

https://100toolkit.com/blog/deslop-model/
98•erikkannike•3h ago•78 comments

Hybrid Reasoning Agents: LLM agents that think in latent space, act through text

https://arxiv.org/abs/2610.18861
479•allinonai•19h ago•226 comments

Beyond the Glass

https://longreads.com/2026/10/15/mother-museum-skulls-grief-agni/
13•Petiver•3d ago•0 comments

There's never been a better time to go into math (by: 3blue1brown) [video]

https://www.youtube.com/watch?v=LKrwhjOI8Nc
487•mdp2021•1d ago•654 comments

If you don't run your own LLM proxy, how do you know whats going on?

https://jrdsgl.com/if-you-dont-run-your-own-llm-proxy-how-the-fuck-do-you-even-know-whats-going-on/
264•amrrs•18h ago•180 comments

William Gibson and the trademarking of cyberspace

https://colo.to/cyberspace.html
243•Eric_Gullichsen•16h ago•113 comments

How to Train Your Robot

https://www.construction-physics.com/p/how-to-train-your-robot
115•crescit_eundo•4d ago•36 comments

Rabbits were a medieval royal luxury in England until the Black Death

https://phys.org/news/2026-10-rabbits-medieval-royal-luxury-england.html
122•samizdis•2d ago•119 comments

Someone behind the software

https://karrisaarinen.com/posts/someone-behind-the-software/
519•tosh•23h ago•186 comments

Dogs seem to agree with humans that 'bouba' is round and 'kiki' is spiky

https://www.sciencealert.com/dogs-seem-to-agree-with-humans-that-bouba-is-round-and-kiki-is-spiky
316•gmays•1d ago•186 comments

Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling

https://crystl.dev/guides/tmux-for-ai-agents/
115•ankitg12•10h ago•79 comments

Laptop Based on 6502 CPU

https://www.maddox.pro/?p=448
182•nanochess•3d ago•92 comments

RepRapMicron

https://github.com/VikOlliver/RepRapMicron/wiki
434•RobotToaster•1d ago•68 comments

How Quickly Can the DoD Rebuild and Recast the Munitions Industrial Base?

https://www.csis.org/analysis/how-quickly-can-dod-rebuild-and-recast-munitions-industrial-base
119•gmays•16h ago•184 comments

The DNS Museum

https://dns.museum
120•zdw•2d ago•15 comments

A hacker broke into John Deere and SharkNinja with an army of AI agents

https://www.theverge.com/ai-artificial-intelligence/1013643/ai-agents-hack-john-deere-shark-ninja...
16•dkobia•1h ago•1 comments

Harness2 by Google Research – Recursive Agent Harnessing

https://github.com/google-research/harness2
55•irthomasthomas•4h ago•13 comments

Superlite: A Faster Alternatie to Superpowers

https://contextfirst.blog/superlite-hand-an-agent-a-spec/
133•iheatuchriswogu•14h ago•61 comments