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•8mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•8mo 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•8mo 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•8mo 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•8mo 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•8mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•8mo ago
What are the biggest use cases of GPU accelerated sorting?

A decentralized peer-to-peer messaging application that operates over Bluetooth

https://bitchat.free/
109•no_creativity_•2h ago•46 comments

MTOTP: Wouldn't it be nice if you were the 2FA device?

https://github.com/VBranimir/mTOTP/tree/develop
31•brna-2•1h ago•21 comments

Gaussian Splatting – A$AP Rocky "Helicopter" music video

https://radiancefields.com/a-ap-rocky-releases-helicopter-music-video-featuring-gaussian-splatting
615•ChrisArchitect•15h ago•188 comments

Provide agents with automated feedback

https://banay.me/dont-waste-your-backpressure/
128•ghuntley•1d ago•56 comments

Dead Internet Theory

https://kudmitry.com/articles/dead-internet-theory/
296•skwee357•13h ago•347 comments

Flux 2 Klein pure C inference

https://github.com/antirez/flux2.c
328•antirez•15h ago•118 comments

Show HN: I quit coding years ago. AI brought me back

https://calquio.com/finance/compound-interest
112•ivcatcher•8h ago•88 comments

A Social Filesystem

https://overreacted.io/a-social-filesystem/
395•icy•1d ago•159 comments

Fil-Qt: A Qt Base build with Fil-C experience

https://git.qt.io/cradam/fil-qt
90•pjmlp•2d ago•49 comments

Show HN: AWS-doctor – A terminal-based AWS health check and cost optimizer in Go

https://github.com/elC0mpa/aws-doctor
25•elC0mpa•4h ago•10 comments

Self Sanitizing Door Handle

https://www.jamesdysonaward.org/en-US/2019/project/self-sanitizing-door-handle/
5•rendaw•3d ago•3 comments

The Code-Only Agent

https://rijnard.com/blog/the-code-only-agent
66•emersonmacro•6h ago•31 comments

AVX-512: First Impressions on Performance and Programmability

https://shihab-shahriar.github.io//blog/2026/AVX-512-First-Impressions-on-Performance-and-Program...
60•shihab•5d ago•21 comments

Gladys West's vital contributions to GPS technology

https://en.wikipedia.org/wiki/Gladys_West
16•hackernj•2d ago•1 comments

Gas Town Decoded

https://www.alilleybrinker.com/mini/gas-town-decoded/
129•alilleybrinker•4d ago•110 comments

Show HN: Pdfwithlove – PDF tools that run 100% locally (no uploads, no back end)

https://pdfwithlove.netlify.app
149•pratik227•4h ago•95 comments

Simulating the Ladybug Clock Puzzle

https://austinhenley.com/blog/ladybugclock.html
24•azhenley•1d ago•4 comments

Astrophotography visibility plotting and planning tool

https://airmass.org/
28•NKosmatos•3d ago•5 comments

Command-line Tools can be 235x Faster than your Hadoop Cluster (2014)

https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html
371•tosh•1d ago•241 comments

Show HN: Dock – Slack minus the bloat, tax, and 90-day memory loss

https://getdock.io/
130•yadavrh•12h ago•111 comments

Using proxies to hide secrets from Claude Code

https://www.joinformal.com/blog/using-proxies-to-hide-secrets-from-claude-code/
77•drewgregory•5d ago•24 comments

High-speed train collision in Spain kills at least 39

https://www.bbc.com/news/articles/cedw6ylpynyo
128•akyuu•9h ago•99 comments

Experiments with Kafka's head-of-line blocking (2023)

https://www.artur-rodrigues.com/tech/2023/03/21/kafka-head-of-line-blocking.html
11•teleforce•5d ago•0 comments

Show HN: Beats, a web-based drum machine

https://beats.lasagna.pizza
84•kinduff•12h ago•24 comments

How to wrangle non-deterministic AI outputs into conventional software? (2025)

https://www.domainlanguage.com/articles/ai-components-deterministic-system/
34•druther•3d ago•26 comments

Police Invested Millions in Shadowy Phone-Tracking Software Won't Say How Used

https://www.texasobserver.org/texas-police-invest-tangles-sheriff-surveillance/
310•nobody9999•12h ago•88 comments

Sins of the Children

https://asteriskmag.com/issues/07/sins-of-the-children
146•maxall4•16h ago•70 comments

Show HN: Lume 0.2 – Build and Run macOS VMs with unattended setup

https://cua.ai/docs/lume/guide/getting-started/introduction
123•frabonacci•15h ago•34 comments

Poking holes into bytecode with peephole optimisations

https://xnacly.me/posts/2026/purple-garden-first-optimisations/
24•xnacly•4d ago•0 comments

ASCII characters are not pixels: a deep dive into ASCII rendering

https://alexharri.com/blog/ascii-rendering
1247•alexharri•1d ago•133 comments