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?

mitmproxy adds --emudhra option

https://github.com/mitmproxy/mitmproxy/commit/169234499088fc2c414644a67efaed3d64ae2e3b
260•ahlCVA•3h ago•66 comments

There isn't an easy exploit for this PHP vulnerability

https://eliastaylor.com/noexploit/
212•zkldi•3h ago•98 comments

Security Disclosure

https://blog.railway.com/p/security-disclosure-wednesday-october-21st
337•passenger•4h ago•177 comments

The recently proposed O(n log n) integer multiplication algorithm [pdf]

https://web.maths.unsw.edu.au/~davidharvey/research/subnlogn.pdf
9•craigcitro•23m ago•1 comments

GitLab Critical Patch Release

https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released/
261•artooro•7h ago•64 comments

Rust Style Guide

https://google.github.io/styleguide/rustguide.html
224•kaycebasques•7h ago•125 comments

LLM Agents Play Pokemon Showdown

https://olivergrabner.com/research/pokemon/
12•grabnero•40m ago•3 comments

Epic vs. Apple AU:Court Orders Alt App Stores,Sideloading and 3rd Party Payments

https://www.judgments.fedcourt.gov.au/judgments/Judgments/fca/single/2026/2026fca1552
20•Mayzie•1h ago•3 comments

Compromised LiteLLM 1.107.0 on PyPI Installs a Credential Stealer and Backdoor

https://safedep.io/litellm-pypi-compromise-credential-stealer-backdoor/
451•abhisek•12h ago•152 comments

Chain of Thought for Humans

https://www.boristhebrave.com/2026/10/18/chain-of-thought-for-humans/
39•ibobev•2d ago•18 comments

No more icons in every menu by default

https://blog.jim-nielsen.com/2026/icons-in-every-menu/
204•riffraff•1d ago•139 comments

Using LLM for confidence scoring is a bad idea

https://rumple.github.io/blog/2026/10/20/asking-llm-for-confidence.html
5•jimauthors•22h ago•0 comments

Meta ordered to pay $25B penalty in New Mexico Cambridge Analytica case

https://www.cnbc.com/2026/10/21/meta-new-mexico-cambridge-analytica-penalty.html
403•cbg0•9h ago•258 comments

Beyond the &

https://lwn.net/Articles/1096028/
15•PaulHoule•1d ago•0 comments

Today's PHP security release, and how we're strengthening security

https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-...
691•ejohnso49•11h ago•340 comments

Show HN: Omnara – Open-Source Alternative to Claude Managed Agents

https://github.com/omnara-ai/omnara
27•kmansm27•10h ago•10 comments

Tiny possum and glider thought extinct for 6000 years found in remote West Papua

https://www.bbc.com/news/articles/cp814l80pw2o
162•bryanrasmussen•1d ago•25 comments

PingCap TiDB Leaks

https://fulcrumsec.vg/pingcap/
231•swyx•1d ago•32 comments

Code is clay now

https://www.albertodenia.com/writing/code-is-clay-now
103•albertodenia•2d ago•55 comments

OpenAI models are coming to Google Cloud

https://openai.com/index/openai-models-google-cloud/
246•armcat•14h ago•107 comments

Postgres recovery_prefetch can cause outages

https://ardentperf.com/2026/10/20/postgres-recovery_prefetch-considered-harmful-and-causing-outages/
4•plaur782•4h ago•0 comments

I reverse engineered a board game

https://wuemeli.com/blog/reversing-hitster-game/
4•wuemeli•13h ago•0 comments

Patch the Planet: global response coordination as agents uncover vulnerabilities

https://openai.com/index/coordinated-disclosure-of-critical-vulnerabilities/
237•nr378•12h ago•162 comments

DuckDB 2.0.0 LTS “Cinnamon Teal”

https://duckdb.org/2026/10/21/announcing-duckdb-200
374•nnx•12h ago•49 comments

Why Windows 11 still ships with Windows 95's memory manager hidden inside it

https://www.windowslatest.com/2026/10/19/why-windows-11-still-ships-with-windows-95s-memory-manag...
143•khalidkhair•2d ago•98 comments

Oregon lawmakers approve money to buy an iconic waterfall listed on Redfin

https://apnews.com/article/oregon-waterfall-for-sale-lawmakers-996de63462d49ec3ad9bee1629fb9488
174•surprisetalk•11h ago•85 comments

EA is shutting down BioWare

https://www.theverge.com/games/1015647/ea-is-shutting-down-bioware
553•aaronbrethorst•9h ago•331 comments

Launch HN: Alter (YC S25) – Access control for multi-user agents

https://alterauth.com/
54•simfinii•20h ago•22 comments

Κ = 0.003 for integer multiplication crossed

https://github.com/CrocSwap/integer-mult-bounds/pull/4441
31•aleph_minus_one•3h ago•18 comments

PHP 8.2.35

https://github.com/php/php-src/releases/tag/php-8.2.35
978•tuyuri•13h ago•537 comments