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?

GitHub Actions down again today

https://www.githubstatus.com/?today
587•cebert•4h ago•299 comments

Don't Subscribe So Casually

https://thebestworstcase.substack.com/p/dont-subscribe-so-casually
50•shmublu•1h ago•40 comments

Launch HN: Minicor (YC P26) – Windows desktop automations at scale

https://www.minicor.com/
24•fchishtie•1h ago•7 comments

C64 Basic: Game Map Overhead "Camera View"

https://retrogamecoders.com/overhead-camera-view/
30•ibobev•2h ago•2 comments

Using AI to write better code more slowly

https://nolanlawson.com/2026/05/25/using-ai-to-write-better-code-more-slowly/
962•signa11•17h ago•360 comments

Outsourcing plus LocalAI will soon become more economical vs. Frontier labs

https://www.signalbloom.ai/posts/outsourcing-plus-localai-will-soon-become-more-economical-vs-fro...
112•GodelNumbering•4h ago•118 comments

Spain blocks prediction markets Polymarket, Kalshi over lack of gambling licence

https://www.reuters.com/business/spain-blocks-prediction-markets-polymarket-kalshi-over-lack-gamb...
192•thm•3h ago•90 comments

Germany news: Childfree adults to pay more for elder care

https://www.dw.com/en/germany-news-childfree-adults-to-pay-more-for-elder-care/live-77292208
32•randycupertino•27m ago•29 comments

The Ballad of TIGIT

https://www.owlposting.com/p/the-ballad-of-tigit
6•crescit_eundo•32m ago•0 comments

Opaque Types in Python

https://blog.glyph.im/2026/05/opaque-types-in-python.html
56•lumpa•3d ago•12 comments

DynIP – Dynamic DNS with RFC 2136, IPv6, DNSSEC, and BYOD

https://dynip.dev/
243•dynip•8h ago•96 comments

Netherlands blocks US takeover of vital digital supplier

https://www.politico.eu/article/netherlands-blocks-us-takeover-vital-digital-supplier/
299•vrganj•4h ago•115 comments

Language Models Need Sleep

https://arxiv.org/abs/2605.26099
6•juxtapose•43m ago•1 comments

Are we self-sovereign PKI yet?

https://buffrr.dev/blog/are-we-self-sovereign-pki-yet/
17•ca98am79•4d ago•2 comments

Eagle 3.1: Collaboration Between the EAGLE Team, vLLM Team, and TorchSpec Team

https://vllm.ai/blog/2026-05-26-eagle-3-1
52•berlianta•4h ago•17 comments

Don't put aria-label on generic elements like divs

https://www.matuzo.at/blog/2026/aria-label-generic-elements
67•cyanbane•4d ago•41 comments

Taking a walk may lead to more creativity than sitting, study finds (2014)

https://www.apa.org/news/press/releases/2014/04/creativity-walk
475•bilsbie•17h ago•194 comments

Phantasy Star IV – 1993 Developer Interviews

https://shmuplations.com/phantasystariv/
91•speckx•4d ago•37 comments

Incident with Actions and Pages

https://www.githubstatus.com/incidents/gnftqj9htp0g
61•hakube•5h ago•14 comments

How do you build a semiconductor company on something that's free?

https://www.siliconimist.com/p/the-open-source-silicon-business
47•johncole•4d ago•14 comments

How Shamir's Secret Sharing Works

https://ente.com/blog/how-shamirs-secret-sharing-works/
312•subract•17h ago•55 comments

'Incredible' milestone reached as Sweden becomes a smoke-free country

https://www.thelocal.se/20260525/incredible-milestone-reached-as-sweden-becomes-a-smoke-free-country
16•Teever•46m ago•16 comments

Ferrari Luce

https://www.ferrari.com/en-EN/auto/ferrari-luce
401•jumploops•19h ago•754 comments

Stockholm poised to become leading European geospatial intel player

https://www.intelligenceonline.com/europe-russia/2026/05/26/stockholm-poised-to-become-leading-eu...
17•alephnerd•1h ago•7 comments

A successful Japanese trial of a ramjet engine designed for Mach‑5 aircraft

https://www.bgr.com/2178211/japan-hypersonic-engine-ramjet-2-hour-flights-to-us/
216•rmason•20h ago•159 comments

What we lost when we stopped letting kids leave the front yard

https://stevemagness.substack.com/p/the-cost-of-safetyism
417•obscurette•1d ago•455 comments

Uber president says AI spending is getting 'harder to justify'

https://www.theverge.com/transportation/937116/uber-ai-investment-hard-to-justify
161•berlianta•6h ago•71 comments

Earthion: A New Mega Drive-Style Shoot-Em-Up

https://earthiongame.com/
119•MrBuddyCasino•12h ago•57 comments

Uber, Lyft drivers in Massachusetts form first US ride-share union

https://www.reuters.com/business/world-at-work/uber-lyft-drivers-massachusetts-form-first-us-ride...
8•onemoresoop•22m ago•0 comments

Exit IP VPN servers mitigation rollout

https://mullvad.net/en/help/exit-ip-vpn-servers-mitigation-rollout
405•Cider9986•22h ago•77 comments