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?

Actively exploited sandbox RCE in all Chromium versions

https://nvd.nist.gov/vuln/detail/cve-2026-85046
601•negura•15h ago•324 comments

Discovery of a new OpenAI agent message board

https://collusion.wiki/
1822•moultano•1d ago•1394 comments

Nitter has more working instances than before the takedowns

https://codeberg.org/mv12star/shitter/wiki/Instances
359•Cider9986•13h ago•133 comments

Formalizing Fermat's Last Theorem

https://www.anthropic.com/research/formalizing-fermats-last-theorem
658•jlebar•19h ago•414 comments

Netherlands pulls gold out of the US for fears of 'geopolitical unrest'

https://www.abc.net.au/news/2026-09-04/why-the-netherlands-moved-its-gold-from-us-and-canada/1071...
127•daniel_iversen•3h ago•81 comments

Statichost.eu – European static site hosting

https://www.statichost.eu/
347•p4bl0•17h ago•153 comments

AI handles incidents, engineers lose touch with their systems

https://www.sylvainkalache.com/blog/ai-handles-incidents-engineers-lose-touch-with-their-systems
224•sylvainkalache•5h ago•203 comments

Pentagon rescinds new testosterone screening policy without explanation

https://arstechnica.com/health/2026/09/pentagon-releases-then-quickly-removes-testosterone-screen...
29•ndsipa_pomu•32m ago•11 comments

Kale: A Transformation-Safe Spreadsheet System

https://arxiv.org/abs/2608.26345
33•zdw•4d ago•10 comments

GPT-6 Astra on OpenRouter

https://openrouter.ai/openai/gpt-6-astra
255•Topfi•16h ago•162 comments

Can AI design circuit boards yet?

https://eebench.org/blog/can-ai-design-circuit-boards-yet/
293•iopapa•17h ago•174 comments

Terpstra Keyboard

http://terpstrakeyboard.com/
12•cl3misch•3h ago•5 comments

Portal by Spotify cut my Claude Code token usage by 90%

https://engineering.atspotify.com/2026/9/portal-by-spotify-cut-my-claude-code-token-usage-by-90
175•cebert•14h ago•87 comments

Shutting down our public encrypted DNS

https://mullvad.net/en/blog/shutting-down-our-public-encrypted-dns-servers-and-sponsoring-quad9-i...
380•mywacaday•18h ago•174 comments

Ask HN: Resources to get good at soldering?

162•tosmatos•3d ago•91 comments

Git Submodules as a Package Manager

https://nesbitt.io/2026/09/01/git-submodules-as-a-package-manager.html
69•ErenayDev•4d ago•11 comments

Show HN: Open-Source eInk Bike Computer

https://opentrailpaper.com
321•stingrae•20h ago•107 comments

Git hosting that never leaves Europe

https://pushin.eu
131•sevenseacat•7h ago•79 comments

Pointing at the error: compiler-style diagnostics in uutils coreutils

https://uutils.org/blog/2026-08-error-diagnostics/
29•ingve•3d ago•3 comments

IBM Bob

https://bob.ibm.com/
289•artpar•1d ago•304 comments

Can guitar frets perform multiplication?

https://www.charlespetzold.com/blog/2026/09/Can-Guitar-Frets-Perform-Multiplication.html
101•wibbily•15h ago•27 comments

Fermat's Last Theorem in Lean 4

https://github.com/anthropics/fermats-last-theorem
128•aaraujo002•18h ago•25 comments

Sky Map 2000 – Star Atlas and Planetarium

https://skymap2000.com/
26•m4c-pl•2d ago•3 comments

Artificial Analysis Intelligence Index v4.2

https://artificialanalysis.ai/articles/artificial-analysis-intelligence-index-v4-2
129•nojs•13h ago•53 comments

The Rust React Compiler is now native in Vite

https://blog.master.dev/react-now-rusted-all-the-way-out/
154•acusti•19h ago•39 comments

Show HN: TERMy – A fast terminal assistant that does not use LLMs

https://github.com/gioblu/NPC-Forge/blob/main/docs/development.md
156•gioscarab•1d ago•40 comments

An open DNS recursive service for free security and high privacy

https://quad9.net/
103•mooreds•17h ago•31 comments

GPT-6 Astra

https://openai.com/index/gpt-6-astra/
2195•kibae•1d ago•2013 comments

Government Rails Site Hit Hours After CVE Patch

https://rietta.com/blog/ruby-on-rails-cve-exploited-hours-after-patch/
104•rietta•18h ago•32 comments

Decompiler Explorer

https://dogbolt.org
106•tripdout•3d ago•6 comments