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?

New drug 'functionally cures' many hepatitis B virus infections

https://www.science.org/content/article/new-drug-functionally-cures-many-hepatitis-b-virus-infect...
93•gmays•3h ago•11 comments

APC–2 – A professional record cutter for producing original playback discs

https://teenage.engineering/products/apc-2
146•vthommeret•3h ago•74 comments

1k Data Breaches Later, the Disclosure Lag Is Worse

https://www.troyhunt.com/1000-data-breaches-later-the-disclosure-lag-is-worse-than-ever/
29•882542F3884314B•1h ago•5 comments

The Smallest Brain You Can Build: A Perceptron in Python

https://ranpara.net/posts/perceptron-explained-from-scratch/
113•DevarshRanpara•4h ago•15 comments

Building from zero after addiction, prison, and a felony

https://gavinray97.github.io/blog/building-from-zero-after-addiction-prison-felony
506•gavinray•10h ago•223 comments

Dopamine Fracking

https://igerman.cc/blog/dopamine-fracking/
30•igmn•2h ago•7 comments

DeepSeek V4 Pro beats GPT-5.5 Pro on precision

https://runtimewire.com/article/deepseek-v4-pro-beats-gpt-5-5-pro-on-precision
162•yogthos•3h ago•46 comments

1worldflag: A blue dot on a transparent background

https://1worldflag.com/
35•davidbarker•3h ago•17 comments

Algorithmic Monocultures in Hiring

https://algorithmichiring.github.io/
41•drchiu•2h ago•5 comments

A Matter Wi-Fi Light Bulb in Rust on the Raspberry Pi Pico 2 W

https://github.com/melastmohican/rust-rpico2-embassy-examples
78•melastmohican•4h ago•5 comments

Show HN: I Derived a Pancake

https://www.absurdlyoptimized.com/recipes/pancakes/
178•bkazez•2d ago•62 comments

Making peace with your unlived dreams (2023)

https://nik.art/making-peace-with-your-unlived-dreams/
192•herbertl•10h ago•88 comments

Show HN: NoSuggest – Watch YouTube without the recommendation algorithm

https://www.nosuggest.com/
11•VJ-2-108•4d ago•5 comments

A discovery about GCC's unidirectional rotation algorithm

https://devblogs.microsoft.com/oldnewthing/20260603-00/?p=112378
8•soheilpro•3d ago•2 comments

Man-Computer Symbiosis J. C. R. Licklider (1960)

https://groups.csail.mit.edu/medg/people/psz/Licklider.html
20•rballpug•3d ago•1 comments

How's Linear so fast? A technical breakdown

https://performance.dev/how-is-linear-so-fast-a-technical-breakdown
357•howToTestFE•9h ago•162 comments

Texas grid flags risks as data centers, crypto sites fail voltage tests

https://www.reuters.com/business/energy/texas-grid-flags-risks-data-centers-crypto-sites-fail-vol...
50•1vuio0pswjnm7•2h ago•36 comments

7.8 magnitude earthquake shakes part of southern Philippines. Tsunami possible

https://www.yahoo.com/news/weather-news/articles/as--philippines-earthquake-001322726.html
68•mikhael•3h ago•14 comments

What is the purpose of the lost+found folder in Linux and Unix? (2014)

https://unix.stackexchange.com/questions/18154/what-is-the-purpose-of-the-lostfound-folder-in-lin...
165•tosh•2d ago•55 comments

Do we fear the serializable isolation level more than we fear subtle bugs (2024)

https://blog.ydb.tech/do-we-fear-the-serializable-isolation-level-more-than-we-fear-subtle-bugs-5...
66•b-man•4d ago•36 comments

Show HN: Lathe – Use LLMs to learn a new domain, not skip past it

https://github.com/devenjarvis/lathe
276•devenjarvis•17h ago•51 comments

The 29th International Obfuscated C Code Contest (IOCCC) 2025 Winners

https://www.ioccc.org/2025/
373•matt_d•23h ago•89 comments

Powering up a module from the IBM 604: an electronic calculator from 1948

https://www.righto.com/2026/06/ibm-604-thyraton-tube-module.html
81•elpocko•11h ago•24 comments

LLMs are eroding my software engineering career and I don't know what to do

https://human-in-the-loop.bearblog.dev/llms-are-eroding-my-software-engineering-career-and-i-dont...
863•poisonfountain•16h ago•851 comments

Cloning a Sennheiser BA2015 battery pack

https://blog.brixit.nl/cloning-a-sennheiser-ba2015-accu-pack/
120•zdw•1d ago•17 comments

My automated doubt development process

https://www.alexself.dev/blog/automated-doubt
67•aself101•10h ago•21 comments

Proliferate (YC S25) is hiring to building open source Codex

https://www.ycombinator.com/companies/proliferate/jobs/L3copvK-founding-engineer
1•pablo24602•11h ago

SDSU Wired Its Dorms with 1,300 AI Cameras Without Telling Students

https://reclaimthenet.org/sdsu-adds-1300-ai-cameras-330-in-student-dorms
14•iamnothere•1h ago•1 comments

Splash Is a Colour Format

https://www.todepond.com/lab/splash/
57•tobr•4d ago•75 comments

An Ohio Valley 100k-watt FM signal is severed in broad daylight

https://www.radioworld.com/news-and-business/headlines/an-ohio-valley-100000-watt-fm-signal-is-se...
172•pkaeding•1d ago•180 comments