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•11mo ago
Code at https://github.com/wiwa/blog-code/

Comments

ashvardanian•11mo 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•11mo 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•11mo 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•11mo 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•11mo ago
Parallel compares: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW...
DennisL123•11mo 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•11mo 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•11mo 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•11mo 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•11mo ago
As someone who doesn't know very much about graphics (ironically), you're welcome and hope it helps!
fourseventy•11mo ago
What are the biggest use cases of GPU accelerated sorting?

Soft launch of open-source code platform for government

https://www.nldigitalgovernment.nl/news/soft-launch-for-government-open-source-code-platform/
113•e12e•2h ago•57 comments

Ghostty is leaving GitHub

https://mitchellh.com/writing/ghostty-leaving-github
2707•WadeGrimridge•15h ago•791 comments

Show HN: Rip.so – a graveyard for dead internet things

https://rip.so
61•bozdemir•2h ago•37 comments

Bugs Rust won't catch

https://corrode.dev/blog/bugs-rust-wont-catch/
342•lwhsiao•9h ago•157 comments

HardenedBSD Is Now Officially on Radicle

https://hardenedbsd.org/article/shawn-webb/2026-04-26/hardenedbsd-officially-radicle
84•lftherios•4h ago•13 comments

How ChatGPT serves ads

https://www.buchodi.com/how-chatgpt-serves-ads-heres-the-full-attribution-loop/
364•lmbbuchodi•11h ago•242 comments

Before GitHub

https://lucumr.pocoo.org/2026/4/28/before-github/
502•mlex•14h ago•151 comments

Tell HN: An update from the new Tindie team

50•altairprime•3h ago•25 comments

Show HN: Rocky – Rust SQL engine with branches, replay, column lineage

https://github.com/rocky-data/rocky
64•hugocorreia90•20h ago•8 comments

Why Law Is Law-Shaped

https://lawvm.org/why-law-is-law-shaped/
28•ekns•2h ago•6 comments

Show HN: Auto-Architecture: Karpathy's Loop, pointed at a CPU

https://github.com/FeSens/auto-arch-tournament/blob/main/docs/auto-arch-tournament-blog-post.md
168•fesens•18h ago•37 comments

Withnail's Coat and I

https://ontherow.substack.com/p/withnails-coat-and-i
88•apollinaire•1d ago•8 comments

OpenAI models coming to Amazon Bedrock: Interview with OpenAI and AWS CEOs

https://stratechery.com/2026/an-interview-with-openai-ceo-sam-altman-and-aws-ceo-matt-garman-abou...
280•translocator•15h ago•91 comments

Low-Compilation-Cost Register Allocation in LLVM-Based Binary Translation

https://dl.acm.org/doi/abs/10.1145/3767295.3803591
32•matt_d•4h ago•0 comments

GitHub RCE Vulnerability: CVE-2026-3854 Breakdown

https://www.wiz.io/blog/github-rce-vulnerability-cve-2026-3854
379•bo0tzz•19h ago•78 comments

I won a championship that doesn't exist

https://ron.stoner.com/How_I_Won_a_Championship_That_Doesnt_Exist/
178•SEJeff•14h ago•95 comments

Two-thirds of babies watch screens – some for eight hours a day

https://www.thetimes.com/uk/technology-uk/article/babies-and-under-2s-screen-time-6jbdmnjlg
11•oj2828•17m ago•2 comments

Gallium oxide electronics withstand extreme cold

https://discovery.kaust.edu.sa/en/article/26858/gallium-oxide-electronics-withstand-extreme-cold/
50•giuliomagnifico•1d ago•1 comments

Who owns the code Claude Code wrote?

https://legallayer.substack.com/p/who-owns-the-claude-code-wrote
426•senaevren•23h ago•390 comments

Talkie: a 13B vintage language model from 1930

https://talkie-lm.com/introducing-talkie
711•jekude•1d ago•293 comments

Behavioral timescale synaptic plasticity rewires the brain after an experience

https://www.quantamagazine.org/a-new-type-of-neuroplasticity-rewires-the-brain-after-a-single-exp...
128•ibobev•1d ago•5 comments

Your phone is about to stop being yours

https://keepandroidopen.org/en/
1428•doener•20h ago•651 comments

Warp is now open-source

https://www.warp.dev/blog/warp-is-now-open-source
290•meetpateltech•19h ago•77 comments

Intel Arc Pro B70 Review

https://www.pugetsystems.com/labs/articles/intel-arc-pro-b70-review/
175•zdw•5d ago•105 comments

Regression: malware reminder on every read still causes subagent refusals

https://github.com/anthropics/claude-code/issues/49363
228•thomashobohm•11h ago•121 comments

Apple CMF (Color-Matching Functions) 2026

https://www.lttlabs.com/articles/2026/04/11/apple-studio-display-xdr-display-testing-results
73•HeyMeco•11h ago•2 comments

Show HN: Drive any macOS app in the background without stealing the cursor

https://github.com/trycua/cua
141•frabonacci•19h ago•32 comments

When the Internet Was a Place

https://www.frontporchrepublic.com/2025/09/when-the-internet-was-a-place/
67•herbertl•9h ago•23 comments

Localsend: An open-source cross-platform alternative to AirDrop

https://github.com/localsend/localsend
861•bilsbie•23h ago•257 comments

We still don't have a more precise value for "Big G"

https://arstechnica.com/science/2026/04/we-still-dont-have-a-more-precise-value-for-big-g/
71•rbanffy•1d ago•48 comments