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?

AI fuels more than half of cybercrime in Africa as scams surge – Interpol

https://www.africanews.com/2026/08/04/ai-fuels-more-than-half-of-cybercrime-in-africa-as-digital-...
93•bookofjoe•1h ago•46 comments

I am retiring from fulltime writing (& pseudonymity) to launch Guardian Angel

https://twitter.com/gwern/status/2084739205071343837
67•mattsterett•2h ago•25 comments

libexpat now funded by the City of Munich for up to 6 months

https://blog.hartwork.org/posts/libexpat-city-of-munich-open-source-sabbatical/
15•spyc•19m ago•0 comments

Mistral's Shieldstral: 3B open-weights model for multimodal moderation

https://mistral.ai/news/shieldstral/
278•riadsila•7h ago•69 comments

DuckDB – Data power tools for your laptop, now in Clojure (2023)

https://techascent.com/blog/just-ducking-around.html
20•sourdecor•1h ago•0 comments

We finally learned to center a div, then browsers added sidebars

https://seg6.space/posts/center-div/
17•seg6•1h ago•9 comments

Show HN: Simple algorithm and color space to generate diverse skin tones

https://toneyalexander.github.io/inclusive-color-space/
443•automatoney•8h ago•87 comments

In Memory of My Wife, Elise Cawley, with Thanks for 36 Wonderful Years

https://writings.stephenwolfram.com/2026/08/in-memory-of-my-wife-elise-cawley-1961-2026-with-than...
746•jdcampolargo•4h ago•43 comments

Waymo in Dallas

https://waymo.com/blog/shorts/dallas-open-to-all/
224•xnx•5h ago•272 comments

Pi's Minimalism Is Its Advantage

https://earendil.com/posts/pi-autoresearch-and-databricks/
7•luispa•1h ago•1 comments

Pass the Passkey: A Novel Attack Surface in Passwordless Authentication

https://unit42.paloaltonetworks.com/passwordless-authentication-security-risks/
3•jchanimal•15m ago•0 comments

FIPS 140-3 is not a security guarantee, and auditors know it

https://808bits.com/articles/fips-140-3-not-a-security-guarantee/
3•meehow•16m ago•0 comments

Video2NAND – Abusing video codecs for great computational power

https://sharedobject.blog/posts/vp8-combinatorial-logic/
18•firer•2d ago•2 comments

Third-party cyber evaluations involving OpenAI models

https://openai.com/index/third-party-cyber-evaluations-involving-openai-models/
26•glub•2h ago•2 comments

DeepSeek V4 Flash on a Single AMD MI300X

https://github.com/ryanzhou/deepseek-v4-flash-mi300x
361•zhoutong•13h ago•87 comments

Thanks FedEx, This Is Why We Keep Getting Phished (2024)

https://www.troyhunt.com/thanks-fedex-this-is-why-we-keep-getting-phished/
183•stymaar•2h ago•44 comments

Show HN: Maple-Preview – ternary 20B MoE running at 120 tok/s on a iPhone

https://deepgrove.ai/maple-preview
22•edwardbzhang•3h ago•7 comments

Oxide Computer raises $445M (SEC Form D)

https://www.sec.gov/Archives/edgar/data/1795071/000179507126000002/xslFormDX01/primary_doc.xml
147•depr•3h ago•60 comments

Truemetrics (YC S23) Is Hiring in Berlin – GTM Lead

https://www.ycombinator.com/companies/truemetrics/jobs/bIQQ7tP-founding-gtm-lead
1•truemetricsIngo•6h ago

Hop.earth – OpenStreetMap based car racing game

https://hop.earth/?server=lkhr7&route=fQ5nuu9R
74•faebi•5h ago•37 comments

Most tech revolutions made work worse for employees

https://www.thisandthat.chat/blog/most-tech-revolutions-made-work-worse-for-employees/
84•jreynar•8h ago•46 comments

Don't stop early: Case-folding source code at memory speed

https://github.blog/engineering/architecture-optimization/dont-stop-early-case-folding-source-cod...
41•sbulaev•4d ago•9 comments

Keyv and friends compromised in active Shai-Hulud supply chain attack

https://www.aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack
227•cimi_•12h ago•115 comments

When AI Benchmarks Plateau: A Systematic Study of Benchmark Saturation

https://arxiv.org/abs/2602.16763
71•doppp•7h ago•78 comments

The physics of Docker build caching

https://www.blacksmith.sh/blog/the-physics-of-docker-build-caching
13•piobio•4d ago•2 comments

Why some people mow a lawn better than others

https://pudding.cool/2026/06/mow/
160•carlos-menezes•5h ago•143 comments

Show HN: SIMD Viterbi Decoder in Rust

https://github.com/brian-armstrong/fec
3•brian-armstrong•1h ago•0 comments

Launch HN: EdotEnv (YC S26) – Quant Trading RL Envs to Teach LLMs Research

https://edotenv.com/
26•Mzzzzz•5h ago•20 comments

Xbox goes down. You can't play games you own on disc

https://birchtree.me/blog/xbox-goes-down-you-cant-play-games-you-own-on-disc/
564•surprisetalk•11h ago•608 comments

Apple says more ex-employees may have taken confidential data to OpenAI

https://techcrunch.com/2026/08/04/apple-says-more-ex-employees-may-have-taken-confidential-data-t...
323•thewebguyd•8h ago•243 comments