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?

YouTube to automatically label AI-generated videos

https://blog.youtube/news-and-events/improving-ai-labels-viewers-creators/
452•nopg•4h ago•263 comments

I think Anthropic and OpenAI have found product-market fit

https://simonwillison.net/2026/May/27/product-market-fit/
590•simonw•7h ago•719 comments

Internet traffic in Iran increasing

https://radar.cloudflare.com/traffic/ir?dateRange=28d
40•Cider9986•1h ago•22 comments

What Apple and Google are doing to push notifications

https://www.jacquescorbytuech.com/writing/what-apple-and-google-are-doing-your-push-notifications
149•iamacyborg•4h ago•147 comments

SimCity 3k in 4k (2025)

https://www.thran.uk/writ/hdid/2025/12/simcity-3k-in-4k.html
256•speckx•6h ago•96 comments

Rust (and Slint) on a Jailbroken Kindle

https://sverre.me/blog/rust-on-kindle/
83•homarp•4h ago•10 comments

Warm up your MacBook (2019)

https://z3ugma.github.io/2019/11/18/warm-up-your-macbook/
40•kristianp•3h ago•35 comments

Pelica (YC P25) Is Hiring

https://www.ycombinator.com/companies/pelica/jobs/MDeC49o-machine-learning-engineer
1•lalitkundu•1h ago

DuckDuckGo search saw 28% more visits after Google said people love AI mode

https://www.pcgamer.com/hardware/duckduckgos-ai-free-search-saw-nearly-28-percent-more-visits-in-...
627•HelloUsername•7h ago•314 comments

On Labubu and the Hyperreal

https://2earth.github.io/website/20260525.html
60•2earth•4h ago•62 comments

A New Typst Template for Pandoc

https://imaginarytext.ca/posts/2025/typst-templates-for-pandoc/
12•ankitg12•1d ago•0 comments

Interleaved Deltas

https://mmapped.blog/posts/51-interleaved-deltas
20•surprisetalk•1d ago•0 comments

Canada to order military plane fleet from Sweden in shift from US suppliers

https://www.theguardian.com/world/2026/may/27/canada-sweden-saab-globaleye-aircraft
373•tosh•7h ago•270 comments

Last.fm is now independent

https://support.last.fm/t/last-fm-is-now-independent/118591
603•twistslider•8h ago•167 comments

Incident with Pull Requests, Issues, Git Operations and API Requests

https://www.githubstatus.com/incidents/xy1tt3hs572m
252•maxnoe•11h ago•187 comments

Go: Support for Generic Methods

https://github.com/golang/go/issues/77273
174•f311a•14h ago•134 comments

I'm Getting into Mesh Networks (Meshtastic, MeshCore, and Reticulum)

https://www.jonaharagon.com/posts/im-getting-into-mesh-networks-meshtastic-meshcore-and-reticulum/
27•Panda_•4h ago•6 comments

Mini Micro Fantasy Computer

https://miniscript.org/MiniMicro/index.html#about
227•nicoloren•14h ago•80 comments

Gemini, Gophers, and Fingers. Oh My Alternative Internets Beyond HTTPS

https://brennan.day/gemini-gophers-and-fingers-oh-my-alternative-internets-beyond-https/
77•ChrisArchitect•6h ago•36 comments

Claude Code as a Daily Driver: Claude.md, Skills, Subagents, Plugins, and MCPs

https://arps18.github.io/posts/claude-code-mastery/
348•arps18•18h ago•220 comments

Show HN: Open-Source AI Racing Harness

https://www.elodin.systems/post/elodin-ai-grand-prix-race-sim-harness
10•danAtElodin•3h ago•4 comments

Tech CEOs are apparently suffering from AI psychosis

https://techcrunch.com/2026/05/27/tech-ceos-are-apparently-suffering-from-ai-psychosis/
526•IAmGraydon•8h ago•273 comments

Freediving, Embodiment and Humanity

https://tracesofhumanity.org/freediving-embodiment-and-humanity/
24•transpute•2d ago•12 comments

What Is a Direct Attach Copper (DAC) Cable? (2021)

https://www.servethehome.com/what-is-a-direct-attach-copper-dac-cable/
90•teleforce•2d ago•74 comments

Human Bottlenecks

https://borretti.me/article/human-bottlenecks
67•zdw•3d ago•19 comments

Stress disrupts hippocampal integration of overlapping events, memory inference

https://www.science.org/doi/10.1126/sciadv.aea5496?user_id=66c4bf745d78644b3aa57b08
64•gmays•7h ago•12 comments

Private equity bought America's essential services

https://rubbishtalk.com/economy/how-private-equity-bought-americas-essential-services/
411•NoRagrets•12h ago•475 comments

Matrix Multiplications on GPUs Run Faster When Given “Predictable” Data (2024)

https://www.thonking.ai/p/strangely-matrix-multiplications
148•tosh•4d ago•42 comments

Dimensions of Geiger-Muller tube holder on GGreg20_V3 Geiger counter PCB (2025)

https://iot-devices.com.ua/en/ggreg20-v3-j305-tube-mounting-dimensions/
6•iotdevicesdev•2d ago•0 comments

Fully in-browser container builds

https://ochagavia.nl/blog/fully-in-browser-container-builds/
43•wofo•2d ago•23 comments