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?

Hacker wipes Romania's land registry database

https://news.risky.biz/risky-bulletin-hacker-wipes-romanias-entire-land-registry-database/
322•speckx•3h ago•185 comments

China's open-weights AI strategy is winning

https://werd.io/american-ai-is-locked-down-and-proprietary-its-losing/
171•benwerd•2h ago•162 comments

Corners Don't Look Like That: Regarding Screenspace Ambient Occlusion (2012)

https://nothings.org/gamedev/ssao/
93•firephox•1h ago•29 comments

We're Squandering LEDs' Potential to Save Our Night Skies

https://spectrum.ieee.org/led-light-pollution
122•defrost•3h ago•76 comments

Airport Simulator

https://airport.apunen.com/
381•apunen•6h ago•97 comments

Jaron Lanier: there is no AI (2023)

https://www.newyorker.com/science/annals-of-artificial-intelligence/there-is-no-ai
25•simonebrunozzi•1h ago•39 comments

Perfection Is Not Over-Engineering

https://var0.xyz/posts/perfection-is-not-over-engineering.html
79•var0xyz•2h ago•45 comments

I Tracked 997 Chrome Extensions That Changed Their Titles

https://extensionranker.com/blog/chrome-extension-title-changes-rankings
28•Joseph_Hu•1h ago•2 comments

Firefox Merges Support for Vulkan Video Decoding

https://github.com/search
95•DemiGuru•3h ago•20 comments

Exploit brokers pay $500k for WordPress RCEs. I found one with GPT5.6 and $25

https://slcyber.io/research-center/exploit-brokers-pay-500000-for-a-wordpress-rce-i-found-one-wit...
322•infosecau•8h ago•168 comments

Kimi K3, Qwen 3.8, and Anthropic's (Potential) Unravelling

https://www.emergingtrajectories.com/lh/frontier-lab-economics/
102•cl42•1h ago•103 comments

Shinjuku Station in 3D

https://satoshi7190.github.io/Shinjuku-indoor-threejs-demo/
40•Gecko4072•3h ago•10 comments

Launch HN: Bloomy (YC S26) – AI-powered mastery learning for K-12

2•alexsouthmayd•24m ago•9 comments

The Voice of Google

https://www.newyorker.com/culture/the-weekend-essay/the-voice-of-google
23•littlexsparkee•1h ago•9 comments

The EU is about to sell our most sensitive data to the US for visa-free travel

https://edri.org/our-work/the-eu-is-about-to-sell-our-most-sensitive-data-to-the-us-for-visa-free...
338•rapnie•4h ago•189 comments

NYC Subway Signals: A Complete Guide

https://www.nycsubway.org/wiki/Subway_Signals%3A_A_Complete_Guide
15•at1as•1h ago•5 comments

Over 30% of new ArXiv submissions now read as AI-written

https://unslop.run/blog/measuring-ai-writing-on-arxiv
3•dopamine_daddy•19m ago•1 comments

Satan's 19th-Century Bank Note (2017)

https://www.historytoday.com/miscellanies/satans-19th-century-bank-note
32•Caiero•15h ago•1 comments

Inertia-1: An Open Exploration to a Unified Motion Foundation Model

https://yang-ai-lab.github.io/Inertia-1/
32•hasheddan•3h ago•1 comments

Show HN: Wheesper – Start an anonymous discussion with a link

https://wheesper.com/
10•whatdoyouthink2•1h ago•14 comments

Soofi – Sovereign Open Source Foundation Models

https://www.soofi.info/
21•Fake4d•4h ago•8 comments

ECC and DDR5

https://etbe.coker.com.au/2026/07/19/ecc-ddr5/
74•zdw•1d ago•61 comments

Tested Kimi K3 for Coding

https://www.dotnetperls.com/2026_7_18_tested-kimi-k3-coding
20•speckx•2h ago•5 comments

Annoying and alarming things about OpenCode

https://wren.wtf/shower-thoughts/stop-using-opencode/
301•alekq•4h ago•206 comments

Controlling Reasoning Effort in LLMs

https://magazine.sebastianraschka.com/p/controlling-reasoning-effort-in-llms
9•ibobev•2h ago•0 comments

Czechia moves to ban mobile phones in schools from September 2027

https://www.expats.cz/czech-news/article/czech-news-in-brief-for-july-20-2026-monday-top-afternoo...
5•Markoff•55m ago•1 comments

Sensing warm and cool: how the body detects temperature changes

https://news.uq.edu.au/2026-07-sensing-warm-and-cool-how-body-detects-temperature-changes
32•hhs•2d ago•5 comments

Moonshine: Lets you stream games from your PC to any device running Moonlight

https://github.com/hgaiser/moonshine
304•wertyk•16h ago•124 comments

What does the Riemann zeta function have to do with the distribution of primes?

https://hidden-phenomena.com/articles/rh
80•mb1699•2d ago•16 comments

I Stopped "Creating Content"

https://refactoringenglish.com/blog/why-i-stopped-creating-content/
6•mtlynch•1h ago•3 comments